@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
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  return t;
21
21
  };
22
22
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
23
- import { mergeHeaders } from "../../../../core/headers.mjs";
23
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
24
24
  import * as core from "../../../../core/index.mjs";
25
25
  import * as environments from "../../../../environments.mjs";
26
26
  import * as errors from "../../../../errors/index.mjs";
@@ -56,22 +56,24 @@ export class CollabAgentsClient {
56
56
  }
57
57
  __sendMessage(request, requestOptions) {
58
58
  return __awaiter(this, void 0, void 0, function* () {
59
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
59
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
60
60
  const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
61
61
  const _authRequest = yield this._options.authProvider.getAuthRequest();
62
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
63
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
64
- 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`),
62
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
63
+ "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,
64
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
65
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
66
+ 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`),
65
67
  method: "POST",
66
68
  headers: _headers,
67
69
  contentType: "application/json",
68
70
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
69
71
  requestType: "json",
70
72
  body: _body,
71
- 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,
72
- 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,
73
+ 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,
74
+ 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,
73
75
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
74
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
76
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
75
77
  logging: this._options.logging,
76
78
  });
77
79
  if (_response.ok) {
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  return t;
21
21
  };
22
22
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
23
- import { mergeHeaders } from "../../../../core/headers.mjs";
23
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
24
24
  import * as core from "../../../../core/index.mjs";
25
25
  import * as environments from "../../../../environments.mjs";
26
26
  import * as errors from "../../../../errors/index.mjs";
@@ -52,22 +52,24 @@ export class ComputerClient {
52
52
  }
53
53
  __deployComputer(request, requestOptions) {
54
54
  return __awaiter(this, void 0, void 0, function* () {
55
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
55
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
56
56
  const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
57
57
  const _authRequest = yield this._options.authProvider.getAuthRequest();
58
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
59
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
60
- 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`),
58
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
59
+ "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,
60
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
61
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
62
+ 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`),
61
63
  method: "POST",
62
64
  headers: _headers,
63
65
  contentType: "application/json",
64
66
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
65
67
  requestType: "json",
66
68
  body: _body,
67
- 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,
68
- 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,
69
+ 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,
70
+ 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,
69
71
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
70
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
72
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
71
73
  logging: this._options.logging,
72
74
  });
