gatana-sdk 2.2.0

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.
Files changed (40) hide show
  1. package/LICENSE +21 -0
  2. package/dist/api/index.cjs +155 -0
  3. package/dist/api/index.d.cts +2 -0
  4. package/dist/api/index.d.mts +2 -0
  5. package/dist/api/index.mjs +3 -0
  6. package/dist/apiv2/index.cjs +9 -0
  7. package/dist/apiv2/index.d.cts +2 -0
  8. package/dist/apiv2/index.d.mts +2 -0
  9. package/dist/apiv2/index.mjs +3 -0
  10. package/dist/chunk-DQk6qfdC.mjs +18 -0
  11. package/dist/chunk-uaV2rQ02.cjs +53 -0
  12. package/dist/config.cjs +92 -0
  13. package/dist/config.d.cts +28 -0
  14. package/dist/config.d.cts.map +1 -0
  15. package/dist/config.d.mts +28 -0
  16. package/dist/config.d.mts.map +1 -0
  17. package/dist/config.mjs +80 -0
  18. package/dist/config.mjs.map +1 -0
  19. package/dist/index.cjs +198 -0
  20. package/dist/index.d.cts +73 -0
  21. package/dist/index.d.cts.map +1 -0
  22. package/dist/index.d.mts +73 -0
  23. package/dist/index.d.mts.map +1 -0
  24. package/dist/index.mjs +189 -0
  25. package/dist/index.mjs.map +1 -0
  26. package/dist/sdk.gen-8pk6phy9.d.mts +4461 -0
  27. package/dist/sdk.gen-8pk6phy9.d.mts.map +1 -0
  28. package/dist/sdk.gen-C3exKd-p.d.mts +623 -0
  29. package/dist/sdk.gen-C3exKd-p.d.mts.map +1 -0
  30. package/dist/sdk.gen-CKko8Vw_.cjs +3977 -0
  31. package/dist/sdk.gen-CjrIKr7c.cjs +774 -0
  32. package/dist/sdk.gen-CsXf3DVg.d.cts +623 -0
  33. package/dist/sdk.gen-CsXf3DVg.d.cts.map +1 -0
  34. package/dist/sdk.gen-DH-7_dug.mjs +728 -0
  35. package/dist/sdk.gen-DH-7_dug.mjs.map +1 -0
  36. package/dist/sdk.gen-DjFKgYPq.mjs +3055 -0
  37. package/dist/sdk.gen-DjFKgYPq.mjs.map +1 -0
  38. package/dist/sdk.gen-vjzsjj67.d.cts +4461 -0
  39. package/dist/sdk.gen-vjzsjj67.d.cts.map +1 -0
  40. package/package.json +89 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,189 @@
