@chainlink/external-adapter-framework 2.6.0 → 2.7.0

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.
Files changed (60) hide show
  1. package/README.md +1 -1
  2. package/adapter/types.d.ts +1 -1
  3. package/config/index.d.ts +4 -0
  4. package/config/index.js +4 -0
  5. package/config/index.js.map +1 -1
  6. package/debug/router.js +7 -36
  7. package/debug/router.js.map +1 -1
  8. package/debug/settings-page.d.ts +1 -7
  9. package/debug/settings-page.js +0 -22
  10. package/debug/settings-page.js.map +1 -1
  11. package/generator-adapter/generators/app/index.js +11 -5
  12. package/generator-adapter/node_modules/.yarn-integrity +2 -2
  13. package/generator-adapter/node_modules/@types/node/README.md +2 -2
  14. package/generator-adapter/node_modules/@types/node/async_hooks.d.ts +65 -1
  15. package/generator-adapter/node_modules/@types/node/buffer.buffer.d.ts +2 -0
  16. package/generator-adapter/node_modules/@types/node/buffer.d.ts +7 -2
  17. package/generator-adapter/node_modules/@types/node/cluster.d.ts +1 -1
  18. package/generator-adapter/node_modules/@types/node/compatibility/disposable.d.ts +0 -2
  19. package/generator-adapter/node_modules/@types/node/compatibility/indexable.d.ts +0 -3
  20. package/generator-adapter/node_modules/@types/node/compatibility/iterators.d.ts +0 -1
  21. package/generator-adapter/node_modules/@types/node/diagnostics_channel.d.ts +37 -13
  22. package/generator-adapter/node_modules/@types/node/dns/promises.d.ts +36 -9
  23. package/generator-adapter/node_modules/@types/node/dns.d.ts +73 -20
  24. package/generator-adapter/node_modules/@types/node/dom-events.d.ts +60 -85
  25. package/generator-adapter/node_modules/@types/node/events.d.ts +0 -1
  26. package/generator-adapter/node_modules/@types/node/fs/promises.d.ts +21 -17
  27. package/generator-adapter/node_modules/@types/node/fs.d.ts +94 -10
  28. package/generator-adapter/node_modules/@types/node/globals.d.ts +136 -283
  29. package/generator-adapter/node_modules/@types/node/http.d.ts +88 -1
  30. package/generator-adapter/node_modules/@types/node/http2.d.ts +69 -1
  31. package/generator-adapter/node_modules/@types/node/module.d.ts +113 -18
  32. package/generator-adapter/node_modules/@types/node/net.d.ts +15 -9
  33. package/generator-adapter/node_modules/@types/node/package.json +2 -2
  34. package/generator-adapter/node_modules/@types/node/perf_hooks.d.ts +2 -2
  35. package/generator-adapter/node_modules/@types/node/process.d.ts +0 -2
  36. package/generator-adapter/node_modules/@types/node/querystring.d.ts +2 -3
  37. package/generator-adapter/node_modules/@types/node/repl.d.ts +3 -5
  38. package/generator-adapter/node_modules/@types/node/sqlite.d.ts +172 -0
  39. package/generator-adapter/node_modules/@types/node/stream/web.d.ts +7 -3
  40. package/generator-adapter/node_modules/@types/node/stream.d.ts +6 -0
  41. package/generator-adapter/node_modules/@types/node/test.d.ts +1865 -1970
  42. package/generator-adapter/node_modules/@types/node/tls.d.ts +1 -1
  43. package/generator-adapter/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +2 -0
  44. package/generator-adapter/node_modules/@types/node/util.d.ts +28 -3
  45. package/generator-adapter/node_modules/@types/node/v8.d.ts +33 -0
  46. package/generator-adapter/node_modules/@types/node/vm.d.ts +61 -8
  47. package/generator-adapter/node_modules/@types/node/worker_threads.d.ts +48 -25
  48. package/generator-adapter/package.json +1 -1
  49. package/index.js +3 -0
  50. package/index.js.map +1 -1
  51. package/package.json +14 -15
  52. package/status/router.d.ts +49 -0
  53. package/status/router.js +55 -0
  54. package/status/router.js.map +1 -0
  55. package/transports/sse.d.ts +2 -2
  56. package/transports/sse.js +2 -5
  57. package/transports/sse.js.map +1 -1
  58. package/util/settings.d.ts +11 -0
  59. package/util/settings.js +29 -0
  60. package/util/settings.js.map +1 -0
