gatana-sdk 2.3.7 → 2.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/v2.ts","../src/index.ts"],"mappings":";;;;;;AAiBA;cAAa,OAAA;EACJ,GAAA,SAAG,mBAAA;EAAA,SACM,MAAA,EAAQ,YAAA;cACZ,GAAA;IAAQ,OAAA,GAAU,aAAA;IAAe,YAAA,GAAe,YAAA;IAAc,KAAA;EAAA;EA8C1E,iBAAA,CAAA;AAAA;;;UC1De,aAAA;EACf,MAAA;EACA,KAAA;EACA,OAAA;AAAA;AAAA,KAGU,YAAA;EAAiB,OAAA;EAAiB,KAAA,QAAa,OAAA;AAAA;AAAA,cAC9C,YAAA;EAAA,SACiB,UAAA,EAAY,cAAA;cAAZ,UAAA,EAAY,cAAA;EAExC,SAAA,CAAA,GAAa,YAAA;AAAA;AAAA,uBAWO,cAAA;EAAA,SACX,SAAA,CAAA;IAAe,KAAA;IAAe,OAAA;IAAiB,KAAA,QAAa,OAAA;EAAA;EAAA,SAC5D,IAAA;AAAA;AAAA,cAGE,qBAAA,SAA8B,cAAA;EAAA,QACrB,OAAA;cAAA,OAAA,GAAU,aAAA;EAIvB,IAAA;EAIP,SAAA,CAAA;;;;;;cAiBW,iBAAA,SAA0B,cAAA;EAC9B,IAAA;EAKP,SAAA,CAAA;;;iBAN6B,OAAA;EAAA;AAAA;AAAA,cAqBlB,kBAAA,SAA2B,cAAA;EAAA,QAClB,KAAA;cAAA,KAAA;EAIb,IAAA;EAKP,SAAA,CAAA;;;iBAV8B,OAAA;EAAA;AAAA;AAAA,cAgEnB,MAAA;EACJ,GAAA,SAAG,iBAAA;EACH,MAAA,EAAQ,YAAA;cACH,GAAA;IAAQ,OAAA,GAAU,aAAA;IAAe,YAAA,GAAe,YAAA;IAAc,KAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/v2.ts","../src/index.ts"],"mappings":";;;;;;AAiBA;cAAa,OAAA;EACJ,GAAA,SAAG,mBAAA;EAAA,SACM,MAAA,EAAQ,YAAA;cACZ,GAAA;IAAQ,OAAA,GAAU,aAAA;IAAe,MAAA,GAAS,YAAA;IAAc,YAAA,GAAe,YAAA;IAAc,KAAA;EAAA;EA8CjG,iBAAA,CAAA;AAAA;;;UC1De,aAAA;EACf,MAAA;EACA,KAAA;EACA,OAAA;AAAA;AAAA,KAGU,YAAA;EAAiB,OAAA;EAAiB,KAAA,QAAa,OAAA;AAAA;AAAA,cAC9C,YAAA;EAAA,SACiB,UAAA,EAAY,cAAA;cAAZ,UAAA,EAAY,cAAA;EAExC,SAAA,CAAA,GAAa,YAAA;AAAA;AAAA,uBAWO,cAAA;EAAA,SACX,SAAA,CAAA;IAAe,KAAA;IAAe,OAAA;IAAiB,KAAA,QAAa,OAAA;EAAA;EAAA,SAC5D,IAAA;AAAA;AAAA,cAGE,qBAAA,SAA8B,cAAA;EAAA,QACrB,OAAA;cAAA,OAAA,GAAU,aAAA;EAIvB,IAAA;EAIP,SAAA,CAAA;;;;;;cAiBW,iBAAA,SAA0B,cAAA;EAC9B,IAAA;EAKP,SAAA,CAAA;;;iBAN6B,OAAA;EAAA;AAAA;AAAA,cAqBlB,kBAAA,SAA2B,cAAA;EAAA,QAClB,KAAA;cAAA,KAAA;EAIb,IAAA;EAKP,SAAA,CAAA;;;iBAV8B,OAAA;EAAA;AAAA;AAAA,cAiEnB,MAAA;EACJ,GAAA,SAAG,iBAAA;EACH,MAAA,EAAQ,YAAA;cACH,GAAA;IAAQ,OAAA,GAAU,aAAA;IAAe,MAAA,GAAS,YAAA;IAAc,YAAA,GAAe,YAAA;IAAc,KAAA;EAAA;AAAA"}
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { hn as client, mn as sdk_gen_exports } from "./sdk.gen-B08PtmWt.mjs";
1
+ import { _n as sdk_gen_exports, vn as client } from "./sdk.gen-B5HNJH3y.mjs";
2
2
  import { extractTenantFromUrl, getDefaultOrganization, getOrganization, setOrganizationConfig } from "./config.mjs";
3
3
  import { d as sdk_gen_exports$1, f as client$1 } from "./sdk.gen-DUNHa0uM.mjs";
4
4
  import createDebug from "debug";
