Skip to content

Commit 23999cd

Browse files
fix: remove Keep-Alive header that causes fetch failures in Node.js/Lambda
The Keep-Alive header with default value 'timeout=200' was causing all API requests to fail in Node.js environments (including AWS Lambda) because Node's undici HTTP client rejects this header as invalid. Error: InvalidArgumentError: invalid keep-alive header code: 'UND_ERR_INVALID_ARG' This removes the Keep-Alive header from all API requests and the keepAlive option from the Options and RequestOptions interfaces. Fixes DEVXP-74 Co-Authored-By: christopher.harrison@flatfile.io <cnharrison@gmail.com>
1 parent 9e39ed0 commit 23999cd

File tree

42 files changed

+1
-440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1
-440
lines changed

src/Client.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ export declare namespace FlatfileClient {
5353
token?: core.Supplier<core.BearerToken | undefined>;
5454
/** Override the X-Disable-Hooks header */
5555
xDisableHooks?: "true";
56-
/** Override the Keep-Alive header */
57-
keepAlive?: "timeout=200";
5856
fetcher?: core.FetchFunction;
5957
}
6058

@@ -67,8 +65,6 @@ export declare namespace FlatfileClient {
6765
abortSignal?: AbortSignal;
6866
/** Override the X-Disable-Hooks header */
6967
xDisableHooks?: "true";
70-
/** Override the Keep-Alive header */
71-
keepAlive?: "timeout=200";
7268
/** Additional headers to include in the request. */
7369
headers?: Record<string, string>;
7470
}

src/api/resources/accounts/client/Client.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ export declare namespace Accounts {
1717
token?: core.Supplier<core.BearerToken | undefined>;
1818
/** Override the X-Disable-Hooks header */
1919
xDisableHooks?: "true";
20-
/** Override the Keep-Alive header */
21-
keepAlive?: "timeout=200";
2220
fetcher?: core.FetchFunction;
2321
}
2422

