@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
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
12
- import { mergeHeaders } from "../../../../../../core/headers.mjs";
12
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
13
13
  import * as core from "../../../../../../core/index.mjs";
14
14
  import * as environments from "../../../../../../environments.mjs";
15
15
  import * as errors from "../../../../../../errors/index.mjs";
@@ -45,21 +45,23 @@ export class GeneralClient {
45
45
  }
46
46
  __invoke(request, requestOptions) {
47
47
  return __awaiter(this, void 0, void 0, function* () {
48
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
49
49
  const _authRequest = yield this._options.authProvider.getAuthRequest();
50
- 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);
51
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
52
- 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/agents/general/invoke"),
50
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
51
+ "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,
52
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
53
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
54
+ 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/agents/general/invoke"),
53
55
  method: "POST",
54
56
  headers: _headers,
55
57
  contentType: "application/json",
56
58
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
57
59
  requestType: "json",
58
60
  body: request,
59
- 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,
60
- 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,
61
+ 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,
62
+ 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,
61
63
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
62
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
64
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
63
65
  logging: this._options.logging,
64
66
  });
65
67
  if (_response.ok) {
@@ -129,21 +131,23 @@ export class GeneralClient {
129
131
  }
130
132
  __invokeAsync(request, requestOptions) {
131
133
  return __awaiter(this, void 0, void 0, function* () {
132
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
134
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
133
135
  const _authRequest = yield this._options.authProvider.getAuthRequest();
134
- 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);
135
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
136
- 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/agents/general/invoke-async"),
136
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
137
+ "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,
138
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
139
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
140
+ 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/agents/general/invoke-async"),
137
141
  method: "POST",
138
142
  headers: _headers,
139
143
  contentType: "application/json",
140
144
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
141
145
  requestType: "json",
142
146
  body: request,
143
- 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,
144
- 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,
147
+ 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,
148
+ 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,
145
149
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
146
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
150
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
147
151
  logging: this._options.logging,
148
152
  });
149
153
  if (_response.ok) {
@@ -52,7 +52,7 @@ export class AopClient {
52
52
  }
53
53
  __getBatchStatus(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 { batch_id: batchId, status, cursor, limit } = request;
57
57
  const _queryParams = {};
58
58
  if (status != null) {
@@ -65,16 +65,18 @@ export class AopClient {
65
65
  _queryParams.limit = limit.toString();
66
66
  }
67
67
  const _authRequest = yield this._options.authProvider.getAuthRequest();
68
- 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);
69
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
70
- 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/aop/batches/${core.url.encodePathParam(batchId)}`),
68
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
69
+ "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,
70
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
71
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
72
+ 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/aop/batches/${core.url.encodePathParam(batchId)}`),
71
73
  method: "GET",
72
74
  headers: _headers,
73
75
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
74
- 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,
75
- 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,
76
+ 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,
77
+ 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,
76
78
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
77
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
79
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
78
80
  logging: this._options.logging,
79
81
  });
80
82
  if (_response.ok) {
@@ -152,21 +154,23 @@ export class AopClient {
152
154
  }
153
155
  __create() {
154
156
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
155
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
157
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
156
158
  const _authRequest = yield this._options.authProvider.getAuthRequest();
157
- 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);
158
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
159
- 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/aop/create"),
159
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
160
+ "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,
161
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
162
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
163
+ 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/aop/create"),
160
164
  method: "POST",
161
165
  headers: _headers,
162
166
  contentType: "application/json",
163
167
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
164
168
  requestType: "json",
165
169
  body: request,
166
- 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,
167
- 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,
170
+ 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,
171
+ 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,
168
172
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
169
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
173
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
170
174
  logging: this._options.logging,
171
175
  });
