@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.
- package/README.md +3 -3
- package/dist/cjs/BaseClient.d.ts +4 -0
- package/dist/cjs/BaseClient.js +3 -2
- package/dist/cjs/api/resources/agents/resources/general/client/Client.js +18 -14
- package/dist/cjs/api/resources/aop/client/Client.js +64 -49
- package/dist/cjs/api/resources/assets/client/Client.js +144 -112
- package/dist/cjs/api/resources/collabAgents/client/Client.js +9 -7
- package/dist/cjs/api/resources/computer/client/Client.js +63 -49
- package/dist/cjs/api/resources/databases/client/Client.js +72 -56
- package/dist/cjs/api/resources/meetings/client/Client.js +27 -21
- package/dist/cjs/api/resources/query/client/Client.js +9 -7
- package/dist/cjs/api/resources/semanticModel/client/Client.js +27 -21
- package/dist/cjs/api/resources/sessions/client/Client.js +45 -35
- package/dist/cjs/api/resources/threads/client/Client.js +45 -35
- package/dist/cjs/api/resources/tools/client/Client.js +79 -63
- package/dist/cjs/api/resources/tools/resources/calendar/client/Client.js +9 -7
- package/dist/cjs/api/resources/tools/resources/email/client/Client.js +18 -14
- package/dist/cjs/api/resources/tools/resources/sheets/client/Client.js +153 -119
- package/dist/cjs/api/resources/tools/resources/structuredDataExtractor/client/Client.js +9 -7
- package/dist/cjs/api/resources/tools/resources/tasks/client/Client.js +9 -7
- package/dist/cjs/api/resources/users/client/Client.js +45 -35
- package/dist/cjs/api/resources/workspaces/client/Client.js +63 -49
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +4 -0
- package/dist/esm/BaseClient.mjs +3 -2
- package/dist/esm/api/resources/agents/resources/general/client/Client.mjs +19 -15
- package/dist/esm/api/resources/aop/client/Client.mjs +64 -49
- package/dist/esm/api/resources/assets/client/Client.mjs +145 -113
- package/dist/esm/api/resources/collabAgents/client/Client.mjs +10 -8
- package/dist/esm/api/resources/computer/client/Client.mjs +64 -50
- package/dist/esm/api/resources/databases/client/Client.mjs +73 -57
- package/dist/esm/api/resources/meetings/client/Client.mjs +28 -22
- package/dist/esm/api/resources/query/client/Client.mjs +10 -8
- package/dist/esm/api/resources/semanticModel/client/Client.mjs +28 -22
- package/dist/esm/api/resources/sessions/client/Client.mjs +46 -36
- package/dist/esm/api/resources/threads/client/Client.mjs +46 -36
- package/dist/esm/api/resources/tools/client/Client.mjs +79 -63
- package/dist/esm/api/resources/tools/resources/calendar/client/Client.mjs +10 -8
- package/dist/esm/api/resources/tools/resources/email/client/Client.mjs +19 -15
- package/dist/esm/api/resources/tools/resources/sheets/client/Client.mjs +154 -120
- package/dist/esm/api/resources/tools/resources/structuredDataExtractor/client/Client.mjs +10 -8
- package/dist/esm/api/resources/tools/resources/tasks/client/Client.mjs +10 -8
- package/dist/esm/api/resources/users/client/Client.mjs +46 -36
- package/dist/esm/api/resources/workspaces/client/Client.mjs +64 -50
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ Instantiate and use the client with the following:
|
|
|
40
40
|
```typescript
|
|
41
41
|
import { AthenaIntelligenceClient } from "@athenaintel/sdk";
|
|
42
42
|
|
|
43
|
-
const client = new AthenaIntelligenceClient({ apiKey: "YOUR_API_KEY" });
|
|
43
|
+
const client = new AthenaIntelligenceClient({ apiKey: "YOUR_API_KEY", sessionCredential: "YOUR_SESSION_CREDENTIAL" });
|
|
44
44
|
await client.aop.create({
|
|
45
45
|
agentId: "research_agent",
|
|
46
46
|
description: "Generates market research reports",
|
|
@@ -95,7 +95,7 @@ import { createReadStream } from "fs";
|
|
|
95
95
|
import { AthenaIntelligenceClient } from "@athenaintel/sdk";
|
|
96
96
|
import * as fs from "fs";
|
|
97
97
|
|
|
98
|
-
const client = new AthenaIntelligenceClient({ apiKey: "YOUR_API_KEY" });
|
|
98
|
+
const client = new AthenaIntelligenceClient({ apiKey: "YOUR_API_KEY", sessionCredential: "YOUR_SESSION_CREDENTIAL" });
|
|
99
99
|
await client.tools.saveAsset({
|
|
100
100
|
file: fs.createReadStream("/path/to/your/file")
|
|
101
101
|
});
|
|
@@ -526,7 +526,7 @@ List endpoints are paginated. The SDK provides an iterator so that you can simpl
|
|
|
526
526
|
```typescript
|
|
527
527
|
import { AthenaIntelligenceClient } from "@athenaintel/sdk";
|
|
528
528
|
|
|
529
|
-
const client = new AthenaIntelligenceClient({ apiKey: "YOUR_API_KEY" });
|
|
529
|
+
const client = new AthenaIntelligenceClient({ apiKey: "YOUR_API_KEY", sessionCredential: "YOUR_SESSION_CREDENTIAL" });
|
|
530
530
|
const pageableResponse = await client.meetings.list({
|
|
531
531
|
limit: 50,
|
|
532
532
|
offset: 0
|
package/dist/cjs/BaseClient.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export interface BaseClientOptions {
|
|
|
5
5
|
/** Specify a custom URL to connect the client to. */
|
|
6
6
|
baseUrl?: core.Supplier<string>;
|
|
7
7
|
apiKey?: core.Supplier<string>;
|
|
8
|
+
/** Override the X-Athena-Session-Credential header */
|
|
9
|
+
sessionCredential?: core.Supplier<string | undefined>;
|
|
8
10
|
/** Additional headers to include in requests. */
|
|
9
11
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
10
12
|
/** The default maximum time to wait for a response in seconds. */
|
|
@@ -24,6 +26,8 @@ export interface BaseRequestOptions {
|
|
|
24
26
|
maxRetries?: number;
|
|
25
27
|
/** A hook to abort the request. */
|
|
26
28
|
abortSignal?: AbortSignal;
|
|
29
|
+
/** Override the X-Athena-Session-Credential header */
|
|
30
|
+
sessionCredential?: string | undefined;
|
|
27
31
|
/** Additional query string parameters to include in the request. */
|
|
28
32
|
queryParams?: Record<string, unknown>;
|
|
29
33
|
/** Additional headers to include in the request. */
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,10 +43,11 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@athenaintel/sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "4.3.
|
|
47
|
-
"User-Agent": "@athenaintel/sdk/4.3.
|
|
46
|
+
"X-Fern-SDK-Version": "4.3.2203",
|
|
47
|
+
"User-Agent": "@athenaintel/sdk/4.3.2203",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
|
+
"X-Athena-Session-Credential": options === null || options === void 0 ? void 0 : options.sessionCredential,
|
|
50
51
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
51
52
|
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
|
|
52
53
|
}
|
|
@@ -81,21 +81,23 @@ class GeneralClient {
|
|
|
81
81
|
}
|
|
82
82
|
__invoke(request, requestOptions) {
|
|
83
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
84
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
85
85
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
86
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
87
|
+
"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,
|
|
88
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
89
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
90
|
+
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"),
|
|
89
91
|
method: "POST",
|
|
90
92
|
headers: _headers,
|
|
91
93
|
contentType: "application/json",
|
|
92
94
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
93
95
|
requestType: "json",
|
|
94
96
|
body: request,
|
|
95
|
-
timeoutMs: ((
|
|
96
|
-
maxRetries: (
|
|
97
|
+
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,
|
|
98
|
+
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,
|
|
97
99
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
98
|
-
fetchFn: (
|
|
100
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
99
101
|
logging: this._options.logging,
|
|
100
102
|
});
|
|
101
103
|
if (_response.ok) {
|
|
@@ -165,21 +167,23 @@ class GeneralClient {
|
|
|
165
167
|
}
|
|
166
168
|
__invokeAsync(request, requestOptions) {
|
|
167
169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
170
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
169
171
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
170
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
173
|
+
"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,
|
|
174
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
175
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
176
|
+
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"),
|
|
173
177
|
method: "POST",
|
|
174
178
|
headers: _headers,
|
|
175
179
|
contentType: "application/json",
|
|
176
180
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
177
181
|
requestType: "json",
|
|
178
182
|
body: request,
|
|
179
|
-
timeoutMs: ((
|
|
180
|
-
maxRetries: (
|
|
183
|
+
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,
|
|
184
|
+
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,
|
|
181
185
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
182
|
-
fetchFn: (
|
|
186
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
183
187
|
logging: this._options.logging,
|
|
184
188
|
});
|
|
185
189
|
if (_response.ok) {
|
|
@@ -88,7 +88,7 @@ class AopClient {
|
|
|
88
88
|
}
|
|
89
89
|
__getBatchStatus(request, requestOptions) {
|
|
90
90
|
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
91
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
92
92
|
const { batch_id: batchId, status, cursor, limit } = request;
|
|
93
93
|
const _queryParams = {};
|
|
94
94
|
if (status != null) {
|
|
@@ -101,16 +101,18 @@ class AopClient {
|
|
|
101
101
|
_queryParams.limit = limit.toString();
|
|
102
102
|
}
|
|
103
103
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
104
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
105
|
+
"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,
|
|
106
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
107
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
108
|
+
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)}`),
|
|
107
109
|
method: "GET",
|
|
108
110
|
headers: _headers,
|
|
109
111
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
110
|
-
timeoutMs: ((
|
|
111
|
-
maxRetries: (
|
|
112
|
+
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,
|
|
113
|
+
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,
|
|
112
114
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
113
|
-
fetchFn: (
|
|
115
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
114
116
|
logging: this._options.logging,
|
|
115
117
|
});
|
|
116
118
|
if (_response.ok) {
|
|
@@ -188,21 +190,23 @@ class AopClient {
|
|
|
188
190
|
}
|
|
189
191
|
__create() {
|
|
190
192
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
191
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
193
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
192
194
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
193
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
194
|
-
|
|
195
|
-
|
|
195
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
196
|
+
"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,
|
|
197
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
198
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
199
|
+
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"),
|
|
196
200
|
method: "POST",
|
|
197
201
|
headers: _headers,
|
|
198
202
|
contentType: "application/json",
|
|
199
203
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
200
204
|
requestType: "json",
|
|
201
205
|
body: request,
|
|
202
|
-
timeoutMs: ((
|
|
203
|
-
maxRetries: (
|
|
206
|
+
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,
|
|
207
|
+
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,
|
|
204
208
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
205
|
-
fetchFn: (
|
|
209
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
206
210
|
logging: this._options.logging,
|
|
207
211
|
});
|
|
208
212
|
if (_response.ok) {
|
|
@@ -283,21 +287,23 @@ class AopClient {
|
|
|
283
287
|
}
|
|
284
288
|
__execute(request, requestOptions) {
|
|
285
289
|
return __awaiter(this, void 0, void 0, function* () {
|
|
286
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
290
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
287
291
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
288
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
289
|
-
|
|
290
|
-
|
|
292
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
293
|
+
"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,
|
|
294
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
295
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
296
|
+
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"),
|
|
291
297
|
method: "POST",
|
|
292
298
|
headers: _headers,
|
|
293
299
|
contentType: "application/json",
|
|
294
300
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
295
301
|
requestType: "json",
|
|
296
302
|
body: request,
|
|
297
|
-
timeoutMs: ((
|
|
298
|
-
maxRetries: (
|
|
303
|
+
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,
|
|
304
|
+
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,
|
|
299
305
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
300
|
-
fetchFn: (
|
|
306
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
301
307
|
logging: this._options.logging,
|
|
302
308
|
});
|
|
303
309
|
if (_response.ok) {
|
|
@@ -381,22 +387,25 @@ class AopClient {
|
|
|
381
387
|
}
|
|
382
388
|
__executeAsync(request, requestOptions) {
|
|
383
389
|
return __awaiter(this, void 0, void 0, function* () {
|
|
384
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
390
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
385
391
|
const { "Idempotency-Key": idempotencyKey, body: _body } = request;
|
|
386
392
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
387
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
388
|
-
|
|
389
|
-
|
|
393
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
394
|
+
"Idempotency-Key": idempotencyKey !== undefined ? idempotencyKey : undefined,
|
|
395
|
+
"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,
|
|
396
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
397
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
398
|
+
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"),
|
|
390
399
|
method: "POST",
|
|
391
400
|
headers: _headers,
|
|
392
401
|
contentType: "application/json",
|
|
393
402
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
394
403
|
requestType: "json",
|
|
395
404
|
body: _body,
|
|
396
|
-
timeoutMs: ((
|
|
397
|
-
maxRetries: (
|
|
405
|
+
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,
|
|
406
|
+
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,
|
|
398
407
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
399
|
-
fetchFn: (
|
|
408
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
400
409
|
logging: this._options.logging,
|
|
401
410
|
});
|
|
402
411
|
if (_response.ok) {
|
|
@@ -486,21 +495,23 @@ class AopClient {
|
|
|
486
495
|
}
|
|
487
496
|
__executeBatch(request, requestOptions) {
|
|
488
497
|
return __awaiter(this, void 0, void 0, function* () {
|
|
489
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
498
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
490
499
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
491
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
492
|
-
|
|
493
|
-
|
|
500
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
501
|
+
"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,
|
|
502
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
503
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
504
|
+
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"),
|
|
494
505
|
method: "POST",
|
|
495
506
|
headers: _headers,
|
|
496
507
|
contentType: "application/json",
|
|
497
508
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
498
509
|
requestType: "json",
|
|
499
510
|
body: request,
|
|
500
|
-
timeoutMs: ((
|
|
501
|
-
maxRetries: (
|
|
511
|
+
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,
|
|
512
|
+
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,
|
|
502
513
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
503
|
-
fetchFn: (
|
|
514
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
504
515
|
logging: this._options.logging,
|
|
505
516
|
});
|
|
506
517
|
if (_response.ok) {
|
|
@@ -571,19 +582,21 @@ class AopClient {
|
|
|
571
582
|
}
|
|
572
583
|
__getConfig(request, requestOptions) {
|
|
573
584
|
return __awaiter(this, void 0, void 0, function* () {
|
|
574
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
585
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
575
586
|
const { asset_id: assetId } = request;
|
|
576
587
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
577
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
578
|
-
|
|
579
|
-
|
|
588
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
589
|
+
"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,
|
|
590
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
591
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
592
|
+
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`),
|
|
580
593
|
method: "GET",
|
|
581
594
|
headers: _headers,
|
|
582
595
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
583
|
-
timeoutMs: ((
|
|
584
|
-
maxRetries: (
|
|
596
|
+
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,
|
|
597
|
+
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,
|
|
585
598
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
586
|
-
fetchFn: (
|
|
599
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
587
600
|
logging: this._options.logging,
|
|
588
601
|
});
|
|
589
602
|
if (_response.ok) {
|
|
@@ -657,22 +670,24 @@ class AopClient {
|
|
|
657
670
|
}
|
|
658
671
|
__updateConfig(request, requestOptions) {
|
|
659
672
|
return __awaiter(this, void 0, void 0, function* () {
|
|
660
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
673
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
661
674
|
const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
|
|
662
675
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
663
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
664
|
-
|
|
665
|
-
|
|
676
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
677
|
+
"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,
|
|
678
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
679
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
680
|
+
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`),
|
|
666
681
|
method: "PUT",
|
|
667
682
|
headers: _headers,
|
|
668
683
|
contentType: "application/json",
|
|
669
684
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
670
685
|
requestType: "json",
|
|
671
686
|
body: _body,
|
|
672
|
-
timeoutMs: ((
|
|
673
|
-
maxRetries: (
|
|
687
|
+
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,
|
|
688
|
+
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,
|
|
674
689
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
675
|
-
fetchFn: (
|
|
690
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
676
691
|
logging: this._options.logging,
|
|
677
692
|
});
|
|
678
693
|
if (_response.ok) {
|