cdk-ecr-deployment 3.0.81 → 3.0.82

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 (51) hide show
  1. package/.jsii +2 -2
  2. package/lib/index.js +3 -3
  3. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
  4. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +11 -0
  5. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +16 -0
  6. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +3 -3
  7. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +121 -2
  8. package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +128 -1
  9. package/node_modules/@types/cacheable-request/node_modules/undici-types/dispatcher.d.ts +4 -4
  10. package/node_modules/@types/cacheable-request/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  11. package/node_modules/@types/cacheable-request/node_modules/undici-types/eventsource.d.ts +4 -2
  12. package/node_modules/@types/cacheable-request/node_modules/undici-types/fetch.d.ts +2 -1
  13. package/node_modules/@types/cacheable-request/node_modules/undici-types/index.d.ts +7 -1
  14. package/node_modules/@types/cacheable-request/node_modules/undici-types/interceptors.d.ts +8 -2
  15. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-interceptor.d.ts +4 -4
  16. package/node_modules/@types/cacheable-request/node_modules/undici-types/package.json +1 -1
  17. package/node_modules/@types/cacheable-request/node_modules/undici-types/util.d.ts +4 -17
  18. package/node_modules/@types/cacheable-request/node_modules/undici-types/webidl.d.ts +7 -8
  19. package/node_modules/@types/keyv/node_modules/@types/node/README.md +1 -1
  20. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +11 -0
  21. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +16 -0
  22. package/node_modules/@types/keyv/node_modules/@types/node/package.json +3 -3
  23. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +121 -2
  24. package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +128 -1
  25. package/node_modules/@types/keyv/node_modules/undici-types/dispatcher.d.ts +4 -4
  26. package/node_modules/@types/keyv/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  27. package/node_modules/@types/keyv/node_modules/undici-types/eventsource.d.ts +4 -2
  28. package/node_modules/@types/keyv/node_modules/undici-types/fetch.d.ts +2 -1
  29. package/node_modules/@types/keyv/node_modules/undici-types/index.d.ts +7 -1
  30. package/node_modules/@types/keyv/node_modules/undici-types/interceptors.d.ts +8 -2
  31. package/node_modules/@types/keyv/node_modules/undici-types/mock-interceptor.d.ts +4 -4
  32. package/node_modules/@types/keyv/node_modules/undici-types/package.json +1 -1
  33. package/node_modules/@types/keyv/node_modules/undici-types/util.d.ts +4 -17
  34. package/node_modules/@types/keyv/node_modules/undici-types/webidl.d.ts +7 -8
  35. package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
  36. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +11 -0
  37. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +16 -0
  38. package/node_modules/@types/responselike/node_modules/@types/node/package.json +3 -3
  39. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +121 -2
  40. package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +128 -1
  41. package/node_modules/@types/responselike/node_modules/undici-types/dispatcher.d.ts +4 -4
  42. package/node_modules/@types/responselike/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  43. package/node_modules/@types/responselike/node_modules/undici-types/eventsource.d.ts +4 -2
  44. package/node_modules/@types/responselike/node_modules/undici-types/fetch.d.ts +2 -1
  45. package/node_modules/@types/responselike/node_modules/undici-types/index.d.ts +7 -1
  46. package/node_modules/@types/responselike/node_modules/undici-types/interceptors.d.ts +8 -2
  47. package/node_modules/@types/responselike/node_modules/undici-types/mock-interceptor.d.ts +4 -4
  48. package/node_modules/@types/responselike/node_modules/undici-types/package.json +1 -1
  49. package/node_modules/@types/responselike/node_modules/undici-types/util.d.ts +4 -17
  50. package/node_modules/@types/responselike/node_modules/undici-types/webidl.d.ts +7 -8
  51. package/package.json +1 -1