@@ -18,43 +18,11 @@ type _EventSource = typeof globalThis extends { onmessage: any } ? {} : import("
18
18
 
19
19
  // Conditional type definitions for webstorage interface, which conflicts with lib.dom otherwise.
20
20
  type _Storage = typeof globalThis extends { onabort: any } ? {} : {
21
- /**
22
- * Returns the number of key/value pairs.
23
- *
24
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/length)
25
- */
26
21
  readonly length: number;
27
- /**
28
- * Removes all key/value pairs, if there are any.
29
- *
30
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/clear)
31
- */
32
22
  clear(): void;
33
- /**
34
- * Returns the current value associated with the given key, or null if the given key does not exist.
35
- *
36
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/getItem)
37
- */
38
23
  getItem(key: string): string | null;
39
- /**
40
- * Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs.
41
- *
42
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/key)
43
- */
44
24
  key(index: number): string | null;
45
- /**
46
- * Removes the key/value pair with the given key, if a key/value pair with the given key exists.
47
- *
48
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/removeItem)
49
- */
50
25
  removeItem(key: string): void;
51
- /**
52
- * Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
53
- *
54
- * Throws a "QuotaExceededError" DOMException exception if the new value couldn't be set.
55
- *
56
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/setItem)
57
- */
58
26
  setItem(key: string, value: string): void;
59
27
  [key: string]: any;
60
28
  };
@@ -62,15 +30,8 @@ type _Storage = typeof globalThis extends { onabort: any } ? {} : {
62
30
  // #region DOMException
63
31
  type _DOMException = typeof globalThis extends { onmessage: any } ? {} : NodeDOMException;
64
32
  interface NodeDOMException extends Error {
65
- /**
66
- * @deprecated
67
- *
68
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
69
- */
70
33
  readonly code: number;
71
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
72
34
  readonly message: string;
73
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
74
35
  readonly name: string;
75
36
  readonly INDEX_SIZE_ERR: 1;
76
37
  readonly DOMSTRING_SIZE_ERR: 2;
@@ -130,263 +91,104 @@ interface NodeDOMExceptionConstructor {
130
91
  // #endregion DOMException
131
92
 
132
93
  declare global {
133
- // Declare "static" methods in Error
134
- interface ErrorConstructor {
135
- /** Create .stack property on a target object */
136
- captureStackTrace(targetObject: object, constructorOpt?: Function): void;
137
-
138
- /**
139
- * Optional override for formatting stack traces
140
- *
141
- * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
142
- */
143
- prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
144
-
145
- stackTraceLimit: number;
146
- }
147
-
148
- /*-----------------------------------------------*
149
- * *
150
- * GLOBAL *
151
- * *
152
- ------------------------------------------------*/
153
-
154
94
  var global: typeof globalThis;
155
95
 
156
96
  var process: NodeJS.Process;
157
97
  var console: Console;
158
98
 
159
- interface GCFunction {
160
- (options: {
161
- execution?: "sync";
162
- flavor?: "regular" | "last-resort";
163
- type?: "major-snapshot" | "major" | "minor";
164
- filename?: string;
165
- }): void;
166
- (options: {
167
- execution: "async";
168
- flavor?: "regular" | "last-resort";
169
- type?: "major-snapshot" | "major" | "minor";
170
- filename?: string;
171
- }): Promise<void>;
172
- (options?: boolean): void;
173
- }
174
-
175
- /**
176
- * Only available if `--expose-gc` is passed to the process.
177
- */
178
- var gc: undefined | GCFunction;
179
-
180
- // #region borrowed
181
- // from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib
182
- /** A controller object that allows you to abort one or more DOM requests as and when desired. */
183
- interface AbortController {
99
+ interface ErrorConstructor {
184
100
  /**
185
- * Returns the AbortSignal object associated with this object.
101
+ * Creates a `.stack` property on `targetObject`, which when accessed returns
102
+ * a string representing the location in the code at which
103
+ * `Error.captureStackTrace()` was called.
104
+ *
105
+ * ```js
106
+ * const myObject = {};
107
+ * Error.captureStackTrace(myObject);
108
+ * myObject.stack; // Similar to `new Error().stack`
109
+ * ```
110
+ *
111
+ * The first line of the trace will be prefixed with
112
+ * `${myObject.name}: ${myObject.message}`.
113
+ *
114
+ * The optional `constructorOpt` argument accepts a function. If given, all frames
115
+ * above `constructorOpt`, including `constructorOpt`, will be omitted from the
116
+ * generated stack trace.
117
+ *
118
+ * The `constructorOpt` argument is useful for hiding implementation
119
+ * details of error generation from the user. For instance:
120
+ *
121
+ * ```js
122
+ * function a() {
123
+ * b();
124
+ * }
125
+ *
126
+ * function b() {
127
+ * c();
128
+ * }
129
+ *
130
+ * function c() {
131
+ * // Create an error without stack trace to avoid calculating the stack trace twice.
132
+ * const { stackTraceLimit } = Error;
133
+ * Error.stackTraceLimit = 0;
134
+ * const error = new Error();
135
+ * Error.stackTraceLimit = stackTraceLimit;
136
+ *
137
+ * // Capture the stack trace above function b
138
+ * Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
139
+ * throw error;
140
+ * }
141
+ *
142
+ * a();
143
+ * ```
186
144
  */
187
-
188
- readonly signal: AbortSignal;
145
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
189
146
  /**
190
- * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
147
+ * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
191
148
  */
192
- abort(reason?: any): void;
193
- }
194
-
195
- /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
196
- interface AbortSignal extends EventTarget {
149
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
197
150
  /**
198
- * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
151
+ * The `Error.stackTraceLimit` property specifies the number of stack frames
152
+ * collected by a stack trace (whether generated by `new Error().stack` or
153
+ * `Error.captureStackTrace(obj)`).
154
+ *
155
+ * The default value is `10` but may be set to any valid JavaScript number. Changes
156
+ * will affect any stack trace captured _after_ the value has been changed.
157
+ *
158
+ * If set to a non-number value, or set to a negative number, stack traces will
159
+ * not capture any frames.
199
160
  */
200
- readonly aborted: boolean;
201
- readonly reason: any;
202
- onabort: null | ((this: AbortSignal, event: Event) => any);
203
- throwIfAborted(): void;
161
+ stackTraceLimit: number;
204
162
  }
205
163
 
206
- var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
207
- : {
208
- prototype: AbortController;
209
- new(): AbortController;
210
- };
211
-
212
- var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
213
- : {
214
- prototype: AbortSignal;
215
- new(): AbortSignal;
216
- abort(reason?: any): AbortSignal;
217
- timeout(milliseconds: number): AbortSignal;
218
- any(signals: AbortSignal[]): AbortSignal;
219
- };
220
- // #endregion borrowed
221
-
222
- // #region Storage
223
- /**
224
- * This Web Storage API interface provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items.
225
- *
226
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage)
227
- */
228
- interface Storage extends _Storage {}
229
-
230
- // Conditional on `onabort` rather than `onmessage`, in order to exclude lib.webworker
231
- var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T
232
- : {
233
- prototype: Storage;
234
- new(): Storage;
235
- };
236
-
237
- /**
238
- * A browser-compatible implementation of [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage). Data is stored
239
- * unencrypted in the file specified by the `--localstorage-file` CLI flag.
240
- * The maximum amount of data that can be stored is 10 MB.
241
- * Any modification of this data outside of the Web Storage API is not supported.
242
- * Enable this API with the `--experimental-webstorage` CLI flag.
243
- * `localStorage` data is not stored per user or per request when used in the context
244
- * of a server, it is shared across all users and requests.
245
- * @since v22.4.0
246
- */
247
- var localStorage: Storage;
248
-
249
- /**
250
- * A browser-compatible implementation of [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage). Data is stored in
251
- * memory, with a storage quota of 10 MB. `sessionStorage` data persists only within
252
- * the currently running process, and is not shared between workers.
253
- * @since v22.4.0
254
- */
255
- var sessionStorage: Storage;
256
- // #endregion Storage
257
-
258
- /**
259
- * @since v17.0.0
260
- *
261
- * Creates a deep clone of an object.
262
- */
263
- function structuredClone<T>(
264
- value: T,
265
- transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
266
- ): T;
267
-
268
- // #region DOMException
269
164
  /**
270
- * @since v17.0.0
271
- * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
272
- *
273
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
165
+ * Enable this API with the `--expose-gc` CLI flag.
274
166
  */
275
- interface DOMException extends _DOMException {}
167
+ var gc: NodeJS.GCFunction | undefined;
276
168
 
277
- /**
278
- * @since v17.0.0
279
- *
280
- * The WHATWG `DOMException` class. See [DOMException](https://developer.mozilla.org/docs/Web/API/DOMException) for more details.
281
- */
282
- var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T
283
- : NodeDOMExceptionConstructor;
284
- // #endregion DOMException
285
-
286
- /*----------------------------------------------*
287
- * *
288
- * GLOBAL INTERFACES *
289
- * *
290
- *-----------------------------------------------*/
291
169
  namespace NodeJS {
292
170
  interface CallSite {
293
- /**
294
- * Value of "this"
295
- */
296
- getThis(): unknown;
297
-
298
- /**
299
- * Type of "this" as a string.
300
- * This is the name of the function stored in the constructor field of
301
- * "this", if available. Otherwise the object's [[Class]] internal
302
- * property.
303
- */
304
- getTypeName(): string | null;
305
-
306
- /**
307
- * Current function
308
- */
171
+ getColumnNumber(): number | null;
172
+ getEnclosingColumnNumber(): number | null;
173
+ getEnclosingLineNumber(): number | null;
174
+ getEvalOrigin(): string | undefined;
175
+ getFileName(): string | null;
309
176
  getFunction(): Function | undefined;
310
-
311
- /**
312
- * Name of the current function, typically its name property.
313
- * If a name property is not available an attempt will be made to try
314
- * to infer a name from the function's context.
315
- */
316
177
  getFunctionName(): string | null;
317
-
318
- /**
319
- * Name of the property [of "this" or one of its prototypes] that holds
320
- * the current function
321
- */
322
- getMethodName(): string | null;
323
-
324
- /**
325
- * Name of the script [if this function was defined in a script]
326
- */
327
- getFileName(): string | undefined;
328
-
329
- /**
330
- * Current line number [if this function was defined in a script]
331
- */
332
178
  getLineNumber(): number | null;
333
-
334
- /**
335
- * Current column number [if this function was defined in a script]
336
- */
337
- getColumnNumber(): number | null;
338
-
339
- /**
340
- * A call site object representing the location where eval was called
341
- * [if this function was created using a call to eval]
342
- */
343
- getEvalOrigin(): string | undefined;
344
-
345
- /**
346
- * Is this a toplevel invocation, that is, is "this" the global object?
347
- */
348
- isToplevel(): boolean;
349
-
350
- /**
351
- * Does this call take place in code defined by a call to eval?
352
- */
179
+ getMethodName(): string | null;
180
+ getPosition(): number;
181
+ getPromiseIndex(): number | null;
182
+ getScriptHash(): string;
183
+ getScriptNameOrSourceURL(): string | null;
184
+ getThis(): unknown;
185
+ getTypeName(): string | null;
186
+ isAsync(): boolean;
187
+ isConstructor(): boolean;
353
188
  isEval(): boolean;
354
-
355
- /**
356
- * Is this call in native V8 code?
357
- */
358
189
  isNative(): boolean;
359
-
360
- /**
361
- * Is this a constructor call?
362
- */
363
- isConstructor(): boolean;
364
-
365
- /**
366
- * is this an async call (i.e. await, Promise.all(), or Promise.any())?
367
- */
368
- isAsync(): boolean;
369
-
370
- /**
371
- * is this an async call to Promise.all()?
372
- */
373
190
  isPromiseAll(): boolean;
374
-
375
- /**
376
- * returns the index of the promise element that was followed in
377
- * Promise.all() or Promise.any() for async stack traces, or null
378
- * if the CallSite is not an async
379
- */
380
- getPromiseIndex(): number | null;
381
-
382
- getScriptNameOrSourceURL(): string;
383
- getScriptHash(): string;
384
-
385
- getEnclosingColumnNumber(): number;
386
- getEnclosingLineNumber(): number;
387
- getPosition(): number;
388
-
389
- toString(): string;
191
+ isToplevel(): boolean;
390
192
  }
391
193
 
392
194
  interface ErrnoException extends Error {
@@ -407,7 +209,7 @@ declare global {
407
209
  unpipe(destination?: WritableStream): this;
408
210
  unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
409
211
  wrap(oldStream: ReadableStream): this;
410
- [Symbol.asyncIterator](): NodeJS.AsyncIterator<string | Buffer>;
212
+ [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
411
213
  }
412
214
 
413
215
  interface WritableStream extends EventEmitter {
@@ -434,21 +236,79 @@ declare global {
434
236
  readonly [key: string]: T | undefined;
435
237
  }
436
238
 
239
+ interface GCFunction {
240
+ (minor?: boolean): void;
241
+ (options: NodeJS.GCOptions & { execution: "async" }): Promise<void>;
242
+ (options: NodeJS.GCOptions): void;
243
+ }
244
+
245
+ interface GCOptions {
246
+ execution?: "sync" | "async" | undefined;
247
+ flavor?: "regular" | "last-resort" | undefined;
248
+ type?: "major-snapshot" | "major" | "minor" | undefined;
249
+ filename?: string | undefined;
250
+ }
251
+
437
252
  /** An iterable iterator returned by the Node.js API. */
438
253
  // Default TReturn/TNext in v22 is `any`, for compatibility with the previously-used IterableIterator.
439
- // TODO: In next major @types/node version, change default TReturn to undefined.
440
254
  interface Iterator<T, TReturn = any, TNext = any> extends IteratorObject<T, TReturn, TNext> {
441
255
  [Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
442
256
  }
443
257
 
444
258
  /** An async iterable iterator returned by the Node.js API. */
445
259
  // Default TReturn/TNext in v22 is `any`, for compatibility with the previously-used AsyncIterableIterator.
446
- // TODO: In next major @types/node version, change default TReturn to undefined.
447
260
  interface AsyncIterator<T, TReturn = any, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
448
261
  [Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
449
262
  }
450
263
  }
451
264
 
265
+ // Global DOM types
266
+
267
+ interface DOMException extends _DOMException {}
268
+ var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T
269
+ : NodeDOMExceptionConstructor;
270
+
271
+ // #region AbortController
272
+ interface AbortController {
273
+ readonly signal: AbortSignal;
274
+ abort(reason?: any): void;
275
+ }
276
+ var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
277
+ : {
278
+ prototype: AbortController;
279
+ new(): AbortController;
280
+ };
281
+
282
+ interface AbortSignal extends EventTarget {
283
+ readonly aborted: boolean;
284
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
285
+ readonly reason: any;
286
+ throwIfAborted(): void;
287
+ }
288
+ var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
289
+ : {
290
+ prototype: AbortSignal;
291
+ new(): AbortSignal;
292
+ abort(reason?: any): AbortSignal;
293
+ any(signals: AbortSignal[]): AbortSignal;
294
+ timeout(milliseconds: number): AbortSignal;
295
+ };
296
+ // #endregion AbortController
297
+
298
+ // #region Storage
299
+ interface Storage extends _Storage {}
300
+ // Conditional on `onabort` rather than `onmessage`, in order to exclude lib.webworker
301
+ var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T
302
+ : {
303
+ prototype: Storage;
304
+ new(): Storage;
305
+ };
306
+
307
+ var localStorage: Storage;
308
+ var sessionStorage: Storage;
309
+ // #endregion Storage
310
+
311
+ // #region fetch
452
312
  interface RequestInit extends _RequestInit {}
453
313
 
454
314
  function fetch(
@@ -487,9 +347,6 @@ declare global {
487
347
  : typeof import("undici-types").Headers;
488
348
 
489
349
  interface MessageEvent extends _MessageEvent {}
490
- /**
491
- * @since v15.0.0
492
- */
493
350
  var MessageEvent: typeof globalThis extends {
494
351
  onmessage: any;
495
352
  MessageEvent: infer T;
@@ -501,11 +358,7 @@ declare global {
501
358
  : typeof import("undici-types").WebSocket;
502
359
 
503
360
  interface EventSource extends _EventSource {}
504
- /**
505
- * Only available through the [--experimental-eventsource](https://nodejs.org/api/cli.html#--experimental-eventsource) flag.
506
- *
507
- * @since v22.3.0
508
- */
509
361
  var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T
510
362
  : typeof import("undici-types").EventSource;
363
+ // #endregion fetch
511
364
  }
@@ -48,6 +48,7 @@ declare module "http" {
48
48
  // incoming headers will never contain number
49
49
  interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
50
50
  accept?: string | undefined;
51
+ "accept-encoding"?: string | undefined;
51
52
  "accept-language"?: string | undefined;
52
53
  "accept-patch"?: string | undefined;
53
54
  "accept-ranges"?: string | undefined;
@@ -94,6 +95,10 @@ declare module "http" {
94
95
  range?: string | undefined;
95
96
  referer?: string | undefined;
96
97
  "retry-after"?: string | undefined;
98
+ "sec-fetch-site"?: string | undefined;
99
+ "sec-fetch-mode"?: string | undefined;
100
+ "sec-fetch-user"?: string | undefined;
101
+ "sec-fetch-dest"?: string | undefined;
97
102
  "sec-websocket-accept"?: string | undefined;
98
103
  "sec-websocket-extensions"?: string | undefined;
99
104
  "sec-websocket-key"?: string | undefined;
@@ -207,7 +212,7 @@ declare module "http" {
207
212
  | undefined;
208
213
  defaultPort?: number | string | undefined;
209
214
  family?: number | undefined;
210
- headers?: OutgoingHttpHeaders | undefined;
215
+ headers?: OutgoingHttpHeaders | readonly string[] | undefined;
211
216
  hints?: LookupOptions["hints"];
212
217
  host?: string | null | undefined;
213
218
  hostname?: string | null | undefined;
@@ -269,6 +274,13 @@ declare module "http" {
269
274
  * @default 30000
270
275
  */
271
276
  connectionsCheckingInterval?: number | undefined;
277
+ /**
278
+ * Sets the timeout value in milliseconds for receiving the complete HTTP headers from the client.
279
+ * See {@link Server.headersTimeout} for more information.
280
+ * @default 60000
281
+ * @since 18.0.0
282
+ */
283
+ headersTimeout?: number | undefined;
272
284
  /**
273
285
  * Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`.
274
286
  * This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`.
@@ -296,6 +308,13 @@ declare module "http" {
296
308
  * @since v16.5.0
297
309
  */
298
310
  noDelay?: boolean | undefined;
311
+ /**
312
+ * If set to `true`, it forces the server to respond with a 400 (Bad Request) status code
313
+ * to any HTTP/1.1 request message that lacks a Host header (as mandated by the specification).
314
+ * @default true
315
+ * @since 20.0.0
316
+ */
317
+ requireHostHeader?: boolean | undefined;
299
318
  /**
300
319
  * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
301
320
  * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`.
@@ -314,6 +333,12 @@ declare module "http" {
314
333
  * If the header's value is an array, the items will be joined using `; `.
315
334
  */
316
335
  uniqueHeaders?: Array<string | string[]> | undefined;
336
+ /**
337
+ * If set to `true`, an error is thrown when writing to an HTTP response which does not have a body.
338
+ * @default false
339
+ * @since v18.17.0, v20.2.0
340
+ */
341
+ rejectNonStandardBodyWrites?: boolean | undefined;
317
342
  }
318
343
  type RequestListener<
319
344
  Request extends typeof IncomingMessage = typeof IncomingMessage,
@@ -1545,6 +1570,68 @@ declare module "http" {
1545
1570
  * @since v0.11.4
1546
1571
  */
1547
1572
  destroy(): void;
1573
+ /**
1574
+ * Produces a socket/stream to be used for HTTP requests.
1575
+ *
1576
+ * By default, this function is the same as `net.createConnection()`. However,
1577
+ * custom agents may override this method in case greater flexibility is desired.
1578
+ *
1579
+ * A socket/stream can be supplied in one of two ways: by returning the
1580
+ * socket/stream from this function, or by passing the socket/stream to `callback`.
1581
+ *
1582
+ * This method is guaranteed to return an instance of the `net.Socket` class,
1583
+ * a subclass of `stream.Duplex`, unless the user specifies a socket
1584
+ * type other than `net.Socket`.
1585
+ *
1586
+ * `callback` has a signature of `(err, stream)`.
1587
+ * @since v0.11.4
1588
+ * @param options Options containing connection details. Check `createConnection` for the format of the options
1589
+ * @param callback Callback function that receives the created socket
1590
+ */
1591
+ createConnection(
1592
+ options: ClientRequestArgs,
1593
+ callback?: (err: Error | null, stream: stream.Duplex) => void,
1594
+ ): stream.Duplex;
1595
+ /**
1596
+ * Called when `socket` is detached from a request and could be persisted by the`Agent`. Default behavior is to:
1597
+ *
1598
+ * ```js
1599
+ * socket.setKeepAlive(true, this.keepAliveMsecs);
1600
+ * socket.unref();
1601
+ * return true;
1602
+ * ```
1603
+ *
1604
+ * This method can be overridden by a particular `Agent` subclass. If this
1605
+ * method returns a falsy value, the socket will be destroyed instead of persisting
1606
+ * it for use with the next request.
1607
+ *
1608
+ * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
1609
+ * @since v8.1.0
1610
+ */
1611
+ keepSocketAlive(socket: stream.Duplex): void;
1612
+ /**
1613
+ * Called when `socket` is attached to `request` after being persisted because of
1614
+ * the keep-alive options. Default behavior is to:
1615
+ *
1616
+ * ```js
1617
+ * socket.ref();
1618
+ * ```
1619
+ *
1620
+ * This method can be overridden by a particular `Agent` subclass.
1621
+ *
1622
+ * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
1623
+ * @since v8.1.0
1624
+ */
1625
+ reuseSocket(socket: stream.Duplex, request: ClientRequest): void;
1626
+ /**
1627
+ * Get a unique name for a set of request options, to determine whether a
1628
+ * connection can be reused. For an HTTP agent, this returns`host:port:localAddress` or `host:port:localAddress:family`. For an HTTPS agent,
1629
+ * the name includes the CA, cert, ciphers, and other HTTPS/TLS-specific options
1630
+ * that determine socket reusability.
1631
+ * @since v0.11.4
1632
+ * @param options A set of options providing information for name generation
1633
+ */
1634
+ getName(options?: ClientRequestArgs): string;
1548
1635
  }
1549
1636
  const METHODS: string[];
1550
1637
  const STATUS_CODES: {