@@ -31,8 +29,6 @@ export declare namespace Accounts {
3129
abortSignal?: AbortSignal;
3230
/** Override the X-Disable-Hooks header */
3331
xDisableHooks?: "true";
34-
/** Override the Keep-Alive header */
35-
keepAlive?: "timeout=200";
3632
/** Additional headers to include in the request. */
3733
headers?: Record<string, string>;
3834
}
@@ -67,7 +63,6 @@ export class Accounts {
6763
headers: {
6864
Authorization: await this._getAuthorizationHeader(),
6965
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
70-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
7166
"X-Fern-Language": "JavaScript",
7267
"X-Fern-SDK-Name": "@flatfile/api",
7368
"X-Fern-SDK-Version": "1.23.1",
@@ -154,7 +149,6 @@ export class Accounts {
154149
headers: {
155150
Authorization: await this._getAuthorizationHeader(),
156151
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
157-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
158152
"X-Fern-Language": "JavaScript",
159153
"X-Fern-SDK-Name": "@flatfile/api",
160154
"X-Fern-SDK-Version": "1.23.1",

src/api/resources/actions/client/Client.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ export declare namespace Actions {
1717
token?: core.Supplier<core.BearerToken | undefined>;
1818
/** Override the X-Disable-Hooks header */
1919
xDisableHooks?: "true";
20-
/** Override the Keep-Alive header */
21-
keepAlive?: "timeout=200";
2220
fetcher?: core.FetchFunction;
2321
}
2422

@@ -31,8 +29,6 @@ export declare namespace Actions {
3129
abortSignal?: AbortSignal;
3230
/** Override the X-Disable-Hooks header */
3331
xDisableHooks?: "true";
34-
/** Override the Keep-Alive header */
35-
keepAlive?: "timeout=200";
3632
/** Additional headers to include in the request. */
3733
headers?: Record<string, string>;
3834
}
@@ -79,7 +75,6 @@ export class Actions {
7975
headers: {
8076
Authorization: await this._getAuthorizationHeader(),
8177
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
82-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
8378
"X-Fern-Language": "JavaScript",
8479
"X-Fern-SDK-Name": "@flatfile/api",
8580
"X-Fern-SDK-Version": "1.23.1",
@@ -175,7 +170,6 @@ export class Actions {
175170
headers: {
176171
Authorization: await this._getAuthorizationHeader(),
177172
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
178-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
179173
"X-Fern-Language": "JavaScript",
180174
"X-Fern-SDK-Name": "@flatfile/api",
181175
"X-Fern-SDK-Version": "1.23.1",
@@ -264,7 +258,6 @@ export class Actions {
264258
headers: {
265259
Authorization: await this._getAuthorizationHeader(),
266260
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
267-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
268261
"X-Fern-Language": "JavaScript",
269262
"X-Fern-SDK-Name": "@flatfile/api",
270263
"X-Fern-SDK-Version": "1.23.1",
@@ -347,7 +340,6 @@ export class Actions {
347340
headers: {
348341
Authorization: await this._getAuthorizationHeader(),
349342
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
350-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
351343
"X-Fern-Language": "JavaScript",
352344
"X-Fern-SDK-Name": "@flatfile/api",
353345
"X-Fern-SDK-Version": "1.23.1",
@@ -432,7 +424,6 @@ export class Actions {
432424
headers: {
433425
Authorization: await this._getAuthorizationHeader(),
434426
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
435-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
436427
"X-Fern-Language": "JavaScript",
437428
"X-Fern-SDK-Name": "@flatfile/api",
438429
"X-Fern-SDK-Version": "1.23.1",
@@ -515,7 +506,6 @@ export class Actions {
515506
headers: {
516507
Authorization: await this._getAuthorizationHeader(),
517508
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
518-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
519509
"X-Fern-Language": "JavaScript",
520510
"X-Fern-SDK-Name": "@flatfile/api",
521511
"X-Fern-SDK-Version": "1.23.1",

src/api/resources/agentExports/client/Client.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ export declare namespace AgentExports {
1818
token?: core.Supplier<core.BearerToken | undefined>;
1919
/** Override the X-Disable-Hooks header */
2020
xDisableHooks?: "true";
21-
/** Override the Keep-Alive header */
22-
keepAlive?: "timeout=200";
2321
fetcher?: core.FetchFunction;
2422
}
2523

@@ -32,8 +30,6 @@ export declare namespace AgentExports {
3230
abortSignal?: AbortSignal;
3331
/** Override the X-Disable-Hooks header */
3432
xDisableHooks?: "true";
35-
/** Override the Keep-Alive header */
36-
keepAlive?: "timeout=200";
3733
/** Additional headers to include in the request. */
3834
headers?: Record<string, string>;
3935
}
@@ -89,7 +85,6 @@ export class AgentExports {
8985
headers: {
9086
Authorization: await this._getAuthorizationHeader(),
9187
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
92-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
9388
"X-Fern-Language": "JavaScript",
9489
"X-Fern-SDK-Name": "@flatfile/api",
9590
"X-Fern-SDK-Version": "1.23.1",
@@ -172,7 +167,6 @@ export class AgentExports {
172167
headers: {
173168
Authorization: await this._getAuthorizationHeader(),
174169
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
175-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
176170
"X-Fern-Language": "JavaScript",
177171
"X-Fern-SDK-Name": "@flatfile/api",
178172
"X-Fern-SDK-Version": "1.23.1",
@@ -249,7 +243,6 @@ export class AgentExports {
249243
headers: {
250244
Authorization: await this._getAuthorizationHeader(),
251245
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
252-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
253246
"X-Fern-Language": "JavaScript",
254247
"X-Fern-SDK-Name": "@flatfile/api",
255248
"X-Fern-SDK-Version": "1.23.1",
@@ -325,7 +318,6 @@ export class AgentExports {
325318
headers: {
326319
Authorization: await this._getAuthorizationHeader(),
327320
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
328-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
329321
"X-Fern-Language": "JavaScript",
330322
"X-Fern-SDK-Name": "@flatfile/api",
331323
"X-Fern-SDK-Version": "1.23.1",

src/api/resources/agents/client/Client.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ export declare namespace Agents {
1717
token?: core.Supplier<core.BearerToken | undefined>;
1818
/** Override the X-Disable-Hooks header */
1919
xDisableHooks?: "true";
20-
/** Override the Keep-Alive header */
21-
keepAlive?: "timeout=200";
2220
fetcher?: core.FetchFunction;
2321
}
2422

@@ -31,8 +29,6 @@ export declare namespace Agents {
3129
abortSignal?: AbortSignal;
3230
/** Override the X-Disable-Hooks header */
3331
xDisableHooks?: "true";
34-
/** Override the Keep-Alive header */
35-
keepAlive?: "timeout=200";
3632
/** Additional headers to include in the request. */
3733
headers?: Record<string, string>;
3834
}
@@ -93,7 +89,6 @@ export class Agents {
9389
headers: {
9490
Authorization: await this._getAuthorizationHeader(),
9591
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
96-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
9792
"X-Fern-Language": "JavaScript",
9893
"X-Fern-SDK-Name": "@flatfile/api",
9994
"X-Fern-SDK-Version": "1.23.1",
@@ -189,7 +184,6 @@ export class Agents {
189184
headers: {
190185
Authorization: await this._getAuthorizationHeader(),
191186
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
192-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
193187
"X-Fern-Language": "JavaScript",
194188
"X-Fern-SDK-Name": "@flatfile/api",
195189
"X-Fern-SDK-Version": "1.23.1",
@@ -301,7 +295,6 @@ export class Agents {
301295
headers: {
302296
Authorization: await this._getAuthorizationHeader(),
303297
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
304-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
305298
"X-Fern-Language": "JavaScript",
306299
"X-Fern-SDK-Name": "@flatfile/api",
307300
"X-Fern-SDK-Version": "1.23.1",
@@ -412,7 +405,6 @@ export class Agents {
412405
headers: {
413406
Authorization: await this._getAuthorizationHeader(),
414407
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
415-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
416408
"X-Fern-Language": "JavaScript",
417409
"X-Fern-SDK-Name": "@flatfile/api",
418410
"X-Fern-SDK-Version": "1.23.1",
@@ -525,7 +517,6 @@ export class Agents {
525517
headers: {
526518
Authorization: await this._getAuthorizationHeader(),
527519
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
528-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
529520
"X-Fern-Language": "JavaScript",
530521
"X-Fern-SDK-Name": "@flatfile/api",
531522
"X-Fern-SDK-Version": "1.23.1",
@@ -640,7 +631,6 @@ export class Agents {
640631
headers: {
641632
Authorization: await this._getAuthorizationHeader(),
642633
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
643-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
644634
"X-Fern-Language": "JavaScript",
645635
"X-Fern-SDK-Name": "@flatfile/api",
646636
"X-Fern-SDK-Version": "1.23.1",
@@ -770,7 +760,6 @@ export class Agents {
770760
headers: {
771761
Authorization: await this._getAuthorizationHeader(),
772762
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
773-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
774763
"X-Fern-Language": "JavaScript",
775764
"X-Fern-SDK-Name": "@flatfile/api",
776765
"X-Fern-SDK-Version": "1.23.1",
@@ -898,7 +887,6 @@ export class Agents {
898887
headers: {
899888
Authorization: await this._getAuthorizationHeader(),
900889
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
901-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
902890
"X-Fern-Language": "JavaScript",
903891
"X-Fern-SDK-Name": "@flatfile/api",
904892
"X-Fern-SDK-Version": "1.23.1",
@@ -1029,7 +1017,6 @@ export class Agents {
10291017
headers: {
10301018
Authorization: await this._getAuthorizationHeader(),
10311019
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
1032-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
10331020
"X-Fern-Language": "JavaScript",
10341021
"X-Fern-SDK-Name": "@flatfile/api",
10351022
"X-Fern-SDK-Version": "1.23.1",
@@ -1148,7 +1135,6 @@ export class Agents {
11481135
headers: {
11491136
Authorization: await this._getAuthorizationHeader(),
11501137
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
1151-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
11521138
"X-Fern-Language": "JavaScript",
11531139
"X-Fern-SDK-Name": "@flatfile/api",
11541140
"X-Fern-SDK-Version": "1.23.1",
@@ -1284,7 +1270,6 @@ export class Agents {
12841270
headers: {
12851271
Authorization: await this._getAuthorizationHeader(),
12861272
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
1287-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
12881273
"X-Fern-Language": "JavaScript",
12891274
"X-Fern-SDK-Name": "@flatfile/api",
12901275
"X-Fern-SDK-Version": "1.23.1",
@@ -1425,7 +1410,6 @@ export class Agents {
14251410
headers: {
14261411
Authorization: await this._getAuthorizationHeader(),
14271412
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
1428-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
14291413
"X-Fern-Language": "JavaScript",
14301414
"X-Fern-SDK-Name": "@flatfile/api",
14311415
"X-Fern-SDK-Version": "1.23.1",
@@ -1547,7 +1531,6 @@ export class Agents {
15471531
headers: {
15481532
Authorization: await this._getAuthorizationHeader(),
15491533
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
1550-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
15511534
"X-Fern-Language": "JavaScript",
15521535
"X-Fern-SDK-Name": "@flatfile/api",
15531536
"X-Fern-SDK-Version": "1.23.1",

src/api/resources/analysis/client/Client.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ export declare namespace Analysis {
1818
token?: core.Supplier<core.BearerToken | undefined>;
1919
/** Override the X-Disable-Hooks header */
2020
xDisableHooks?: "true";
21-
/** Override the Keep-Alive header */
22-
keepAlive?: "timeout=200";
2321
fetcher?: core.FetchFunction;
2422
}
2523

@@ -32,8 +30,6 @@ export declare namespace Analysis {
3230
abortSignal?: AbortSignal;
3331
/** Override the X-Disable-Hooks header */
3432
xDisableHooks?: "true";
35-
/** Override the Keep-Alive header */
36-
keepAlive?: "timeout=200";
3733
/** Additional headers to include in the request. */
3834
headers?: Record<string, string>;
3935
}
@@ -84,7 +80,6 @@ export class Analysis {
8480
headers: {
8581
Authorization: await this._getAuthorizationHeader(),
8682
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
87-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
8883
"X-Fern-Language": "JavaScript",
8984
"X-Fern-SDK-Name": "@flatfile/api",
9085
"X-Fern-SDK-Version": "1.23.1",
@@ -183,7 +178,6 @@ export class Analysis {
183178
headers: {
184179
Authorization: await this._getAuthorizationHeader(),
185180
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
186-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
187181
"X-Fern-Language": "JavaScript",
188182
"X-Fern-SDK-Name": "@flatfile/api",
189183
"X-Fern-SDK-Version": "1.23.1",
@@ -274,7 +268,6 @@ export class Analysis {
274268
headers: {
275269
Authorization: await this._getAuthorizationHeader(),
276270
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
277-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
278271
"X-Fern-Language": "JavaScript",
279272
"X-Fern-SDK-Name": "@flatfile/api",
280273
"X-Fern-SDK-Version": "1.23.1",
@@ -365,7 +358,6 @@ export class Analysis {
365358
headers: {
366359
Authorization: await this._getAuthorizationHeader(),
367360
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
368-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
369361
"X-Fern-Language": "JavaScript",
370362
"X-Fern-SDK-Name": "@flatfile/api",
371363
"X-Fern-SDK-Version": "1.23.1",
@@ -453,7 +445,6 @@ export class Analysis {
453445
headers: {
454446
Authorization: await this._getAuthorizationHeader(),
455447
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
456-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
457448
"X-Fern-Language": "JavaScript",
458449
"X-Fern-SDK-Name": "@flatfile/api",
459450
"X-Fern-SDK-Version": "1.23.1",
@@ -552,7 +543,6 @@ export class Analysis {
552543
headers: {
553544
Authorization: await this._getAuthorizationHeader(),
554545
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
555-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
556546
"X-Fern-Language": "JavaScript",
557547
"X-Fern-SDK-Name": "@flatfile/api",
558548
"X-Fern-SDK-Version": "1.23.1",
@@ -651,7 +641,6 @@ export class Analysis {
651641
headers: {
652642
Authorization: await this._getAuthorizationHeader(),
653643
"X-Disable-Hooks": requestOptions?.xDisableHooks ?? this._options?.xDisableHooks ?? "true",
654-
"Keep-Alive": requestOptions?.keepAlive ?? this._options?.keepAlive ?? "timeout=200",
655644
"X-Fern-Language": "JavaScript",
656645
"X-Fern-SDK-Name": "@flatfile/api",
657646
"X-Fern-SDK-Version": "1.23.1",

0 commit comments

Comments
 (0)