aws-delivlib 15.0.16 → 15.0.18

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 (101) hide show
  1. package/lib/publishing/github/node_modules/.yarn-integrity +2 -2
  2. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/README.md +1 -1
  3. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/assert.d.ts +5 -5
  4. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/async_hooks.d.ts +26 -6
  5. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/buffer.d.ts +1 -2
  6. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/child_process.d.ts +2 -2
  7. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/cluster.d.ts +15 -15
  8. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/console.d.ts +17 -17
  9. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/crypto.d.ts +35 -28
  10. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dgram.d.ts +1 -1
  11. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/diagnostics_channel.d.ts +1 -1
  12. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dns.d.ts +16 -16
  13. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/domain.d.ts +1 -1
  14. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/events.d.ts +1 -2
  15. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/fs/promises.d.ts +16 -9
  16. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/fs.d.ts +28 -19
  17. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/globals.d.ts +7 -6
  18. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/globals.typedarray.d.ts +1 -0
  19. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/http.d.ts +2 -2
  20. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/http2.d.ts +6 -3
  21. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/https.d.ts +1 -1
  22. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/index.d.ts +7 -5
  23. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/inspector.d.ts +3 -7
  24. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/module.d.ts +63 -29
  25. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/net.d.ts +2 -5
  26. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/os.d.ts +8 -7
  27. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/package.json +13 -3
  28. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/path.d.ts +1 -1
  29. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/perf_hooks.d.ts +8 -8
  30. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/process.d.ts +21 -11
  31. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/punycode.d.ts +1 -1
  32. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/querystring.d.ts +1 -1
  33. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/readline/promises.d.ts +0 -1
  34. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/readline.d.ts +13 -13
  35. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/repl.d.ts +14 -16
  36. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/sea.d.ts +1 -1
  37. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/sqlite.d.ts +182 -2
  38. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/stream.d.ts +8 -19
  39. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/string_decoder.d.ts +1 -1
  40. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/test.d.ts +53 -15
  41. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/timers/promises.d.ts +1 -1
  42. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/timers.d.ts +1 -1
  43. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/tls.d.ts +2 -48
  44. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/trace_events.d.ts +6 -6
  45. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/{compatibility → ts5.1/compatibility}/disposable.d.ts +0 -4
  46. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.1/index.d.ts +98 -0
  47. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  48. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +1 -0
  49. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.6/index.d.ts +9 -5
  50. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  51. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts5.7/index.d.ts +96 -0
  52. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/tty.d.ts +1 -1
  53. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/url.d.ts +52 -19
  54. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/util.d.ts +16 -295
  55. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/v8.d.ts +29 -32
  56. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/vm.d.ts +17 -10
  57. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/wasi.d.ts +1 -1
  58. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/worker_threads.d.ts +34 -18
  59. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/zlib.d.ts +5 -7
  60. package/lib/publishing/github/node_modules/undici-types/agent.d.ts +7 -7
  61. package/lib/publishing/github/node_modules/undici-types/api.d.ts +24 -24
  62. package/lib/publishing/github/node_modules/undici-types/balanced-pool.d.ts +11 -11
  63. package/lib/publishing/github/node_modules/undici-types/cache-interceptor.d.ts +172 -0
  64. package/lib/publishing/github/node_modules/undici-types/client.d.ts +12 -13
  65. package/lib/publishing/github/node_modules/undici-types/cookies.d.ts +2 -0
  66. package/lib/publishing/github/node_modules/undici-types/diagnostics-channel.d.ts +10 -10
  67. package/lib/publishing/github/node_modules/undici-types/dispatcher.d.ts +117 -92
  68. package/lib/publishing/github/node_modules/undici-types/env-http-proxy-agent.d.ts +2 -2
  69. package/lib/publishing/github/node_modules/undici-types/errors.d.ts +69 -47
  70. package/lib/publishing/github/node_modules/undici-types/fetch.d.ts +17 -16
  71. package/lib/publishing/github/node_modules/undici-types/formdata.d.ts +7 -7
  72. package/lib/publishing/github/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  73. package/lib/publishing/github/node_modules/undici-types/global-origin.d.ts +5 -5
  74. package/lib/publishing/github/node_modules/undici-types/h2c-client.d.ts +75 -0
  75. package/lib/publishing/github/node_modules/undici-types/handlers.d.ts +7 -7
  76. package/lib/publishing/github/node_modules/undici-types/header.d.ts +157 -1
  77. package/lib/publishing/github/node_modules/undici-types/index.d.ts +51 -47
  78. package/lib/publishing/github/node_modules/undici-types/interceptors.d.ts +25 -8
  79. package/lib/publishing/github/node_modules/undici-types/mock-agent.d.ts +33 -18
  80. package/lib/publishing/github/node_modules/undici-types/mock-call-history.d.ts +111 -0
  81. package/lib/publishing/github/node_modules/undici-types/mock-client.d.ts +4 -4
  82. package/lib/publishing/github/node_modules/undici-types/mock-errors.d.ts +3 -3
  83. package/lib/publishing/github/node_modules/undici-types/mock-interceptor.d.ts +19 -19
  84. package/lib/publishing/github/node_modules/undici-types/mock-pool.d.ts +4 -4
  85. package/lib/publishing/github/node_modules/undici-types/package.json +1 -1
  86. package/lib/publishing/github/node_modules/undici-types/patch.d.ts +0 -4
  87. package/lib/publishing/github/node_modules/undici-types/pool-stats.d.ts +8 -8
  88. package/lib/publishing/github/node_modules/undici-types/pool.d.ts +12 -12
  89. package/lib/publishing/github/node_modules/undici-types/proxy-agent.d.ts +4 -4
  90. package/lib/publishing/github/node_modules/undici-types/readable.d.ts +18 -15
  91. package/lib/publishing/github/node_modules/undici-types/retry-agent.d.ts +1 -1
  92. package/lib/publishing/github/node_modules/undici-types/retry-handler.d.ts +10 -10
  93. package/lib/publishing/github/node_modules/undici-types/util.d.ts +3 -3
  94. package/lib/publishing/github/node_modules/undici-types/utility.d.ts +7 -0
  95. package/lib/publishing/github/node_modules/undici-types/webidl.d.ts +44 -6
  96. package/lib/publishing/github/node_modules/undici-types/websocket.d.ts +35 -1
  97. package/package.json +2 -2
  98. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/compatibility/index.d.ts +0 -9
  99. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
  100. package/lib/publishing/github/node_modules/undici-types/file.d.ts +0 -39
  101. package/lib/publishing/github/node_modules/undici-types/filereader.d.ts +0 -54