@@ -8,24 +8,11 @@ export namespace util {
8
8
  /**
9
9
  * Receives a header object and returns the parsed value.
10
10
  * @param headers Header object
11
+ * @param obj Object to specify a proxy object. Used to assign parsed values.
12
+ * @returns If `obj` is specified, it is equivalent to `obj`.
11
13
  */
12
14
  export function parseHeaders(
13
- headers:
14
- | Record<string, string | string[]>
15
- | (Buffer | string | (Buffer | string)[])[]
16
- ): Record<string, string | string[]>;
17
- /**
18
- * Receives a header object and returns the parsed value.
19
- * @param headers Header object
20
- * @param obj Object to specify a proxy object. Used to assign parsed values. But, if `headers` is an object, it is not used.
21
- * @returns If `headers` is an object, it is `headers`. Otherwise, if `obj` is specified, it is equivalent to `obj`.
22
- */
23
- export function parseHeaders<
24
- H extends
25
- | Record<string, string | string[]>
26
- | (Buffer | string | (Buffer | string)[])[]
27
- >(
28
- headers: H,
29
- obj?: H extends any[] ? Record<string, string | string[]> : never
15
+ headers: (Buffer | string | (Buffer | string)[])[],
16
+ obj?: Record<string, string | string[]>
30
17
  ): Record<string, string | string[]>;
31
18
  }
@@ -55,7 +55,9 @@ interface WebidlUtil {
55
55
  V: unknown,
56
56
  bitLength: number,
57
57
  signedness: 'signed' | 'unsigned',
58
- opts?: ConvertToIntOpts
58
+ opts?: ConvertToIntOpts,
59
+ prefix: string,
60
+ argument: string
59
61
  ): number
60
62
 
61
63
  /**
@@ -73,14 +75,14 @@ interface WebidlConverters {
73
75
  /**
74
76
  * @see https://webidl.spec.whatwg.org/#es-DOMString
75
77
  */