1
+ import { Gn as sdk_gen_exports, Kn as client } from "./sdk.gen-DjFKgYPq.mjs";
2
+ import { getDefaultOrganization, getOrganization, setOrganizationConfig } from "./config.mjs";
3
+ import { c as client$1, s as sdk_gen_exports$1 } from "./sdk.gen-DH-7_dug.mjs";
4
+ import createDebug from "debug";
5
+ import * as openidClient from "openid-client";
6
+
7
+ //#region src/v2.ts
8
+ const debug$1 = createDebug("gatana");
9
+ /**
10
+ * Gatana2 is representing a more REST-ful API where the object returned from GET can be used directly in POST/PUT/PATCH requests.
11
+ */
12
+ var Gatana2 = class {
13
+ api = sdk_gen_exports$1;
14
+ config;
15
+ constructor(arg) {
16
+ const configLoader = arg?.configLoader || new ConfigLoader([
17
+ new OptionsConfigStrategy(arg?.options),
18
+ new EnvConfigStrategy(),
19
+ new FileConfigStrategy()
20
+ ]);
21
+ try {
22
+ this.config = configLoader.getConfig();
23
+ const clientConfig = {
24
+ baseUrl: new URL("/api/v2/", this.config.baseUrl).toString(),
25
+ auth: this.config.token
26
+ };
27
+ client$1.setConfig(clientConfig);
28
+ const debugHttp = createDebug("gatana:http");
29
+ client$1.interceptors.request.use((request) => {
30
+ debugHttp(`→ ${request.method} ${request.url}`);
31
+ return request;
32
+ });
33
+ client$1.interceptors.response.use((response, request) => {
34
+ debugHttp(`← ${response.status} ${response.statusText} ${request.method} ${request.url}`);
35
+ return response;
36
+ });
37
+ client$1.interceptors.error.use((error, response, request) => {
38
+ debugHttp(`✗ ${response.status} ${response.statusText} ${request.method} ${request.url}`, error);
39
+ return error;
40
+ });
41
+ debug$1("Gatana initialized with config", clientConfig);
42
+ } catch (error) {
43
+ debug$1("Failed to initialize", error);
44
+ if (arg?.isCli && error.message === "No valid configuration found from any strategy") {
45
+ console.error("Warning: No valid configuration found. Run \"gatana config login\" to set up your credentials.");
46
+ this.config = {
47
+ baseUrl: "https://NO_ORGANIZATION_SET.gatana.ai",
48
+ token: async () => "PLEASE_SET_UP_CONFIGURATION"
49
+ };
50
+ } else {
51
+ console.error("Error initializing Gatana:", error.message);
52
+ process.exit(1);
53
+ }
54
+ }
55
+ }
56
+ getOpenApiSpecUrl() {
57
+ return new URL("/api/v2/openapi.json", this.config.baseUrl).toString();
58
+ }
59
+ };
60
+
61
+ //#endregion
62
+ //#region src/index.ts
63
+ const debug = createDebug("gatana");
64
+ var ConfigLoader = class {
65
+ constructor(strategies) {
66
+ this.strategies = strategies;
67
+ }
68
+ getConfig() {
69
+ for (const strategy of this.strategies) {
70
+ const config = strategy.getConfig();
71
+ if (config) return config;
72
+ }
73
+ throw new Error("No valid configuration found from any strategy");
74
+ }
75
+ };
76
+ var ConfigStrategy = class {};
77
+ var OptionsConfigStrategy = class extends ConfigStrategy {
78
+ constructor(options) {
79
+ super();
80
+ this.options = options;
81
+ }
82
+ getConfig() {
83
+ if (!this.options) return null;
84
+ if (this.options.apiKey && (this.options.orgId || this.options.baseUrl)) {
85
+ const key = this.options.apiKey;
86
+ return {
87
+ baseUrl: this.options.baseUrl || `https://${this.options.orgId}.gatana.ai`,
88
+ token: async () => key
89
+ };
90
+ }
91
+ return null;
92
+ }
93
+ };
94
+ var EnvConfigStrategy = class extends ConfigStrategy {
95
+ getConfig() {
96
+ const apiKey = process.env.GATANA_API_KEY;
97
+ const orgId = process.env.GATANA_ORG_ID;
98
+ const overrideBaseUrl = process.env.GATANA_BASE_URL;
99
+ if (apiKey && (orgId || overrideBaseUrl)) return {
100
+ baseUrl: overrideBaseUrl || `https://${orgId}.gatana.ai`,
101
+ token: async () => apiKey
102
+ };
103
+ return null;
104
+ }
105
+ };
106
+ var FileConfigStrategy = class extends ConfigStrategy {
107
+ constructor(orgId) {
108
+ super();
109
+ this.orgId = orgId;
110
+ }
111
+ getConfig() {
112
+ let orgId = this.orgId || process.env.GATANA_ORG_ID || getDefaultOrganization();
113
+ if (!orgId) return null;
114
+ debug(`FileConfigLoader loading config for orgId=${orgId}`);
115
+ const tenantConfig = getOrganization(orgId);
116
+ if (!tenantConfig) return null;
117
+ return {
118
+ baseUrl: tenantConfig.baseUrl,
119
+ token: async () => {
120
+ if (tenantConfig?.apiKey) return tenantConfig.apiKey;
121
+ else if (tenantConfig?.tokens?.access_token) return tenantConfig.tokens.access_token;
122
+ else if (tenantConfig.tokens?.refresh_token) {
123
+ debug("Access token expired or about to expire, attempting to refresh");
124
+ const config = await openidClient.discovery(new URL(`/.well-known/openid-configuration`, tenantConfig.baseUrl), `${orgId}-cli`);
125
+ const token = await openidClient.refreshTokenGrant(config, tenantConfig.tokens.refresh_token);
126
+ if (token) {
127
+ setOrganizationConfig(orgId, { tokens: {
128
+ access_token: token.access_token,
129
+ refresh_token: token.refresh_token || tenantConfig.tokens.refresh_token,
130
+ expires_at: token.expires_in ? Math.floor(Date.now() / 1e3) + token.expires_in : 0
131
+ } });
132
+ debug("Token refreshed successfully");
133
+ return token.access_token;
134
+ }
135
+ }
136
+ throw new Error("No valid API key, access token or refresh token available.");
137
+ }
138
+ };
139
+ }
140
+ };
141
+ var Gatana = class {
142
+ api = sdk_gen_exports;
143
+ config;
144
+ constructor(arg) {
145
+ const configLoader = arg?.configLoader || new ConfigLoader([
146
+ new OptionsConfigStrategy(arg?.options),
147
+ new EnvConfigStrategy(),
148
+ new FileConfigStrategy()
149
+ ]);
150
+ try {
151
+ this.config = configLoader.getConfig();
152
+ const clientConfig = {
153
+ baseUrl: new URL("/api/v1/", this.config.baseUrl).toString(),
154
+ auth: this.config.token
155
+ };
156
+ client.setConfig(clientConfig);
157
+ const debugHttp = createDebug("gatana:http");
158
+ client.interceptors.request.use((request) => {
159
+ debugHttp(`→ ${request.method} ${request.url}`);
160
+ return request;
161
+ });
162
+ client.interceptors.response.use((response, request) => {
163
+ debugHttp(`← ${response.status} ${response.statusText} ${request.method} ${request.url}`);
164
+ return response;
165
+ });
166
+ client.interceptors.error.use((error, response, request) => {
167
+ debugHttp(`✗ ${response.status} ${response.statusText} ${request.method} ${request.url}`, error);
168
+ return error;
169
+ });
170
+ debug("Gatana initialized with config", clientConfig);
171
+ } catch (error) {
172
+ debug("Failed to initialize", error);
173
+ if (arg?.isCli && error.message === "No valid configuration found from any strategy") {
174
+ console.error("Warning: No valid configuration found. Run \"gatana config login\" to set up your credentials.");
175
+ this.config = {
176
+ baseUrl: "https://NO_ORGANIZATION_SET.gatana.ai",
177
+ token: async () => "PLEASE_SET_UP_CONFIGURATION"
178
+ };
179
+ } else {
180
+ console.error("Error initializing Gatana:", error.message);
181
+ process.exit(1);
182
+ }
183
+ }
184
+ }
185
+ };
186
+
187
+ //#endregion
188
+ export { ConfigLoader, ConfigStrategy, EnvConfigStrategy, FileConfigStrategy, Gatana, Gatana2, OptionsConfigStrategy };
189
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +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 type { Agent } from './api/types.gen.js';\nimport createDebug from 'debug';\nimport { getOrganization, getDefaultOrganization, setOrganizationConfig } 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(): { 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 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 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 if (!tenantConfig) {\n return null;\n }\n return {\n baseUrl: tenantConfig.baseUrl,\n token: async () => {\n if (tenantConfig?.apiKey) {\n return tenantConfig.apiKey;\n } else if (tenantConfig?.tokens?.access_token) {\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 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 }\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 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/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;AAE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