@@ -4,7 +4,7 @@
4
4
  * ```js
5
5
  * import v8 from 'node:v8';
6
6
  * ```
7
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/v8.js)
7
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/v8.js)
8
8
  */
9
9
  declare module "v8" {
10
10
  import { Readable } from "node:stream";
@@ -547,8 +547,7 @@ declare module "v8" {
547
547
  function stopCoverage(): void;
548
548
  /**
549
549
  * The API is a no-op if `--heapsnapshot-near-heap-limit` is already set from the command line or the API is called more than once.
550
- * `limit` must be a positive integer. See [`--heapsnapshot-near-heap-limit`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information.
551
- * @experimental
550
+ * `limit` must be a positive integer. See [`--heapsnapshot-near-heap-limit`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information.
552
551
  * @since v18.10.0, v16.18.0
553
552
  */
554
553
  function setHeapSnapshotNearHeapLimit(limit: number): void;
@@ -774,33 +773,6 @@ declare module "v8" {
774
773
  */
775
774
  const promiseHooks: PromiseHooks;
776
775
  type StartupSnapshotCallbackFn = (args: any) => any;
777
- interface StartupSnapshot {
778
- /**
779
- * Add a callback that will be called when the Node.js instance is about to get serialized into a snapshot and exit.
780
- * This can be used to release resources that should not or cannot be serialized or to convert user data into a form more suitable for serialization.
781
- * @since v18.6.0, v16.17.0
782
- */
783
- addSerializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
784
- /**
785
- * Add a callback that will be called when the Node.js instance is deserialized from a snapshot.
786
- * The `callback` and the `data` (if provided) will be serialized into the snapshot, they can be used to re-initialize the state of the application or
787
- * to re-acquire resources that the application needs when the application is restarted from the snapshot.
788
- * @since v18.6.0, v16.17.0
789
- */
790
- addDeserializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
791
- /**
792
- * This sets the entry point of the Node.js application when it is deserialized from a snapshot. This can be called only once in the snapshot building script.
793
- * If called, the deserialized application no longer needs an additional entry point script to start up and will simply invoke the callback along with the deserialized
794
- * data (if provided), otherwise an entry point script still needs to be provided to the deserialized application.
795
- * @since v18.6.0, v16.17.0
796
- */
797
- setDeserializeMainFunction(callback: StartupSnapshotCallbackFn, data?: any): void;
798
- /**
799
- * Returns true if the Node.js instance is run to build a snapshot.
800
- * @since v18.6.0, v16.17.0
801
- */
802
- isBuildingSnapshot(): boolean;
803
- }
804
776
  /**
805
777
  * The `v8.startupSnapshot` interface can be used to add serialization and deserialization hooks for custom startup snapshots.
806
778
  *
@@ -879,10 +851,35 @@ declare module "v8" {
879
851
  *
880
852
  * Currently the application deserialized from a user-land snapshot cannot be snapshotted again, so these APIs are only available to applications that are not deserialized from a user-land snapshot.
881
853
  *
882
- * @experimental
883
854
  * @since v18.6.0, v16.17.0
884
855
  */
885
- const startupSnapshot: StartupSnapshot;
856
+ namespace startupSnapshot {
857
+ /**
858
+ * Add a callback that will be called when the Node.js instance is about to get serialized into a snapshot and exit.
859
+ * This can be used to release resources that should not or cannot be serialized or to convert user data into a form more suitable for serialization.
860
+ * @since v18.6.0, v16.17.0
861
+ */
862
+ function addSerializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
863
+ /**
864
+ * Add a callback that will be called when the Node.js instance is deserialized from a snapshot.
865
+ * The `callback` and the `data` (if provided) will be serialized into the snapshot, they can be used to re-initialize the state of the application or
866
+ * to re-acquire resources that the application needs when the application is restarted from the snapshot.
867
+ * @since v18.6.0, v16.17.0
868
+ */
869
+ function addDeserializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
870
+ /**
871
+ * This sets the entry point of the Node.js application when it is deserialized from a snapshot. This can be called only once in the snapshot building script.
872
+ * If called, the deserialized application no longer needs an additional entry point script to start up and will simply invoke the callback along with the deserialized
873
+ * data (if provided), otherwise an entry point script still needs to be provided to the deserialized application.
874
+ * @since v18.6.0, v16.17.0
875
+ */
876
+ function setDeserializeMainFunction(callback: StartupSnapshotCallbackFn, data?: any): void;
877
+ /**
878
+ * Returns true if the Node.js instance is run to build a snapshot.
879
+ * @since v18.6.0, v16.17.0
880
+ */
881
+ function isBuildingSnapshot(): boolean;
882
+ }
886
883
  }
887
884
  declare module "node:v8" {
888
885
  export * from "v8";
@@ -34,7 +34,7 @@
34
34
  *
35
35
  * console.log(x); // 1; y is not defined.
36
36
  * ```
37
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/vm.js)
37
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/vm.js)
38
38
  */
39
39
  declare module "vm" {
40
40
  import { ImportAttributes } from "node:module";
@@ -60,6 +60,7 @@ declare module "vm" {
60
60
  specifier: string,
61
61
  referrer: T,
62
62
  importAttributes: ImportAttributes,
63
+ phase: "source" | "evaluation",
63
64
  ) => Module | Promise<Module>;
64
65
  interface ScriptOptions extends BaseOptions {
65
66
  /**
@@ -71,7 +72,8 @@ declare module "vm" {
71
72
  /**
72
73
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
73
74
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
74
- * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v22.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
75
+ * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
76
+ * @experimental
75
77
  */
76
78
  importModuleDynamically?:
77
79
  | DynamicModuleLoader<Script>
@@ -122,7 +124,8 @@ declare module "vm" {
122
124
  /**
123
125
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
124
126
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
125
- * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v22.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
127
+ * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
128
+ * @experimental
126
129
  */
127
130
  importModuleDynamically?:
128
131
  | DynamicModuleLoader<Script>
@@ -137,7 +140,8 @@ declare module "vm" {
137
140
  /**
138
141
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
139
142
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
140
- * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v22.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
143
+ * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
144
+ * @experimental
141
145
  */
142
146
  importModuleDynamically?:
143
147
  | DynamicModuleLoader<Script>
@@ -165,7 +169,8 @@ declare module "vm" {
165
169
  /**
166
170
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
167
171
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
168
- * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v22.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
172
+ * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
173
+ * @experimental
169
174
  */
170
175
  importModuleDynamically?:
171
176
  | DynamicModuleLoader<ReturnType<typeof compileFunction>>
@@ -208,7 +213,8 @@ declare module "vm" {
208
213
  /**
209
214
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
210
215
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
211
- * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v22.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
216
+ * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
217
+ * @experimental
212
218
  */
213
219
  importModuleDynamically?:
214
220
  | DynamicModuleLoader<Context>
@@ -410,9 +416,9 @@ declare module "vm" {
410
416
  }
411
417
  /**
412
418
  * If the given `contextObject` is an object, the `vm.createContext()` method will
413
- * [prepare that object](https://nodejs.org/docs/latest-v22.x/api/vm.html#what-does-it-mean-to-contextify-an-object)
419
+ * [prepare that object](https://nodejs.org/docs/latest-v24.x/api/vm.html#what-does-it-mean-to-contextify-an-object)
414
420
  * and return a reference to it so that it can be used in calls to {@link runInContext} or
415
- * [`script.runInContext()`](https://nodejs.org/docs/latest-v22.x/api/vm.html#scriptrunincontextcontextifiedobject-options).
421
+ * [`script.runInContext()`](https://nodejs.org/docs/latest-v24.x/api/vm.html#scriptrunincontextcontextifiedobject-options).
416
422
  * Inside such scripts, the global object will be wrapped by the `contextObject`, retaining all of its
417
423
  * existing properties but also having the built-in objects and functions any standard
418
424
  * [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global
@@ -907,7 +913,8 @@ declare module "vm" {
907
913
  /**
908
914
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
909
915
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
910
- * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v22.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
916
+ * [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
917
+ * @experimental
911
918
  */
912
919
  importModuleDynamically?: DynamicModuleLoader<SourceTextModule> | undefined;
913
920
  }
@@ -1005,7 +1012,7 @@ declare module "vm" {
1005
1012
  * and `vm.compileFunction()` so that Node.js uses the default ESM loader from the main
1006
1013
  * context to load the requested module.
1007
1014
  *
1008
- * For detailed information, see [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v22.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
1015
+ * For detailed information, see [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
1009
1016
  * @since v21.7.0, v20.12.0
1010
1017
  */
1011
1018
  const USE_MAIN_CONTEXT_DEFAULT_LOADER: number;
@@ -67,7 +67,7 @@
67
67
  * wat2wasm demo.wat
68
68
  * ```
69
69
  * @experimental
70
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/wasi.js)
70
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/wasi.js)
71
71
  */
72
72
  declare module "wasi" {
73
73
  interface WASIOptions {
@@ -15,28 +15,31 @@
15
15
  *
16
16
  * ```js
17
17
  * import {
18
- * Worker, isMainThread, parentPort, workerData,
18
+ * Worker,
19
+ * isMainThread,
20
+ * parentPort,
21
+ * workerData,
19
22
  * } from 'node:worker_threads';
20
- * import { parse } from 'some-js-parsing-library';
21
23
  *
22
- * if (isMainThread) {
23
- * module.exports = function parseJSAsync(script) {
24
- * return new Promise((resolve, reject) => {
25
- * const worker = new Worker(__filename, {
26
- * workerData: script,
27
- * });
28
- * worker.on('message', resolve);
29
- * worker.on('error', reject);
30
- * worker.on('exit', (code) => {
31
- * if (code !== 0)
32
- * reject(new Error(`Worker stopped with exit code ${code}`));
33
- * });
34
- * });
35
- * };
36
- * } else {
24
+ * if (!isMainThread) {
25
+ * const { parse } = await import('some-js-parsing-library');
37
26
  * const script = workerData;
38
27
  * parentPort.postMessage(parse(script));
39
28
  * }
29
+ *
30
+ * export default function parseJSAsync(script) {
31
+ * return new Promise((resolve, reject) => {
32
+ * const worker = new Worker(new URL(import.meta.url), {
33
+ * workerData: script,
34
+ * });
35
+ * worker.on('message', resolve);
36
+ * worker.on('error', reject);
37
+ * worker.on('exit', (code) => {
38
+ * if (code !== 0)
39
+ * reject(new Error(`Worker stopped with exit code ${code}`));
40
+ * });
41
+ * });
42
+ * };
40
43
  * ```
41
44
  *
42
45
  * The above example spawns a Worker thread for each `parseJSAsync()` call. In
@@ -49,7 +52,7 @@
49
52
  *
50
53
  * Worker threads inherit non-process-specific options by default. Refer to `Worker constructor options` to know how to customize worker thread options,
51
54
  * specifically `argv` and `execArgv` options.
52
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/worker_threads.js)
55
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/worker_threads.js)
53
56
  */
54
57
  declare module "worker_threads" {
55
58
  import { Context } from "node:vm";
@@ -59,6 +62,7 @@ declare module "worker_threads" {
59
62
  import { Readable, Writable } from "node:stream";
60
63
  import { ReadableStream, TransformStream, WritableStream } from "node:stream/web";
61
64
  import { URL } from "node:url";
65
+ import { HeapInfo } from "node:v8";
62
66
  const isInternalThread: boolean;
63
67
  const isMainThread: boolean;
64
68
  const parentPort: null | MessagePort;
@@ -184,6 +188,11 @@ declare module "worker_threads" {
184
188
  * @since v10.5.0
185
189
  */
186
190
  postMessage(value: any, transferList?: readonly Transferable[]): void;
191
+ /**
192
+ * If true, the `MessagePort` object will keep the Node.js event loop active.
193
+ * @since v18.1.0, v16.17.0
194
+ */
195
+ hasRef(): boolean;
187
196
  /**
188
197
  * Opposite of `unref()`. Calling `ref()` on a previously `unref()`ed port does _not_ let the program exit if it's the only active handle left (the default
189
198
  * behavior). If the port is `ref()`ed, calling `ref()` again has no effect.
@@ -466,6 +475,13 @@ declare module "worker_threads" {
466
475
  * @return A promise for a Readable Stream containing a V8 heap snapshot
467
476
  */
468
477
  getHeapSnapshot(): Promise<Readable>;
478
+ /**
479
+ * This method returns a `Promise` that will resolve to an object identical to `v8.getHeapStatistics()`,
480
+ * or reject with an `ERR_WORKER_NOT_RUNNING` error if the worker is no longer running.
481
+ * This methods allows the statistics to be observed from outside the actual thread.
482
+ * @since v24.0.0
483
+ */
484
+ getHeapStatistics(): Promise<HeapInfo>;
469
485
  addListener(event: "error", listener: (err: Error) => void): this;
470
486
  addListener(event: "exit", listener: (exitCode: number) => void): this;
471
487
  addListener(event: "message", listener: (value: any) => void): this;
@@ -9,7 +9,7 @@
9
9
  * ```
10
10
  *
11
11
  * Compression and decompression are built around the Node.js
12
- * [Streams API](https://nodejs.org/docs/latest-v22.x/api/stream.html).
12
+ * [Streams API](https://nodejs.org/docs/latest-v24.x/api/stream.html).
13
13
  *
14
14
  * Compressing or decompressing a stream (such as a file) can be accomplished by
15
15
  * piping the source stream through a `zlib` `Transform` stream into a destination
@@ -89,7 +89,7 @@
89
89
  * });
90
90
  * ```
91
91
  * @since v0.5.8
92
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/zlib.js)
92
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/zlib.js)
93
93
  */
94
94
  declare module "zlib" {
95
95
  import * as stream from "node:stream";
@@ -143,7 +143,7 @@ declare module "zlib" {
143
143
  }
144
144
  | undefined;
145
145
  /**
146
- * Limits output size when using [convenience methods](https://nodejs.org/docs/latest-v22.x/api/zlib.html#convenience-methods).
146
+ * Limits output size when using [convenience methods](https://nodejs.org/docs/latest-v24.x/api/zlib.html#convenience-methods).
147
147
  * @default buffer.kMaxLength
148
148
  */
149
149
  maxOutputLength?: number | undefined;
@@ -163,19 +163,17 @@ declare module "zlib" {
163
163
  chunkSize?: number | undefined;
164
164
  /**
165
165
  * Key-value object containing indexed
166
- * [Zstd parameters](https://nodejs.org/docs/latest-v22.x/api/zlib.html#zstd-constants).
166
+ * [Zstd parameters](https://nodejs.org/docs/latest-v24.x/api/zlib.html#zstd-constants).
167
167
  */
168
168
  params?: { [key: number]: number | boolean } | undefined;
169
169
  /**
170
170
  * Limits output size when using
171
- * [convenience methods](https://nodejs.org/docs/latest-v22.x/api/zlib.html#convenience-methods).
171
+ * [convenience methods](https://nodejs.org/docs/latest-v24.x/api/zlib.html#convenience-methods).
172
172
  * @default buffer.kMaxLength
173
173
  */
174
174
  maxOutputLength?: number | undefined;
175
175
  }
176
176
  interface Zlib {
177
- /** @deprecated Use bytesWritten instead. */
178
- readonly bytesRead: number;
179
177
  readonly bytesWritten: number;
180
178
  shell?: boolean | string | undefined;
181
179
  close(callback?: () => void): void;
@@ -1,17 +1,17 @@
1
1
  import { URL } from 'url'
2
2
  import Pool from './pool'
3
- import Dispatcher from "./dispatcher";
3
+ import Dispatcher from './dispatcher'
4
4
 
5
5
  export default Agent
6
6
 
7
- declare class Agent extends Dispatcher{
8
- constructor(opts?: Agent.Options)
7
+ declare class Agent extends Dispatcher {
8
+ constructor (opts?: Agent.Options)
9
9
  /** `true` after `dispatcher.close()` has been called. */
10
- closed: boolean;
10
+ closed: boolean
11
11
  /** `true` after `dispatcher.destroyed()` has been called or `dispatcher.close()` has been called and the dispatcher shutdown has completed. */
12
- destroyed: boolean;
12
+ destroyed: boolean
13
13
  /** Dispatches a request. */
14
- dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
14
+ dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
15
15
  }
16
16
 
17
17
  declare namespace Agent {
@@ -21,7 +21,7 @@ declare namespace Agent {
21
21
  /** Integer. Default: `0` */
22
22
  maxRedirections?: number;
23
23
 
24
- interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options["interceptors"]
24
+ interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options['interceptors']
25
25
  }
26
26
 
27
27
  export interface DispatchOptions extends Dispatcher.DispatchOptions {
@@ -2,42 +2,42 @@ import { URL, UrlObject } from 'url'
2
2
  import { Duplex } from 'stream'
3
3
  import Dispatcher from './dispatcher'
4
4
 
5
- export {
6
- request,
7
- stream,
8
- pipeline,
9
- connect,
10
- upgrade,
11
- }
12
-
13
5
  /** Performs an HTTP request. */
14
- declare function request(
6
+ declare function request<TOpaque = null> (
15
7
  url: string | URL | UrlObject,
16
- options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
17
- ): Promise<Dispatcher.ResponseData>;
8
+ options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions<TOpaque>, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
9
+ ): Promise<Dispatcher.ResponseData<TOpaque>>
18
10
 
19
11
  /** A faster version of `request`. */
20
- declare function stream(
12
+ declare function stream<TOpaque = null> (
21
13
  url: string | URL | UrlObject,
22
- options: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path'>,
23
- factory: Dispatcher.StreamFactory
24
- ): Promise<Dispatcher.StreamData>;
14
+ options: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions<TOpaque>, 'origin' | 'path'>,
15
+ factory: Dispatcher.StreamFactory<TOpaque>
16
+ ): Promise<Dispatcher.StreamData<TOpaque>>
25
17
 
26
18
  /** For easy use with `stream.pipeline`. */
27
- declare function pipeline(
19
+ declare function pipeline<TOpaque = null> (
28
20
  url: string | URL | UrlObject,
29
- options: { dispatcher?: Dispatcher } & Omit<Dispatcher.PipelineOptions, 'origin' | 'path'>,
30
- handler: Dispatcher.PipelineHandler
31
- ): Duplex;
21
+ options: { dispatcher?: Dispatcher } & Omit<Dispatcher.PipelineOptions<TOpaque>, 'origin' | 'path'>,
22
+ handler: Dispatcher.PipelineHandler<TOpaque>
23
+ ): Duplex
32
24
 
33
25
  /** Starts two-way communications with the requested resource. */
34
- declare function connect(
26
+ declare function connect<TOpaque = null> (
35
27
  url: string | URL | UrlObject,
36
- options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions, 'origin' | 'path'>
37
- ): Promise<Dispatcher.ConnectData>;
28
+ options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions<TOpaque>, 'origin' | 'path'>
29
+ ): Promise<Dispatcher.ConnectData<TOpaque>>
38
30
 
39
31
  /** Upgrade to a different protocol. */
40
- declare function upgrade(
32
+ declare function upgrade (
41
33
  url: string | URL | UrlObject,
42
34
  options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.UpgradeOptions, 'origin' | 'path'>
43
- ): Promise<Dispatcher.UpgradeData>;
35
+ ): Promise<Dispatcher.UpgradeData>
36
+
37
+ export {
38
+ request,
39
+ stream,
40
+ pipeline,
41
+ connect,
42
+ upgrade
43
+ }
@@ -4,26 +4,26 @@ import { URL } from 'url'
4
4
 
5
5
  export default BalancedPool
6
6
 
7
- type BalancedPoolConnectOptions = Omit<Dispatcher.ConnectOptions, "origin">;
7
+ type BalancedPoolConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
8
8
 
9
9
  declare class BalancedPool extends Dispatcher {
10
- constructor(url: string | string[] | URL | URL[], options?: Pool.Options);
10
+ constructor (url: string | string[] | URL | URL[], options?: Pool.Options)
11
11
 
12
- addUpstream(upstream: string | URL): BalancedPool;
13
- removeUpstream(upstream: string | URL): BalancedPool;
14
- upstreams: Array<string>;
12
+ addUpstream (upstream: string | URL): BalancedPool
13
+ removeUpstream (upstream: string | URL): BalancedPool
14
+ upstreams: Array<string>
15
15
 
16
16
  /** `true` after `pool.close()` has been called. */
17
- closed: boolean;
17
+ closed: boolean
18
18
  /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
19
- destroyed: boolean;
19
+ destroyed: boolean
20
20
 
21
21
  // Override dispatcher APIs.
22
- override connect(
22
+ override connect (
23
23
  options: BalancedPoolConnectOptions
24
- ): Promise<Dispatcher.ConnectData>;
25
- override connect(
24
+ ): Promise<Dispatcher.ConnectData>
25
+ override connect (
26
26
  options: BalancedPoolConnectOptions,
27
27
  callback: (err: Error | null, data: Dispatcher.ConnectData) => void
28
- ): void;
28
+ ): void
29
29
  }
@@ -0,0 +1,172 @@
1
+ import { Readable, Writable } from 'node:stream'
2
+
3
+ export default CacheHandler
4
+
5
+ declare namespace CacheHandler {
6
+ export type CacheMethods = 'GET' | 'HEAD' | 'OPTIONS' | 'TRACE'
7
+
8
+ export interface CacheHandlerOptions {
9
+ store: CacheStore
10
+
11
+ cacheByDefault?: number
12
+
13
+ type?: CacheOptions['type']
14
+ }
15
+
16
+ export interface CacheOptions {
17
+ store?: CacheStore
18
+
19
+ /**
20
+ * The methods to cache
21
+ * Note we can only cache safe methods. Unsafe methods (i.e. PUT, POST)
22
+ * invalidate the cache for a origin.
23
+ * @see https://www.rfc-editor.org/rfc/rfc9111.html#name-invalidating-stored-respons
24
+ * @see https://www.rfc-editor.org/rfc/rfc9110#section-9.2.1
25
+ */
26
+ methods?: CacheMethods[]
27
+
28
+ /**
29
+ * RFC9111 allows for caching responses that we aren't explicitly told to
30
+ * cache or to not cache.
31
+ * @see https://www.rfc-editor.org/rfc/rfc9111.html#section-3-5
32
+ * @default undefined
33
+ */
34
+ cacheByDefault?: number
35
+
36
+ /**
37
+ * TODO docs
38
+ * @default 'shared'
39
+ */
40
+ type?: 'shared' | 'private'
41
+ }
42
+
43
+ export interface CacheControlDirectives {
44
+ 'max-stale'?: number;
45
+ 'min-fresh'?: number;
46
+ 'max-age'?: number;
47
+ 's-maxage'?: number;
48
+ 'stale-while-revalidate'?: number;
49
+ 'stale-if-error'?: number;
50
+ public?: true;
51
+ private?: true | string[];
52
+ 'no-store'?: true;
53
+ 'no-cache'?: true | string[];
54
+ 'must-revalidate'?: true;
55
+ 'proxy-revalidate'?: true;
56
+ immutable?: true;
57
+ 'no-transform'?: true;
58
+ 'must-understand'?: true;
59
+ 'only-if-cached'?: true;
60
+ }
61
+
62
+ export interface CacheKey {
63
+ origin: string
64
+ method: string
65
+ path: string
66
+ headers?: Record<string, string | string[]>
67
+ }
68
+
69
+ export interface CacheValue {
70
+ statusCode: number
71
+ statusMessage: string
72
+ headers: Record<string, string | string[]>
73
+ vary?: Record<string, string | string[] | null>
74
+ etag?: string
75
+ cacheControlDirectives?: CacheControlDirectives
76
+ cachedAt: number
77
+ staleAt: number
78
+ deleteAt: number
79
+ }
80
+
81
+ export interface DeleteByUri {
82
+ origin: string
83
+ method: string
84
+ path: string
85
+ }
86
+
87
+ type GetResult = {
88
+ statusCode: number
89
+ statusMessage: string
90
+ headers: Record<string, string | string[]>
91
+ vary?: Record<string, string | string[] | null>
92
+ etag?: string
93
+ body?: Readable | Iterable<Buffer> | AsyncIterable<Buffer> | Buffer | Iterable<string> | AsyncIterable<string> | string
94
+ cacheControlDirectives: CacheControlDirectives,
95
+ cachedAt: number
96
+ staleAt: number
97
+ deleteAt: number
98
+ }
99
+
100
+ /**
101
+ * Underlying storage provider for cached responses
102
+ */
103
+ export interface CacheStore {
104
+ get(key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
105
+
106
+ createWriteStream(key: CacheKey, val: CacheValue): Writable | undefined
107
+
108
+ delete(key: CacheKey): void | Promise<void>
109
+ }
110
+
111
+ export interface MemoryCacheStoreOpts {
112
+ /**
113
+ * @default Infinity
114
+ */
115
+ maxCount?: number
116
+
117
+ /**
118
+ * @default Infinity
119
+ */
120
+ maxSize?: number
121
+
122
+ /**
123
+ * @default Infinity
124
+ */
125
+ maxEntrySize?: number
126
+
127
+ errorCallback?: (err: Error) => void
128
+ }
129
+
130
+ export class MemoryCacheStore implements CacheStore {
131
+ constructor (opts?: MemoryCacheStoreOpts)
132
+
133
+ get (key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
134
+
135
+ createWriteStream (key: CacheKey, value: CacheValue): Writable | undefined
136
+
137
+ delete (key: CacheKey): void | Promise<void>
138
+ }
139
+
140
+ export interface SqliteCacheStoreOpts {
141
+ /**
142
+ * Location of the database
143
+ * @default ':memory:'
144
+ */
145
+ location?: string
146
+
147
+ /**
148
+ * @default Infinity
149
+ */
150
+ maxCount?: number
151
+
152
+ /**
153
+ * @default Infinity
154
+ */
155
+ maxEntrySize?: number
156
+ }
157
+
158
+ export class SqliteCacheStore implements CacheStore {
159
+ constructor (opts?: SqliteCacheStoreOpts)
160
+
161
+ /**
162
+ * Closes the connection to the database
163
+ */
164
+ close (): void
165
+
166
+ get (key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
167
+
168
+ createWriteStream (key: CacheKey, value: CacheValue): Writable | undefined
169
+
170
+ delete (key: CacheKey): void | Promise<void>
171
+ }
172
+ }