gatana-sdk 2.3.5 → 2.3.6
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.
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +5 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +5 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -83,6 +83,7 @@ var OptionsConfigStrategy = class extends ConfigStrategy {
|
|
|
83
83
|
super();
|
|
84
84
|
this.options = options;
|
|
85
85
|
}
|
|
86
|
+
help = "OptionsConfigStrategy: Provide configuration via Gatana constructor options. Example: new Gatana({ options }) where options includes apiKey and orgId or baseUrl.";
|
|
86
87
|
getConfig() {
|
|
87
88
|
if (!this.options) return null;
|
|
88
89
|
if (this.options.apiKey && (this.options.orgId || this.options.baseUrl)) {
|
|
@@ -98,6 +99,7 @@ var OptionsConfigStrategy = class extends ConfigStrategy {
|
|
|
98
99
|
}
|
|
99
100
|
};
|
|
100
101
|
var EnvConfigStrategy = class extends ConfigStrategy {
|
|
102
|
+
help = "EnvConfigStrategy: Provide configuration via environment variables. Required: GATANA_API_KEY and either GATANA_ORG_ID or GATANA_BASE_URL. Example: export GATANA_API_KEY=your_api_key; export GATANA_ORG_ID=your_org_id";
|
|
101
103
|
getConfig() {
|
|
102
104
|
const apiKey = process.env.GATANA_API_KEY;
|
|
103
105
|
const orgId = process.env.GATANA_ORG_ID;
|
|
@@ -115,6 +117,7 @@ var FileConfigStrategy = class extends ConfigStrategy {
|
|
|
115
117
|
super();
|
|
116
118
|
this.orgId = orgId;
|
|
117
119
|
}
|
|
120
|
+
help = "FileConfigStrategy: Provide configuration via a local config file. Use the \"gatana config\" commands to manage this configuration. The CLI will look for the default organization in the config file or use the org specified by GATANA_ORG_ID env var.";
|
|
118
121
|
getConfig() {
|
|
119
122
|
let orgId = this.orgId || process.env.GATANA_ORG_ID || require_config.getDefaultOrganization();
|
|
120
123
|
if (!orgId) return null;
|
package/dist/index.d.cts
CHANGED
|
@@ -27,7 +27,7 @@ type GatanaConfig = {
|
|
|
27
27
|
token: () => Promise<string>;
|
|
28
28
|
};
|
|
29
29
|
declare class ConfigLoader {
|
|
30
|
-
|
|
30
|
+
readonly strategies: ConfigStrategy[];
|
|
31
31
|
constructor(strategies: ConfigStrategy[]);
|
|
32
32
|
getConfig(): GatanaConfig;
|
|
33
33
|
}
|
|
@@ -37,10 +37,12 @@ declare abstract class ConfigStrategy {
|
|
|
37
37
|
baseUrl: string;
|
|
38
38
|
token: () => Promise<string>;
|
|
39
39
|
} | null;
|
|
40
|
+
abstract help: string;
|
|
40
41
|
}
|
|
41
42
|
declare class OptionsConfigStrategy extends ConfigStrategy {
|
|
42
43
|
private options?;
|
|
43
44
|
constructor(options?: GatanaOptions | undefined);
|
|
45
|
+
help: string;
|
|
44
46
|
getConfig(): {
|
|
45
47
|
orgId: string;
|
|
46
48
|
baseUrl: string;
|
|
@@ -48,6 +50,7 @@ declare class OptionsConfigStrategy extends ConfigStrategy {
|
|
|
48
50
|
} | null;
|
|
49
51
|
}
|
|
50
52
|
declare class EnvConfigStrategy extends ConfigStrategy {
|
|
53
|
+
help: string;
|
|
51
54
|
getConfig(): {
|
|
52
55
|
orgId: string;
|
|
53
56
|
baseUrl: string;
|
|
@@ -57,6 +60,7 @@ declare class EnvConfigStrategy extends ConfigStrategy {
|
|
|
57
60
|
declare class FileConfigStrategy extends ConfigStrategy {
|
|
58
61
|
private orgId?;
|
|
59
62
|
constructor(orgId?: string | undefined);
|
|
63
|
+
help: string;
|
|
60
64
|
getConfig(): {
|
|
61
65
|
orgId: string;
|
|
62
66
|
baseUrl: string;
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/v2.ts","../src/index.ts"],"mappings":";;;;;;AAiBA;cAAa,OAA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;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"}
|
package/dist/index.d.mts
CHANGED
|
@@ -27,7 +27,7 @@ type GatanaConfig = {
|
|
|
27
27
|
token: () => Promise<string>;
|
|
28
28
|
};
|
|
29
29
|
declare class ConfigLoader {
|
|
30
|
-
|
|
30
|
+
readonly strategies: ConfigStrategy[];
|
|
31
31
|
constructor(strategies: ConfigStrategy[]);
|
|
32
32
|
getConfig(): GatanaConfig;
|
|
33
33
|
}
|
|
@@ -37,10 +37,12 @@ declare abstract class ConfigStrategy {
|
|
|
37
37
|
baseUrl: string;
|
|
38
38
|
token: () => Promise<string>;
|
|
39
39
|
} | null;
|
|
40
|
+
abstract help: string;
|
|
40
41
|
}
|
|
41
42
|
declare class OptionsConfigStrategy extends ConfigStrategy {
|
|
42
43
|
private options?;
|
|
43
44
|
constructor(options?: GatanaOptions | undefined);
|
|
45
|
+
help: string;
|
|
44
46
|
getConfig(): {
|
|
45
47
|
orgId: string;
|
|
46
48
|
baseUrl: string;
|
|
@@ -48,6 +50,7 @@ declare class OptionsConfigStrategy extends ConfigStrategy {
|
|
|
48
50
|
} | null;
|
|
49
51
|
}
|
|
50
52
|
declare class EnvConfigStrategy extends ConfigStrategy {
|
|
53
|
+
help: string;
|
|
51
54
|
getConfig(): {
|
|
52
55
|
orgId: string;
|
|
53
56
|
baseUrl: string;
|
|
@@ -57,6 +60,7 @@ declare class EnvConfigStrategy extends ConfigStrategy {
|
|
|
57
60
|
declare class FileConfigStrategy extends ConfigStrategy {
|
|
58
61
|
private orgId?;
|
|
59
62
|
constructor(orgId?: string | undefined);
|
|
63
|
+
help: string;
|
|
60
64
|
getConfig(): {
|
|
61
65
|
orgId: string;
|
|
62
66
|
baseUrl: string;
|
package/dist/index.d.mts.map
CHANGED
|
@@ -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,
|
|
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"}
|
package/dist/index.mjs
CHANGED
|
@@ -79,6 +79,7 @@ var OptionsConfigStrategy = class extends ConfigStrategy {
|
|
|
79
79
|
super();
|
|
80
80
|
this.options = options;
|
|
81
81
|
}
|
|
82
|
+
help = "OptionsConfigStrategy: Provide configuration via Gatana constructor options. Example: new Gatana({ options }) where options includes apiKey and orgId or baseUrl.";
|
|
82
83
|
getConfig() {
|
|
83
84
|
if (!this.options) return null;
|
|
84
85
|
if (this.options.apiKey && (this.options.orgId || this.options.baseUrl)) {
|
|
@@ -94,6 +95,7 @@ var OptionsConfigStrategy = class extends ConfigStrategy {
|
|
|
94
95
|
}
|
|
95
96
|
};
|
|
96
97
|
var EnvConfigStrategy = class extends ConfigStrategy {
|
|
98
|
+
help = "EnvConfigStrategy: Provide configuration via environment variables. Required: GATANA_API_KEY and either GATANA_ORG_ID or GATANA_BASE_URL. Example: export GATANA_API_KEY=your_api_key; export GATANA_ORG_ID=your_org_id";
|
|
97
99
|
getConfig() {
|
|
98
100
|
const apiKey = process.env.GATANA_API_KEY;
|
|
99
101
|
const orgId = process.env.GATANA_ORG_ID;
|
|
@@ -111,6 +113,7 @@ var FileConfigStrategy = class extends ConfigStrategy {
|
|
|
111
113
|
super();
|
|
112
114
|
this.orgId = orgId;
|
|
113
115
|
}
|
|
116
|
+
help = "FileConfigStrategy: Provide configuration via a local config file. Use the \"gatana config\" commands to manage this configuration. The CLI will look for the default organization in the config file or use the org specified by GATANA_ORG_ID env var.";
|
|
114
117
|
getConfig() {
|
|
115
118
|
let orgId = this.orgId || process.env.GATANA_ORG_ID || getDefaultOrganization();
|
|
116
119
|
if (!orgId) return null;
|
package/dist/index.mjs.map
CHANGED
|
@@ -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(private 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}\n\nexport class OptionsConfigStrategy extends ConfigStrategy {\n constructor(private options?: GatanaOptions) {\n super();\n }\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 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 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,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,MAAM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AAY;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; 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,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