@credal/sdk 0.1.10 → 0.1.11
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/dist/cjs/BaseClient.d.ts +4 -0
- package/dist/cjs/Client.js +3 -3
- package/dist/cjs/api/resources/copilots/client/Client.js +27 -9
- package/dist/cjs/api/resources/documentCatalog/client/Client.js +12 -4
- package/dist/cjs/api/resources/documentCollections/client/Client.js +21 -7
- package/dist/cjs/api/resources/search/client/Client.js +3 -1
- package/dist/cjs/api/resources/users/client/Client.js +3 -1
- package/dist/cjs/core/exports.d.ts +1 -0
- package/dist/cjs/core/exports.js +1 -0
- package/dist/cjs/core/fetcher/Fetcher.d.ts +4 -1
- package/dist/cjs/core/fetcher/Fetcher.js +202 -9
- package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
- package/dist/cjs/core/fetcher/getRequestBody.js +4 -0
- package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/cjs/core/fetcher/makeRequest.js +0 -2
- package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
- package/dist/cjs/core/fetcher/signals.d.ts +0 -6
- package/dist/cjs/core/fetcher/signals.js +0 -12
- package/dist/cjs/core/headers.js +6 -4
- package/dist/cjs/core/index.d.ts +1 -0
- package/dist/cjs/core/index.js +2 -1
- package/dist/cjs/core/logging/exports.d.ts +18 -0
- package/dist/cjs/core/logging/exports.js +45 -0
- package/dist/cjs/core/logging/index.d.ts +1 -0
- package/dist/cjs/core/logging/index.js +17 -0
- package/dist/cjs/core/logging/logger.d.ts +126 -0
- package/dist/cjs/core/logging/logger.js +144 -0
- package/dist/cjs/core/url/join.js +0 -1
- 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/Client.mjs +3 -3
- package/dist/esm/api/resources/copilots/client/Client.mjs +27 -9
- package/dist/esm/api/resources/documentCatalog/client/Client.mjs +12 -4
- package/dist/esm/api/resources/documentCollections/client/Client.mjs +21 -7
- package/dist/esm/api/resources/search/client/Client.mjs +3 -1
- package/dist/esm/api/resources/users/client/Client.mjs +3 -1
- package/dist/esm/core/exports.d.mts +1 -0
- package/dist/esm/core/exports.mjs +1 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +4 -1
- package/dist/esm/core/fetcher/Fetcher.mjs +202 -9
- package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
- package/dist/esm/core/fetcher/getRequestBody.mjs +4 -0
- package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
- package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
- package/dist/esm/core/fetcher/signals.d.mts +0 -6
- package/dist/esm/core/fetcher/signals.mjs +0 -12
- package/dist/esm/core/headers.mjs +6 -4
- package/dist/esm/core/index.d.mts +1 -0
- package/dist/esm/core/index.mjs +1 -0
- package/dist/esm/core/logging/exports.d.mts +18 -0
- package/dist/esm/core/logging/exports.mjs +9 -0
- package/dist/esm/core/logging/index.d.mts +1 -0
- package/dist/esm/core/logging/index.mjs +1 -0
- package/dist/esm/core/logging/logger.d.mts +126 -0
- package/dist/esm/core/logging/logger.mjs +138 -0
- package/dist/esm/core/url/join.mjs +0 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +3 -2
package/dist/cjs/BaseClient.d.ts
CHANGED
|
@@ -11,7 +11,11 @@ export interface BaseClientOptions {
|
|
|
11
11
|
timeoutInSeconds?: number;
|
|
12
12
|
/** The default number of times to retry the request. Defaults to 2. */
|
|
13
13
|
maxRetries?: number;
|
|
14
|
+
/** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */
|
|
15
|
+
fetch?: typeof fetch;
|
|
14
16
|
fetcher?: core.FetchFunction;
|
|
17
|
+
/** Configure logging for the client. */
|
|
18
|
+
logging?: core.logging.LogConfig | core.logging.Logger;
|
|
15
19
|
}
|
|
16
20
|
export interface BaseRequestOptions {
|
|
17
21
|
/** The maximum time to wait for a response in seconds. */
|
package/dist/cjs/Client.js
CHANGED
|
@@ -44,11 +44,11 @@ const headers_js_1 = require("./core/headers.js");
|
|
|
44
44
|
const core = __importStar(require("./core/index.js"));
|
|
45
45
|
class CredalClient {
|
|
46
46
|
constructor(_options = {}) {
|
|
47
|
-
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
47
|
+
this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: (0, headers_js_1.mergeHeaders)({
|
|
48
48
|
"X-Fern-Language": "JavaScript",
|
|
49
49
|
"X-Fern-SDK-Name": "@credal/sdk",
|
|
50
|
-
"X-Fern-SDK-Version": "0.1.
|
|
51
|
-
"User-Agent": "@credal/sdk/0.1.
|
|
50
|
+
"X-Fern-SDK-Version": "0.1.11",
|
|
51
|
+
"User-Agent": "@credal/sdk/0.1.11",
|
|
52
52
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
53
53
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
54
54
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -73,7 +73,7 @@ class Copilots {
|
|
|
73
73
|
}
|
|
74
74
|
__createCopilot(request, requestOptions) {
|
|
75
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
76
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
77
77
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
78
78
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
79
79
|
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.CredalEnvironment.Production, "/v0/copilots/createCopilot"),
|
|
@@ -86,6 +86,8 @@ class Copilots {
|
|
|
86
86
|
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,
|
|
87
87
|
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,
|
|
88
88
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
89
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
90
|
+
logging: this._options.logging,
|
|
89
91
|
});
|
|
90
92
|
if (_response.ok) {
|
|
91
93
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -131,7 +133,7 @@ class Copilots {
|
|
|
131
133
|
}
|
|
132
134
|
__createConversation(request, requestOptions) {
|
|
133
135
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
136
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
135
137
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
136
138
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
137
139
|
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.CredalEnvironment.Production, "/v0/copilots/createConversation"),
|
|
@@ -144,6 +146,8 @@ class Copilots {
|
|
|
144
146
|
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,
|
|
145
147
|
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,
|
|
146
148
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
149
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
150
|
+
logging: this._options.logging,
|
|
147
151
|
});
|
|
148
152
|
if (_response.ok) {
|
|
149
153
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -193,7 +197,7 @@ class Copilots {
|
|
|
193
197
|
}
|
|
194
198
|
__provideMessageFeedback(request, requestOptions) {
|
|
195
199
|
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
200
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
197
201
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
198
202
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
199
203
|
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.CredalEnvironment.Production, "/v0/copilots/provideMessageFeedback"),
|
|
@@ -206,6 +210,8 @@ class Copilots {
|
|
|
206
210
|
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,
|
|
207
211
|
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,
|
|
208
212
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
213
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
214
|
+
logging: this._options.logging,
|
|
209
215
|
});
|
|
210
216
|
if (_response.ok) {
|
|
211
217
|
return { data: undefined, rawResponse: _response.rawResponse };
|
|
@@ -257,7 +263,7 @@ class Copilots {
|
|
|
257
263
|
}
|
|
258
264
|
__sendMessage(request, requestOptions) {
|
|
259
265
|
return __awaiter(this, void 0, void 0, function* () {
|
|
260
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
266
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
261
267
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
262
268
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
263
269
|
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.CredalEnvironment.Production, "/v0/copilots/sendMessage"),
|
|
@@ -270,6 +276,8 @@ class Copilots {
|
|
|
270
276
|
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
277
|
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,
|
|
272
278
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
279
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
280
|
+
logging: this._options.logging,
|
|
273
281
|
});
|
|
274
282
|
if (_response.ok) {
|
|
275
283
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -306,7 +314,7 @@ class Copilots {
|
|
|
306
314
|
}
|
|
307
315
|
__streamMessage(request, requestOptions) {
|
|
308
316
|
return __awaiter(this, void 0, void 0, function* () {
|
|
309
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
317
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
310
318
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
311
319
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
312
320
|
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.CredalEnvironment.Production, "/v0/copilots/streamMessage"),
|
|
@@ -320,6 +328,8 @@ class Copilots {
|
|
|
320
328
|
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
329
|
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,
|
|
322
330
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
331
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
332
|
+
logging: this._options.logging,
|
|
323
333
|
});
|
|
324
334
|
if (_response.ok) {
|
|
325
335
|
return {
|
|
@@ -376,7 +386,7 @@ class Copilots {
|
|
|
376
386
|
}
|
|
377
387
|
__addCollectionToCopilot(request, requestOptions) {
|
|
378
388
|
return __awaiter(this, void 0, void 0, function* () {
|
|
379
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
389
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
380
390
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
381
391
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
382
392
|
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.CredalEnvironment.Production, "/v0/copilots/addCollectionToCopilot"),
|
|
@@ -389,6 +399,8 @@ class Copilots {
|
|
|
389
399
|
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,
|
|
390
400
|
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,
|
|
391
401
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
402
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
403
|
+
logging: this._options.logging,
|
|
392
404
|
});
|
|
393
405
|
if (_response.ok) {
|
|
394
406
|
return { data: undefined, rawResponse: _response.rawResponse };
|
|
@@ -434,7 +446,7 @@ class Copilots {
|
|
|
434
446
|
}
|
|
435
447
|
__removeCollectionFromCopilot(request, requestOptions) {
|
|
436
448
|
return __awaiter(this, void 0, void 0, function* () {
|
|
437
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
449
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
438
450
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
439
451
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
440
452
|
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.CredalEnvironment.Production, "/v0/copilots/removeCollectionFromCopilot"),
|
|
@@ -447,6 +459,8 @@ class Copilots {
|
|
|
447
459
|
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,
|
|
448
460
|
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,
|
|
449
461
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
462
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
463
|
+
logging: this._options.logging,
|
|
450
464
|
});
|
|
451
465
|
if (_response.ok) {
|
|
452
466
|
return { data: undefined, rawResponse: _response.rawResponse };
|
|
@@ -500,7 +514,7 @@ class Copilots {
|
|
|
500
514
|
}
|
|
501
515
|
__updateConfiguration(request, requestOptions) {
|
|
502
516
|
return __awaiter(this, void 0, void 0, function* () {
|
|
503
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
517
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
504
518
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
505
519
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
506
520
|
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.CredalEnvironment.Production, "/v0/copilots/updateConfiguration"),
|
|
@@ -513,6 +527,8 @@ class Copilots {
|
|
|
513
527
|
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,
|
|
514
528
|
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,
|
|
515
529
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
530
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
531
|
+
logging: this._options.logging,
|
|
516
532
|
});
|
|
517
533
|
if (_response.ok) {
|
|
518
534
|
return { data: undefined, rawResponse: _response.rawResponse };
|
|
@@ -555,7 +571,7 @@ class Copilots {
|
|
|
555
571
|
}
|
|
556
572
|
__deleteCopilot(request, requestOptions) {
|
|
557
573
|
return __awaiter(this, void 0, void 0, function* () {
|
|
558
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
574
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
559
575
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
560
576
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
561
577
|
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.CredalEnvironment.Production, "/v0/copilots/deleteCopilot"),
|
|
@@ -568,6 +584,8 @@ class Copilots {
|
|
|
568
584
|
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,
|
|
569
585
|
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,
|
|
570
586
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
587
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
588
|
+
logging: this._options.logging,
|
|
571
589
|
});
|
|
572
590
|
if (_response.ok) {
|
|
573
591
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -70,7 +70,7 @@ class DocumentCatalog {
|
|
|
70
70
|
}
|
|
71
71
|
__uploadDocumentContents(request, requestOptions) {
|
|
72
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
73
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
74
74
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
75
75
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
76
76
|
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.CredalEnvironment.Production, "/v0/catalog/uploadDocumentContents"),
|
|
@@ -83,6 +83,8 @@ class DocumentCatalog {
|
|
|
83
83
|
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,
|
|
84
84
|
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,
|
|
85
85
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
86
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
87
|
+
logging: this._options.logging,
|
|
86
88
|
});
|
|
87
89
|
if (_response.ok) {
|
|
88
90
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -122,7 +124,7 @@ class DocumentCatalog {
|
|
|
122
124
|
}
|
|
123
125
|
__uploadFile(request, requestOptions) {
|
|
124
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
127
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
126
128
|
const _request = yield core.newFormData();
|
|
127
129
|
yield _request.appendFile("file", request.file);
|
|
128
130
|
if (request.documentName != null) {
|
|
@@ -167,6 +169,8 @@ class DocumentCatalog {
|
|
|
167
169
|
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,
|
|
168
170
|
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,
|
|
169
171
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
172
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
173
|
+
logging: this._options.logging,
|
|
170
174
|
});
|
|
171
175
|
if (_response.ok) {
|
|
172
176
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -212,7 +216,7 @@ class DocumentCatalog {
|
|
|
212
216
|
}
|
|
213
217
|
__syncSourceByUrl(request, requestOptions) {
|
|
214
218
|
return __awaiter(this, void 0, void 0, function* () {
|
|
215
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
219
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
216
220
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
217
221
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
218
222
|
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.CredalEnvironment.Production, "/v0/catalog/syncSourceByUrl"),
|
|
@@ -225,6 +229,8 @@ class DocumentCatalog {
|
|
|
225
229
|
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,
|
|
226
230
|
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,
|
|
227
231
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
232
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
233
|
+
logging: this._options.logging,
|
|
228
234
|
});
|
|
229
235
|
if (_response.ok) {
|
|
230
236
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -290,7 +296,7 @@ class DocumentCatalog {
|
|
|
290
296
|
}
|
|
291
297
|
__metadata(request, requestOptions) {
|
|
292
298
|
return __awaiter(this, void 0, void 0, function* () {
|
|
293
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
299
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
294
300
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
295
301
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
296
302
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/catalog/metadata"),
|
|
@@ -303,6 +309,8 @@ class DocumentCatalog {
|
|
|
303
309
|
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,
|
|
304
310
|
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,
|
|
305
311
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
312
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
313
|
+
logging: this._options.logging,
|
|
306
314
|
});
|
|
307
315
|
if (_response.ok) {
|
|
308
316
|
return { data: undefined, rawResponse: _response.rawResponse };
|
|
@@ -77,7 +77,7 @@ class DocumentCollections {
|
|
|
77
77
|
}
|
|
78
78
|
__addDocumentsToCollection(request, requestOptions) {
|
|
79
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
80
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
81
81
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
82
82
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
83
83
|
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.CredalEnvironment.Production, "/v0/documentCollections/addDocumentsToCollection"),
|
|
@@ -90,6 +90,8 @@ class DocumentCollections {
|
|
|
90
90
|
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,
|
|
91
91
|
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,
|
|
92
92
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
93
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
94
|
+
logging: this._options.logging,
|
|
93
95
|
});
|
|
94
96
|
if (_response.ok) {
|
|
95
97
|
return { data: undefined, rawResponse: _response.rawResponse };
|
|
@@ -143,7 +145,7 @@ class DocumentCollections {
|
|
|
143
145
|
}
|
|
144
146
|
__removeDocumentsFromCollection(request, requestOptions) {
|
|
145
147
|
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
148
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
147
149
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
148
150
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
149
151
|
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.CredalEnvironment.Production, "/v0/documentCollections/removeDocumentsFromCollection"),
|
|
@@ -156,6 +158,8 @@ class DocumentCollections {
|
|
|
156
158
|
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
159
|
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,
|
|
158
160
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
161
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
162
|
+
logging: this._options.logging,
|
|
159
163
|
});
|
|
160
164
|
if (_response.ok) {
|
|
161
165
|
return { data: undefined, rawResponse: _response.rawResponse };
|
|
@@ -200,7 +204,7 @@ class DocumentCollections {
|
|
|
200
204
|
}
|
|
201
205
|
__listDocumentsInCollection(request, requestOptions) {
|
|
202
206
|
return __awaiter(this, void 0, void 0, function* () {
|
|
203
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
207
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
204
208
|
const { collectionId } = request;
|
|
205
209
|
const _queryParams = {};
|
|
206
210
|
_queryParams.collectionId = collectionId;
|
|
@@ -213,6 +217,8 @@ class DocumentCollections {
|
|
|
213
217
|
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,
|
|
214
218
|
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,
|
|
215
219
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
220
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
221
|
+
logging: this._options.logging,
|
|
216
222
|
});
|
|
217
223
|
if (_response.ok) {
|
|
218
224
|
return {
|
|
@@ -265,7 +271,7 @@ class DocumentCollections {
|
|
|
265
271
|
}
|
|
266
272
|
__createCollection(request, requestOptions) {
|
|
267
273
|
return __awaiter(this, void 0, void 0, function* () {
|
|
268
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
274
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
269
275
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
270
276
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
271
277
|
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.CredalEnvironment.Production, "/v0/documentCollections/createCollection"),
|
|
@@ -278,6 +284,8 @@ class DocumentCollections {
|
|
|
278
284
|
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,
|
|
279
285
|
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,
|
|
280
286
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
287
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
288
|
+
logging: this._options.logging,
|
|
281
289
|
});
|
|
282
290
|
if (_response.ok) {
|
|
283
291
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -322,7 +330,7 @@ class DocumentCollections {
|
|
|
322
330
|
}
|
|
323
331
|
__deleteCollection(request, requestOptions) {
|
|
324
332
|
return __awaiter(this, void 0, void 0, function* () {
|
|
325
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
333
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
326
334
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
327
335
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
328
336
|
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.CredalEnvironment.Production, "/v0/documentCollections/deleteCollection"),
|
|
@@ -335,6 +343,8 @@ class DocumentCollections {
|
|
|
335
343
|
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,
|
|
336
344
|
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,
|
|
337
345
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
346
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
347
|
+
logging: this._options.logging,
|
|
338
348
|
});
|
|
339
349
|
if (_response.ok) {
|
|
340
350
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -395,7 +405,7 @@ class DocumentCollections {
|
|
|
395
405
|
}
|
|
396
406
|
__createMongoCollectionSync(request, requestOptions) {
|
|
397
407
|
return __awaiter(this, void 0, void 0, function* () {
|
|
398
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
408
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
399
409
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
400
410
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
401
411
|
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.CredalEnvironment.Production, "/v0/documentCollections/mongodb/createMongoSync"),
|
|
@@ -408,6 +418,8 @@ class DocumentCollections {
|
|
|
408
418
|
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,
|
|
409
419
|
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,
|
|
410
420
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
421
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
422
|
+
logging: this._options.logging,
|
|
411
423
|
});
|
|
412
424
|
if (_response.ok) {
|
|
413
425
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -468,7 +480,7 @@ class DocumentCollections {
|
|
|
468
480
|
}
|
|
469
481
|
__updateMongoCollectionSync(request, requestOptions) {
|
|
470
482
|
return __awaiter(this, void 0, void 0, function* () {
|
|
471
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
483
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
472
484
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
473
485
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
474
486
|
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.CredalEnvironment.Production, "/v0/documentCollections/mongodb/updateMongoSync"),
|
|
@@ -481,6 +493,8 @@ class DocumentCollections {
|
|
|
481
493
|
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,
|
|
482
494
|
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,
|
|
483
495
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
496
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
497
|
+
logging: this._options.logging,
|
|
484
498
|
});
|
|
485
499
|
if (_response.ok) {
|
|
486
500
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -83,7 +83,7 @@ class Search {
|
|
|
83
83
|
}
|
|
84
84
|
__searchDocumentCollection(request, requestOptions) {
|
|
85
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
86
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
87
87
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
88
88
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
89
89
|
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.CredalEnvironment.Production, "/v0/search/searchDocumentCollection"),
|
|
@@ -96,6 +96,8 @@ class Search {
|
|
|
96
96
|
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,
|
|
97
97
|
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,
|
|
98
98
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
99
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
100
|
+
logging: this._options.logging,
|
|
99
101
|
});
|
|
100
102
|
if (_response.ok) {
|
|
101
103
|
return {
|
|
@@ -78,7 +78,7 @@ class Users {
|
|
|
78
78
|
}
|
|
79
79
|
__metadata(request, requestOptions) {
|
|
80
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
81
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
82
82
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
83
83
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
84
84
|
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.CredalEnvironment.Production, "/v0/users/metadata"),
|
|
@@ -91,6 +91,8 @@ class Users {
|
|
|
91
91
|
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,
|
|
92
92
|
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,
|
|
93
93
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
94
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
95
|
+
logging: this._options.logging,
|
|
94
96
|
});
|
|
95
97
|
if (_response.ok) {
|
|
96
98
|
return { data: undefined, rawResponse: _response.rawResponse };
|
package/dist/cjs/core/exports.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type LogConfig, type Logger } from "../logging/logger.js";
|
|
1
2
|
import type { APIResponse } from "./APIResponse.js";
|
|
2
3
|
import type { EndpointMetadata } from "./EndpointMetadata.js";
|
|
3
4
|
import { EndpointSupplier } from "./EndpointSupplier.js";
|
|
@@ -14,10 +15,12 @@ export declare namespace Fetcher {
|
|
|
14
15
|
maxRetries?: number;
|
|
15
16
|
withCredentials?: boolean;
|
|
16
17
|
abortSignal?: AbortSignal;
|
|
17
|
-
requestType?: "json" | "file" | "bytes";
|
|
18
|
+
requestType?: "json" | "file" | "bytes" | "form" | "other";
|
|
18
19
|
responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer" | "binary-response";
|
|
19
20
|
duplex?: "half";
|
|
20
21
|
endpointMetadata?: EndpointMetadata;
|
|
22
|
+
fetchFn?: typeof fetch;
|
|
23
|
+
logging?: LogConfig | Logger;
|
|
21
24
|
}
|
|
22
25
|
type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
|
|
23
26
|
interface FailedStatusCodeError {
|