const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/router-BhKBgDIv.js","assets/jwt-decode.esm-DyyavT6h.js","assets/jwt-decode-D9e-DIPp.css","assets/ts.worker-Do44s_XH.js"])))=>i.map(i=>d[i]);
import{ad as p}from"./jwt-decode.esm-DyyavT6h.js";import{C as c}from"./router-BhKBgDIv.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="95bb63d1-83e7-4982-b2ee-b762a1933dd7",s._sentryDebugIdIdentifier="sentry-dbid-95bb63d1-83e7-4982-b2ee-b762a1933dd7")}catch{}})();class u{async generateEcdsaKey(e){const{projectId:n,connectionName:o,connectorType:t}=e;return c.post(`projects/${n}/connectors/${t}/connections/${o}/ecdsa-key`,{})}async createEcdsaConnection(e){const{projectId:n,connectionName:o,connectorType:t,publicKey:r,privateKey:a,accessId:i}=e;return c.post(`projects/${n}/connectors/${t}/connections/${o}/create-ecdsa`,{publicKey:r,privateKey:a,accessId:i})}async generateRsaKey(e){const{projectId:n,connectionName:o,connectorType:t}=e;return c.post(`projects/${n}/connectors/${t}/connections/${o}/rsa-key`,{})}async createRsaConnection(e){const{projectId:n,connectionName:o,connectorType:t,publicKey:r,privateKey:a,apiToken:i}=e;return c.post(`projects/${n}/connectors/${t}/connections/${o}/create-rsa`,{publicKey:r,privateKey:a,apiToken:i})}async getLoginUrl(e,n,o,t,r){return c.get(`projects/${e}/connectors/${o}/connections/${n}/login-url`,{scopeIds:t.join(","),...r})}async listConnectors(e){return c.get(`projects/${e}/connectors`)}async getConnectorsBetaStatus(){const{EnvURL:e}=await p(async()=>{const{EnvURL:n}=await import("./router-BhKBgDIv.js").then(o=>o.o);return{EnvURL:n}},__vite__mapDeps([0,1,2,3]));try{const n=await fetch(`${e.cloudApi}/public/connectors/beta-status`);if(!n.ok){if(n.status===404)return console.warn("Beta status endpoint not available yet, returning empty status"),{};throw new Error("Failed to fetch connectors beta status")}return n.json()}catch(n){return console.error("Error fetching beta status:",n),{}}}async createTokenConnection(e){const{projectId:n,connectionName:o,connectorType:t,tokens:r}=e,a={type:"tokens",tokens:r};return c.post(`projects/${n}/connectors/${t}/connections/${o}`,a)}async listConnections(e){return c.get(`projects/${e}/connections`)}async getConnection(e,n,o){return c.get(`projects/${e}/connectors/${n}/connections/${o}`)}async deleteConnection(e){const{projectId:n,connectionName:o,connectorType:t}=e;return c.delete(`projects/${n}/connectors/${t}/connections/${o}`)}async renameConnection(e){const{projectId:n,connectionName:o,connectorType:t,newConnectionName:r}=e;return c.patch(`projects/${n}/connectors/${t}/connections/${o}`,{newConnectionName:r})}async getGoogleDriveAccessToken(e,n){return(await c.get(`projects/${e}/connectors/google-drive/connections/${n}/token`)).access_token}async saveAllowedGoogleDriveFiles(e,n,o,t){if(!t)throw new Error("Config is required");return c.patch(`projects/${e}/connectors/${o}/connections/${n}/config`,{config:t})}}export{u as C};
//# sourceMappingURL=connectors-DOwWJwmt.js.map
