@chainlink/external-adapter-framework 2.0.0 → 2.1.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 (30) hide show
  1. package/README.md +1 -1
  2. package/adapter/price.d.ts +1 -0
  3. package/adapter/price.js +13 -7
  4. package/adapter/price.js.map +1 -1
  5. package/generator-adapter/node_modules/.yarn-integrity +2 -2
  6. package/generator-adapter/node_modules/@types/node/README.md +1 -1
  7. package/generator-adapter/node_modules/@types/node/assert.d.ts +53 -0
  8. package/generator-adapter/node_modules/@types/node/buffer.buffer.d.ts +2 -1
  9. package/generator-adapter/node_modules/@types/node/dgram.d.ts +10 -7
  10. package/generator-adapter/node_modules/@types/node/events.d.ts +1 -1
  11. package/generator-adapter/node_modules/@types/node/fs.d.ts +45 -98
  12. package/generator-adapter/node_modules/@types/node/globals.d.ts +8 -63
  13. package/generator-adapter/node_modules/@types/node/http.d.ts +1 -0
  14. package/generator-adapter/node_modules/@types/node/module.d.ts +528 -235
  15. package/generator-adapter/node_modules/@types/node/net.d.ts +33 -5
  16. package/generator-adapter/node_modules/@types/node/package.json +2 -2
  17. package/generator-adapter/node_modules/@types/node/perf_hooks.d.ts +5 -0
  18. package/generator-adapter/node_modules/@types/node/process.d.ts +54 -4
  19. package/generator-adapter/node_modules/@types/node/sea.d.ts +1 -1
  20. package/generator-adapter/node_modules/@types/node/sqlite.d.ts +236 -10
  21. package/generator-adapter/node_modules/@types/node/test.d.ts +0 -5
  22. package/generator-adapter/node_modules/@types/node/util.d.ts +85 -17
  23. package/generator-adapter/package.json +1 -1
  24. package/metrics/index.d.ts +1 -0
  25. package/metrics/index.js +4 -0
  26. package/metrics/index.js.map +1 -1
  27. package/package.json +12 -12
  28. package/transports/websocket.d.ts +18 -0
  29. package/transports/websocket.js +9 -0
  30. package/transports/websocket.js.map +1 -1
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # EA Framework v3
2
2
 
