const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/router-DFKMVA7Q.js","assets/jwt-decode.esm-Dzy-9m8i.js","assets/jwt-decode-D9e-DIPp.css","assets/ts.worker-DQrt9nOI.js"])))=>i.map(i=>d[i]);
import{_ as p}from"./jwt-decode.esm-Dzy-9m8i.js";import{b as c}from"./router-DFKMVA7Q.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[n]="3eae81d7-8c79-4b77-9b96-95350729f3e7",s._sentryDebugIdIdentifier="sentry-dbid-3eae81d7-8c79-4b77-9b96-95350729f3e7")}catch{}})();class d{async generateEcdsaKey(n){const{projectId:e,connectionName:t,connectorType:o}=n;return c.post(`projects/${e}/connectors/${o}/connections/${t}/ecdsa-key`,{})}async createEcdsaConnection(n){const{projectId:e,connectionName:t,connectorType:o,publicKey:r,privateKey:a,accessId:i}=n;return c.post(`projects/${e}/connectors/${o}/connections/${t}/create-ecdsa`,{publicKey:r,privateKey:a,accessId:i})}async generateRsaKey(n){const{projectId:e,connectionName:t,connectorType:o}=n;return c.post(`projects/${e}/connectors/${o}/connections/${t}/rsa-key`,{})}async createRsaConnection(n){const{projectId:e,connectionName:t,connectorType:o,publicKey:r,privateKey:a,apiToken:i}=n;return c.post(`projects/${e}/connectors/${o}/connections/${t}/create-rsa`,{publicKey:r,privateKey:a,apiToken:i})}async getLoginUrl(n,e,t,o,r){return c.get(`projects/${n}/connectors/${t}/connections/${e}/login-url`,{scopeIds:o.join(","),...r})}async listConnectors(n){return c.get(`projects/${n}/connectors`)}async getConnectorsBetaStatus(){const{EnvURL:n}=await p(async()=>{const{EnvURL:e}=await import("./router-DFKMVA7Q.js").then(t=>t.q);return{EnvURL:e}},__vite__mapDeps([0,1,2,3]));try{const e=await fetch(`${n.cloudApi}/public/connectors/beta-status`);if(!e.ok){if(e.status===404)return console.warn("Beta status endpoint not available yet, returning empty status"),{};throw new Error("Failed to fetch connectors beta status")}return e.json()}catch(e){return console.error("Error fetching beta status:",e),{}}}async createTokenConnection(n){const{projectId:e,connectionName:t,connectorType:o,tokens:r}=n,a={type:"tokens",tokens:r};return c.post(`projects/${e}/connectors/${o}/connections/${t}`,a)}async listConnections(n){return c.get(`projects/${n}/connections`)}async getConnection(n,e,t){return c.get(`projects/${n}/connectors/${e}/connections/${t}`)}async deleteConnection(n){const{projectId:e,connectionName:t,connectorType:o}=n;return c.delete(`projects/${e}/connectors/${o}/connections/${t}`)}async renameConnection(n){const{projectId:e,connectionName:t,connectorType:o,newConnectionName:r}=n;return c.patch(`projects/${e}/connectors/${o}/connections/${t}`,{newConnectionName:r})}async getPostConnectionSetup(n,e,t,o){return c.get(`projects/${n}/connectors/${e}/connections/${t}/setup?setupType=${encodeURIComponent(o)}`)}async updateConnectionConfig(n){const{projectId:e,connectorType:t,connectionName:o,config:r}=n;return c.patch(`projects/${e}/connectors/${t}/connections/${o}/config`,{config:r})}}export{d as C};
//# sourceMappingURL=connectors-Ceeg8VFd.js.map
