const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/router--fZPWl_4.js","assets/jwt-decode.esm-BUhVyVlz.js","assets/jwt-decode-D9e-DIPp.css","assets/ts.worker-tNVI-xkB.js"])))=>i.map(i=>d[i]);
import{_ as p}from"./jwt-decode.esm-BUhVyVlz.js";import{b as c}from"./router--fZPWl_4.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]="bb7b1080-e01e-49c4-959a-cf0db3cc604f",s._sentryDebugIdIdentifier="sentry-dbid-bb7b1080-e01e-49c4-959a-cf0db3cc604f")}catch{}})();class d{async generateEcdsaKey(n){const{projectId:e,connectionName:o,connectorType:t}=n;return c.post(`projects/${e}/connectors/${t}/connections/${o}/ecdsa-key`,{})}async createEcdsaConnection(n){const{projectId:e,connectionName:o,connectorType:t,publicKey:r,privateKey:a,accessId:i}=n;return c.post(`projects/${e}/connectors/${t}/connections/${o}/create-ecdsa`,{publicKey:r,privateKey:a,accessId:i})}async generateRsaKey(n){const{projectId:e,connectionName:o,connectorType:t}=n;return c.post(`projects/${e}/connectors/${t}/connections/${o}/rsa-key`,{})}async createRsaConnection(n){const{projectId:e,connectionName:o,connectorType:t,publicKey:r,privateKey:a,apiToken:i}=n;return c.post(`projects/${e}/connectors/${t}/connections/${o}/create-rsa`,{publicKey:r,privateKey:a,apiToken:i})}async getLoginUrl(n,e,o,t,r){return c.get(`projects/${n}/connectors/${o}/connections/${e}/login-url`,{scopeIds:t.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--fZPWl_4.js").then(o=>o.s);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:o,connectorType:t,tokens:r}=n,a={type:"tokens",tokens:r};return c.post(`projects/${e}/connectors/${t}/connections/${o}`,a)}async createPublicConnection(n){const{projectId:e,connectionName:o,connectorType:t}=n,r={type:"public"};return c.post(`projects/${e}/connectors/${t}/connections/${o}`,r)}async listConnections(n){return c.get(`projects/${n}/connections`)}async getConnection(n,e,o){return c.get(`projects/${n}/connectors/${e}/connections/${o}`)}async deleteConnection(n){const{projectId:e,connectionName:o,connectorType:t}=n;return c.delete(`projects/${e}/connectors/${t}/connections/${o}`)}async renameConnection(n){const{projectId:e,connectionName:o,connectorType:t,newConnectionName:r}=n;return c.patch(`projects/${e}/connectors/${t}/connections/${o}`,{newConnectionName:r})}async getPostConnectionSetup(n,e,o,t){return c.get(`projects/${n}/connectors/${e}/connections/${o}/setup?setupType=${encodeURIComponent(t)}`)}async updateConnectionConfig(n){const{projectId:e,connectorType:o,connectionName:t,config:r}=n;return c.patch(`projects/${e}/connectors/${o}/connections/${t}/config`,{config:r})}}export{d as C};
//# sourceMappingURL=connectors-BjSUpUcC.js.map