73
75
  if (_response.ok) {
@@ -140,19 +142,21 @@ export class ComputerClient {
140
142
  }
141
143
  __getInitialization(request, requestOptions) {
142
144
  return __awaiter(this, void 0, void 0, function* () {
143
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
145
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
144
146
  const { asset_id: assetId } = request;
145
147
  const _authRequest = yield this._options.authProvider.getAuthRequest();
146
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
147
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
148
- 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`),
148
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
149
+ "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,
150
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
151
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
152
+ 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`),
149
153
  method: "GET",
150
154
  headers: _headers,
151
155
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
152
- 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,
153
- 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,
156
+ 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,
157
+ 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,
154
158
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
155
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
159
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
156
160
  logging: this._options.logging,
157
161
  });
158
162
  if (_response.ok) {
@@ -224,19 +228,21 @@ export class ComputerClient {
224
228
  }
225
229
  __getSshAccess(request, requestOptions) {
226
230
  return __awaiter(this, void 0, void 0, function* () {
227
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
231
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
228
232
  const { asset_id: assetId } = request;
229
233
  const _authRequest = yield this._options.authProvider.getAuthRequest();
230
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
231
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
232
- 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`),
234
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
235
+ "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,
236
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
237
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
238
+ 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`),
233
239
  method: "GET",
234
240
  headers: _headers,
235
241
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
236
- 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,
237
- 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,
242
+ 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,
243
+ 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,
238
244
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
239
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
245
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
240
246
  logging: this._options.logging,
241
247
  });
242
248
  if (_response.ok) {
@@ -305,22 +311,24 @@ export class ComputerClient {
305
311
  }
306
312
  __createSshAccess(request, requestOptions) {
307
313
  return __awaiter(this, void 0, void 0, function* () {
308
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
314
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
309
315
  const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
310
316
  const _authRequest = yield this._options.authProvider.getAuthRequest();
311
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
312
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
313
- 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`),
317
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
318
+ "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,
319
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
320
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
321
+ 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`),
314
322
  method: "POST",
315
323
  headers: _headers,
316
324
  contentType: "application/json",
317
325
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
318
326
  requestType: "json",
319
327
  body: _body,
320
- 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,
321
- 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,
328
+ 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,
329
+ 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,
322
330
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
323
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
331
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
324
332
  logging: this._options.logging,
325
333
  });
326
334
  if (_response.ok) {
@@ -394,22 +402,24 @@ export class ComputerClient {
394
402
  }
395
403
  __revokeSshAccess(request, requestOptions) {
396
404
  return __awaiter(this, void 0, void 0, function* () {
397
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
405
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
398
406
  const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
399
407
  const _authRequest = yield this._options.authProvider.getAuthRequest();
400
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
401
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
402
- 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`),
408
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
409
+ "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,
410
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
411
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
412
+ 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`),
403
413
  method: "DELETE",
404
414
  headers: _headers,
405
415
  contentType: "application/json",
406
416
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
407
417
  requestType: "json",
408
418
  body: _body,
409
- 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,
410
- 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,
419
+ 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,
420
+ 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,
411
421
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
412
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
422
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
413
423
  logging: this._options.logging,
414
424
  });
415
425
  if (_response.ok) {
@@ -482,19 +492,21 @@ export class ComputerClient {
482
492
  }
483
493
  __startComputer(request, requestOptions) {
484
494
  return __awaiter(this, void 0, void 0, function* () {
485
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
495
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
486
496
  const { asset_id: assetId } = request;
487
497
  const _authRequest = yield this._options.authProvider.getAuthRequest();
488
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
489
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
490
- 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`),
498
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
499
+ "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,
500
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
501
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
502
+ 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`),
491
503
  method: "POST",
492
504
  headers: _headers,
493
505
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
494
- 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,
495
- 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,
506
+ 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,
507
+ 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,
496
508
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
497
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
509
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
498
510
  logging: this._options.logging,
499
511
  });
500
512
  if (_response.ok) {
@@ -567,19 +579,21 @@ export class ComputerClient {
567
579
  }
568
580
  __stopComputer(request, requestOptions) {
569
581
  return __awaiter(this, void 0, void 0, function* () {
570
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
582
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
571
583
  const { asset_id: assetId } = request;
572
584
  const _authRequest = yield this._options.authProvider.getAuthRequest();
573
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
574
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
575
- 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`),
585
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
586
+ "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,
587
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
588
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
589
+ 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`),
576
590
  method: "POST",
577
591
  headers: _headers,
578
592
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
579
- 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,
580
- 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,
593
+ 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,
594
+ 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,
581
595
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
582
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
596
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
583
597
  logging: this._options.logging,
584
598
  });
585
599
  if (_response.ok) {
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  return t;
21
21
  };
22
22
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
23
- import { mergeHeaders } from "../../../../core/headers.mjs";
23
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
24
24
  import * as core from "../../../../core/index.mjs";
25
25
  import * as environments from "../../../../environments.mjs";
26
26
  import * as errors from "../../../../errors/index.mjs";
@@ -58,19 +58,21 @@ export class DatabasesClient {
58
58
  }
59
59
  __getStatus(request, requestOptions) {
60
60
  return __awaiter(this, void 0, void 0, function* () {
61
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
61
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
62
62
  const { asset_id: assetId } = request;
63
63
  const _authRequest = yield this._options.authProvider.getAuthRequest();
64
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
65
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
66
- 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`),
64
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
65
+ "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,
66
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
67
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
68
+ 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`),
67
69
  method: "GET",
68
70
  headers: _headers,
69
71
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
70
- 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,
71
- 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,
72
+ 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,
73
+ 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,
72
74
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
73
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
75
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
74
76
  logging: this._options.logging,
75
77
  });
76
78
  if (_response.ok) {
@@ -144,19 +146,21 @@ export class DatabasesClient {
144
146
  }
145
147
  __listTables(request, requestOptions) {
146
148
  return __awaiter(this, void 0, void 0, function* () {
147
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
149
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
148
150
  const { asset_id: assetId } = request;
149
151
  const _authRequest = yield this._options.authProvider.getAuthRequest();
150
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
151
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
152
- 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`),
152
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
153
+ "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,
154
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
155
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
156
+ 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`),
153
157
  method: "GET",
154
158
  headers: _headers,
155
159
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
156
- 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,
157
- 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,
160
+ 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,
161
+ 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,
158
162
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
159
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
163
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
160
164
  logging: this._options.logging,
161
165
  });
162
166
  if (_response.ok) {
@@ -245,7 +249,7 @@ export class DatabasesClient {
245
249
  }
246
250
  __select(request, requestOptions) {
247
251
  return __awaiter(this, void 0, void 0, function* () {
248
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
252
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
249
253
  const { asset_id: assetId, table_name: tableName, select, order, limit, offset } = request;
250
254
  const _queryParams = {};
251
255
  if (select !== undefined) {
@@ -261,16 +265,18 @@ export class DatabasesClient {
261
265
  _queryParams.offset = offset.toString();
262
266
  }
263
267
  const _authRequest = yield this._options.authProvider.getAuthRequest();
264
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
265
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
266
- 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)}`),
268
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
269
+ "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,
270
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
271
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
272
+ 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)}`),
267
273
  method: "GET",
268
274
  headers: _headers,
269
275
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
270
- 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,
271
- 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,
276
+ 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,
277
+ 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,
272
278
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
273
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
279
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
274
280
  logging: this._options.logging,
275
281
  });
276
282
  if (_response.ok) {
@@ -353,22 +359,24 @@ export class DatabasesClient {
353
359
  }
354
360
  __insert(request, requestOptions) {
355
361
  return __awaiter(this, void 0, void 0, function* () {
356
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
362
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
357
363
  const { asset_id: assetId, table_name: tableName } = request, _body = __rest(request, ["asset_id", "table_name"]);
358
364
  const _authRequest = yield this._options.authProvider.getAuthRequest();
359
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
360
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
361
- 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)}`),
365
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
366
+ "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,
367
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
368
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
369
+ 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)}`),
362
370
  method: "POST",
363
371
  headers: _headers,
364
372
  contentType: "application/json",
365
373
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
366
374
  requestType: "json",
367
375
  body: _body,
368
- 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,
369
- 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,
376
+ 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,
377
+ 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,
370
378
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
371
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
379
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
372
380
  logging: this._options.logging,
373
381
  });
374
382
  if (_response.ok) {
@@ -464,26 +472,28 @@ export class DatabasesClient {
464
472
  }
465
473
  __delete(request, requestOptions) {
466
474
  return __awaiter(this, void 0, void 0, function* () {
467
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
475
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
468
476
  const { asset_id: assetId, table_name: tableName, force, body: _body } = request;
469
477
  const _queryParams = {};
470
478
  if (force != null) {
471
479
  _queryParams.force = force.toString();
472
480
  }
473
481
  const _authRequest = yield this._options.authProvider.getAuthRequest();
474
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
475
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
476
- 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)}`),
482
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
483
+ "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,
484
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
485
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
486
+ 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)}`),
477
487
  method: "DELETE",
478
488
  headers: _headers,
479
489
  contentType: "application/json",
480
490
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
481
491
  requestType: "json",
482
492
  body: _body != null ? _body : undefined,
483
- 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,
484
- 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,
493
+ 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,
494
+ 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,
485
495
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
486
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
496
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
487
497
  logging: this._options.logging,
488
498
  });
489
499
  if (_response.ok) {
@@ -580,26 +590,28 @@ export class DatabasesClient {
580
590
  }
581
591
  __update(request, requestOptions) {
582
592
  return __awaiter(this, void 0, void 0, function* () {
583
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
593
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
584
594
  const { asset_id: assetId, table_name: tableName, force } = request, _body = __rest(request, ["asset_id", "table_name", "force"]);
585
595
  const _queryParams = {};
586
596
  if (force != null) {
587
597
  _queryParams.force = force.toString();
588
598
  }
589
599
  const _authRequest = yield this._options.authProvider.getAuthRequest();
590
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
591
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
592
- 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)}`),
600
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
601
+ "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,
602
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
603
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
604
+ 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)}`),
593
605
  method: "PATCH",
594
606
  headers: _headers,
595
607
  contentType: "application/json",
596
608
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
597
609
  requestType: "json",
598
610
  body: _body,
599
- 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,
600
- 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,
611
+ 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,
612
+ 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,
601
613
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
602
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
614
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
603
615
  logging: this._options.logging,
604
616
  });
605
617
  if (_response.ok) {
@@ -678,19 +690,21 @@ export class DatabasesClient {
678
690
  }
679
691
  __getTableSchema(request, requestOptions) {
680
692
  return __awaiter(this, void 0, void 0, function* () {
681
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
693
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
682
694
  const { asset_id: assetId, table_name: tableName } = request;
683
695
  const _authRequest = yield this._options.authProvider.getAuthRequest();
684
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
685
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
686
- 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)}`),
696
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
697
+ "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,
698
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
699
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
700
+ 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)}`),
687
701
  method: "GET",
688
702
  headers: _headers,
689
703
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
690
- 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,
691
- 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,
704
+ 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,
705
+ 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,
692
706
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
693
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
707
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
694
708
  logging: this._options.logging,
695
709
  });
696
710
  if (_response.ok) {
@@ -768,22 +782,24 @@ export class DatabasesClient {
768
782
  }
769
783
  __executeSql(request, requestOptions) {
770
784
  return __awaiter(this, void 0, void 0, function* () {
771
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
785
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
772
786
  const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
773
787
  const _authRequest = yield this._options.authProvider.getAuthRequest();
774
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
775
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
776
- 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`),
788
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
789
+ "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,
790
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
791
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
792
+ 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`),
777
793
  method: "POST",
778
794
  headers: _headers,
779
795
  contentType: "application/json",
780
796
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
781
797
  requestType: "json",
782
798
  body: _body,
783
- 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,
784
- 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,
799
+ 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,
800
+ 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,
785
801
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
786
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
802
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
787
803
  logging: this._options.logging,
788
804
  });
789
805
  if (_response.ok) {