@@ -14,11 +14,13 @@ export declare namespace Connectors {
14
14
environment ?: core . Supplier < environments . CohereEnvironment | string > ;
15
15
token ?: core . Supplier < core . BearerToken | undefined > ;
16
16
clientName ?: core . Supplier < string | undefined > ;
17
+ fetcher ?: core . FetchFunction ;
17
18
}
18
19
19
20
interface RequestOptions {
20
21
timeoutInSeconds ?: number ;
21
22
maxRetries ?: number ;
23
+ abortSignal ?: AbortSignal ;
22
24
}
23
25
}
24
26
@@ -52,7 +54,7 @@ export class Connectors {
52
54
_queryParams [ "offset" ] = offset . toString ( ) ;
53
55
}
54
56
55
- const _response = await core . fetcher ( {
57
+ const _response = await ( this . _options . fetcher ?? core . fetcher ) ( {
56
58
url : urlJoin (
57
59
( await core . Supplier . get ( this . _options . environment ) ) ?? environments . CohereEnvironment . Production ,
58
60
"connectors"
@@ -66,14 +68,15 @@ export class Connectors {
66
68
: undefined ,
67
69
"X-Fern-Language" : "JavaScript" ,
68
70
"X-Fern-SDK-Name" : "cohere-ai" ,
69
- "X-Fern-SDK-Version" : "7.10.1 " ,
71
+ "X-Fern-SDK-Version" : "7.10.2 " ,
70
72
"X-Fern-Runtime" : core . RUNTIME . type ,
71
73
"X-Fern-Runtime-Version" : core . RUNTIME . version ,
72
74
} ,
73
75
contentType : "application/json" ,
74
76
queryParameters : _queryParams ,
75
77
timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 300000 ,
76
78
maxRetries : requestOptions ?. maxRetries ,
79
+ abortSignal : requestOptions ?. abortSignal ,
77
80
} ) ;
78
81
if ( _response . ok ) {
79
82
return await serializers . ListConnectorsResponse . parseOrThrow ( _response . body , {
@@ -145,7 +148,7 @@ export class Connectors {
145
148
request : Cohere . CreateConnectorRequest ,
146
149
requestOptions ?: Connectors . RequestOptions
147
150
) : Promise < Cohere . CreateConnectorResponse > {
148
- const _response = await core . fetcher ( {
151
+ const _response = await ( this . _options . fetcher ?? core . fetcher ) ( {
149
152
url : urlJoin (
150
153
( await core . Supplier . get ( this . _options . environment ) ) ?? environments . CohereEnvironment . Production ,
151
154
"connectors"
@@ -159,7 +162,7 @@ export class Connectors {
159
162
: undefined ,
160
163
"X-Fern-Language" : "JavaScript" ,
161
164
"X-Fern-SDK-Name" : "cohere-ai" ,
162
- "X-Fern-SDK-Version" : "7.10.1 " ,
165
+ "X-Fern-SDK-Version" : "7.10.2 " ,
163
166
"X-Fern-Runtime" : core . RUNTIME . type ,
164
167
"X-Fern-Runtime-Version" : core . RUNTIME . version ,
165
168
} ,
@@ -171,6 +174,7 @@ export class Connectors {
171
174
} ) ,
172
175
timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 300000 ,
173
176
maxRetries : requestOptions ?. maxRetries ,
177
+ abortSignal : requestOptions ?. abortSignal ,
174
178
} ) ;
175
179
if ( _response . ok ) {
176
180
return await serializers . CreateConnectorResponse . parseOrThrow ( _response . body , {
@@ -238,7 +242,7 @@ export class Connectors {
238
242
* await cohere.connectors.get("id")
239
243
*/
240
244
public async get ( id : string , requestOptions ?: Connectors . RequestOptions ) : Promise < Cohere . GetConnectorResponse > {
241
- const _response = await core . fetcher ( {
245
+ const _response = await ( this . _options . fetcher ?? core . fetcher ) ( {
242
246
url : urlJoin (
243
247
( await core . Supplier . get ( this . _options . environment ) ) ?? environments . CohereEnvironment . Production ,
244
248
`connectors/${ encodeURIComponent ( id ) } `
@@ -252,13 +256,14 @@ export class Connectors {
252
256
: undefined ,
253
257
"X-Fern-Language" : "JavaScript" ,
254
258
"X-Fern-SDK-Name" : "cohere-ai" ,
255
- "X-Fern-SDK-Version" : "7.10.1 " ,
259
+ "X-Fern-SDK-Version" : "7.10.2 " ,
256
260
"X-Fern-Runtime" : core . RUNTIME . type ,
257
261
"X-Fern-Runtime-Version" : core . RUNTIME . version ,
258
262
} ,
259
263
contentType : "application/json" ,
260
264
timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 300000 ,
261
265
maxRetries : requestOptions ?. maxRetries ,
266
+ abortSignal : requestOptions ?. abortSignal ,
262
267
} ) ;
263
268
if ( _response . ok ) {
264
269
return await serializers . GetConnectorResponse . parseOrThrow ( _response . body , {
@@ -330,7 +335,7 @@ export class Connectors {
330
335
id : string ,
331
336
requestOptions ?: Connectors . RequestOptions
332
337
) : Promise < Cohere . DeleteConnectorResponse > {
333
- const _response = await core . fetcher ( {
338
+ const _response = await ( this . _options . fetcher ?? core . fetcher ) ( {
334
339
url : urlJoin (
335
340
( await core . Supplier . get ( this . _options . environment ) ) ?? environments . CohereEnvironment . Production ,
336
341
`connectors/${ encodeURIComponent ( id ) } `
@@ -344,13 +349,14 @@ export class Connectors {
344
349
: undefined ,
345
350
"X-Fern-Language" : "JavaScript" ,
346
351
"X-Fern-SDK-Name" : "cohere-ai" ,
347
- "X-Fern-SDK-Version" : "7.10.1 " ,
352
+ "X-Fern-SDK-Version" : "7.10.2 " ,
348
353
"X-Fern-Runtime" : core . RUNTIME . type ,
349
354
"X-Fern-Runtime-Version" : core . RUNTIME . version ,
350
355
} ,
351
356
contentType : "application/json" ,
352
357
timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 300000 ,
353
358
maxRetries : requestOptions ?. maxRetries ,
359
+ abortSignal : requestOptions ?. abortSignal ,
354
360
} ) ;
355
361
if ( _response . ok ) {
356
362
return await serializers . DeleteConnectorResponse . parseOrThrow ( _response . body , {
@@ -426,7 +432,7 @@ export class Connectors {
426
432
request : Cohere . UpdateConnectorRequest = { } ,
427
433
requestOptions ?: Connectors . RequestOptions
428
434
) : Promise < Cohere . UpdateConnectorResponse > {
429
- const _response = await core . fetcher ( {
435
+ const _response = await ( this . _options . fetcher ?? core . fetcher ) ( {
430
436
url : urlJoin (
431
437
( await core . Supplier . get ( this . _options . environment ) ) ?? environments . CohereEnvironment . Production ,
432
438
`connectors/${ encodeURIComponent ( id ) } `
@@ -440,7 +446,7 @@ export class Connectors {
440
446
: undefined ,
441
447
"X-Fern-Language" : "JavaScript" ,
442
448
"X-Fern-SDK-Name" : "cohere-ai" ,
443
- "X-Fern-SDK-Version" : "7.10.1 " ,
449
+ "X-Fern-SDK-Version" : "7.10.2 " ,
444
450
"X-Fern-Runtime" : core . RUNTIME . type ,
445
451
"X-Fern-Runtime-Version" : core . RUNTIME . version ,
446
452
} ,
@@ -452,6 +458,7 @@ export class Connectors {
452
458
} ) ,
453
459
timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 300000 ,
454
460
maxRetries : requestOptions ?. maxRetries ,
461
+ abortSignal : requestOptions ?. abortSignal ,
455
462
} ) ;
456
463
if ( _response . ok ) {
457
464
return await serializers . UpdateConnectorResponse . parseOrThrow ( _response . body , {
@@ -532,7 +539,7 @@ export class Connectors {
532
539
_queryParams [ "after_token_redirect" ] = afterTokenRedirect ;
533
540
}
534
541
535
- const _response = await core . fetcher ( {
542
+ const _response = await ( this . _options . fetcher ?? core . fetcher ) ( {
536
543
url : urlJoin (
537
544
( await core . Supplier . get ( this . _options . environment ) ) ?? environments . CohereEnvironment . Production ,
538
545
`connectors/${ encodeURIComponent ( id ) } /oauth/authorize`
@@ -546,14 +553,15 @@ export class Connectors {
546
553
: undefined ,
547
554
"X-Fern-Language" : "JavaScript" ,
548
555
"X-Fern-SDK-Name" : "cohere-ai" ,
549
- "X-Fern-SDK-Version" : "7.10.1 " ,
556
+ "X-Fern-SDK-Version" : "7.10.2 " ,
550
557
"X-Fern-Runtime" : core . RUNTIME . type ,
551
558
"X-Fern-Runtime-Version" : core . RUNTIME . version ,
552
559
} ,
553
560
contentType : "application/json" ,
554
561
queryParameters : _queryParams ,
555
562
timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 300000 ,
556
563
maxRetries : requestOptions ?. maxRetries ,
564
+ abortSignal : requestOptions ?. abortSignal ,
557
565
} ) ;
558
566
if ( _response . ok ) {
559
567
return await serializers . OAuthAuthorizeResponse . parseOrThrow ( _response . body , {
0 commit comments