@@ -13,13 +13,13 @@ var Gatana2 = class {
13
13
  api = sdk_gen_exports$1;
14
14
  config;
15
15
  constructor(arg) {
16
- const configLoader = arg?.configLoader || new ConfigLoader([
16
+ const configLoader = !arg?.config && arg?.configLoader || new ConfigLoader([
17
17
  new OptionsConfigStrategy(arg?.options),
18
18
  new EnvConfigStrategy(),
19
19
  new FileConfigStrategy()
20
20
  ]);
21
21
  try {
22
- this.config = configLoader.getConfig();
22
+ this.config = arg?.config || configLoader.getConfig();
23
23
  const clientConfig = {
24
24
  baseUrl: new URL("/api/v2/", this.config.baseUrl).toString(),
25
25
  auth: this.config.token
@@ -27,7 +27,7 @@ var Gatana2 = class {
27
27
  client$1.setConfig(clientConfig);
28
28
  const debugHttp = createDebug("gatana:http");
29
29
  client$1.interceptors.request.use((request) => {
30
- debugHttp(`→ ${request.method} ${request.url}`);
30
+ debugHttp(`→ ${request.method} ${request.url}`, { body: request.body });
31
31
  return request;
32
32
  });
33
33
  client$1.interceptors.response.use((response, request) => {
@@ -38,7 +38,7 @@ var Gatana2 = class {
38
38
  debugHttp(`✗ ${response.status} ${response.statusText} ${request.method} ${request.url}`, error);
39
39
  return error;
40
40
  });
41
- debug$1("Gatana initialized with config", clientConfig);
41
+ debug$1("Gatana v2 initialized with config", clientConfig);
42
42
  } catch (error) {
43
43
  debug$1("Failed to initialize", error);
44
44
  if (arg?.isCli && error.message === "No valid configuration found from any strategy") {
@@ -133,12 +133,13 @@ var FileConfigStrategy = class extends ConfigStrategy {
133
133
  try {
134
134
  const token = await openidClient.refreshTokenGrant(config, tenantConfig.tokens.refresh_token);
135
135
  if (token) {
136
- setOrganizationConfig(orgId, { tokens: {
136
+ tenantConfig.tokens = {
137
137
  access_token: token.access_token,
138
138
  refresh_token: token.refresh_token || tenantConfig.tokens.refresh_token,
139
139
  expires_at: token.expires_in ? Math.floor(Date.now() / 1e3) + token.expires_in : 0
140
- } });
141
- debug("Token refreshed successfully");
140
+ };
141
+ setOrganizationConfig(orgId, { tokens: tenantConfig.tokens });
142
+ debug("Token refreshed successfully", { token });
142
143
  return token.access_token;
143
144
  }
144
145
  } catch (error) {
@@ -155,13 +156,13 @@ var Gatana = class {
155
156
  api = sdk_gen_exports;
156
157
  config;
157
158
  constructor(arg) {
158
- const configLoader = arg?.configLoader || new ConfigLoader([
159
+ const configLoader = !arg?.config && arg?.configLoader || new ConfigLoader([
159
160
  new OptionsConfigStrategy(arg?.options),
160
161
  new EnvConfigStrategy(),
161
162
  new FileConfigStrategy()
162
163
  ]);
163
164
  try {
164
- this.config = configLoader.getConfig();
165
+ this.config = arg?.config || configLoader.getConfig();
165
166
  const clientConfig = {
166
167
  baseUrl: new URL("/api/v1/", this.config.baseUrl).toString(),
167
168
  auth: this.config.token
@@ -169,7 +170,7 @@ var Gatana = class {
169
170
  client.setConfig(clientConfig);
170
171
  const debugHttp = createDebug("gatana:http");
171
172
  client.interceptors.request.use((request) => {
172
- debugHttp(`→ ${request.method} ${request.url}`);
173
+ debugHttp(`→ ${request.method} ${request.url}`, { body: request.body });
173
174
  return request;
174
175
  });
175
176
  client.interceptors.response.use((response, request) => {
@@ -180,7 +181,7 @@ var Gatana = class {
180
181
  debugHttp(`✗ ${response.status} ${response.statusText} ${request.method} ${request.url}`, error);
181
182
  return error;
182
183
  });
183
- debug("Gatana initialized with config", clientConfig);
184
+ debug("Gatana v1 initialized with config", clientConfig);
184
185
  } catch (error) {
185
186
  debug("Failed to initialize", error);
186
187
  if (arg?.isCli && error.message === "No valid configuration found from any strategy") {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["debug","sdk","sdk"],"sources":["../src/v2.ts","../src/index.ts"],"sourcesContent":["import { client } from './apiv2/client.gen.js';\nimport * as sdk from './apiv2/sdk.gen.js';\nimport createDebug from 'debug';\nimport { Config } from './api/client/types.gen.js';\nimport {\n ConfigLoader,\n EnvConfigStrategy,\n FileConfigStrategy,\n GatanaConfig,\n GatanaOptions,\n OptionsConfigStrategy,\n} from './index.js';\nconst debug = createDebug('gatana');\n\n/**\n * Gatana2 is representing a more REST-ful API where the object returned from GET can be used directly in POST/PUT/PATCH requests.\n */\nexport class Gatana2 {\n public api = sdk;\n public readonly config: GatanaConfig;\n constructor(arg?: { options?: GatanaOptions; configLoader?: ConfigLoader; isCli?: boolean }) {\n // Try to get config from file if not provided via options or env vars\n const configLoader =\n arg?.configLoader ||\n new ConfigLoader([new OptionsConfigStrategy(arg?.options), new EnvConfigStrategy(), new FileConfigStrategy()]);\n\n try {\n this.config = configLoader.getConfig();\n\n const clientConfig = {\n baseUrl: new URL('/api/v2/', this.config.baseUrl).toString(),\n auth: this.config.token,\n } satisfies Config;\n client.setConfig(clientConfig);\n\n // Add verbose request/response logging via debug\n const debugHttp = createDebug('gatana:http');\n client.interceptors.request.use(request => {\n debugHttp(`→ ${request.method} ${request.url}`);\n return request;\n });\n client.interceptors.response.use((response, request) => {\n debugHttp(`← ${response.status} ${response.statusText} ${request.method} ${request.url}`);\n return response;\n });\n client.interceptors.error.use((error, response, request) => {\n debugHttp(`✗ ${response.status} ${response.statusText} ${request.method} ${request.url}`, error);\n return error;\n });\n\n debug('Gatana initialized with config', clientConfig);\n } catch (error: any) {\n debug('Failed to initialize', error);\n if (arg?.isCli && error.message === 'No valid configuration found from any strategy') {\n console.error('Warning: No valid configuration found. Run \"gatana config login\" to set up your credentials.');\n this.config = {\n baseUrl: 'https://NO_ORGANIZATION_SET.gatana.ai',\n token: async () => 'PLEASE_SET_UP_CONFIGURATION',\n };\n } else {\n console.error('Error initializing Gatana:', error.message);\n process.exit(1);\n }\n }\n }\n\n getOpenApiSpecUrl() {\n return new URL('/api/v2/openapi.json', this.config.baseUrl).toString();\n }\n}\n","import { client } from './api/client.gen.js';\nimport * as sdk from './api/sdk.gen.js';\nimport createDebug from 'debug';\nimport { getOrganization, getDefaultOrganization, setOrganizationConfig, extractTenantFromUrl } from './config.js';\nimport * as openidClient from 'openid-client';\nimport { Config } from './api/client/types.gen.js';\nconst debug = createDebug('gatana');\n\nexport interface GatanaOptions {\n apiKey: string;\n orgId?: string;\n baseUrl?: string;\n}\n\nexport type GatanaConfig = { baseUrl: string; token: () => Promise<string> };\nexport class ConfigLoader {\n constructor(public readonly strategies: ConfigStrategy[]) {}\n\n getConfig(): GatanaConfig {\n for (const strategy of this.strategies) {\n const config = strategy.getConfig();\n if (config) {\n return config;\n }\n }\n throw new Error('No valid configuration found from any strategy');\n }\n}\n\nexport abstract class ConfigStrategy {\n abstract getConfig(): { orgId: string; baseUrl: string; token: () => Promise<string> } | null;\n abstract help: string;\n}\n\nexport class OptionsConfigStrategy extends ConfigStrategy {\n constructor(private options?: GatanaOptions) {\n super();\n }\n\n public help =\n `OptionsConfigStrategy: Provide configuration via Gatana constructor options. ` +\n `Example: new Gatana({ options }) where options includes apiKey and orgId or baseUrl.`;\n\n getConfig() {\n if (!this.options) {\n return null;\n }\n if (this.options.apiKey && (this.options.orgId || this.options.baseUrl)) {\n const key = this.options.apiKey;\n const baseUrl = this.options.baseUrl || `https://${this.options.orgId}.gatana.ai`;\n return {\n orgId: this.options.orgId!,\n baseUrl,\n token: async () => key,\n };\n }\n return null;\n }\n}\n\nexport class EnvConfigStrategy extends ConfigStrategy {\n public help =\n `EnvConfigStrategy: Provide configuration via environment variables. ` +\n `Required: GATANA_API_KEY and either GATANA_ORG_ID or GATANA_BASE_URL. ` +\n `Example: export GATANA_API_KEY=your_api_key; export GATANA_ORG_ID=your_org_id`;\n\n getConfig() {\n const apiKey = process.env.GATANA_API_KEY;\n const orgId = process.env.GATANA_ORG_ID;\n const overrideBaseUrl = process.env.GATANA_BASE_URL;\n if (apiKey && (orgId || overrideBaseUrl)) {\n return {\n orgId: orgId || extractTenantFromUrl(overrideBaseUrl!),\n baseUrl: overrideBaseUrl || `https://${orgId}.gatana.ai`,\n token: async () => apiKey,\n };\n }\n return null;\n }\n}\n\nexport class FileConfigStrategy extends ConfigStrategy {\n constructor(private orgId?: string) {\n super();\n }\n\n public help =\n `FileConfigStrategy: Provide configuration via a local config file. Use the ` +\n `\"gatana config\" commands to manage this configuration. The CLI will look for the default ` +\n `organization in the config file or use the org specified by GATANA_ORG_ID env var.`;\n\n getConfig() {\n let orgId = this.orgId || process.env.GATANA_ORG_ID || getDefaultOrganization();\n if (!orgId) {\n return null;\n }\n debug(`FileConfigLoader loading config for orgId=${orgId}`);\n const tenantConfig = getOrganization(orgId);\n debug(tenantConfig);\n if (!tenantConfig) {\n return null;\n }\n return {\n orgId,\n baseUrl: tenantConfig.baseUrl,\n token: async () => {\n if (tenantConfig?.pat) {\n return tenantConfig.pat;\n } else if (\n tenantConfig?.tokens?.access_token &&\n tenantConfig.tokens.expires_at &&\n tenantConfig.tokens.expires_at > Math.floor(Date.now() / 1000) + 60\n ) {\n return tenantConfig.tokens.access_token;\n } else if (tenantConfig.tokens?.refresh_token) {\n debug('Access token expired or about to expire, attempting to refresh');\n // Try to refresh the token\n const config = await openidClient.discovery(\n new URL(`/.well-known/openid-configuration`, tenantConfig.baseUrl),\n `${orgId}-cli`\n );\n try {\n const token = await openidClient.refreshTokenGrant(config, tenantConfig.tokens.refresh_token);\n if (token) {\n setOrganizationConfig(orgId, {\n tokens: {\n access_token: token.access_token,\n refresh_token: token.refresh_token || tenantConfig.tokens.refresh_token,\n expires_at: token.expires_in ? Math.floor(Date.now() / 1000) + token.expires_in : 0,\n },\n });\n debug('Token refreshed successfully');\n return token.access_token;\n }\n } catch (error) {\n debug('Failed to refresh token', error);\n throw new Error(`Failed to refresh access token. Please log in again. (${(error as Error).message})`);\n }\n }\n throw new Error('No valid API key, access token or refresh token available.');\n },\n };\n }\n}\n\nexport class Gatana {\n public api = sdk;\n public config: GatanaConfig;\n constructor(arg?: { options?: GatanaOptions; configLoader?: ConfigLoader; isCli?: boolean }) {\n // Try to get config from file if not provided via options or env vars\n const configLoader =\n arg?.configLoader ||\n new ConfigLoader([new OptionsConfigStrategy(arg?.options), new EnvConfigStrategy(), new FileConfigStrategy()]);\n\n try {\n this.config = configLoader.getConfig();\n\n const clientConfig = {\n baseUrl: new URL('/api/v1/', this.config.baseUrl).toString(),\n auth: this.config.token,\n } satisfies Config;\n client.setConfig(clientConfig);\n\n // Add verbose request/response logging via debug\n const debugHttp = createDebug('gatana:http');\n client.interceptors.request.use(request => {\n debugHttp(`→ ${request.method} ${request.url}`);\n return request;\n });\n client.interceptors.response.use((response, request) => {\n debugHttp(`← ${response.status} ${response.statusText} ${request.method} ${request.url}`);\n return response;\n });\n client.interceptors.error.use((error, response, request) => {\n debugHttp(`✗ ${response.status} ${response.statusText} ${request.method} ${request.url}`, error);\n return error;\n });\n\n debug('Gatana initialized with config', clientConfig);\n } catch (error: any) {\n debug('Failed to initialize', error);\n if (arg?.isCli && error.message === 'No valid configuration found from any strategy') {\n console.error('Warning: No valid configuration found. Run \"gatana config login\" to set up your credentials.');\n this.config = {\n baseUrl: 'https://NO_ORGANIZATION_SET.gatana.ai',\n token: async () => 'PLEASE_SET_UP_CONFIGURATION',\n };\n } else {\n console.error('Error initializing Gatana:', error.message);\n process.exit(1);\n }\n }\n }\n}\n\nexport { Gatana2 } from './v2.js';\n"],"mappings":";;;;;;;AAYA,MAAMA,UAAQ,YAAY,SAAS;;;;AAKnC,IAAa,UAAb,MAAqB;CACnB,AAAO,MAAMC;CACb,AAAgB;CAChB,YAAY,KAAiF;EAE3F,MAAM,eACJ,KAAK,gBACL,IAAI,aAAa;GAAC,IAAI,sBAAsB,KAAK,QAAQ;GAAE,IAAI,mBAAmB;GAAE,IAAI,oBAAoB;GAAC,CAAC;AAEhH,MAAI;AACF,QAAK,SAAS,aAAa,WAAW;GAEtC,MAAM,eAAe;IACnB,SAAS,IAAI,IAAI,YAAY,KAAK,OAAO,QAAQ,CAAC,UAAU;IAC5D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QAAQ,OAAO,MAAM;AAChG,WAAO;KACP;AAEF,SAAM,kCAAkC,aAAa;WAC9C,OAAY;AACnB,SAAM,wBAAwB,MAAM;AACpC,OAAI,KAAK,SAAS,MAAM,YAAY,kDAAkD;AACpF,YAAQ,MAAM,iGAA+F;AAC7G,SAAK,SAAS;KACZ,SAAS;KACT,OAAO,YAAY;KACpB;UACI;AACL,YAAQ,MAAM,8BAA8B,MAAM,QAAQ;AAC1D,YAAQ,KAAK,EAAE"}
1
+ {"version":3,"file":"index.mjs","names":["debug","sdk","sdk"],"sources":["../src/v2.ts","../src/index.ts"],"sourcesContent":["import { client } from './apiv2/client.gen.js';\nimport * as sdk from './apiv2/sdk.gen.js';\nimport createDebug from 'debug';\nimport { Config } from './api/client/types.gen.js';\nimport {\n ConfigLoader,\n EnvConfigStrategy,\n FileConfigStrategy,\n GatanaConfig,\n GatanaOptions,\n OptionsConfigStrategy,\n} from './index.js';\nconst debug = createDebug('gatana');\n\n/**\n * Gatana2 is representing a more REST-ful API where the object returned from GET can be used directly in POST/PUT/PATCH requests.\n */\nexport class Gatana2 {\n public api = sdk;\n public readonly config: GatanaConfig;\n constructor(arg?: { options?: GatanaOptions; config?: GatanaConfig; configLoader?: ConfigLoader; isCli?: boolean }) {\n // Try to get config from file if not provided via options or env vars\n const configLoader =\n (!arg?.config && arg?.configLoader) ||\n new ConfigLoader([new OptionsConfigStrategy(arg?.options), new EnvConfigStrategy(), new FileConfigStrategy()]);\n\n try {\n this.config = arg?.config || configLoader.getConfig();\n\n const clientConfig = {\n baseUrl: new URL('/api/v2/', this.config.baseUrl).toString(),\n auth: this.config.token,\n } satisfies Config;\n client.setConfig(clientConfig);\n\n // Add verbose request/response logging via debug\n const debugHttp = createDebug('gatana:http');\n client.interceptors.request.use(request => {\n debugHttp(`→ ${request.method} ${request.url}`, { body: request.body });\n return request;\n });\n client.interceptors.response.use((response, request) => {\n debugHttp(`← ${response.status} ${response.statusText} ${request.method} ${request.url}`);\n return response;\n });\n client.interceptors.error.use((error, response, request) => {\n debugHttp(`✗ ${response.status} ${response.statusText} ${request.method} ${request.url}`, error);\n return error;\n });\n\n debug('Gatana v2 initialized with config', clientConfig);\n } catch (error: any) {\n debug('Failed to initialize', error);\n if (arg?.isCli && error.message === 'No valid configuration found from any strategy') {\n console.error('Warning: No valid configuration found. Run \"gatana config login\" to set up your credentials.');\n this.config = {\n baseUrl: 'https://NO_ORGANIZATION_SET.gatana.ai',\n token: async () => 'PLEASE_SET_UP_CONFIGURATION',\n };\n } else {\n console.error('Error initializing Gatana:', error.message);\n process.exit(1);\n }\n }\n }\n\n getOpenApiSpecUrl() {\n return new URL('/api/v2/openapi.json', this.config.baseUrl).toString();\n }\n}\n","import { client } from './api/client.gen.js';\nimport * as sdk from './api/sdk.gen.js';\nimport createDebug from 'debug';\nimport { getOrganization, getDefaultOrganization, setOrganizationConfig, extractTenantFromUrl } from './config.js';\nimport * as openidClient from 'openid-client';\nimport { Config } from './api/client/types.gen.js';\nconst debug = createDebug('gatana');\n\nexport interface GatanaOptions {\n apiKey: string;\n orgId?: string;\n baseUrl?: string;\n}\n\nexport type GatanaConfig = { baseUrl: string; token: () => Promise<string> };\nexport class ConfigLoader {\n constructor(public readonly strategies: ConfigStrategy[]) {}\n\n getConfig(): GatanaConfig {\n for (const strategy of this.strategies) {\n const config = strategy.getConfig();\n if (config) {\n return config;\n }\n }\n throw new Error('No valid configuration found from any strategy');\n }\n}\n\nexport abstract class ConfigStrategy {\n abstract getConfig(): { orgId: string; baseUrl: string; token: () => Promise<string> } | null;\n abstract help: string;\n}\n\nexport class OptionsConfigStrategy extends ConfigStrategy {\n constructor(private options?: GatanaOptions) {\n super();\n }\n\n public help =\n `OptionsConfigStrategy: Provide configuration via Gatana constructor options. ` +\n `Example: new Gatana({ options }) where options includes apiKey and orgId or baseUrl.`;\n\n getConfig() {\n if (!this.options) {\n return null;\n }\n if (this.options.apiKey && (this.options.orgId || this.options.baseUrl)) {\n const key = this.options.apiKey;\n const baseUrl = this.options.baseUrl || `https://${this.options.orgId}.gatana.ai`;\n return {\n orgId: this.options.orgId!,\n baseUrl,\n token: async () => key,\n };\n }\n return null;\n }\n}\n\nexport class EnvConfigStrategy extends ConfigStrategy {\n public help =\n `EnvConfigStrategy: Provide configuration via environment variables. ` +\n `Required: GATANA_API_KEY and either GATANA_ORG_ID or GATANA_BASE_URL. ` +\n `Example: export GATANA_API_KEY=your_api_key; export GATANA_ORG_ID=your_org_id`;\n\n getConfig() {\n const apiKey = process.env.GATANA_API_KEY;\n const orgId = process.env.GATANA_ORG_ID;\n const overrideBaseUrl = process.env.GATANA_BASE_URL;\n if (apiKey && (orgId || overrideBaseUrl)) {\n return {\n orgId: orgId || extractTenantFromUrl(overrideBaseUrl!),\n baseUrl: overrideBaseUrl || `https://${orgId}.gatana.ai`,\n token: async () => apiKey,\n };\n }\n return null;\n }\n}\n\nexport class FileConfigStrategy extends ConfigStrategy {\n constructor(private orgId?: string) {\n super();\n }\n\n public help =\n `FileConfigStrategy: Provide configuration via a local config file. Use the ` +\n `\"gatana config\" commands to manage this configuration. The CLI will look for the default ` +\n `organization in the config file or use the org specified by GATANA_ORG_ID env var.`;\n\n getConfig() {\n let orgId = this.orgId || process.env.GATANA_ORG_ID || getDefaultOrganization();\n if (!orgId) {\n return null;\n }\n debug(`FileConfigLoader loading config for orgId=${orgId}`);\n const tenantConfig = getOrganization(orgId);\n debug(tenantConfig);\n if (!tenantConfig) {\n return null;\n }\n return {\n orgId,\n baseUrl: tenantConfig.baseUrl,\n token: async () => {\n if (tenantConfig?.pat) {\n return tenantConfig.pat;\n } else if (\n tenantConfig?.tokens?.access_token &&\n tenantConfig.tokens.expires_at &&\n tenantConfig.tokens.expires_at > Math.floor(Date.now() / 1000) + 60\n ) {\n return tenantConfig.tokens.access_token;\n } else if (tenantConfig.tokens?.refresh_token) {\n debug('Access token expired or about to expire, attempting to refresh');\n // Try to refresh the token\n const config = await openidClient.discovery(\n new URL(`/.well-known/openid-configuration`, tenantConfig.baseUrl),\n `${orgId}-cli`\n );\n try {\n const token = await openidClient.refreshTokenGrant(config, tenantConfig.tokens.refresh_token);\n if (token) {\n tenantConfig.tokens = {\n access_token: token.access_token,\n refresh_token: token.refresh_token || tenantConfig.tokens.refresh_token,\n expires_at: token.expires_in ? Math.floor(Date.now() / 1000) + token.expires_in : 0,\n };\n setOrganizationConfig(orgId, {\n tokens: tenantConfig.tokens,\n });\n debug('Token refreshed successfully', { token });\n return token.access_token;\n }\n } catch (error) {\n debug('Failed to refresh token', error);\n throw new Error(`Failed to refresh access token. Please log in again. (${(error as Error).message})`);\n }\n }\n throw new Error('No valid API key, access token or refresh token available.');\n },\n };\n }\n}\n\nexport class Gatana {\n public api = sdk;\n public config: GatanaConfig;\n constructor(arg?: { options?: GatanaOptions; config?: GatanaConfig; configLoader?: ConfigLoader; isCli?: boolean }) {\n // Try to get config from file if not provided via options or env vars\n const configLoader =\n (!arg?.config && arg?.configLoader) ||\n new ConfigLoader([new OptionsConfigStrategy(arg?.options), new EnvConfigStrategy(), new FileConfigStrategy()]);\n\n try {\n this.config = arg?.config || configLoader.getConfig();\n\n const clientConfig = {\n baseUrl: new URL('/api/v1/', this.config.baseUrl).toString(),\n auth: this.config.token,\n } satisfies Config;\n client.setConfig(clientConfig);\n\n // Add verbose request/response logging via debug\n const debugHttp = createDebug('gatana:http');\n client.interceptors.request.use(request => {\n debugHttp(`→ ${request.method} ${request.url}`, { body: request.body });\n return request;\n });\n client.interceptors.response.use((response, request) => {\n debugHttp(`← ${response.status} ${response.statusText} ${request.method} ${request.url}`);\n return response;\n });\n client.interceptors.error.use((error, response, request) => {\n debugHttp(`✗ ${response.status} ${response.statusText} ${request.method} ${request.url}`, error);\n return error;\n });\n\n debug('Gatana v1 initialized with config', clientConfig);\n } catch (error: any) {\n debug('Failed to initialize', error);\n if (arg?.isCli && error.message === 'No valid configuration found from any strategy') {\n console.error('Warning: No valid configuration found. Run \"gatana config login\" to set up your credentials.');\n this.config = {\n baseUrl: 'https://NO_ORGANIZATION_SET.gatana.ai',\n token: async () => 'PLEASE_SET_UP_CONFIGURATION',\n };\n } else {\n console.error('Error initializing Gatana:', error.message);\n process.exit(1);\n }\n }\n }\n}\n\nexport { Gatana2 } from './v2.js';\n"],"mappings":";;;;;;;AAYA,MAAMA,UAAQ,YAAY,SAAS;;;;AAKnC,IAAa,UAAb,MAAqB;CACnB,AAAO,MAAMC;CACb,AAAgB;CAChB,YAAY,KAAwG;EAElH,MAAM,eACH,CAAC,KAAK,UAAU,KAAK,gBACtB,IAAI,aAAa;GAAC,IAAI,sBAAsB,KAAK,QAAQ;GAAE,IAAI,mBAAmB;GAAE,IAAI,oBAAoB;GAAC,CAAC;AAEhH,MAAI;AACF,QAAK,SAAS,KAAK,UAAU,aAAa,WAAW;GAErD,MAAM,eAAe;IACnB,SAAS,IAAI,IAAI,YAAY,KAAK,OAAO,QAAQ,CAAC,UAAU;IAC5D,MAAM,KAAK,OAAO;IACnB;AACD,YAAO,UAAU,aAAa;GAG9B,MAAM,YAAY,YAAY,cAAc;AAC5C,YAAO,aAAa,QAAQ,KAAI,YAAW;AACzC,cAAU,KAAK,QAAQ,OAAO,GAAG,QAAQ,OAAO,EAAE,MAAM,QAAQ,MAAM,CAAC;AACvE,WAAO;KACP;AACF,YAAO,aAAa,SAAS,KAAK,UAAU,YAAY;AACtD,cAAU,KAAK,SAAS,OAAO,GAAG,SAAS,WAAW,GAAG,QAAQ,OAAO,GAAG,QAAQ,MAAM;AACzF,WAAO;KACP;AACF,YAAO,aAAa,MAAM,KAAK,OAAO,UAAU,YAAY;AAC1D,cAAU,KAAK,SAAS,OAAO,GAAG,SAAS,WAAW,GAAG,QAAQ,OAAO,GAAG,QAAQ,OAAO,MAAM;AAChG,WAAO;KACP;AAEF,WAAM,qCAAqC,aAAa;WACjD,OAAY;AACnB,WAAM,wBAAwB,MAAM;AACpC,OAAI,KAAK,SAAS,MAAM,YAAY,kDAAkD;AACpF,YAAQ,MAAM,iGAA+F;AAC7G,SA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,sBAAsB,KAAK,QAAQ;GAAE,IAAI,mBAAmB;GAAE,IAAI,oBAAoB;GAAC,CAAC;AAEhH,MAAI;AACF,QAAK,SAAS,KAAK,UAAU,aAAa,WAAW;GAErD,MAAM,eAAe;IACnB,SAAS,IAAI,IAAI,YAAY,KAAK,OAAO,QAAQ,CAAC,UAAU;IAC5D,MAAM,KAAK,OAAO;IACnB;AACD,UAAO,UAAU,aAAa;GAG9B,MAAM,YAAY,YAAY,cAAc;AAC5C,UAAO,aAAa,QAAQ,KAAI,YAAW;AACzC,cAAU,KAAK,QAAQ,OAAO,GAAG,QAAQ,OAAO,EAAE,MAAM,QAAQ,MAAM,CAAC;AACvE,WAAO;KACP;AACF,UAAO,aAAa,SAAS,KAAK,UAAU,YAAY;AACtD,cAAU,KAAK,SAAS,OAAO,GAAG,SAAS,WAAW,GAAG,QAAQ,OAAO,GAAG,QAAQ,MAAM;AACzF,WAAO;KACP;AACF,UAAO,aAAa,MAAM,KAAK,OAAO,UAAU,YAAY;AAC1D,cAAU,KAAK,SAAS,OAAO,GAAG,SAAS,WAAW,GAAG,QAAQ,OAAO,GAAG,QAAQ,OAAO,MAAM;AAChG,WAAO;KACP;AAEF,SAAM,qCAAqC,aAAa;WACjD,OAAY;AACnB,SAAM,wBAAwB,MAAM;AACpC,OAAI,KAAK,SAAS,MAAM,YAAY,kDAAkD;AACpF,YAAQ,MAAM,iGAA+F;AAC7G,SAAK,SAAS;KACZ,SAAS;KACT,OAAO,YAAY;KACpB;UACI;AACL,YAAQ,MAAM,8BAA8B,MAAM,QAAQ;AAC1D,YAAQ,KAAK,EAAE"}
@@ -693,6 +693,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
693
693
  getProfiles: () => getProfiles,
694
694
  getProfilesByProfileId: () => getProfilesByProfileId,
695
695
  getProfilesByProfileIdClaimMappings: () => getProfilesByProfileIdClaimMappings,
696
+ getProfilesByProfileIdDirectAssignments: () => getProfilesByProfileIdDirectAssignments,
696
697
  getProfilesByProfileIdTools: () => getProfilesByProfileIdTools,
697
698
  getSandboxes: () => getSandboxes,
698
699
  getSandboxesBySandboxId: () => getSandboxesBySandboxId,
@@ -722,9 +723,11 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
722
723
  patchUsersByUserIdPersonalAccessTokensByPatId: () => patchUsersByUserIdPersonalAccessTokensByPatId,
723
724
  patchUsersByUserIdProfilesByProfileId: () => patchUsersByUserIdProfilesByProfileId,
724
725
  postEmailVerificationSendCode: () => postEmailVerificationSendCode,
726
+ postInstallPredefinedById: () => postInstallPredefinedById,
725
727
  postMcpServers: () => postMcpServers,
726
728
  postMcpServersByServerSlugCredentialsCopy: () => postMcpServersByServerSlugCredentialsCopy,
727
729
  postMcpServersByServerSlugFiles: () => postMcpServersByServerSlugFiles,
730
+ postMcpServersByServerSlugOpenapiTest: () => postMcpServersByServerSlugOpenapiTest,
728
731
  postMcpServersByServerSlugStart: () => postMcpServersByServerSlugStart,
729
732
  postMcpServersByServerSlugStop: () => postMcpServersByServerSlugStop,
730
733
  postMcpServersByServerSlugToolsByToolNameCall: () => postMcpServersByServerSlugToolsByToolNameCall,
@@ -1164,6 +1167,24 @@ const getMcpServersByServerSlugOauthDiscover = (options) => (options.client ?? c
1164
1167
  url: "/mcp-servers/{serverSlug}/oauth/discover",
1165
1168
  ...options
1166
1169
  });
1170
+ /**
1171
+ * Fetch a remote OpenAPI/Swagger specification from the given URL and validate that it is a valid spec.
1172
+ */
1173
+ const postMcpServersByServerSlugOpenapiTest = (options) => (options.client ?? client).post({
1174
+ security: [{
1175
+ scheme: "bearer",
1176
+ type: "http"
1177
+ }, {
1178
+ scheme: "bearer",
1179
+ type: "http"
1180
+ }],
1181
+ url: "/mcp-servers/{serverSlug}/openapi/test",
1182
+ ...options,
1183
+ headers: {
1184
+ "Content-Type": "application/json",
1185
+ ...options.headers
1186
+ }
1187
+ });
1167
1188
  const getMcpServersByServerSlugTools = (options) => (options.client ?? client).get({
1168
1189
  security: [{
1169
1190
  scheme: "bearer",
@@ -1621,6 +1642,17 @@ const getTenantsByTenantIdSubscription = (options) => (options.client ?? client)
1621
1642
  url: "/tenants/{tenantId}/subscription",
1622
1643
  ...options
1623
1644
  });
1645
+ const postInstallPredefinedById = (options) => (options.client ?? client).post({
1646
+ security: [{
1647
+ scheme: "bearer",
1648
+ type: "http"
1649
+ }, {
1650
+ scheme: "bearer",
1651
+ type: "http"
1652
+ }],
1653
+ url: "/install-predefined/{id}",
1654
+ ...options
1655
+ });
1624
1656
  const getDeploymentsStatus = (options) => (options?.client ?? client).get({
1625
1657
  security: [{
1626
1658
  scheme: "bearer",
@@ -2128,6 +2160,17 @@ const deleteProfilesByProfileIdClaimMappingsByMappingId = (options) => (options.
2128
2160
  url: "/profiles/{profileId}/claim-mappings/{mappingId}",
2129
2161
  ...options
2130
2162
  });
2163
+ const getProfilesByProfileIdDirectAssignments = (options) => (options.client ?? client).get({
2164
+ security: [{
2165
+ scheme: "bearer",
2166
+ type: "http"
2167
+ }, {
2168
+ scheme: "bearer",
2169
+ type: "http"
2170
+ }],
2171
+ url: "/profiles/{profileId}/direct-assignments",
2172
+ ...options
2173
+ });
2131
2174
  const getProfilesByProfileIdTools = (options) => (options.client ?? client).get({
2132
2175
  security: [{
2133
2176
  scheme: "bearer",
@@ -2341,5 +2384,5 @@ const deleteScimConfigTokensByTokenId = (options) => (options.client ?? client).
2341
2384
  });
2342
2385
 
2343
2386
  //#endregion
2344
- export { getSandboxesBySandboxIdAuditLogs as $, putMcpServersByServerSlugCredentialsProfilesByProfileId as $t, getMcpServersByServerSlug as A, postMcpServersByServerSlugToolsByToolNameCall as At, getMcpServersByServerSlugFilesByFileId as B, postSecretStoresByStoreIdMappings as Bt, getAuthMe as C, patchUsersByUserIdProfilesByProfileId as Ct, getDeploymentsStatus as D, postMcpServersByServerSlugFiles as Dt, getDeploymentsMetrics as E, postMcpServersByServerSlugCredentialsCopy as Et, getMcpServersByServerSlugCredentialsServerApikeys as F, postSandboxesBySandboxIdReadFile as Ft, getMcpServersByServerSlugTools as G, postTeamsByTeamIdMembers as Gt, getMcpServersByServerSlugOauthDiscover as H, postTeams as Ht, getMcpServersByServerSlugCredentialsToken as I, postSandboxesBySandboxIdSshSession as It, getProfilesByProfileId as J, postUsersByUserIdPersonalAccessTokens as Jt, getMcpServersByServerSlugToolsByToolName as K, postToolsRefresh as Kt, getMcpServersByServerSlugCredentialsUser as L, postSandboxesBySandboxIdWriteFile as Lt, getMcpServersByServerSlugCredentialsProfile as M, postProfilesByProfileIdClaimMappings as Mt, getMcpServersByServerSlugCredentialsProfileByProfileIdApikeys as N, postSandboxes as Nt, getMcpServers as O, postMcpServersByServerSlugStart as Ot, getMcpServersByServerSlugCredentialsServer as P, postSandboxesBySandboxIdExec as Pt, getSandboxesBySandboxId as Q, putMcpServersByServerSlugAllToolsIsEnabled as Qt, getMcpServersByServerSlugCredentialsUserApikeys as R, postScimConfigTokens as Rt, getAuditLogsById as S, patchUsersByUserIdPersonalAccessTokensByPatId as St, getDeploymentsLogs as T, postMcpServers as Tt, getMcpServersByServerSlugRunningStatus as U, postTeamsByTeamIdClaimMappings as Ut, getMcpServersByServerSlugMembers as V, postSecretStoresByStoreIdTest as Vt, getMcpServersByServerSlugSourceCode as W, postTeamsByTeamIdInvitations as Wt, getProfilesByProfileIdTools as X, postUsersMeRequestEmailVerification as Xt, getProfilesByProfileIdClaimMappings as Y, postUsersByUserIdProfiles as Yt, getSandboxes as Z, putMcpServersByServerSlug as Zt, deleteTeamsByTeamIdMembersByUserId as _, getUsersByUserIdPersonalAccessTokens as _t, deleteMcpServersByServerSlugCredentialsUser as a, putMcpServersByServerSlugMembersByMemberTypeByMemberId as an, getSecretStoresByStoreIdMappings as at, deleteUsersByUserIdProfilesByProfileId as b, patchSecretStoresById as bt, deleteProfilesByProfileId as c, putProfilesByProfileId as cn, getTeamsByTeamIdClaimMappings as ct, deleteScimConfigTokensByTokenId as d, putTeamsByTeamIdMembersByUserId as dn, getTeamsByTeamIdServers as dt, putMcpServersByServerSlugCredentialsServer as en, getSandboxesBySandboxIdAuditLogsById as et, deleteSecretStoresById as f, putUsersByUserId as fn, getTenantsByTenantId as ft, deleteTeamsByTeamIdInvitationsByInvitationId as g, getUsersByUserId as gt, deleteTeamsByTeamIdClaimMappingsByMappingId as h, client as hn, getUsers as ht, deleteMcpServersByServerSlugCredentialsServer as i, putMcpServersByServerSlugIsEnabled as in, getSecretStoresById as it, getMcpServersByServerSlugCredentialsAuthorizeUrl as j, postProfiles as jt, getMcpServersAccessPreview as k, postMcpServersByServerSlugStop as kt, deleteProfilesByProfileIdClaimMappingsByMappingId as l, putProfilesByProfileIdServersByServerSlugTools as ln, getTeamsByTeamIdInvitations as lt, deleteTeamsByTeamId as m, sdk_gen_exports as mn, getTools as mt, deleteMcpServersByServerSlugCredentialsByCredentialsId as n, putMcpServersByServerSlugFilesByFileId as nn, getScimConfigTokensByTokenIdSecret as nt, deleteMcpServersByServerSlugFilesByFileId as o, putMcpServersByServerSlugSourceCode as on, getTeams as ot, deleteSecretStoresByStoreIdMappingsByMappingName as p, putUsersMe as pn, getTenantsByTenantIdSubscription as pt, getProfiles as q, postUsers as qt, deleteMcpServersByServerSlugCredentialsProfilesByProfileId as r, putMcpServersByServerSlugFilesByFileIdName as rn, getSecretStores as rt, deleteMcpServersByServerSlugMembersByMemberTypeByMemberId as s, putMcpServersByServerSlugToolsByToolNameIsEnabled as sn, getTeamsByTeamId as st, deleteMcpServersByServerSlug as t, putMcpServersByServerSlugCredentialsUser as tn, getScimConfigTokens as tt, deleteSandboxesBySandboxId as u, putTeamsByTeamId as un, getTeamsByTeamIdMembers as ut, deleteUsersByUserId as v, getUsersByUserIdProfiles as vt, getDeploymentsDeploymentLogs as w, postEmailVerificationSendCode as wt, getAuditLogs as x, patchSecretStoresByStoreIdMappingsByMappingName as xt, deleteUsersByUserIdPersonalAccessTokensByPatId as y, getUsersMe as yt, getMcpServersByServerSlugFiles as z, postSecretStores as zt };
2345
- //# sourceMappingURL=sdk.gen-B08PtmWt.mjs.map
2387
+ export { getSandboxesBySandboxId as $, postUsersMeRequestEmailVerification as $t, getMcpServersByServerSlug as A, postMcpServersByServerSlugOpenapiTest as At, getMcpServersByServerSlugFilesByFileId as B, postSandboxesBySandboxIdWriteFile as Bt, getAuthMe as C, patchUsersByUserIdPersonalAccessTokensByPatId as Ct, getDeploymentsStatus as D, postMcpServers as Dt, getDeploymentsMetrics as E, postInstallPredefinedById as Et, getMcpServersByServerSlugCredentialsServerApikeys as F, postProfilesByProfileIdClaimMappings as Ft, getMcpServersByServerSlugTools as G, postTeams as Gt, getMcpServersByServerSlugOauthDiscover as H, postSecretStores as Ht, getMcpServersByServerSlugCredentialsToken as I, postSandboxes as It, getProfilesByProfileId as J, postTeamsByTeamIdMembers as Jt, getMcpServersByServerSlugToolsByToolName as K, postTeamsByTeamIdClaimMappings as Kt, getMcpServersByServerSlugCredentialsUser as L, postSandboxesBySandboxIdExec as Lt, getMcpServersByServerSlugCredentialsProfile as M, postMcpServersByServerSlugStop as Mt, getMcpServersByServerSlugCredentialsProfileByProfileIdApikeys as N, postMcpServersByServerSlugToolsByToolNameCall as Nt, getMcpServers as O, postMcpServersByServerSlugCredentialsCopy as Ot, getMcpServersByServerSlugCredentialsServer as P, postProfiles as Pt, getSandboxes as Q, postUsersByUserIdProfiles as Qt, getMcpServersByServerSlugCredentialsUserApikeys as R, postSandboxesBySandboxIdReadFile as Rt, getAuditLogsById as S, patchSecretStoresByStoreIdMappingsByMappingName as St, getDeploymentsLogs as T, postEmailVerificationSendCode as Tt, getMcpServersByServerSlugRunningStatus as U, postSecretStoresByStoreIdMappings as Ut, getMcpServersByServerSlugMembers as V, postScimConfigTokens as Vt, getMcpServersByServerSlugSourceCode as W, postSecretStoresByStoreIdTest as Wt, getProfilesByProfileIdDirectAssignments as X, postUsers as Xt, getProfilesByProfileIdClaimMappings as Y, postToolsRefresh as Yt, getProfilesByProfileIdTools as Z, postUsersByUserIdPersonalAccessTokens as Zt, deleteTeamsByTeamIdMembersByUserId as _, sdk_gen_exports as _n, getUsersByUserId as _t, deleteMcpServersByServerSlugCredentialsUser as a, putMcpServersByServerSlugFilesByFileId as an, getSecretStoresById as at, deleteUsersByUserIdProfilesByProfileId as b, getUsersMe as bt, deleteProfilesByProfileId as c, putMcpServersByServerSlugMembersByMemberTypeByMemberId as cn, getTeamsByTeamId as ct, deleteScimConfigTokensByTokenId as d, putProfilesByProfileId as dn, getTeamsByTeamIdMembers as dt, putMcpServersByServerSlug as en, getSandboxesBySandboxIdAuditLogs as et, deleteSecretStoresById as f, putProfilesByProfileIdServersByServerSlugTools as fn, getTeamsByTeamIdServers as ft, deleteTeamsByTeamIdInvitationsByInvitationId as g, putUsersMe as gn, getUsers as gt, deleteTeamsByTeamIdClaimMappingsByMappingId as h, putUsersByUserId as hn, getTools as ht, deleteMcpServersByServerSlugCredentialsServer as i, putMcpServersByServerSlugCredentialsUser as in, getSecretStores as it, getMcpServersByServerSlugCredentialsAuthorizeUrl as j, postMcpServersByServerSlugStart as jt, getMcpServersAccessPreview as k, postMcpServersByServerSlugFiles as kt, deleteProfilesByProfileIdClaimMappingsByMappingId as l, putMcpServersByServerSlugSourceCode as ln, getTeamsByTeamIdClaimMappings as lt, deleteTeamsByTeamId as m, putTeamsByTeamIdMembersByUserId as mn, getTenantsByTenantIdSubscription as mt, deleteMcpServersByServerSlugCredentialsByCredentialsId as n, putMcpServersByServerSlugCredentialsProfilesByProfileId as nn, getScimConfigTokens as nt, deleteMcpServersByServerSlugFilesByFileId as o, putMcpServersByServerSlugFilesByFileIdName as on, getSecretStoresByStoreIdMappings as ot, deleteSecretStoresByStoreIdMappingsByMappingName as p, putTeamsByTeamId as pn, getTenantsByTenantId as pt, getProfiles as q, postTeamsByTeamIdInvitations as qt, deleteMcpServersByServerSlugCredentialsProfilesByProfileId as r, putMcpServersByServerSlugCredentialsServer as rn, getScimConfigTokensByTokenIdSecret as rt, deleteMcpServersByServerSlugMembersByMemberTypeByMemberId as s, putMcpServersByServerSlugIsEnabled as sn, getTeams as st, deleteMcpServersByServerSlug as t, putMcpServersByServerSlugAllToolsIsEnabled as tn, getSandboxesBySandboxIdAuditLogsById as tt, deleteSandboxesBySandboxId as u, putMcpServersByServerSlugToolsByToolNameIsEnabled as un, getTeamsByTeamIdInvitations as ut, deleteUsersByUserId as v, client as vn, getUsersByUserIdPersonalAccessTokens as vt, getDeploymentsDeploymentLogs as w, patchUsersByUserIdProfilesByProfileId as wt, getAuditLogs as x, patchSecretStoresById as xt, deleteUsersByUserIdPersonalAccessTokensByPatId as y, getUsersByUserIdProfiles as yt, getMcpServersByServerSlugFiles as z, postSandboxesBySandboxIdSshSession as zt };
2388
+ //# sourceMappingURL=sdk.gen-B5HNJH3y.mjs.map