3
3
  [![NPM version](https://img.shields.io/npm/v/@chainlink/external-adapter-framework.svg?style=flat)](https://www.npmjs.com/package/@chainlink/external-adapter-framework)
4
- ![Coverage](https://img.shields.io/badge/coverage-99.1%25-green)
4
+ ![Coverage](https://img.shields.io/badge/coverage-99.11%25-green)
5
5
 
6
6
  Framework to create External adapters, microservices that serve as middleware to facilitate connections between Chainlink Nodes and Data Providers (DP).
7
7
 
@@ -47,6 +47,7 @@ type IncludeDetails = {
47
47
  from: string;
48
48
  to: string;
49
49
  inverse: boolean;
50
+ endpoints?: string[];
50
51
  };
51
52
  type IncludePair = {
52
53
  from: string;
package/adapter/price.js CHANGED
@@ -57,14 +57,20 @@ class PriceAdapter extends index_1.Adapter {
57
57
  return;
58
58
  }
59
59
  const includesDetails = this.includesMap?.[requestData.base]?.[requestData.quote];
60
- if (includesDetails) {
61
- requestData.base = includesDetails.from || requestData.base;
62
- requestData.quote = includesDetails.to || requestData.quote;
60
+ if (includesDetails?.endpoints === undefined ||
61
+ includesDetails?.endpoints?.includes(req.requestContext.endpointName)) {
62
+ if (includesDetails) {
63
+ requestData.base = includesDetails.from || requestData.base;
64
+ requestData.quote = includesDetails.to || requestData.quote;
65
+ }
66
+ const inverse = includesDetails?.inverse || false;
67
+ priceRequest.requestContext.priceMeta = {
68
+ inverse,
69
+ };
70
+ }
71
+ else {
72
+ throw new Error(`Endpoint ${req.requestContext.endpointName} not supported for ${requestData.base}/${requestData.quote} in includes.json`);
63
73
  }
64
- const inverse = includesDetails?.inverse || false;
65
- priceRequest.requestContext.priceMeta = {
66
- inverse,
67
- };
68
74
  };
69
75
  for (const endpoint of priceEndpoints) {
70
76
  endpoint.requestTransforms?.push(requestTransform);
@@ -1 +1 @@
1
- {"version":3,"file":"price.js","sourceRoot":"","sources":["../../../src/adapter/price.ts"],"names":[],"mappings":";;;AAaA,yCAA4C;AAC5C,mCAAuE;AAoBvE;;GAEG;AACU,QAAA,sCAAsC,GAAG;IACpD,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC,MAA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@@
6
6
  "flags": [],
7
7
  "linkedModules": [],
8
8
  "topLevelPatterns": [
9
- "@types/node@22.10.2",
9
+ "@types/node@22.13.0",
10
10
  "@yeoman/adapter@2.0.0",
11
11
  "@yeoman/types@1.5.0",
12
12
  "mem-fs@4.1.2",
@@ -62,7 +62,7 @@
62
62
  "@types/lodash-es@^4.17.9": "https://registry.yarnpkg.com/@types/lodash-es/-/lodash-es-4.17.12.tgz#65f6d1e5f80539aa7cfbfc962de5def0cf4f341b",
63
63
  "@types/lodash@*": "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.13.tgz#786e2d67cfd95e32862143abe7463a7f90c300eb",
64
64
  "@types/node@*": "https://registry.yarnpkg.com/@types/node/-/node-22.10.1.tgz#41ffeee127b8975a05f8c4f83fb89bcb2987d766",
65
- "@types/node@22.10.2": "https://registry.yarnpkg.com/@types/node/-/node-22.10.2.tgz#a485426e6d1fdafc7b0d4c7b24e2c78182ddabb9",
65
+ "@types/node@22.13.0": "https://registry.yarnpkg.com/@types/node/-/node-22.13.0.tgz#d376dd9a0ee2f9382d86c2d5d7beb4d198b4ea8c",
66
66
  "@types/node@>=18": "https://registry.yarnpkg.com/@types/node/-/node-22.10.1.tgz#41ffeee127b8975a05f8c4f83fb89bcb2987d766",
67
67
  "@types/node@>=18.18.5": "https://registry.yarnpkg.com/@types/node/-/node-22.10.1.tgz#41ffeee127b8975a05f8c4f83fb89bcb2987d766",
68
68
  "@types/normalize-package-data@^2.4.3": "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901",
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 11 Dec 2024 09:35:14 GMT
11
+ * Last updated: Fri, 31 Jan 2025 20:02:26 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -956,6 +956,59 @@ declare module "assert" {
956
956
  * @since v13.6.0, v12.16.0
957
957
  */
958
958
  function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
959
+ /**
960
+ * `assert.partialDeepStrictEqual()` Asserts the equivalence between the `actual` and `expected` parameters through a
961
+ * deep comparison, ensuring that all properties in the `expected` parameter are
962
+ * present in the `actual` parameter with equivalent values, not allowing type coercion.
963
+ * The main difference with `assert.deepStrictEqual()` is that `assert.partialDeepStrictEqual()` does not require
964
+ * all properties in the `actual` parameter to be present in the `expected` parameter.
965
+ * This method should always pass the same test cases as `assert.deepStrictEqual()`, behaving as a super set of it.
966
+ *
967
+ * ```js
968
+ * import assert from 'node:assert';
969
+ *
970
+ * assert.partialDeepStrictEqual({ a: 1, b: 2 }, { a: 1, b: 2 });
971
+ * // OK
972
+ *
973
+ * assert.partialDeepStrictEqual({ a: { b: { c: 1 } } }, { a: { b: { c: 1 } } });
974
+ * // OK
975
+ *
976
+ * assert.partialDeepStrictEqual({ a: 1, b: 2, c: 3 }, { a: 1, b: 2 });
977
+ * // OK
978
+ *
979
+ * assert.partialDeepStrictEqual(new Set(['value1', 'value2']), new Set(['value1', 'value2']));
980
+ * // OK
981
+ *
982
+ * assert.partialDeepStrictEqual(new Map([['key1', 'value1']]), new Map([['key1', 'value1']]));
983
+ * // OK
984
+ *
985
+ * assert.partialDeepStrictEqual(new Uint8Array([1, 2, 3]), new Uint8Array([1, 2, 3]));
986
+ * // OK
987
+ *
988
+ * assert.partialDeepStrictEqual(/abc/, /abc/);
989
+ * // OK
990
+ *
991
+ * assert.partialDeepStrictEqual([{ a: 5 }, { b: 5 }], [{ a: 5 }]);
992
+ * // OK
993
+ *
994
+ * assert.partialDeepStrictEqual(new Set([{ a: 1 }, { b: 1 }]), new Set([{ a: 1 }]));
995
+ * // OK
996
+ *
997
+ * assert.partialDeepStrictEqual(new Date(0), new Date(0));
998
+ * // OK
999
+ *
1000
+ * assert.partialDeepStrictEqual({ a: 1 }, { a: 1, b: 2 });
1001
+ * // AssertionError
1002
+ *
1003
+ * assert.partialDeepStrictEqual({ a: 1, b: '2' }, { a: 1, b: 2 });
1004
+ * // AssertionError
1005
+ *
1006
+ * assert.partialDeepStrictEqual({ a: { b: 2 } }, { a: { b: '2' } });
1007
+ * // AssertionError
1008
+ * ```
1009
+ * @since v22.13.0
1010
+ */
1011
+ function partialDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
959
1012
  /**
960
1013
  * In strict assertion mode, non-strict methods behave like their corresponding strict methods. For example,
961
1014
  * {@link deepEqual} will behave like {@link deepStrictEqual}.
@@ -107,7 +107,8 @@ declare module "buffer" {
107
107
  *
108
108
  * If `totalLength` is provided, it is coerced to an unsigned integer. If the
109
109
  * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
110
- * truncated to `totalLength`.
110
+ * truncated to `totalLength`. If the combined length of the `Buffer`s in `list` is
111
+ * less than `totalLength`, the remaining space is filled with zeros.
111
112
  *
112
113
  * ```js
113
114
  * import { Buffer } from 'node:buffer';
@@ -26,7 +26,7 @@
26
26
  * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/dgram.js)
27
27
  */
28
28
  declare module "dgram" {
29
- import { AddressInfo } from "node:net";
29
+ import { AddressInfo, BlockList } from "node:net";
30
30
  import * as dns from "node:dns";
31
31
  import { Abortable, EventEmitter } from "node:events";
32
32
  interface RemoteInfo {
@@ -45,6 +45,7 @@ declare module "dgram" {
45
45
  interface SocketOptions extends Abortable {
46
46
  type: SocketType;
47
47
  reuseAddr?: boolean | undefined;
48
+ reusePort?: boolean | undefined;
48
49
  /**
49
50
  * @default false
50
51
  */
@@ -58,6 +59,8 @@ declare module "dgram" {
58
59
  callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
59
60
  ) => void)
60
61
  | undefined;
62
+ receiveBlockList?: BlockList | undefined;
63
+ sendBlockList?: BlockList | undefined;
61
64
  }
62
65
  /**
63
66
  * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram
@@ -352,22 +355,22 @@ declare module "dgram" {
352
355
  * @param callback Called when the message has been sent.
353
356
  */
354
357
  send(
355
- msg: string | Uint8Array | readonly any[],
358
+ msg: string | NodeJS.ArrayBufferView | readonly any[],
356
359
  port?: number,
357
360
  address?: string,
358
361
  callback?: (error: Error | null, bytes: number) => void,
359
362
  ): void;
360
363
  send(
361
- msg: string | Uint8Array | readonly any[],
364
+ msg: string | NodeJS.ArrayBufferView | readonly any[],
362
365
  port?: number,
363
366
  callback?: (error: Error | null, bytes: number) => void,
364
367
  ): void;
365
368
  send(
366
- msg: string | Uint8Array | readonly any[],
369
+ msg: string | NodeJS.ArrayBufferView | readonly any[],
367
370
  callback?: (error: Error | null, bytes: number) => void,
368
371
  ): void;
369
372
  send(
370
- msg: string | Uint8Array,
373
+ msg: string | NodeJS.ArrayBufferView,
371
374
  offset: number,
372
375
  length: number,
373
376
  port?: number,
@@ -375,14 +378,14 @@ declare module "dgram" {
375
378
  callback?: (error: Error | null, bytes: number) => void,
376
379
  ): void;
377
380
  send(
378
- msg: string | Uint8Array,
381
+ msg: string | NodeJS.ArrayBufferView,
379
382
  offset: number,
380
383
  length: number,
381
384
  port?: number,
382
385
  callback?: (error: Error | null, bytes: number) => void,
383
386
  ): void;
384
387
  send(
385
- msg: string | Uint8Array,
388
+ msg: string | NodeJS.ArrayBufferView,
386
389
  offset: number,
387
390
  length: number,
388
391
  callback?: (error: Error | null, bytes: number) => void,
@@ -768,7 +768,7 @@ declare module "events" {
768
768
  setMaxListeners(n: number): this;
769
769
  /**
770
770
  * Returns the current max listener value for the `EventEmitter` which is either
771
- * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}.
771
+ * set by `emitter.setMaxListeners(n)` or defaults to {@link EventEmitter.defaultMaxListeners}.
772
772
  * @since v1.0.0
773
773
  */
774
774
  getMaxListeners(): number;
@@ -438,57 +438,47 @@ declare module "fs" {
438
438
  * 2. close
439
439
  * 3. ready
440
440
  */
441
- addListener(event: "close", listener: () => void): this;
442
- addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
443
- addListener(event: "end", listener: () => void): this;
444
- addListener(event: "error", listener: (err: Error) => void): this;
445
- addListener(event: "open", listener: (fd: number) => void): this;
446
- addListener(event: "pause", listener: () => void): this;
447
- addListener(event: "readable", listener: () => void): this;
448
- addListener(event: "ready", listener: () => void): this;
449
- addListener(event: "resume", listener: () => void): this;
450
- addListener(event: string | symbol, listener: (...args: any[]) => void): this;
451
- on(event: "close", listener: () => void): this;
452
- on(event: "data", listener: (chunk: Buffer | string) => void): this;
453
- on(event: "end", listener: () => void): this;
454
- on(event: "error", listener: (err: Error) => void): this;
455
- on(event: "open", listener: (fd: number) => void): this;
456
- on(event: "pause", listener: () => void): this;
457
- on(event: "readable", listener: () => void): this;
458
- on(event: "ready", listener: () => void): this;
459
- on(event: "resume", listener: () => void): this;
460
- on(event: string | symbol, listener: (...args: any[]) => void): this;
461
- once(event: "close", listener: () => void): this;
462
- once(event: "data", listener: (chunk: Buffer | string) => void): this;
463
- once(event: "end", listener: () => void): this;
464
- once(event: "error", listener: (err: Error) => void): this;
465
- once(event: "open", listener: (fd: number) => void): this;
466
- once(event: "pause", listener: () => void): this;
467
- once(event: "readable", listener: () => void): this;
468
- once(event: "ready", listener: () => void): this;
469
- once(event: "resume", listener: () => void): this;
470
- once(event: string | symbol, listener: (...args: any[]) => void): this;
471
- prependListener(event: "close", listener: () => void): this;
472
- prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
473
- prependListener(event: "end", listener: () => void): this;
474
- prependListener(event: "error", listener: (err: Error) => void): this;
475
- prependListener(event: "open", listener: (fd: number) => void): this;
476
- prependListener(event: "pause", listener: () => void): this;
477
- prependListener(event: "readable", listener: () => void): this;
478
- prependListener(event: "ready", listener: () => void): this;
479
- prependListener(event: "resume", listener: () => void): this;
480
- prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
481
- prependOnceListener(event: "close", listener: () => void): this;
482
- prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
483
- prependOnceListener(event: "end", listener: () => void): this;
484
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
485
- prependOnceListener(event: "open", listener: (fd: number) => void): this;
486
- prependOnceListener(event: "pause", listener: () => void): this;
487
- prependOnceListener(event: "readable", listener: () => void): this;
488
- prependOnceListener(event: "ready", listener: () => void): this;
489
- prependOnceListener(event: "resume", listener: () => void): this;
490
- prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
441
+ addListener<K extends keyof ReadStreamEvents>(event: K, listener: ReadStreamEvents[K]): this;
442
+ on<K extends keyof ReadStreamEvents>(event: K, listener: ReadStreamEvents[K]): this;
443
+ once<K extends keyof ReadStreamEvents>(event: K, listener: ReadStreamEvents[K]): this;
444
+ prependListener<K extends keyof ReadStreamEvents>(event: K, listener: ReadStreamEvents[K]): this;
445
+ prependOnceListener<K extends keyof ReadStreamEvents>(event: K, listener: ReadStreamEvents[K]): this;
491
446
  }
447
+
448
+ /**
449
+ * The Keys are events of the ReadStream and the values are the functions that are called when the event is emitted.
450
+ */
451
+ type ReadStreamEvents = {
452
+ close: () => void;
453
+ data: (chunk: Buffer | string) => void;
454
+ end: () => void;
455
+ error: (err: Error) => void;
456
+ open: (fd: number) => void;
457
+ pause: () => void;
458
+ readable: () => void;
459
+ ready: () => void;
460
+ resume: () => void;
461
+ } & CustomEvents;
462
+
463
+ /**
464
+ * string & {} allows to allow any kind of strings for the event
465
+ * but still allows to have auto completion for the normal events.
466
+ */
467
+ type CustomEvents = { [Key in string & {} | symbol]: (...args: any[]) => void };
468
+
469
+ /**
470
+ * The Keys are events of the WriteStream and the values are the functions that are called when the event is emitted.
471
+ */
472
+ type WriteStreamEvents = {
473
+ close: () => void;
474
+ drain: () => void;
475
+ error: (err: Error) => void;
476
+ finish: () => void;
477
+ open: (fd: number) => void;
478
+ pipe: (src: stream.Readable) => void;
479
+ ready: () => void;
480
+ unpipe: (src: stream.Readable) => void;
481
+ } & CustomEvents;
492
482
  /**
493
483
  * * Extends `stream.Writable`
494
484
  *
@@ -527,51 +517,11 @@ declare module "fs" {
527
517
  * 2. close
528
518
  * 3. ready
529
519
  */
530
- addListener(event: "close", listener: () => void): this;
531
- addListener(event: "drain", listener: () => void): this;
532
- addListener(event: "error", listener: (err: Error) => void): this;
533
- addListener(event: "finish", listener: () => void): this;
534
- addListener(event: "open", listener: (fd: number) => void): this;
535
- addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
536
- addListener(event: "ready", listener: () => void): this;
537
- addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
538
- addListener(event: string | symbol, listener: (...args: any[]) => void): this;
539
- on(event: "close", listener: () => void): this;
540
- on(event: "drain", listener: () => void): this;
541
- on(event: "error", listener: (err: Error) => void): this;
542
- on(event: "finish", listener: () => void): this;
543
- on(event: "open", listener: (fd: number) => void): this;
544
- on(event: "pipe", listener: (src: stream.Readable) => void): this;
545
- on(event: "ready", listener: () => void): this;
546
- on(event: "unpipe", listener: (src: stream.Readable) => void): this;
547
- on(event: string | symbol, listener: (...args: any[]) => void): this;
548
- once(event: "close", listener: () => void): this;
549
- once(event: "drain", listener: () => void): this;
550
- once(event: "error", listener: (err: Error) => void): this;
551
- once(event: "finish", listener: () => void): this;
552
- once(event: "open", listener: (fd: number) => void): this;
553
- once(event: "pipe", listener: (src: stream.Readable) => void): this;
554
- once(event: "ready", listener: () => void): this;
555
- once(event: "unpipe", listener: (src: stream.Readable) => void): this;
556
- once(event: string | symbol, listener: (...args: any[]) => void): this;
557
- prependListener(event: "close", listener: () => void): this;
558
- prependListener(event: "drain", listener: () => void): this;
559
- prependListener(event: "error", listener: (err: Error) => void): this;
560
- prependListener(event: "finish", listener: () => void): this;
561
- prependListener(event: "open", listener: (fd: number) => void): this;
562
- prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
563
- prependListener(event: "ready", listener: () => void): this;
564
- prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
565
- prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
566
- prependOnceListener(event: "close", listener: () => void): this;
567
- prependOnceListener(event: "drain", listener: () => void): this;
568
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
569
- prependOnceListener(event: "finish", listener: () => void): this;
570
- prependOnceListener(event: "open", listener: (fd: number) => void): this;
571
- prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
572
- prependOnceListener(event: "ready", listener: () => void): this;
573
- prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
574
- prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
520
+ addListener<K extends keyof WriteStreamEvents>(event: K, listener: WriteStreamEvents[K]): this;
521
+ on<K extends keyof WriteStreamEvents>(event: K, listener: WriteStreamEvents[K]): this;
522
+ once<K extends keyof WriteStreamEvents>(event: K, listener: WriteStreamEvents[K]): this;
523
+ prependListener<K extends keyof WriteStreamEvents>(event: K, listener: WriteStreamEvents[K]): this;
524
+ prependOnceListener<K extends keyof WriteStreamEvents>(event: K, listener: WriteStreamEvents[K]): this;
575
525
  }
576
526
  /**
577
527
  * Asynchronously rename file at `oldPath` to the pathname provided
@@ -3845,9 +3795,6 @@ declare module "fs" {
3845
3795
  flush?: boolean | undefined;
3846
3796
  }
3847
3797
  /**
3848
- * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream
3849
- * returned by this method has a default `highWaterMark` of 64 KiB.
3850
- *
3851
3798
  * `options` can include `start` and `end` values to read a range of bytes from
3852
3799
  * the file instead of the entire file. Both `start` and `end` are inclusive and
3853
3800
  * start counting at 0, allowed values are in the
@@ -151,25 +151,11 @@ declare global {
151
151
  * *
152
152
  ------------------------------------------------*/
153
153
 
154
- // For backwards compability
155
- interface NodeRequire extends NodeJS.Require {}
156
- interface RequireResolve extends NodeJS.RequireResolve {}
157
- interface NodeModule extends NodeJS.Module {}
158
-
159
154
  var global: typeof globalThis;
160
155
 
161
156
  var process: NodeJS.Process;
162
157
  var console: Console;
163
158
 
164
- var __filename: string;
165
- var __dirname: string;
166
-
167
- var require: NodeRequire;
168
- var module: NodeModule;
169
-
170
- // Same as module.exports
171
- var exports: any;
172
-
173
159
  interface GCFunction {
174
160
  (options: {
175
161
  execution?: "sync";
@@ -249,19 +235,21 @@ declare global {
249
235
  };
250
236
 
251
237
  /**
252
- * A browser-compatible implementation of [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage).
253
- * Data is stored unencrypted in the file specified by the `--localstorage-file` CLI flag.
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.
254
241
  * Any modification of this data outside of the Web Storage API is not supported.
255
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.
256
245
  * @since v22.4.0
257
246
  */
258
247
  var localStorage: Storage;
259
248
 
260
249
  /**
261
- * A browser-compatible implementation of [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage).
262
- * Data is stored in memory, with a storage quota of 10 MB.
263
- * Any modification of this data outside of the Web Storage API is not supported.
264
- * Enable this API with the `--experimental-webstorage` CLI flag.
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.
265
253
  * @since v22.4.0
266
254
  */
267
255
  var sessionStorage: Storage;
@@ -438,49 +426,6 @@ declare global {
438
426
  unref(): this;
439
427
  }
440
428
 
441
- interface Require {
442
- (id: string): any;
443
- resolve: RequireResolve;
444
- cache: Dict<NodeModule>;
445
- /**
446
- * @deprecated
447
- */
448
- extensions: RequireExtensions;
449
- main: Module | undefined;
450
- }
451
-
452
- interface RequireResolve {
453
- (id: string, options?: { paths?: string[] | undefined }): string;
454
- paths(request: string): string[] | null;
455
- }
456
-
457
- interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
458
- ".js": (m: Module, filename: string) => any;
459
- ".json": (m: Module, filename: string) => any;
460
- ".node": (m: Module, filename: string) => any;
461
- }
462
- interface Module {
463
- /**
464
- * `true` if the module is running during the Node.js preload
465
- */
466
- isPreloading: boolean;
467
- exports: any;
468
- require: Require;
469
- id: string;
470
- filename: string;
471
- loaded: boolean;
472
- /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */
473
- parent: Module | null | undefined;
474
- children: Module[];
475
- /**
476
- * @since v11.14.0
477
- *
478
- * The directory name of the module. This is usually the same as the path.dirname() of the module.id.
479
- */
480
- path: string;
481
- paths: string[];
482
- }
483
-
484
429
  interface Dict<T> {
485
430
  [key: string]: T | undefined;
486
431
  }
@@ -223,6 +223,7 @@ declare module "http" {
223
223
  path?: string | null | undefined;
224
224
  port?: number | string | null | undefined;
225
225
  protocol?: string | null | undefined;
226
+ setDefaultHeaders?: boolean | undefined;
226
227
  setHost?: boolean | undefined;
227
228
  signal?: AbortSignal | undefined;
228
229
  socketPath?: string | undefined;