@athenaintel/sdk 4.3.2202 → 4.3.2203

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 (48) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/BaseClient.d.ts +4 -0
  3. package/dist/cjs/BaseClient.js +3 -2
  4. package/dist/cjs/api/resources/agents/resources/general/client/Client.js +18 -14
  5. package/dist/cjs/api/resources/aop/client/Client.js +64 -49
  6. package/dist/cjs/api/resources/assets/client/Client.js +144 -112
  7. package/dist/cjs/api/resources/collabAgents/client/Client.js +9 -7
  8. package/dist/cjs/api/resources/computer/client/Client.js +63 -49
  9. package/dist/cjs/api/resources/databases/client/Client.js +72 -56
  10. package/dist/cjs/api/resources/meetings/client/Client.js +27 -21
  11. package/dist/cjs/api/resources/query/client/Client.js +9 -7
  12. package/dist/cjs/api/resources/semanticModel/client/Client.js +27 -21
  13. package/dist/cjs/api/resources/sessions/client/Client.js +45 -35
  14. package/dist/cjs/api/resources/threads/client/Client.js +45 -35
  15. package/dist/cjs/api/resources/tools/client/Client.js +79 -63
  16. package/dist/cjs/api/resources/tools/resources/calendar/client/Client.js +9 -7
  17. package/dist/cjs/api/resources/tools/resources/email/client/Client.js +18 -14
  18. package/dist/cjs/api/resources/tools/resources/sheets/client/Client.js +153 -119
  19. package/dist/cjs/api/resources/tools/resources/structuredDataExtractor/client/Client.js +9 -7
  20. package/dist/cjs/api/resources/tools/resources/tasks/client/Client.js +9 -7
  21. package/dist/cjs/api/resources/users/client/Client.js +45 -35
  22. package/dist/cjs/api/resources/workspaces/client/Client.js +63 -49
  23. package/dist/cjs/version.d.ts +1 -1
  24. package/dist/cjs/version.js +1 -1
  25. package/dist/esm/BaseClient.d.mts +4 -0
  26. package/dist/esm/BaseClient.mjs +3 -2
  27. package/dist/esm/api/resources/agents/resources/general/client/Client.mjs +19 -15
  28. package/dist/esm/api/resources/aop/client/Client.mjs +64 -49
  29. package/dist/esm/api/resources/assets/client/Client.mjs +145 -113
  30. package/dist/esm/api/resources/collabAgents/client/Client.mjs +10 -8
  31. package/dist/esm/api/resources/computer/client/Client.mjs +64 -50
  32. package/dist/esm/api/resources/databases/client/Client.mjs +73 -57
  33. package/dist/esm/api/resources/meetings/client/Client.mjs +28 -22
  34. package/dist/esm/api/resources/query/client/Client.mjs +10 -8
  35. package/dist/esm/api/resources/semanticModel/client/Client.mjs +28 -22
  36. package/dist/esm/api/resources/sessions/client/Client.mjs +46 -36
  37. package/dist/esm/api/resources/threads/client/Client.mjs +46 -36
  38. package/dist/esm/api/resources/tools/client/Client.mjs +79 -63
  39. package/dist/esm/api/resources/tools/resources/calendar/client/Client.mjs +10 -8
  40. package/dist/esm/api/resources/tools/resources/email/client/Client.mjs +19 -15
  41. package/dist/esm/api/resources/tools/resources/sheets/client/Client.mjs +154 -120
  42. package/dist/esm/api/resources/tools/resources/structuredDataExtractor/client/Client.mjs +10 -8
  43. package/dist/esm/api/resources/tools/resources/tasks/client/Client.mjs +10 -8
  44. package/dist/esm/api/resources/users/client/Client.mjs +46 -36
  45. package/dist/esm/api/resources/workspaces/client/Client.mjs +64 -50
  46. package/dist/esm/version.d.mts +1 -1
  47. package/dist/esm/version.mjs +1 -1
  48. package/package.json +1 -1
@@ -92,22 +92,24 @@ class CollabAgentsClient {
92
92
  }
