@corti/sdk 0.10.0 → 0.10.1
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/Client.js +2 -2
- package/dist/cjs/api/resources/agents/client/Client.js +0 -10
- package/dist/cjs/api/resources/auth/client/Client.js +0 -1
- package/dist/cjs/api/resources/codes/client/Client.js +0 -1
- package/dist/cjs/api/resources/documents/client/Client.js +0 -5
- package/dist/cjs/api/resources/facts/client/Client.js +0 -6
- package/dist/cjs/api/resources/interactions/client/Client.js +0 -5
- package/dist/cjs/api/resources/recordings/client/Client.js +0 -4
- package/dist/cjs/api/resources/templates/client/Client.js +0 -3
- package/dist/cjs/api/resources/transcripts/client/Client.js +0 -5
- package/dist/cjs/core/fetcher/Fetcher.js +7 -1
- package/dist/cjs/custom/CortiClient.d.ts +4 -0
- package/dist/cjs/custom/CortiClient.js +8 -1
- package/dist/cjs/custom/utils/withCredentialsConfig.d.ts +2 -0
- package/dist/cjs/custom/utils/withCredentialsConfig.js +15 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/agents/client/Client.mjs +0 -10
- package/dist/esm/api/resources/auth/client/Client.mjs +0 -1
- package/dist/esm/api/resources/codes/client/Client.mjs +0 -1
- package/dist/esm/api/resources/documents/client/Client.mjs +0 -5
- package/dist/esm/api/resources/facts/client/Client.mjs +0 -6
- package/dist/esm/api/resources/interactions/client/Client.mjs +0 -5
- package/dist/esm/api/resources/recordings/client/Client.mjs +0 -4
- package/dist/esm/api/resources/templates/client/Client.mjs +0 -3
- package/dist/esm/api/resources/transcripts/client/Client.mjs +0 -5
- package/dist/esm/core/fetcher/Fetcher.mjs +7 -1
- package/dist/esm/custom/CortiClient.d.mts +4 -0
- package/dist/esm/custom/CortiClient.mjs +8 -1
- package/dist/esm/custom/utils/withCredentialsConfig.d.mts +2 -0
- package/dist/esm/custom/utils/withCredentialsConfig.mjs +11 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/dist/cjs/Client.js
CHANGED
|
@@ -65,8 +65,8 @@ class CortiClient {
|
|
|
65
65
|
"Tenant-Name": _options === null || _options === void 0 ? void 0 : _options.tenantName,
|
|
66
66
|
"X-Fern-Language": "JavaScript",
|
|
67
67
|
"X-Fern-SDK-Name": "@corti/sdk",
|
|
68
|
-
"X-Fern-SDK-Version": "0.10.
|
|
69
|
-
"User-Agent": "@corti/sdk/0.10.
|
|
68
|
+
"X-Fern-SDK-Version": "0.10.1",
|
|
69
|
+
"User-Agent": "@corti/sdk/0.10.1",
|
|
70
70
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
71
71
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
72
72
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -105,7 +105,6 @@ class Agents {
|
|
|
105
105
|
queryParameters: _queryParams,
|
|
106
106
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
107
107
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
108
|
-
withCredentials: true,
|
|
109
108
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
110
109
|
});
|
|
111
110
|
if (_response.ok) {
|
|
@@ -193,7 +192,6 @@ class Agents {
|
|
|
193
192
|
}),
|
|
194
193
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
195
194
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
196
|
-
withCredentials: true,
|
|
197
195
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
198
196
|
});
|
|
199
197
|
if (_response.ok) {
|
|
@@ -267,7 +265,6 @@ class Agents {
|
|
|
267
265
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
268
266
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
269
267
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
270
|
-
withCredentials: true,
|
|
271
268
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
272
269
|
});
|
|
273
270
|
if (_response.ok) {
|
|
@@ -343,7 +340,6 @@ class Agents {
|
|
|
343
340
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
344
341
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
345
342
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
346
|
-
withCredentials: true,
|
|
347
343
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
348
344
|
});
|
|
349
345
|
if (_response.ok) {
|
|
@@ -422,7 +418,6 @@ class Agents {
|
|
|
422
418
|
}),
|
|
423
419
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
424
420
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
425
|
-
withCredentials: true,
|
|
426
421
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
427
422
|
});
|
|
428
423
|
if (_response.ok) {
|
|
@@ -498,7 +493,6 @@ class Agents {
|
|
|
498
493
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
499
494
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
500
495
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
501
|
-
withCredentials: true,
|
|
502
496
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
503
497
|
});
|
|
504
498
|
if (_response.ok) {
|
|
@@ -591,7 +585,6 @@ class Agents {
|
|
|
591
585
|
}),
|
|
592
586
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
593
587
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
594
|
-
withCredentials: true,
|
|
595
588
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
596
589
|
});
|
|
597
590
|
if (_response.ok) {
|
|
@@ -675,7 +668,6 @@ class Agents {
|
|
|
675
668
|
queryParameters: _queryParams,
|
|
676
669
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
677
670
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
678
|
-
withCredentials: true,
|
|
679
671
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
680
672
|
});
|
|
681
673
|
if (_response.ok) {
|
|
@@ -762,7 +754,6 @@ class Agents {
|
|
|
762
754
|
queryParameters: _queryParams,
|
|
763
755
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
764
756
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
765
|
-
withCredentials: true,
|
|
766
757
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
767
758
|
});
|
|
768
759
|
if (_response.ok) {
|
|
@@ -849,7 +840,6 @@ class Agents {
|
|
|
849
840
|
queryParameters: _queryParams,
|
|
850
841
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
851
842
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
852
|
-
withCredentials: true,
|
|
853
843
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
854
844
|
});
|
|
855
845
|
if (_response.ok) {
|
|
@@ -87,7 +87,6 @@ class Auth {
|
|
|
87
87
|
})), { scope: "openid", grant_type: "client_credentials" }),
|
|
88
88
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
89
89
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
90
|
-
withCredentials: true,
|
|
91
90
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
92
91
|
});
|
|
93
92
|
if (_response.ok) {
|
|
@@ -98,7 +98,6 @@ class Codes {
|
|
|
98
98
|
}),
|
|
99
99
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
100
100
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
101
|
-
withCredentials: true,
|
|
102
101
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
103
102
|
});
|
|
104
103
|
if (_response.ok) {
|
|
@@ -84,7 +84,6 @@ class Documents {
|
|
|
84
84
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
85
85
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
86
86
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
87
|
-
withCredentials: true,
|
|
88
87
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
89
88
|
});
|
|
90
89
|
if (_response.ok) {
|
|
@@ -198,7 +197,6 @@ class Documents {
|
|
|
198
197
|
}),
|
|
199
198
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
200
199
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
201
|
-
withCredentials: true,
|
|
202
200
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
203
201
|
});
|
|
204
202
|
if (_response.ok) {
|
|
@@ -296,7 +294,6 @@ class Documents {
|
|
|
296
294
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
297
295
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
298
296
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
299
|
-
withCredentials: true,
|
|
300
297
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
301
298
|
});
|
|
302
299
|
if (_response.ok) {
|
|
@@ -392,7 +389,6 @@ class Documents {
|
|
|
392
389
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
393
390
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
394
391
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
395
|
-
withCredentials: true,
|
|
396
392
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
397
393
|
});
|
|
398
394
|
if (_response.ok) {
|
|
@@ -486,7 +482,6 @@ class Documents {
|
|
|
486
482
|
}),
|
|
487
483
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
488
484
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
489
|
-
withCredentials: true,
|
|
490
485
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
491
486
|
});
|
|
492
487
|
if (_response.ok) {
|
|
@@ -80,7 +80,6 @@ class Facts {
|
|
|
80
80
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
81
81
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
82
82
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
83
|
-
withCredentials: true,
|
|
84
83
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
85
84
|
});
|
|
86
85
|
if (_response.ok) {
|
|
@@ -156,7 +155,6 @@ class Facts {
|
|
|
156
155
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
157
156
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
158
157
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
159
|
-
withCredentials: true,
|
|
160
158
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
161
159
|
});
|
|
162
160
|
if (_response.ok) {
|
|
@@ -244,7 +242,6 @@ class Facts {
|
|
|
244
242
|
}),
|
|
245
243
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
246
244
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
247
|
-
withCredentials: true,
|
|
248
245
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
249
246
|
});
|
|
250
247
|
if (_response.ok) {
|
|
@@ -331,7 +328,6 @@ class Facts {
|
|
|
331
328
|
}),
|
|
332
329
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
333
330
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
334
|
-
withCredentials: true,
|
|
335
331
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
336
332
|
});
|
|
337
333
|
if (_response.ok) {
|
|
@@ -415,7 +411,6 @@ class Facts {
|
|
|
415
411
|
}),
|
|
416
412
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
417
413
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
418
|
-
withCredentials: true,
|
|
419
414
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
420
415
|
});
|
|
421
416
|
if (_response.ok) {
|
|
@@ -503,7 +498,6 @@ class Facts {
|
|
|
503
498
|
}),
|
|
504
499
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
505
500
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
506
|
-
withCredentials: true,
|
|
507
501
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
508
502
|
});
|
|
509
503
|
if (_response.ok) {
|
|
@@ -115,7 +115,6 @@ class Interactions {
|
|
|
115
115
|
queryParameters: _queryParams,
|
|
116
116
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
117
117
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
118
|
-
withCredentials: true,
|
|
119
118
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
120
119
|
});
|
|
121
120
|
if (_response.ok) {
|
|
@@ -227,7 +226,6 @@ class Interactions {
|
|
|
227
226
|
}),
|
|
228
227
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
229
228
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
230
|
-
withCredentials: true,
|
|
231
229
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
232
230
|
});
|
|
233
231
|
if (_response.ok) {
|
|
@@ -322,7 +320,6 @@ class Interactions {
|
|
|
322
320
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
323
321
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
324
322
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
325
|
-
withCredentials: true,
|
|
326
323
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
327
324
|
});
|
|
328
325
|
if (_response.ok) {
|
|
@@ -407,7 +404,6 @@ class Interactions {
|
|
|
407
404
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
408
405
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
409
406
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
410
|
-
withCredentials: true,
|
|
411
407
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
412
408
|
});
|
|
413
409
|
if (_response.ok) {
|
|
@@ -490,7 +486,6 @@ class Interactions {
|
|
|
490
486
|
}),
|
|
491
487
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
492
488
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
493
|
-
withCredentials: true,
|
|
494
489
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
495
490
|
});
|
|
496
491
|
if (_response.ok) {
|
|
@@ -84,7 +84,6 @@ class Recordings {
|
|
|
84
84
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
85
85
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
86
86
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
87
|
-
withCredentials: true,
|
|
88
87
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
89
88
|
});
|
|
90
89
|
if (_response.ok) {
|
|
@@ -184,7 +183,6 @@ class Recordings {
|
|
|
184
183
|
body: _binaryUploadRequest.body,
|
|
185
184
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
186
185
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
187
|
-
withCredentials: true,
|
|
188
186
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
189
187
|
});
|
|
190
188
|
if (_response.ok) {
|
|
@@ -276,7 +274,6 @@ class Recordings {
|
|
|
276
274
|
responseType: "binary-response",
|
|
277
275
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
278
276
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
279
|
-
withCredentials: true,
|
|
280
277
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
281
278
|
});
|
|
282
279
|
if (_response.ok) {
|
|
@@ -367,7 +364,6 @@ class Recordings {
|
|
|
367
364
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
368
365
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
369
366
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
370
|
-
withCredentials: true,
|
|
371
367
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
372
368
|
});
|
|
373
369
|
if (_response.ok) {
|
|
@@ -101,7 +101,6 @@ class Templates {
|
|
|
101
101
|
queryParameters: _queryParams,
|
|
102
102
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
103
103
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
104
|
-
withCredentials: true,
|
|
105
104
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
106
105
|
});
|
|
107
106
|
if (_response.ok) {
|
|
@@ -207,7 +206,6 @@ class Templates {
|
|
|
207
206
|
queryParameters: _queryParams,
|
|
208
207
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
209
208
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
210
|
-
withCredentials: true,
|
|
211
209
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
212
210
|
});
|
|
213
211
|
if (_response.ok) {
|
|
@@ -286,7 +284,6 @@ class Templates {
|
|
|
286
284
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
287
285
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
288
286
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
289
|
-
withCredentials: true,
|
|
290
287
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
291
288
|
});
|
|
292
289
|
if (_response.ok) {
|
|
@@ -92,7 +92,6 @@ class Transcripts {
|
|
|
92
92
|
queryParameters: _queryParams,
|
|
93
93
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
94
94
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
95
|
-
withCredentials: true,
|
|
96
95
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
97
96
|
});
|
|
98
97
|
if (_response.ok) {
|
|
@@ -202,7 +201,6 @@ class Transcripts {
|
|
|
202
201
|
}),
|
|
203
202
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
204
203
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
205
|
-
withCredentials: true,
|
|
206
204
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
207
205
|
});
|
|
208
206
|
if (_response.ok) {
|
|
@@ -303,7 +301,6 @@ class Transcripts {
|
|
|
303
301
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
304
302
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
305
303
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
306
|
-
withCredentials: true,
|
|
307
304
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
308
305
|
});
|
|
309
306
|
if (_response.ok) {
|
|
@@ -404,7 +401,6 @@ class Transcripts {
|
|
|
404
401
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
405
402
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
406
403
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
407
|
-
withCredentials: true,
|
|
408
404
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
409
405
|
});
|
|
410
406
|
if (_response.ok) {
|
|
@@ -492,7 +488,6 @@ class Transcripts {
|
|
|
492
488
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
493
489
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
494
490
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
495
|
-
withCredentials: true,
|
|
496
491
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
497
492
|
});
|
|
498
493
|
if (_response.ok) {
|
|
@@ -11,6 +11,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.fetcher = void 0;
|
|
13
13
|
exports.fetcherImpl = fetcherImpl;
|
|
14
|
+
/**
|
|
15
|
+
* Patch: respect CortiClient withCredentials. When args.withCredentials is undefined,
|
|
16
|
+
* use the global default set by CortiClient (see src/custom/withCredentialsConfig.ts).
|
|
17
|
+
*/
|
|
14
18
|
const json_js_1 = require("../json.js");
|
|
15
19
|
const RawResponse_js_1 = require("./RawResponse.js");
|
|
16
20
|
const Supplier_js_1 = require("./Supplier.js");
|
|
@@ -21,6 +25,7 @@ const getRequestBody_js_1 = require("./getRequestBody.js");
|
|
|
21
25
|
const getResponseBody_js_1 = require("./getResponseBody.js");
|
|
22
26
|
const makeRequest_js_1 = require("./makeRequest.js");
|
|
23
27
|
const requestWithRetries_js_1 = require("./requestWithRetries.js");
|
|
28
|
+
const withCredentialsConfig_js_1 = require("../../custom/utils/withCredentialsConfig.js");
|
|
24
29
|
function getHeaders(args) {
|
|
25
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
31
|
const newHeaders = {};
|
|
@@ -54,7 +59,8 @@ function fetcherImpl(args) {
|
|
|
54
59
|
const fetchFn = yield (0, getFetchFn_js_1.getFetchFn)();
|
|
55
60
|
try {
|
|
56
61
|
const response = yield (0, requestWithRetries_js_1.requestWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
|
|
62
|
+
var _a;
|
|
63
|
+
return (0, makeRequest_js_1.makeRequest)(fetchFn, url, args.method, yield getHeaders(args), requestBody, args.timeoutMs, args.abortSignal, (_a = args.withCredentials) !== null && _a !== void 0 ? _a : (0, withCredentialsConfig_js_1.getDefaultWithCredentials)(), args.duplex);
|
|
58
64
|
}), args.maxRetries);
|
|
59
65
|
if (response.status >= 200 && response.status < 400) {
|
|
60
66
|
return {
|
|
@@ -47,6 +47,8 @@ export declare namespace CortiClient {
|
|
|
47
47
|
baseUrl?: core.Supplier<string>;
|
|
48
48
|
/** Patch: added new option to encode headers as WebSocket protocols for streaming resources (for proxy scenarios) */
|
|
49
49
|
encodeHeadersAsWsProtocols?: boolean;
|
|
50
|
+
/** Patch: when true, fetcher sends credentials (cookies, auth headers) on cross-origin requests; sets global default used by core fetcher when not passed per-request */
|
|
51
|
+
withCredentials?: boolean;
|
|
50
52
|
}
|
|
51
53
|
interface OptionsWithClientCredentials extends BaseOptions {
|
|
52
54
|
/**
|
|
@@ -85,6 +87,7 @@ export declare namespace CortiClient {
|
|
|
85
87
|
* - made clientId and clientSecret optional
|
|
86
88
|
* - updated environment type to CortiInternalEnvironment
|
|
87
89
|
* - added `encodeHeadersAsWsProtocols`
|
|
90
|
+
* - added `withCredentials`
|
|
88
91
|
*/
|
|
89
92
|
interface InternalOptions {
|
|
90
93
|
environment: CortiInternalEnvironment;
|
|
@@ -98,6 +101,7 @@ export declare namespace CortiClient {
|
|
|
98
101
|
/** Additional headers to include in requests. */
|
|
99
102
|
headers?: HeadersRecord;
|
|
100
103
|
encodeHeadersAsWsProtocols?: boolean;
|
|
104
|
+
withCredentials?: boolean;
|
|
101
105
|
}
|
|
102
106
|
interface RequestOptions {
|
|
103
107
|
/** The maximum time to wait for a response in seconds. */
|
|
@@ -85,6 +85,7 @@ const version_js_1 = require("../version.js");
|
|
|
85
85
|
const getEnvironmentFromString_js_1 = require("./utils/getEnvironmentFromString.js");
|
|
86
86
|
const resolveClientOptions_js_1 = require("./utils/resolveClientOptions.js");
|
|
87
87
|
const RefreshBearerProvider_js_1 = require("./RefreshBearerProvider.js");
|
|
88
|
+
const withCredentialsConfig_js_1 = require("./utils/withCredentialsConfig.js");
|
|
88
89
|
class CortiClient {
|
|
89
90
|
constructor(_options) {
|
|
90
91
|
/**
|
|
@@ -105,7 +106,13 @@ class CortiClient {
|
|
|
105
106
|
"User-Agent": `@corti/sdk/${version_js_1.SDK_VERSION}`,
|
|
106
107
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
107
108
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
108
|
-
}, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: _options.auth && "clientId" in _options.auth ? _options.auth.clientId : undefined, clientSecret: _options.auth && "clientSecret" in _options.auth ? _options.auth.clientSecret : undefined, token: _options.auth && "accessToken" in _options.auth ? _options.auth.accessToken : undefined, tenantName, environment: (0, getEnvironmentFromString_js_1.getEnvironment)(environment) });
|
|
109
|
+
}, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: _options.auth && "clientId" in _options.auth ? _options.auth.clientId : undefined, clientSecret: _options.auth && "clientSecret" in _options.auth ? _options.auth.clientSecret : undefined, token: _options.auth && "accessToken" in _options.auth ? _options.auth.accessToken : undefined, tenantName, environment: (0, getEnvironmentFromString_js_1.getEnvironment)(environment), withCredentials: _options.withCredentials });
|
|
110
|
+
/**
|
|
111
|
+
* Patch: set global default for fetcher withCredentials when passed on CortiClient
|
|
112
|
+
*/
|
|
113
|
+
if (_options.withCredentials !== undefined) {
|
|
114
|
+
(0, withCredentialsConfig_js_1.setDefaultWithCredentials)(_options.withCredentials);
|
|
115
|
+
}
|
|
109
116
|
/**
|
|
110
117
|
* Patch: if `clientId` is provided, use OAuthTokenProvider, otherwise use BearerProvider
|
|
111
118
|
* Only create token provider when auth is provided
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDefaultWithCredentials = getDefaultWithCredentials;
|
|
4
|
+
exports.setDefaultWithCredentials = setDefaultWithCredentials;
|
|
5
|
+
/**
|
|
6
|
+
* Global default for fetcher withCredentials. Set by CortiClient when withCredentials
|
|
7
|
+
* is passed in options; the core fetcher reads this when args.withCredentials is undefined.
|
|
8
|
+
*/
|
|
9
|
+
let defaultWithCredentials = undefined;
|
|
10
|
+
function getDefaultWithCredentials() {
|
|
11
|
+
return defaultWithCredentials;
|
|
12
|
+
}
|
|
13
|
+
function setDefaultWithCredentials(value) {
|
|
14
|
+
defaultWithCredentials = value;
|
|
15
|
+
}
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.10.
|
|
1
|
+
export declare const SDK_VERSION = "0.10.1";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -29,8 +29,8 @@ export class CortiClient {
|
|
|
29
29
|
"Tenant-Name": _options === null || _options === void 0 ? void 0 : _options.tenantName,
|
|
30
30
|
"X-Fern-Language": "JavaScript",
|
|
31
31
|
"X-Fern-SDK-Name": "@corti/sdk",
|
|
32
|
-
"X-Fern-SDK-Version": "0.10.
|
|
33
|
-
"User-Agent": "@corti/sdk/0.10.
|
|
32
|
+
"X-Fern-SDK-Version": "0.10.1",
|
|
33
|
+
"User-Agent": "@corti/sdk/0.10.1",
|
|
34
34
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
35
35
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
36
36
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -69,7 +69,6 @@ export class Agents {
|
|
|
69
69
|
queryParameters: _queryParams,
|
|
70
70
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
71
71
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
72
|
-
withCredentials: true,
|
|
73
72
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
74
73
|
});
|
|
75
74
|
if (_response.ok) {
|
|
@@ -157,7 +156,6 @@ export class Agents {
|
|
|
157
156
|
}),
|
|
158
157
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
159
158
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
160
|
-
withCredentials: true,
|
|
161
159
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
162
160
|
});
|
|
163
161
|
if (_response.ok) {
|
|
@@ -231,7 +229,6 @@ export class Agents {
|
|
|
231
229
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
232
230
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
233
231
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
234
|
-
withCredentials: true,
|
|
235
232
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
236
233
|
});
|
|
237
234
|
if (_response.ok) {
|
|
@@ -307,7 +304,6 @@ export class Agents {
|
|
|
307
304
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
308
305
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
309
306
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
310
|
-
withCredentials: true,
|
|
311
307
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
312
308
|
});
|
|
313
309
|
if (_response.ok) {
|
|
@@ -386,7 +382,6 @@ export class Agents {
|
|
|
386
382
|
}),
|
|
387
383
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
388
384
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
389
|
-
withCredentials: true,
|
|
390
385
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
391
386
|
});
|
|
392
387
|
if (_response.ok) {
|
|
@@ -462,7 +457,6 @@ export class Agents {
|
|
|
462
457
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
463
458
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
464
459
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
465
|
-
withCredentials: true,
|
|
466
460
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
467
461
|
});
|
|
468
462
|
if (_response.ok) {
|
|
@@ -555,7 +549,6 @@ export class Agents {
|
|
|
555
549
|
}),
|
|
556
550
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
557
551
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
558
|
-
withCredentials: true,
|
|
559
552
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
560
553
|
});
|
|
561
554
|
if (_response.ok) {
|
|
@@ -639,7 +632,6 @@ export class Agents {
|
|
|
639
632
|
queryParameters: _queryParams,
|
|
640
633
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
641
634
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
642
|
-
withCredentials: true,
|
|
643
635
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
644
636
|
});
|
|
645
637
|
if (_response.ok) {
|
|
@@ -726,7 +718,6 @@ export class Agents {
|
|
|
726
718
|
queryParameters: _queryParams,
|
|
727
719
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
728
720
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
729
|
-
withCredentials: true,
|
|
730
721
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
731
722
|
});
|
|
732
723
|
if (_response.ok) {
|
|
@@ -813,7 +804,6 @@ export class Agents {
|
|
|
813
804
|
queryParameters: _queryParams,
|
|
814
805
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
815
806
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
816
|
-
withCredentials: true,
|
|
817
807
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
818
808
|
});
|
|
819
809
|
if (_response.ok) {
|
|
@@ -51,7 +51,6 @@ export class Auth {
|
|
|
51
51
|
})), { scope: "openid", grant_type: "client_credentials" }),
|
|
52
52
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
53
53
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
54
|
-
withCredentials: true,
|
|
55
54
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
56
55
|
});
|
|
57
56
|
if (_response.ok) {
|
|
@@ -62,7 +62,6 @@ export class Codes {
|
|
|
62
62
|
}),
|
|
63
63
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
64
64
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
65
|
-
withCredentials: true,
|
|
66
65
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
67
66
|
});
|
|
68
67
|
if (_response.ok) {
|
|
@@ -48,7 +48,6 @@ export class Documents {
|
|
|
48
48
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
49
49
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
50
50
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
51
|
-
withCredentials: true,
|
|
52
51
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
53
52
|
});
|
|
54
53
|
if (_response.ok) {
|
|
@@ -162,7 +161,6 @@ export class Documents {
|
|
|
162
161
|
}),
|
|
163
162
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
164
163
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
165
|
-
withCredentials: true,
|
|
166
164
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
167
165
|
});
|
|
168
166
|
if (_response.ok) {
|
|
@@ -260,7 +258,6 @@ export class Documents {
|
|
|
260
258
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
261
259
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
262
260
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
263
|
-
withCredentials: true,
|
|
264
261
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
265
262
|
});
|
|
266
263
|
if (_response.ok) {
|
|
@@ -356,7 +353,6 @@ export class Documents {
|
|
|
356
353
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
357
354
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
358
355
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
359
|
-
withCredentials: true,
|
|
360
356
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
361
357
|
});
|
|
362
358
|
if (_response.ok) {
|
|
@@ -450,7 +446,6 @@ export class Documents {
|
|
|
450
446
|
}),
|
|
451
447
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
452
448
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
453
|
-
withCredentials: true,
|
|
454
449
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
455
450
|
});
|
|
456
451
|
if (_response.ok) {
|
|
@@ -44,7 +44,6 @@ export class Facts {
|
|
|
44
44
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
45
45
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
46
46
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
47
|
-
withCredentials: true,
|
|
48
47
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
49
48
|
});
|
|
50
49
|
if (_response.ok) {
|
|
@@ -120,7 +119,6 @@ export class Facts {
|
|
|
120
119
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
121
120
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
122
121
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
123
|
-
withCredentials: true,
|
|
124
122
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
125
123
|
});
|
|
126
124
|
if (_response.ok) {
|
|
@@ -208,7 +206,6 @@ export class Facts {
|
|
|
208
206
|
}),
|
|
209
207
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
210
208
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
211
|
-
withCredentials: true,
|
|
212
209
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
213
210
|
});
|
|
214
211
|
if (_response.ok) {
|
|
@@ -295,7 +292,6 @@ export class Facts {
|
|
|
295
292
|
}),
|
|
296
293
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
297
294
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
298
|
-
withCredentials: true,
|
|
299
295
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
300
296
|
});
|
|
301
297
|
if (_response.ok) {
|
|
@@ -379,7 +375,6 @@ export class Facts {
|
|
|
379
375
|
}),
|
|
380
376
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
381
377
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
382
|
-
withCredentials: true,
|
|
383
378
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
384
379
|
});
|
|
385
380
|
if (_response.ok) {
|
|
@@ -467,7 +462,6 @@ export class Facts {
|
|
|
467
462
|
}),
|
|
468
463
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
469
464
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
470
|
-
withCredentials: true,
|
|
471
465
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
472
466
|
});
|
|
473
467
|
if (_response.ok) {
|
|
@@ -79,7 +79,6 @@ export class Interactions {
|
|
|
79
79
|
queryParameters: _queryParams,
|
|
80
80
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
81
81
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
82
|
-
withCredentials: true,
|
|
83
82
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
84
83
|
});
|
|
85
84
|
if (_response.ok) {
|
|
@@ -191,7 +190,6 @@ export class Interactions {
|
|
|
191
190
|
}),
|
|
192
191
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
193
192
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
194
|
-
withCredentials: true,
|
|
195
193
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
196
194
|
});
|
|
197
195
|
if (_response.ok) {
|
|
@@ -286,7 +284,6 @@ export class Interactions {
|
|
|
286
284
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
287
285
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
288
286
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
289
|
-
withCredentials: true,
|
|
290
287
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
291
288
|
});
|
|
292
289
|
if (_response.ok) {
|
|
@@ -371,7 +368,6 @@ export class Interactions {
|
|
|
371
368
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
372
369
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
373
370
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
374
|
-
withCredentials: true,
|
|
375
371
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
376
372
|
});
|
|
377
373
|
if (_response.ok) {
|
|
@@ -454,7 +450,6 @@ export class Interactions {
|
|
|
454
450
|
}),
|
|
455
451
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
456
452
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
457
|
-
withCredentials: true,
|
|
458
453
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
459
454
|
});
|
|
460
455
|
if (_response.ok) {
|
|
@@ -48,7 +48,6 @@ export class Recordings {
|
|
|
48
48
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
49
49
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
50
50
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
51
|
-
withCredentials: true,
|
|
52
51
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
53
52
|
});
|
|
54
53
|
if (_response.ok) {
|
|
@@ -148,7 +147,6 @@ export class Recordings {
|
|
|
148
147
|
body: _binaryUploadRequest.body,
|
|
149
148
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
150
149
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
151
|
-
withCredentials: true,
|
|
152
150
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
153
151
|
});
|
|
154
152
|
if (_response.ok) {
|
|
@@ -240,7 +238,6 @@ export class Recordings {
|
|
|
240
238
|
responseType: "binary-response",
|
|
241
239
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
242
240
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
243
|
-
withCredentials: true,
|
|
244
241
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
245
242
|
});
|
|
246
243
|
if (_response.ok) {
|
|
@@ -331,7 +328,6 @@ export class Recordings {
|
|
|
331
328
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
332
329
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
333
330
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
334
|
-
withCredentials: true,
|
|
335
331
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
336
332
|
});
|
|
337
333
|
if (_response.ok) {
|
|
@@ -65,7 +65,6 @@ export class Templates {
|
|
|
65
65
|
queryParameters: _queryParams,
|
|
66
66
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
67
67
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
68
|
-
withCredentials: true,
|
|
69
68
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
70
69
|
});
|
|
71
70
|
if (_response.ok) {
|
|
@@ -171,7 +170,6 @@ export class Templates {
|
|
|
171
170
|
queryParameters: _queryParams,
|
|
172
171
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
173
172
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
174
|
-
withCredentials: true,
|
|
175
173
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
176
174
|
});
|
|
177
175
|
if (_response.ok) {
|
|
@@ -250,7 +248,6 @@ export class Templates {
|
|
|
250
248
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
251
249
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
252
250
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
253
|
-
withCredentials: true,
|
|
254
251
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
255
252
|
});
|
|
256
253
|
if (_response.ok) {
|
|
@@ -56,7 +56,6 @@ export class Transcripts {
|
|
|
56
56
|
queryParameters: _queryParams,
|
|
57
57
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
58
58
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
59
|
-
withCredentials: true,
|
|
60
59
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
61
60
|
});
|
|
62
61
|
if (_response.ok) {
|
|
@@ -166,7 +165,6 @@ export class Transcripts {
|
|
|
166
165
|
}),
|
|
167
166
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
168
167
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
169
|
-
withCredentials: true,
|
|
170
168
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
171
169
|
});
|
|
172
170
|
if (_response.ok) {
|
|
@@ -267,7 +265,6 @@ export class Transcripts {
|
|
|
267
265
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
268
266
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
269
267
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
270
|
-
withCredentials: true,
|
|
271
268
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
272
269
|
});
|
|
273
270
|
if (_response.ok) {
|
|
@@ -368,7 +365,6 @@ export class Transcripts {
|
|
|
368
365
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
369
366
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
370
367
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
371
|
-
withCredentials: true,
|
|
372
368
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
373
369
|
});
|
|
374
370
|
if (_response.ok) {
|
|
@@ -456,7 +452,6 @@ export class Transcripts {
|
|
|
456
452
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
457
453
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
458
454
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
459
|
-
withCredentials: true,
|
|
460
455
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
461
456
|
});
|
|
462
457
|
if (_response.ok) {
|
|
@@ -7,6 +7,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Patch: respect CortiClient withCredentials. When args.withCredentials is undefined,
|
|
12
|
+
* use the global default set by CortiClient (see src/custom/withCredentialsConfig.ts).
|
|
13
|
+
*/
|
|
10
14
|
import { toJson } from "../json.mjs";
|
|
11
15
|
import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
12
16
|
import { Supplier } from "./Supplier.mjs";
|
|
@@ -17,6 +21,7 @@ import { getRequestBody } from "./getRequestBody.mjs";
|
|
|
17
21
|
import { getResponseBody } from "./getResponseBody.mjs";
|
|
18
22
|
import { makeRequest } from "./makeRequest.mjs";
|
|
19
23
|
import { requestWithRetries } from "./requestWithRetries.mjs";
|
|
24
|
+
import { getDefaultWithCredentials } from "../../custom/utils/withCredentialsConfig.mjs";
|
|
20
25
|
function getHeaders(args) {
|
|
21
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
27
|
const newHeaders = {};
|
|
@@ -50,7 +55,8 @@ export function fetcherImpl(args) {
|
|
|
50
55
|
const fetchFn = yield getFetchFn();
|
|
51
56
|
try {
|
|
52
57
|
const response = yield requestWithRetries(() => __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
|
|
58
|
+
var _a;
|
|
59
|
+
return makeRequest(fetchFn, url, args.method, yield getHeaders(args), requestBody, args.timeoutMs, args.abortSignal, (_a = args.withCredentials) !== null && _a !== void 0 ? _a : getDefaultWithCredentials(), args.duplex);
|
|
54
60
|
}), args.maxRetries);
|
|
55
61
|
if (response.status >= 200 && response.status < 400) {
|
|
56
62
|
return {
|
|
@@ -47,6 +47,8 @@ export declare namespace CortiClient {
|
|
|
47
47
|
baseUrl?: core.Supplier<string>;
|
|
48
48
|
/** Patch: added new option to encode headers as WebSocket protocols for streaming resources (for proxy scenarios) */
|
|
49
49
|
encodeHeadersAsWsProtocols?: boolean;
|
|
50
|
+
/** Patch: when true, fetcher sends credentials (cookies, auth headers) on cross-origin requests; sets global default used by core fetcher when not passed per-request */
|
|
51
|
+
withCredentials?: boolean;
|
|
50
52
|
}
|
|
51
53
|
interface OptionsWithClientCredentials extends BaseOptions {
|
|
52
54
|
/**
|
|
@@ -85,6 +87,7 @@ export declare namespace CortiClient {
|
|
|
85
87
|
* - made clientId and clientSecret optional
|
|
86
88
|
* - updated environment type to CortiInternalEnvironment
|
|
87
89
|
* - added `encodeHeadersAsWsProtocols`
|
|
90
|
+
* - added `withCredentials`
|
|
88
91
|
*/
|
|
89
92
|
interface InternalOptions {
|
|
90
93
|
environment: CortiInternalEnvironment;
|
|
@@ -98,6 +101,7 @@ export declare namespace CortiClient {
|
|
|
98
101
|
/** Additional headers to include in requests. */
|
|
99
102
|
headers?: HeadersRecord;
|
|
100
103
|
encodeHeadersAsWsProtocols?: boolean;
|
|
104
|
+
withCredentials?: boolean;
|
|
101
105
|
}
|
|
102
106
|
interface RequestOptions {
|
|
103
107
|
/** The maximum time to wait for a response in seconds. */
|
|
@@ -49,6 +49,7 @@ import { SDK_VERSION } from "../version.mjs";
|
|
|
49
49
|
import { getEnvironment } from "./utils/getEnvironmentFromString.mjs";
|
|
50
50
|
import { resolveClientOptions } from "./utils/resolveClientOptions.mjs";
|
|
51
51
|
import { RefreshBearerProvider } from "./RefreshBearerProvider.mjs";
|
|
52
|
+
import { setDefaultWithCredentials } from "./utils/withCredentialsConfig.mjs";
|
|
52
53
|
export class CortiClient {
|
|
53
54
|
constructor(_options) {
|
|
54
55
|
/**
|
|
@@ -69,7 +70,13 @@ export class CortiClient {
|
|
|
69
70
|
"User-Agent": `@corti/sdk/${SDK_VERSION}`,
|
|
70
71
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
71
72
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
72
|
-
}, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: _options.auth && "clientId" in _options.auth ? _options.auth.clientId : undefined, clientSecret: _options.auth && "clientSecret" in _options.auth ? _options.auth.clientSecret : undefined, token: _options.auth && "accessToken" in _options.auth ? _options.auth.accessToken : undefined, tenantName, environment: getEnvironment(environment) });
|
|
73
|
+
}, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: _options.auth && "clientId" in _options.auth ? _options.auth.clientId : undefined, clientSecret: _options.auth && "clientSecret" in _options.auth ? _options.auth.clientSecret : undefined, token: _options.auth && "accessToken" in _options.auth ? _options.auth.accessToken : undefined, tenantName, environment: getEnvironment(environment), withCredentials: _options.withCredentials });
|
|
74
|
+
/**
|
|
75
|
+
* Patch: set global default for fetcher withCredentials when passed on CortiClient
|
|
76
|
+
*/
|
|
77
|
+
if (_options.withCredentials !== undefined) {
|
|
78
|
+
setDefaultWithCredentials(_options.withCredentials);
|
|
79
|
+
}
|
|
73
80
|
/**
|
|
74
81
|
* Patch: if `clientId` is provided, use OAuthTokenProvider, otherwise use BearerProvider
|
|
75
82
|
* Only create token provider when auth is provided
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global default for fetcher withCredentials. Set by CortiClient when withCredentials
|
|
3
|
+
* is passed in options; the core fetcher reads this when args.withCredentials is undefined.
|
|
4
|
+
*/
|
|
5
|
+
let defaultWithCredentials = undefined;
|
|
6
|
+
export function getDefaultWithCredentials() {
|
|
7
|
+
return defaultWithCredentials;
|
|
8
|
+
}
|
|
9
|
+
export function setDefaultWithCredentials(value) {
|
|
10
|
+
defaultWithCredentials = value;
|
|
11
|
+
}
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.10.
|
|
1
|
+
export declare const SDK_VERSION = "0.10.1";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.10.
|
|
1
|
+
export const SDK_VERSION = "0.10.1";
|