172
176
  if (_response.ok) {
@@ -247,21 +251,23 @@ export class AopClient {
247
251
  }
248
252
  __execute(request, requestOptions) {
249
253
  return __awaiter(this, void 0, void 0, function* () {
250
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
254
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
251
255
  const _authRequest = yield this._options.authProvider.getAuthRequest();
252
- 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);
253
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
254
- 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/aop/execute"),
256
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
257
+ "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,
258
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
259
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
260
+ 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/aop/execute"),
255
261
  method: "POST",
256
262
  headers: _headers,
257
263
  contentType: "application/json",
258
264
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
259
265
  requestType: "json",
260
266
  body: request,
261
- 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,
262
- 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,
267
+ 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,
268
+ 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,
263
269
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
264
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
270
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
265
271
  logging: this._options.logging,
266
272
  });
267
273
  if (_response.ok) {
@@ -345,22 +351,25 @@ export class AopClient {
345
351
  }
346
352
  __executeAsync(request, requestOptions) {
347
353
  return __awaiter(this, void 0, void 0, function* () {
348
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
354
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
349
355
  const { "Idempotency-Key": idempotencyKey, body: _body } = request;
350
356
  const _authRequest = yield this._options.authProvider.getAuthRequest();
351
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "Idempotency-Key": idempotencyKey !== undefined ? idempotencyKey : undefined }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
352
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
353
- 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/aop/execute-async"),
357
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
358
+ "Idempotency-Key": idempotencyKey !== undefined ? idempotencyKey : undefined,
359
+ "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,
360
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
361
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
362
+ 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/aop/execute-async"),
354
363
  method: "POST",
355
364
  headers: _headers,
356
365
  contentType: "application/json",
357
366
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
358
367
  requestType: "json",
359
368
  body: _body,
360
- 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,
361
- 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,
369
+ 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,
370
+ 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,
362
371
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
363
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
372
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
364
373
  logging: this._options.logging,
365
374
  });
366
375
  if (_response.ok) {
@@ -450,21 +459,23 @@ export class AopClient {
450
459
  }
451
460
  __executeBatch(request, requestOptions) {
452
461
  return __awaiter(this, void 0, void 0, function* () {
453
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
462
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
454
463
  const _authRequest = yield this._options.authProvider.getAuthRequest();
455
- 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);
456
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
457
- 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/aop/execute-batch"),
464
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
465
+ "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,
466
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
467
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
468
+ 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/aop/execute-batch"),
458
469
  method: "POST",
459
470
  headers: _headers,
460
471
  contentType: "application/json",
461
472
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
462
473
  requestType: "json",
463
474
  body: request,
464
- 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,
465
- 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,
475
+ 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,
476
+ 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,
466
477
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
467
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
478
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
468
479
  logging: this._options.logging,
469
480
  });
470
481
  if (_response.ok) {
@@ -535,19 +546,21 @@ export class AopClient {
535
546
  }
536
547
  __getConfig(request, requestOptions) {
537
548
  return __awaiter(this, void 0, void 0, function* () {
538
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
549
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
539
550
  const { asset_id: assetId } = request;
540
551
  const _authRequest = yield this._options.authProvider.getAuthRequest();
541
- 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);
542
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
543
- 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/aop/${core.url.encodePathParam(assetId)}/config`),
552
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
553
+ "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,
554
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
555
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
556
+ 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/aop/${core.url.encodePathParam(assetId)}/config`),
544
557
  method: "GET",
545
558
  headers: _headers,
546
559
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
547
- 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,
548
- 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,
560
+ 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,
561
+ 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,
549
562
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
550
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
563
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
551
564
  logging: this._options.logging,
552
565
  });
553
566
  if (_response.ok) {
@@ -621,22 +634,24 @@ export class AopClient {
621
634
  }
622
635
  __updateConfig(request, requestOptions) {
623
636
  return __awaiter(this, void 0, void 0, function* () {
624
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
637
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
625
638
  const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
626
639
  const _authRequest = yield this._options.authProvider.getAuthRequest();
627
- 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);
628
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
629
- 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/aop/${core.url.encodePathParam(assetId)}/config`),
640
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
641
+ "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,
642
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
643
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
644
+ 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/aop/${core.url.encodePathParam(assetId)}/config`),
630
645
  method: "PUT",
631
646
  headers: _headers,
632
647
  contentType: "application/json",
633
648
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
634
649
  requestType: "json",
635
650
  body: _body,
636
- 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,
637
- 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,
651
+ 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,
652
+ 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,
638
653
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
639
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
654
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
640
655
  logging: this._options.logging,
641
656
  });
642
657
  if (_response.ok) {