93
93
  __sendMessage(request, requestOptions) {
94
94
  return __awaiter(this, void 0, void 0, function* () {
95
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
95
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
96
96
  const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
97
97
  const _authRequest = yield this._options.authProvider.getAuthRequest();
98
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
99
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
100
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/collab-agents/${core.url.encodePathParam(assetId)}/messages`),
98
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
99
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
100
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
101
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
102
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/collab-agents/${core.url.encodePathParam(assetId)}/messages`),
101
103
  method: "POST",
102
104
  headers: _headers,
103
105
  contentType: "application/json",
104
106
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
105
107
  requestType: "json",
106
108
  body: _body,
107
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
108
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
109
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
110
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
109
111
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
110
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
112
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
111
113
  logging: this._options.logging,
112
114
  });
113
115
  if (_response.ok) {
@@ -88,22 +88,24 @@ class ComputerClient {
88
88
  }
89
89
  __deployComputer(request, requestOptions) {
90
90
  return __awaiter(this, void 0, void 0, function* () {
91
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
91
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
92
92
  const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
93
93
  const _authRequest = yield this._options.authProvider.getAuthRequest();
94
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
95
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
96
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/deploy`),
94
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
95
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
96
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
97
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
98
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/deploy`),
97
99
  method: "POST",
98
100
  headers: _headers,
99
101
  contentType: "application/json",
100
102
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
101
103
  requestType: "json",
102
104
  body: _body,
103
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
104
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
105
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
106
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
105
107
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
106
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
108
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
107
109
  logging: this._options.logging,
108
110
  });
109
111
  if (_response.ok) {
@@ -176,19 +178,21 @@ class ComputerClient {
176
178
  }
177
179
  __getInitialization(request, requestOptions) {
178
180
  return __awaiter(this, void 0, void 0, function* () {
179
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
181
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
180
182
  const { asset_id: assetId } = request;
181
183
  const _authRequest = yield this._options.authProvider.getAuthRequest();
182
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
183
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
184
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/initialization`),
184
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
185
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
186
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
187
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
188
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/initialization`),
185
189
  method: "GET",
186
190
  headers: _headers,
187
191
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
188
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
189
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
192
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
193
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
190
194
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
191
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
195
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
192
196
  logging: this._options.logging,
193
197
  });
194
198
  if (_response.ok) {
@@ -260,19 +264,21 @@ class ComputerClient {
260
264
  }
261
265
  __getSshAccess(request, requestOptions) {
262
266
  return __awaiter(this, void 0, void 0, function* () {
263
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
267
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
264
268
  const { asset_id: assetId } = request;
265
269
  const _authRequest = yield this._options.authProvider.getAuthRequest();
266
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
267
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
268
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/ssh-access`),
270
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
271
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
272
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
273
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
274
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/ssh-access`),
269
275
  method: "GET",
270
276
  headers: _headers,
271
277
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
272
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
273
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
278
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
279
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
274
280
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
275
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
281
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
276
282
  logging: this._options.logging,
277
283
  });
278
284
  if (_response.ok) {
@@ -341,22 +347,24 @@ class ComputerClient {
341
347
  }
342
348
  __createSshAccess(request, requestOptions) {
343
349
  return __awaiter(this, void 0, void 0, function* () {
344
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
350
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
345
351
  const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
346
352
  const _authRequest = yield this._options.authProvider.getAuthRequest();
347
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
348
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
349
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/ssh-access`),
353
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
354
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
355
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
356
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
357
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/ssh-access`),
350
358
  method: "POST",
351
359
  headers: _headers,
352
360
  contentType: "application/json",
353
361
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
354
362
  requestType: "json",
355
363
  body: _body,
356
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
357
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
364
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
365
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
358
366
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
359
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
367
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
360
368
  logging: this._options.logging,
361
369
  });
362
370
  if (_response.ok) {
@@ -430,22 +438,24 @@ class ComputerClient {
430
438
  }
431
439
  __revokeSshAccess(request, requestOptions) {
432
440
  return __awaiter(this, void 0, void 0, function* () {
433
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
441
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
434
442
  const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
435
443
  const _authRequest = yield this._options.authProvider.getAuthRequest();
436
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
437
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
438
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/ssh-access`),
444
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
445
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
446
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
447
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
448
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/ssh-access`),
439
449
  method: "DELETE",
440
450
  headers: _headers,
441
451
  contentType: "application/json",
442
452
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
443
453
  requestType: "json",
444
454
  body: _body,
445
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
446
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
455
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
456
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
447
457
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
448
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
458
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
449
459
  logging: this._options.logging,
450
460
  });
451
461
  if (_response.ok) {
@@ -518,19 +528,21 @@ class ComputerClient {
518
528
  }
519
529
  __startComputer(request, requestOptions) {
520
530
  return __awaiter(this, void 0, void 0, function* () {
521
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
531
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
522
532
  const { asset_id: assetId } = request;
523
533
  const _authRequest = yield this._options.authProvider.getAuthRequest();
524
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
525
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
526
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/start`),
534
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
535
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
536
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
537
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
538
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/start`),
527
539
  method: "POST",
528
540
  headers: _headers,
529
541
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
530
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
531
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
542
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
543
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
532
544
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
533
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
545
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
534
546
  logging: this._options.logging,
535
547
  });
536
548
  if (_response.ok) {
@@ -603,19 +615,21 @@ class ComputerClient {
603
615
  }
604
616
  __stopComputer(request, requestOptions) {
605
617
  return __awaiter(this, void 0, void 0, function* () {
606
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
618
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
607
619
  const { asset_id: assetId } = request;
608
620
  const _authRequest = yield this._options.authProvider.getAuthRequest();
609
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
610
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
611
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/stop`),
621
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
622
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
623
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
624
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
625
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/stop`),
612
626
  method: "POST",
613
627
  headers: _headers,
614
628
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
615
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
616
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
629
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
630
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
617
631
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
618
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
632
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
619
633
  logging: this._options.logging,
620
634
  });
621
635
  if (_response.ok) {
@@ -94,19 +94,21 @@ class DatabasesClient {
94
94
  }
95
95
  __getStatus(request, requestOptions) {
96
96
  return __awaiter(this, void 0, void 0, function* () {
97
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
97
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
98
98
  const { asset_id: assetId } = request;
99
99
  const _authRequest = yield this._options.authProvider.getAuthRequest();
100
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
101
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
102
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/compute-status`),
100
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
101
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
102
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
103
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
104
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/compute-status`),
103
105
  method: "GET",
104
106
  headers: _headers,
105
107
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
106
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
107
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
108
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
109
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
108
110
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
109
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
111
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
110
112
  logging: this._options.logging,
111
113
  });
112
114
  if (_response.ok) {
@@ -180,19 +182,21 @@ class DatabasesClient {
180
182
  }
181
183
  __listTables(request, requestOptions) {
182
184
  return __awaiter(this, void 0, void 0, function* () {
183
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
185
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
184
186
  const { asset_id: assetId } = request;
185
187
  const _authRequest = yield this._options.authProvider.getAuthRequest();
186
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
187
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
188
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/data`),
188
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
189
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
190
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
191
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
192
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/data`),
189
193
  method: "GET",
190
194
  headers: _headers,
191
195
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
192
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
193
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
196
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
197
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
194
198
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
195
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
199
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
196
200
  logging: this._options.logging,
197
201
  });
198
202
  if (_response.ok) {
@@ -281,7 +285,7 @@ class DatabasesClient {
281
285
  }
282
286
  __select(request, requestOptions) {
283
287
  return __awaiter(this, void 0, void 0, function* () {
284
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
288
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
285
289
  const { asset_id: assetId, table_name: tableName, select, order, limit, offset } = request;
286
290
  const _queryParams = {};
287
291
  if (select !== undefined) {
@@ -297,16 +301,18 @@ class DatabasesClient {
297
301
  _queryParams.offset = offset.toString();
298
302
  }
299
303
  const _authRequest = yield this._options.authProvider.getAuthRequest();
300
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
301
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
302
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/data/${core.url.encodePathParam(tableName)}`),
304
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
305
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
306
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
307
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
308
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/data/${core.url.encodePathParam(tableName)}`),
303
309
  method: "GET",
304
310
  headers: _headers,
305
311
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
306
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
307
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
312
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
313
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
308
314
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
309
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
315
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
310
316
  logging: this._options.logging,
311
317
  });
312
318
  if (_response.ok) {
@@ -389,22 +395,24 @@ class DatabasesClient {
389
395
  }
390
396
  __insert(request, requestOptions) {
391
397
  return __awaiter(this, void 0, void 0, function* () {
392
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
398
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
393
399
  const { asset_id: assetId, table_name: tableName } = request, _body = __rest(request, ["asset_id", "table_name"]);
394
400
  const _authRequest = yield this._options.authProvider.getAuthRequest();
395
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
396
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
397
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/data/${core.url.encodePathParam(tableName)}`),
401
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
402
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
403
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
404
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
405
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/data/${core.url.encodePathParam(tableName)}`),
398
406
  method: "POST",
399
407
  headers: _headers,
400
408
  contentType: "application/json",
401
409
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
402
410
  requestType: "json",
403
411
  body: _body,
404
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
405
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
412
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
413
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
406
414
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
407
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
415
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
408
416
  logging: this._options.logging,
409
417
  });
410
418
  if (_response.ok) {
@@ -500,26 +508,28 @@ class DatabasesClient {
500
508
  }
501
509
  __delete(request, requestOptions) {
502
510
  return __awaiter(this, void 0, void 0, function* () {
503
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
511
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
504
512
  const { asset_id: assetId, table_name: tableName, force, body: _body } = request;
505
513
  const _queryParams = {};
506
514
  if (force != null) {
507
515
  _queryParams.force = force.toString();
508
516
  }
509
517
  const _authRequest = yield this._options.authProvider.getAuthRequest();
510
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
511
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
512
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/data/${core.url.encodePathParam(tableName)}`),
518
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
519
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
520
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
521
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
522
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/data/${core.url.encodePathParam(tableName)}`),
513
523
  method: "DELETE",
514
524
  headers: _headers,
515
525
  contentType: "application/json",
516
526
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
517
527
  requestType: "json",
518
528
  body: _body != null ? _body : undefined,
519
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
520
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
529
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
530
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
521
531
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
522
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
532
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
523
533
  logging: this._options.logging,
524
534
  });
525
535
  if (_response.ok) {
@@ -616,26 +626,28 @@ class DatabasesClient {
616
626
  }
617
627
  __update(request, requestOptions) {
618
628
  return __awaiter(this, void 0, void 0, function* () {
619
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
629
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
620
630
  const { asset_id: assetId, table_name: tableName, force } = request, _body = __rest(request, ["asset_id", "table_name", "force"]);
621
631
  const _queryParams = {};
622
632
  if (force != null) {
623
633
  _queryParams.force = force.toString();
624
634
  }
625
635
  const _authRequest = yield this._options.authProvider.getAuthRequest();
626
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
627
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
628
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/data/${core.url.encodePathParam(tableName)}`),
636
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
637
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
638
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
639
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
640
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/data/${core.url.encodePathParam(tableName)}`),
629
641
  method: "PATCH",
630
642
  headers: _headers,
631
643
  contentType: "application/json",
632
644
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
633
645
  requestType: "json",
634
646
  body: _body,
635
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
636
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
647
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
648
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
637
649
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
638
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
650
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
639
651
  logging: this._options.logging,
640
652
  });
641
653
  if (_response.ok) {
@@ -714,19 +726,21 @@ class DatabasesClient {
714
726
  }
715
727
  __getTableSchema(request, requestOptions) {
716
728
  return __awaiter(this, void 0, void 0, function* () {
717
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
729
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
718
730
  const { asset_id: assetId, table_name: tableName } = request;
719
731
  const _authRequest = yield this._options.authProvider.getAuthRequest();
720
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
721
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
722
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/schema/${core.url.encodePathParam(tableName)}`),
732
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
733
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
734
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
735
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
736
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/schema/${core.url.encodePathParam(tableName)}`),
723
737
  method: "GET",
724
738
  headers: _headers,
725
739
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
726
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
727
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
740
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
741
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
728
742
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
729
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
743
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
730
744
  logging: this._options.logging,
731
745
  });
732
746
  if (_response.ok) {
@@ -804,22 +818,24 @@ class DatabasesClient {
804
818
  }
805
819
  __executeSql(request, requestOptions) {
806
820
  return __awaiter(this, void 0, void 0, function* () {
807
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
821
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
808
822
  const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
809
823
  const _authRequest = yield this._options.authProvider.getAuthRequest();
810
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
811
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
812
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/sql`),
824
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
825
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
826
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
827
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
828
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/databases/${core.url.encodePathParam(assetId)}/sql`),
813
829
  method: "POST",
814
830
  headers: _headers,
815
831
  contentType: "application/json",
816
832
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
817
833
  requestType: "json",
818
834
  body: _body,
819
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
820
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
835
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
836
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
821
837
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
822
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
838
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
823
839
  logging: this._options.logging,
824
840
  });
825
841
  if (_response.ok) {