76
- DOMString (V: unknown, opts?: {
78
+ DOMString (V: unknown, prefix: string, argument: string, opts?: {
77
79
  legacyNullToEmptyString: boolean
78
80
  }): string
79
81
 
80
82
  /**
81
83
  * @see https://webidl.spec.whatwg.org/#es-ByteString
82
84
  */
83
- ByteString (V: unknown): string
85
+ ByteString (V: unknown, prefix: string, argument: string): string
84
86
 
85
87
  /**
86
88
  * @see https://webidl.spec.whatwg.org/#es-USVString
@@ -204,7 +206,7 @@ export interface Webidl {
204
206
  */
205
207
  dictionaryConverter (converters: {
206
208
  key: string,
207
- defaultValue?: unknown,
209
+ defaultValue?: () => unknown,
208
210
  required?: boolean,
209
211
  converter: (...args: unknown[]) => unknown,
210
212
  allowedValues?: unknown[]
@@ -218,8 +220,5 @@ export interface Webidl {
218
220
  converter: Converter<T>
219
221
  ): (V: unknown) => ReturnType<typeof converter> | null
220
222
 
221
- argumentLengthCheck (args: { length: number }, min: number, context: {
222
- header: string
223
- message?: string
224
- }): void
223
+ argumentLengthCheck (args: { length: number }, min: number, context: string): void
225
224
  }
@@ -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: Fri, 09 Aug 2024 18:08:59 GMT
11
+ * Last updated: Wed, 14 Aug 2024 07:35:57 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -170,6 +170,17 @@ declare module "buffer" {
170
170
  * @since v15.7.0, v14.18.0
171
171
  */
172
172
  arrayBuffer(): Promise<ArrayBuffer>;
173
+ /**
174
+ * The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise<Uint8Array>`.
175
+ *
176
+ * ```js
177
+ * const blob = new Blob(['hello']);
178
+ * blob.bytes().then((bytes) => {
179
+ * console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]
180
+ * });
181
+ * ```
182
+ */
183
+ bytes(): Promise<Uint8Array>;
173
184
  /**
174
185
  * Creates and returns a new `Blob` containing a subset of this `Blob` objects
175
186
  * data. The original `Blob` is not altered.
@@ -7,12 +7,14 @@ type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undi
7
7
  type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response;
8
8
  type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData;
9
9
  type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers;
10
+ type _MessageEvent = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").MessageEvent;
10
11
  type _RequestInit = typeof globalThis extends { onmessage: any } ? {}
11
12
  : import("undici-types").RequestInit;
12
13
  type _ResponseInit = typeof globalThis extends { onmessage: any } ? {}
13
14
  : import("undici-types").ResponseInit;
14
15
  type _File = typeof globalThis extends { onmessage: any } ? {} : import("node:buffer").File;
15
16
  type _WebSocket = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").WebSocket;
17
+ type _EventSource = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").EventSource;
16
18
  // #endregion Fetch and friends
17
19
 
18
20
  declare global {
@@ -404,6 +406,13 @@ declare global {
404
406
  } ? T
405
407
  : typeof import("undici-types").Headers;
406
408
 
409
+ interface MessageEvent extends _MessageEvent {}
410
+ var MessageEvent: typeof globalThis extends {
411
+ onmessage: any;
412
+ MessageEvent: infer T;
413
+ } ? T
414
+ : typeof import("undici-types").MessageEvent;
415
+
407
416
  interface File extends _File {}
408
417
  var File: typeof globalThis extends {
409
418
  onmessage: any;
@@ -414,4 +423,11 @@ declare global {
414
423
  interface WebSocket extends _WebSocket {}
415
424
  var WebSocket: typeof globalThis extends { onmessage: any; WebSocket: infer T } ? T
416
425
  : typeof import("undici-types").WebSocket;
426
+
427
+ interface EventSource extends _EventSource {}
428
+ /**
429
+ * Only available through the [--experimental-eventsource](https://nodejs.org/api/cli.html#--experimental-eventsource) flag.
430
+ */
431
+ var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T
432
+ : typeof import("undici-types").EventSource;
417
433
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "22.2.0",
3
+ "version": "22.3.0",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -210,8 +210,8 @@
210
210
  },
211
211
  "scripts": {},
212
212
  "dependencies": {
213
- "undici-types": "~6.13.0"
213
+ "undici-types": "~6.18.2"
214
214
  },
215
- "typesPublisherContentHash": "e8a1feecc621a4e4c40517dba1262b6a77dcb9cdd874f74c76cb391931926c7c",
215
+ "typesPublisherContentHash": "620b8a407d4118e9931ab6e01ed7af87ce13d63daa46a4098fca6d43eaf853db",
216
216
  "typeScriptVersion": "4.8"
217
217
  }
@@ -1,8 +1,121 @@
1
1
  declare module "process" {
2
- import * as net from "node:net";
3
- import * as os from "node:os";
4
2
  import * as tty from "node:tty";
5
3
  import { Worker } from "node:worker_threads";
4
+
5
+ interface BuiltInModule {
6
+ "assert": typeof import("assert");
7
+ "node:assert": typeof import("node:assert");
8
+ "assert/strict": typeof import("assert/strict");
9
+ "node:assert/strict": typeof import("node:assert/strict");
10
+ "async_hooks": typeof import("async_hooks");
11
+ "node:async_hooks": typeof import("node:async_hooks");
12
+ "buffer": typeof import("buffer");
13
+ "node:buffer": typeof import("node:buffer");
14
+ "child_process": typeof import("child_process");
15
+ "node:child_process": typeof import("node:child_process");
16
+ "cluster": typeof import("cluster");
17
+ "node:cluster": typeof import("node:cluster");
18
+ "console": typeof import("console");
19
+ "node:console": typeof import("node:console");
20
+ "constants": typeof import("constants");
21
+ "node:constants": typeof import("node:constants");
22
+ "crypto": typeof import("crypto");
23
+ "node:crypto": typeof import("node:crypto");
24
+ "dgram": typeof import("dgram");
25
+ "node:dgram": typeof import("node:dgram");
26
+ "diagnostics_channel": typeof import("diagnostics_channel");
27
+ "node:diagnostics_channel": typeof import("node:diagnostics_channel");
28
+ "dns": typeof import("dns");
29
+ "node:dns": typeof import("node:dns");
30
+ "dns/promises": typeof import("dns/promises");
31
+ "node:dns/promises": typeof import("node:dns/promises");
32
+ "domain": typeof import("domain");
33
+ "node:domain": typeof import("node:domain");
34
+ "events": typeof import("events");
35
+ "node:events": typeof import("node:events");
36
+ "fs": typeof import("fs");
37
+ "node:fs": typeof import("node:fs");
38
+ "fs/promises": typeof import("fs/promises");
39
+ "node:fs/promises": typeof import("node:fs/promises");
40
+ "http": typeof import("http");
41
+ "node:http": typeof import("node:http");
42
+ "http2": typeof import("http2");
43
+ "node:http2": typeof import("node:http2");
44
+ "https": typeof import("https");
45
+ "node:https": typeof import("node:https");
46
+ "inspector": typeof import("inspector");
47
+ "node:inspector": typeof import("node:inspector");
48
+ // FIXME: module is missed
49
+ // "inspector/promises": typeof import("inspector/promises");
50
+ // "node:inspector/promises": typeof import("node:inspector/promises");
51
+ "module": typeof import("module");
52
+ "node:module": typeof import("node:module");
53
+ "net": typeof import("net");
54
+ "node:net": typeof import("node:net");
55
+ "os": typeof import("os");
56
+ "node:os": typeof import("node:os");
57
+ "path": typeof import("path");
58
+ "node:path": typeof import("node:path");
59
+ "path/posix": typeof import("path/posix");
60
+ "node:path/posix": typeof import("node:path/posix");
61
+ "path/win32": typeof import("path/win32");
62
+ "node:path/win32": typeof import("node:path/win32");
63
+ "perf_hooks": typeof import("perf_hooks");
64
+ "node:perf_hooks": typeof import("node:perf_hooks");
65
+ "process": typeof import("process");
66
+ "node:process": typeof import("node:process");
67
+ "punycode": typeof import("punycode");
68
+ "node:punycode": typeof import("node:punycode");
69
+ "querystring": typeof import("querystring");
70
+ "node:querystring": typeof import("node:querystring");
71
+ "readline": typeof import("readline");
72
+ "node:readline": typeof import("node:readline");
73
+ "readline/promises": typeof import("readline/promises");
74
+ "node:readline/promises": typeof import("node:readline/promises");
75
+ "repl": typeof import("repl");
76
+ "node:repl": typeof import("node:repl");
77
+ "node:sea": typeof import("node:sea");
78
+ "stream": typeof import("stream");
79
+ "node:stream": typeof import("node:stream");
80
+ "stream/consumers": typeof import("stream/consumers");
81
+ "node:stream/consumers": typeof import("node:stream/consumers");
82
+ "stream/promises": typeof import("stream/promises");
83
+ "node:stream/promises": typeof import("node:stream/promises");
84
+ "stream/web": typeof import("stream/web");
85
+ "node:stream/web": typeof import("node:stream/web");
86
+ "string_decoder": typeof import("string_decoder");
87
+ "node:string_decoder": typeof import("node:string_decoder");
88
+ "node:test": typeof import("node:test");
89
+ "node:test/reporters": typeof import("node:test/reporters");
90
+ "timers": typeof import("timers");
91
+ "node:timers": typeof import("node:timers");
92
+ "timers/promises": typeof import("timers/promises");
93
+ "node:timers/promises": typeof import("node:timers/promises");
94
+ "tls": typeof import("tls");
95
+ "node:tls": typeof import("node:tls");
96
+ "trace_events": typeof import("trace_events");
97
+ "node:trace_events": typeof import("node:trace_events");
98
+ "tty": typeof import("tty");
99
+ "node:tty": typeof import("node:tty");
100
+ "url": typeof import("url");
101
+ "node:url": typeof import("node:url");
102
+ "util": typeof import("util");
103
+ "node:util": typeof import("node:util");
104
+ "sys": typeof import("util");
105
+ "node:sys": typeof import("node:util");
106
+ "util/types": typeof import("util/types");
107
+ "node:util/types": typeof import("node:util/types");
108
+ "v8": typeof import("v8");
109
+ "node:v8": typeof import("node:v8");
110
+ "vm": typeof import("vm");
111
+ "node:vm": typeof import("node:vm");
112
+ "wasi": typeof import("wasi");
113
+ "node:wasi": typeof import("node:wasi");
114
+ "worker_threads": typeof import("worker_threads");
115
+ "node:worker_threads": typeof import("node:worker_threads");
116
+ "zlib": typeof import("zlib");
117
+ "node:zlib": typeof import("node:zlib");
118
+ }
6
119
  global {
7
120
  var process: NodeJS.Process;
8
121
  namespace NodeJS {
@@ -793,6 +906,12 @@ declare module "process" {
793
906
  * @since v17.3.0, v16.14.0
794
907
  */
795
908
  getActiveResourcesInfo(): string[];
909
+ /**
910
+ * Provides a way to load built-in modules in a globally available function.
911
+ * @param id ID of the built-in module being requested.
912
+ */
913
+ getBuiltinModule<ID extends keyof BuiltInModule>(id: ID): BuiltInModule[ID];
914
+ getBuiltinModule(id: string): object | undefined;
796
915
  /**
797
916
  * The `process.getgid()` method returns the numerical group identity of the
798
917
  * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).)
@@ -144,7 +144,22 @@ declare module "node:test" {
144
144
  function test(options?: TestOptions, fn?: TestFn): Promise<void>;
145
145
  function test(fn?: TestFn): Promise<void>;
146
146
  namespace test {
147
- export { after, afterEach, before, beforeEach, describe, it, mock, only, run, skip, suite, test, todo };
147
+ export {
148
+ after,
149
+ afterEach,
150
+ before,
151
+ beforeEach,
152
+ describe,
153
+ it,
154
+ mock,
155
+ only,
156
+ run,
157
+ skip,
158
+ snapshot,
159
+ suite,
160
+ test,
161
+ todo,
162
+ };
148
163
  }
149
164
  /**
150
165
  * The `suite()` function is imported from the `node:test` module.
@@ -509,6 +524,11 @@ declare module "node:test" {
509
524
  * @param message Message to be reported.
510
525
  */
511
526
  diagnostic(message: string): void;
527
+ /**
528
+ * The name of the test and each of its ancestors, separated by `>`.
529
+ * @since v22.3.0
530
+ */
531
+ readonly fullName: string;
512
532
  /**
513
533
  * The name of the test.
514
534
  * @since v18.8.0, v16.18.0
@@ -695,6 +715,36 @@ declare module "node:test" {
695
715
  * Identical to the `throws` function from the `node:assert` module, but bound to the test context.
696
716
  */
697
717
  throws: typeof import("node:assert").throws;
718
+ /**
719
+ * This function implements assertions for snapshot testing.
720
+ * ```js
721
+ * test('snapshot test with default serialization', (t) => {
722
+ * t.assert.snapshot({ value1: 1, value2: 2 });
723
+ * });
724
+ *
725
+ * test('snapshot test with custom serialization', (t) => {
726
+ * t.assert.snapshot({ value3: 3, value4: 4 }, {
727
+ * serializers: [(value) => JSON.stringify(value)]
728
+ * });
729
+ * });
730
+ * ```
731
+ *
732
+ * Only available through the [--experimental-test-snapshots](https://nodejs.org/api/cli.html#--experimental-test-snapshots) flag.
733
+ * @since v22.3.0
734
+ * @experimental
735
+ */
736
+ snapshot(value: any, options?: AssertSnapshotOptions): void;
737
+ }
738
+ interface AssertSnapshotOptions {
739
+ /**
740
+ * An array of synchronous functions used to serialize `value` into a string.
741
+ * `value` is passed as the only argument to the first serializer function.
742
+ * The return value of each serializer is passed as input to the next serializer.
743
+ * Once all serializers have run, the resulting value is coerced to a string.
744
+ *
745
+ * If no serializers are provided, the test runner's default serializers are used.
746
+ */
747
+ serializers?: ReadonlyArray<(value: any) => any> | undefined;
698
748
  }
699
749
 
700
750
  /**
@@ -879,6 +929,30 @@ declare module "node:test" {
879
929
  type FunctionPropertyNames<T> = {
880
930
  [K in keyof T]: T[K] extends Function ? K : never;
881
931
  }[keyof T];
932
+ interface MockModuleOptions {
933
+ /**
934
+ * If false, each call to `require()` or `import()` generates a new mock module.
935
+ * If true, subsequent calls will return the same module mock, and the mock module is inserted into the CommonJS cache.
936
+ * @default false
937
+ */
938
+ cache?: boolean | undefined;
939
+ /**
940
+ * The value to use as the mocked module's default export.
941
+ *
942
+ * If this value is not provided, ESM mocks do not include a default export.
943
+ * If the mock is a CommonJS or builtin module, this setting is used as the value of `module.exports`.
944
+ * If this value is not provided, CJS and builtin mocks use an empty object as the value of `module.exports`.
945
+ */
946
+ defaultExport?: any;
947
+ /**
948
+ * An object whose keys and values are used to create the named exports of the mock module.
949
+ *
950
+ * If the mock is a CommonJS or builtin module, these values are copied onto `module.exports`.
951
+ * Therefore, if a mock is created with both named exports and a non-object default export,
952
+ * the mock will throw an exception when used as a CJS or builtin module.
953
+ */
954
+ namedExports?: object | undefined;
955
+ }
882
956
  /**
883
957
  * The `MockTracker` class is used to manage mocking functionality. The test runner
884
958
  * module provides a top level `mock` export which is a `MockTracker` instance.
@@ -1042,6 +1116,18 @@ declare module "node:test" {
1042
1116
  options?: MockFunctionOptions,
1043
1117
  ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>;
1044
1118
 
1119
+ /**
1120
+ * This function is used to mock the exports of ECMAScript modules, CommonJS modules, and Node.js builtin modules.
1121
+ * Any references to the original module prior to mocking are not impacted.
1122
+ *
1123
+ * Only available through the [--experimental-test-module-mocks](https://nodejs.org/api/cli.html#--experimental-test-module-mocks) flag.
1124
+ * @since v22.3.0
1125
+ * @experimental
1126
+ * @param specifier A string identifying the module to mock.
1127
+ * @param options Optional configuration options for the mock module.
1128
+ */
1129
+ module(specifier: string, options?: MockModuleOptions): MockModuleContext;
1130
+
1045
1131
  /**
1046
1132
  * This function restores the default behavior of all mocks that were previously
1047
1133
  * created by this `MockTracker` and disassociates the mocks from the `MockTracker` instance. Once disassociated, the mocks can still be used, but the `MockTracker` instance can no longer be
@@ -1201,6 +1287,17 @@ declare module "node:test" {
1201
1287
  */
1202
1288
  restore(): void;
1203
1289
  }
1290
+ /**
1291
+ * @since v22.3.0
1292
+ * @experimental
1293
+ */
1294
+ class MockModuleContext {
1295
+ /**
1296
+ * Resets the implementation of the mock module.
1297
+ * @since v22.3.0
1298
+ */
1299
+ restore(): void;
1300
+ }
1204
1301
 
1205
1302
  type Timer = "setInterval" | "setTimeout" | "setImmediate" | "Date";
1206
1303
  interface MockTimersOptions {
@@ -1423,6 +1520,35 @@ declare module "node:test" {
1423
1520
  */
1424
1521
  [Symbol.dispose](): void;
1425
1522
  }
1523
+ /**
1524
+ * Only available through the [--experimental-test-snapshots](https://nodejs.org/api/cli.html#--experimental-test-snapshots) flag.
1525
+ * @since v22.3.0
1526
+ * @experimental
1527
+ */
1528
+ namespace snapshot {
1529
+ /**
1530
+ * This function is used to customize the default serialization mechanism used by the test runner.
1531
+ *
1532
+ * By default, the test runner performs serialization by calling `JSON.stringify(value, null, 2)` on the provided value.
1533
+ * `JSON.stringify()` does have limitations regarding circular structures and supported data types.
1534
+ * If a more robust serialization mechanism is required, this function should be used to specify a list of custom serializers.
1535
+ *
1536
+ * Serializers are called in order, with the output of the previous serializer passed as input to the next.
1537
+ * The final result must be a string value.
1538
+ * @since v22.3.0
1539
+ * @param serializers An array of synchronous functions used as the default serializers for snapshot tests.
1540
+ */
1541
+ function setDefaultSnapshotSerializers(serializers: ReadonlyArray<(value: any) => any>): void;
1542
+ /**
1543
+ * This function is used to set a custom resolver for the location of the snapshot file used for snapshot testing.
1544
+ * By default, the snapshot filename is the same as the entry point filename with `.snapshot` appended.
1545
+ * @since v22.3.0
1546
+ * @param fn A function which returns a string specifying the location of the snapshot file.
1547
+ * The function receives the path of the test file as its only argument.
1548
+ * If `process.argv[1]` is not associated with a file (for example in the REPL), the input is undefined.
1549
+ */
1550
+ function setResolveSnapshotPath(fn: (path: string | undefined) => string): void;
1551
+ }
1426
1552
  export {
1427
1553
  after,
1428
1554
  afterEach,
@@ -1435,6 +1561,7 @@ declare module "node:test" {
1435
1561
  only,
1436
1562
  run,
1437
1563
  skip,
1564
+ snapshot,
1438
1565
  suite,
1439
1566
  SuiteContext,
1440
1567
  test,
@@ -19,8 +19,8 @@ declare class Dispatcher extends EventEmitter {
19
19
  connect(options: Dispatcher.ConnectOptions): Promise<Dispatcher.ConnectData>;
20
20
  connect(options: Dispatcher.ConnectOptions, callback: (err: Error | null, data: Dispatcher.ConnectData) => void): void;
21
21
  /** Compose a chain of dispatchers */
22
- compose(dispatchers: Dispatcher.DispatcherInterceptor[]): Dispatcher.ComposedDispatcher;
23
- compose(...dispatchers: Dispatcher.DispatcherInterceptor[]): Dispatcher.ComposedDispatcher;
22
+ compose(dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher;
23
+ compose(...dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher;
24
24
  /** Performs an HTTP request. */
25
25
  request(options: Dispatcher.RequestOptions): Promise<Dispatcher.ResponseData>;
26
26
  request(options: Dispatcher.RequestOptions, callback: (err: Error | null, data: Dispatcher.ResponseData) => void): void;
@@ -97,7 +97,7 @@ declare class Dispatcher extends EventEmitter {
97
97
 
98
98
  declare namespace Dispatcher {
99
99
  export interface ComposedDispatcher extends Dispatcher {}
100
- export type DispatcherInterceptor = (dispatch: Dispatcher['dispatch']) => Dispatcher['dispatch'];
100
+ export type DispatcherComposeInterceptor = (dispatch: Dispatcher['dispatch']) => Dispatcher['dispatch'];
101
101
  export interface DispatchOptions {
102
102
  origin?: string | URL;
103
103
  path: string;
@@ -217,7 +217,7 @@ declare namespace Dispatcher {
217
217
  export type StreamFactory = (data: StreamFactoryData) => Writable;
218
218
  export interface DispatchHandlers {
219
219
  /** Invoked before request is dispatched on socket. May be invoked multiple times when a request is retried when the request at the head of the pipeline fails. */
220
- onConnect?(abort: () => void): void;
220
+ onConnect?(abort: (err?: Error) => void): void;
221
221
  /** Invoked when an error has occurred. */
222
222
  onError?(err: Error): void;
223
223
  /** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */
@@ -0,0 +1,21 @@
1
+ import Agent from './agent'
2
+ import Dispatcher from './dispatcher'
3
+
4
+ export default EnvHttpProxyAgent
5
+
6
+ declare class EnvHttpProxyAgent extends Dispatcher {
7
+ constructor(opts?: EnvHttpProxyAgent.Options)
8
+
9
+ dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
10
+ }
11
+
12
+ declare namespace EnvHttpProxyAgent {
13
+ export interface Options extends Agent.Options {
14
+ /** Overrides the value of the HTTP_PROXY environment variable */
15
+ httpProxy?: string;
16
+ /** Overrides the value of the HTTPS_PROXY environment variable */
17
+ httpsProxy?: string;
18
+ /** Overrides the value of the NO_PROXY environment variable */
19
+ noProxy?: string;
20
+ }
21
+ }
@@ -1,4 +1,5 @@
1
1
  import { MessageEvent, ErrorEvent } from './websocket'
2
+ import Dispatcher from './dispatcher'
2
3
 
3
4
  import {
4
5
  EventTarget,
@@ -50,12 +51,13 @@ interface EventSource extends EventTarget {
50
51
 
51
52
  export declare const EventSource: {
52
53
  prototype: EventSource
53
- new (url: string | URL, init: EventSourceInit): EventSource
54
+ new (url: string | URL, init?: EventSourceInit): EventSource
54
55
  readonly CLOSED: 2
55
56
  readonly CONNECTING: 0
56
57
  readonly OPEN: 1
57
58
  }
58
59
 
59
60
  interface EventSourceInit {
60
- withCredentials?: boolean
61
+ withCredentials?: boolean,
62
+ dispatcher?: Dispatcher
61
63
  }
@@ -85,7 +85,7 @@ export declare class Headers implements SpecIterable<[string, string]> {
85
85
  readonly keys: () => SpecIterableIterator<string>
86
86
  readonly values: () => SpecIterableIterator<string>
87
87
  readonly entries: () => SpecIterableIterator<[string, string]>
88
- readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
88
+ readonly [Symbol.iterator]: () => SpecIterableIterator<[string, string]>
89
89
  }
90
90
 
91
91
  export type RequestCache =
@@ -163,6 +163,7 @@ export declare class Request extends BodyMixin {
163
163
  readonly method: string
164
164
  readonly mode: RequestMode
165
165
  readonly redirect: RequestRedirect
166
+ readonly referrer: string
166
167
  readonly referrerPolicy: ReferrerPolicy
167
168
  readonly url: string
168
169
 
@@ -14,6 +14,7 @@ import MockPool from'./mock-pool'
14
14
  import MockAgent from'./mock-agent'
15
15
  import mockErrors from'./mock-errors'
16
16
  import ProxyAgent from'./proxy-agent'
17
+ import EnvHttpProxyAgent from './env-http-proxy-agent'
17
18
  import RetryHandler from'./retry-handler'
18
19
  import RetryAgent from'./retry-agent'
19
20
  import { request, pipeline, stream, connect, upgrade } from './api'
@@ -31,7 +32,7 @@ export * from './content-type'
31
32
  export * from './cache'
32
33
  export { Interceptable } from './mock-interceptor'
33
34
 
34
- export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent }
35
+ export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent }
35
36
  export default Undici
36
37
 
37
38
  declare namespace Undici {
@@ -65,4 +66,9 @@ declare namespace Undici {
65
66
  var File: typeof import('./file').File;
66
67
  var FileReader: typeof import('./filereader').FileReader;
67
68
  var caches: typeof import('./cache').caches;
69
+ var interceptors: {
70
+ dump: typeof import('./interceptors').dump;
71
+ retry: typeof import('./interceptors').retry;
72
+ redirect: typeof import('./interceptors').redirect;
73
+ }
68
74
  }
@@ -1,5 +1,11 @@
1
1
  import Dispatcher from "./dispatcher";
2
+ import RetryHandler from "./retry-handler";
2
3
 
3
- type RedirectInterceptorOpts = { maxRedirections?: number }
4
+ export type DumpInterceptorOpts = { maxSize?: number }
5
+ export type RetryInterceptorOpts = RetryHandler.RetryOptions
6
+ export type RedirectInterceptorOpts = { maxRedirections?: number }
4
7
 
5
- export declare function createRedirectInterceptor (opts: RedirectInterceptorOpts): Dispatcher.DispatchInterceptor
8
+ export declare function createRedirectInterceptor (opts: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
9
+ export declare function dump(opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
10
+ export declare function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
11
+ export declare function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
@@ -71,11 +71,11 @@ declare namespace MockInterceptor {
71
71
 
72
72
  export interface MockResponseCallbackOptions {
73
73
  path: string;
74
- origin: string;
75
74
  method: string;
76
- body?: BodyInit | Dispatcher.DispatchOptions['body'];
77
- headers: Headers | Record<string, string>;
78
- maxRedirections: number;
75
+ headers?: Headers | Record<string, string>;
76
+ origin?: string;
77
+ body?: BodyInit | Dispatcher.DispatchOptions['body'] | null;
78
+ maxRedirections?: number;
79
79
  }
80
80
 
81
81
  export type MockResponseDataHandler<TData extends object = object> = (
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici-types",
3
- "version": "6.13.0",
3
+ "version": "6.18.2",
4
4
  "description": "A stand-alone types package for Undici",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {