cdk-ecr-deployment 3.0.80 → 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.
- package/.jsii +2 -2
- package/.jsii.tabl.json +1 -1
- package/lib/index.js +3 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +11 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +15 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +45 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +16 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +37 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +121 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +248 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +9 -0
- package/node_modules/@types/cacheable-request/node_modules/undici-types/dispatcher.d.ts +4 -4
- package/node_modules/@types/cacheable-request/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/node_modules/@types/cacheable-request/node_modules/undici-types/eventsource.d.ts +4 -2
- package/node_modules/@types/cacheable-request/node_modules/undici-types/fetch.d.ts +2 -1
- package/node_modules/@types/cacheable-request/node_modules/undici-types/index.d.ts +7 -1
- package/node_modules/@types/cacheable-request/node_modules/undici-types/interceptors.d.ts +8 -2
- package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-interceptor.d.ts +4 -4
- package/node_modules/@types/cacheable-request/node_modules/undici-types/package.json +1 -1
- package/node_modules/@types/cacheable-request/node_modules/undici-types/util.d.ts +4 -17
- package/node_modules/@types/cacheable-request/node_modules/undici-types/webidl.d.ts +7 -8
- package/node_modules/@types/keyv/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +11 -0
- package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +15 -1
- package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +45 -2
- package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +16 -0
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +37 -1
- package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +121 -2
- package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +248 -1
- package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +9 -0
- package/node_modules/@types/keyv/node_modules/undici-types/dispatcher.d.ts +4 -4
- package/node_modules/@types/keyv/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/node_modules/@types/keyv/node_modules/undici-types/eventsource.d.ts +4 -2
- package/node_modules/@types/keyv/node_modules/undici-types/fetch.d.ts +2 -1
- package/node_modules/@types/keyv/node_modules/undici-types/index.d.ts +7 -1
- package/node_modules/@types/keyv/node_modules/undici-types/interceptors.d.ts +8 -2
- package/node_modules/@types/keyv/node_modules/undici-types/mock-interceptor.d.ts +4 -4
- package/node_modules/@types/keyv/node_modules/undici-types/package.json +1 -1
- package/node_modules/@types/keyv/node_modules/undici-types/util.d.ts +4 -17
- package/node_modules/@types/keyv/node_modules/undici-types/webidl.d.ts +7 -8
- package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +11 -0
- package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +15 -1
- package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +45 -2
- package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +16 -0
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +37 -1
- package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +121 -2
- package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +248 -1
- package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +9 -0
- package/node_modules/@types/responselike/node_modules/undici-types/dispatcher.d.ts +4 -4
- package/node_modules/@types/responselike/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/node_modules/@types/responselike/node_modules/undici-types/eventsource.d.ts +4 -2
- package/node_modules/@types/responselike/node_modules/undici-types/fetch.d.ts +2 -1
- package/node_modules/@types/responselike/node_modules/undici-types/index.d.ts +7 -1
- package/node_modules/@types/responselike/node_modules/undici-types/interceptors.d.ts +8 -2
- package/node_modules/@types/responselike/node_modules/undici-types/mock-interceptor.d.ts +4 -4
- package/node_modules/@types/responselike/node_modules/undici-types/package.json +1 -1
- package/node_modules/@types/responselike/node_modules/undici-types/util.d.ts +4 -17
- package/node_modules/@types/responselike/node_modules/undici-types/webidl.d.ts +7 -8
- package/package.json +3 -3
|
@@ -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 {
|
|
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.
|
|
@@ -461,6 +476,12 @@ declare module "node:test" {
|
|
|
461
476
|
* @since v18.0.0, v16.17.0
|
|
462
477
|
*/
|
|
463
478
|
class TestContext {
|
|
479
|
+
/**
|
|
480
|
+
* An object containing assertion methods bound to the test context.
|
|
481
|
+
* The top-level functions from the `node:assert` module are exposed here for the purpose of creating test plans.
|
|
482
|
+
* @since v22.2.0
|
|
483
|
+
*/
|
|
484
|
+
readonly assert: TestContextAssert;
|
|
464
485
|
/**
|
|
465
486
|
* This function is used to create a hook running before subtest of the current test.
|
|
466
487
|
* @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument.
|
|
@@ -503,11 +524,52 @@ declare module "node:test" {
|
|
|
503
524
|
* @param message Message to be reported.
|
|
504
525
|
*/
|
|
505
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;
|
|
506
532
|
/**
|
|
507
533
|
* The name of the test.
|
|
508
534
|
* @since v18.8.0, v16.18.0
|
|
509
535
|
*/
|
|
510
536
|
readonly name: string;
|
|
537
|
+
/**
|
|
538
|
+
* Used to set the number of assertions and subtests that are expected to run within the test.
|
|
539
|
+
* If the number of assertions and subtests that run does not match the expected count, the test will fail.
|
|
540
|
+
*
|
|
541
|
+
* To make sure assertions are tracked, the assert functions on `context.assert` must be used,
|
|
542
|
+
* instead of importing from the `node:assert` module.
|
|
543
|
+
* ```js
|
|
544
|
+
* test('top level test', (t) => {
|
|
545
|
+
* t.plan(2);
|
|
546
|
+
* t.assert.ok('some relevant assertion here');
|
|
547
|
+
* t.test('subtest', () => {});
|
|
548
|
+
* });
|
|
549
|
+
* ```
|
|
550
|
+
*
|
|
551
|
+
* When working with asynchronous code, the `plan` function can be used to ensure that the correct number of assertions are run:
|
|
552
|
+
* ```js
|
|
553
|
+
* test('planning with streams', (t, done) => {
|
|
554
|
+
* function* generate() {
|
|
555
|
+
* yield 'a';
|
|
556
|
+
* yield 'b';
|
|
557
|
+
* yield 'c';
|
|
558
|
+
* }
|
|
559
|
+
* const expected = ['a', 'b', 'c'];
|
|
560
|
+
* t.plan(expected.length);
|
|
561
|
+
* const stream = Readable.from(generate());
|
|
562
|
+
* stream.on('data', (chunk) => {
|
|
563
|
+
* t.assert.strictEqual(chunk, expected.shift());
|
|
564
|
+
* });
|
|
565
|
+
* stream.on('end', () => {
|
|
566
|
+
* done();
|
|
567
|
+
* });
|
|
568
|
+
* });
|
|
569
|
+
* ```
|
|
570
|
+
* @since v22.2.0
|
|
571
|
+
*/
|
|
572
|
+
plan(count: number): void;
|
|
511
573
|
/**
|
|
512
574
|
* If `shouldRunOnlyTests` is truthy, the test context will only run tests that
|
|
513
575
|
* have the `only` option set. Otherwise, all tests are run. If Node.js was not
|
|
@@ -584,6 +646,106 @@ declare module "node:test" {
|
|
|
584
646
|
*/
|
|
585
647
|
readonly mock: MockTracker;
|
|
586
648
|
}
|
|
649
|
+
interface TestContextAssert {
|
|
650
|
+
/**
|
|
651
|
+
* Identical to the `deepEqual` function from the `node:assert` module, but bound to the test context.
|
|
652
|
+
*/
|
|
653
|
+
deepEqual: typeof import("node:assert").deepEqual;
|
|
654
|
+
/**
|
|
655
|
+
* Identical to the `deepStrictEqual` function from the `node:assert` module, but bound to the test context.
|
|
656
|
+
*/
|
|
657
|
+
deepStrictEqual: typeof import("node:assert").deepStrictEqual;
|
|
658
|
+
/**
|
|
659
|
+
* Identical to the `doesNotMatch` function from the `node:assert` module, but bound to the test context.
|
|
660
|
+
*/
|
|
661
|
+
doesNotMatch: typeof import("node:assert").doesNotMatch;
|
|
662
|
+
/**
|
|
663
|
+
* Identical to the `doesNotReject` function from the `node:assert` module, but bound to the test context.
|
|
664
|
+
*/
|
|
665
|
+
doesNotReject: typeof import("node:assert").doesNotReject;
|
|
666
|
+
/**
|
|
667
|
+
* Identical to the `doesNotThrow` function from the `node:assert` module, but bound to the test context.
|
|
668
|
+
*/
|
|
669
|
+
doesNotThrow: typeof import("node:assert").doesNotThrow;
|
|
670
|
+
/**
|
|
671
|
+
* Identical to the `equal` function from the `node:assert` module, but bound to the test context.
|
|
672
|
+
*/
|
|
673
|
+
equal: typeof import("node:assert").equal;
|
|
674
|
+
/**
|
|
675
|
+
* Identical to the `fail` function from the `node:assert` module, but bound to the test context.
|
|
676
|
+
*/
|
|
677
|
+
fail: typeof import("node:assert").fail;
|
|
678
|
+
/**
|
|
679
|
+
* Identical to the `ifError` function from the `node:assert` module, but bound to the test context.
|
|
680
|
+
*/
|
|
681
|
+
ifError: typeof import("node:assert").ifError;
|
|
682
|
+
/**
|
|
683
|
+
* Identical to the `match` function from the `node:assert` module, but bound to the test context.
|
|
684
|
+
*/
|
|
685
|
+
match: typeof import("node:assert").match;
|
|
686
|
+
/**
|
|
687
|
+
* Identical to the `notDeepEqual` function from the `node:assert` module, but bound to the test context.
|
|
688
|
+
*/
|
|
689
|
+
notDeepEqual: typeof import("node:assert").notDeepEqual;
|
|
690
|
+
/**
|
|
691
|
+
* Identical to the `notDeepStrictEqual` function from the `node:assert` module, but bound to the test context.
|
|
692
|
+
*/
|
|
693
|
+
notDeepStrictEqual: typeof import("node:assert").notDeepStrictEqual;
|
|
694
|
+
/**
|
|
695
|
+
* Identical to the `notEqual` function from the `node:assert` module, but bound to the test context.
|
|
696
|
+
*/
|
|
697
|
+
notEqual: typeof import("node:assert").notEqual;
|
|
698
|
+
/**
|
|
699
|
+
* Identical to the `notStrictEqual` function from the `node:assert` module, but bound to the test context.
|
|
700
|
+
*/
|
|
701
|
+
notStrictEqual: typeof import("node:assert").notStrictEqual;
|
|
702
|
+
/**
|
|
703
|
+
* Identical to the `ok` function from the `node:assert` module, but bound to the test context.
|
|
704
|
+
*/
|
|
705
|
+
ok: typeof import("node:assert").ok;
|
|
706
|
+
/**
|
|
707
|
+
* Identical to the `rejects` function from the `node:assert` module, but bound to the test context.
|
|
708
|
+
*/
|
|
709
|
+
rejects: typeof import("node:assert").rejects;
|
|
710
|
+
/**
|
|
711
|
+
* Identical to the `strictEqual` function from the `node:assert` module, but bound to the test context.
|
|
712
|
+
*/
|
|
713
|
+
strictEqual: typeof import("node:assert").strictEqual;
|
|
714
|
+
/**
|
|
715
|
+
* Identical to the `throws` function from the `node:assert` module, but bound to the test context.
|
|
716
|
+
*/
|
|
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;
|
|
748
|
+
}
|
|
587
749
|
|
|
588
750
|
/**
|
|
589
751
|
* An instance of `SuiteContext` is passed to each suite function in order to
|
|
@@ -643,6 +805,14 @@ declare module "node:test" {
|
|
|
643
805
|
* @default false
|
|
644
806
|
*/
|
|
645
807
|
todo?: boolean | string | undefined;
|
|
808
|
+
/**
|
|
809
|
+
* The number of assertions and subtests expected to be run in the test.
|
|
810
|
+
* If the number of assertions run in the test does not match the number
|
|
811
|
+
* specified in the plan, the test will fail.
|
|
812
|
+
* @default undefined
|
|
813
|
+
* @since v22.2.0
|
|
814
|
+
*/
|
|
815
|
+
plan?: number | undefined;
|
|
646
816
|
}
|
|
647
817
|
/**
|
|
648
818
|
* This function creates a hook that runs before executing a suite.
|
|
@@ -759,6 +929,30 @@ declare module "node:test" {
|
|
|
759
929
|
type FunctionPropertyNames<T> = {
|
|
760
930
|
[K in keyof T]: T[K] extends Function ? K : never;
|
|
761
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
|
+
}
|
|
762
956
|
/**
|
|
763
957
|
* The `MockTracker` class is used to manage mocking functionality. The test runner
|
|
764
958
|
* module provides a top level `mock` export which is a `MockTracker` instance.
|
|
@@ -922,6 +1116,18 @@ declare module "node:test" {
|
|
|
922
1116
|
options?: MockFunctionOptions,
|
|
923
1117
|
): Mock<((value: MockedObject[MethodName]) => void) | Implementation>;
|
|
924
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
|
+
|
|
925
1131
|
/**
|
|
926
1132
|
* This function restores the default behavior of all mocks that were previously
|
|
927
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
|
|
@@ -1081,6 +1287,17 @@ declare module "node:test" {
|
|
|
1081
1287
|
*/
|
|
1082
1288
|
restore(): void;
|
|
1083
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
|
+
}
|
|
1084
1301
|
|
|
1085
1302
|
type Timer = "setInterval" | "setTimeout" | "setImmediate" | "Date";
|
|
1086
1303
|
interface MockTimersOptions {
|
|
@@ -1303,6 +1520,35 @@ declare module "node:test" {
|
|
|
1303
1520
|
*/
|
|
1304
1521
|
[Symbol.dispose](): void;
|
|
1305
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
|
+
}
|
|
1306
1552
|
export {
|
|
1307
1553
|
after,
|
|
1308
1554
|
afterEach,
|
|
@@ -1315,6 +1561,7 @@ declare module "node:test" {
|
|
|
1315
1561
|
only,
|
|
1316
1562
|
run,
|
|
1317
1563
|
skip,
|
|
1564
|
+
snapshot,
|
|
1318
1565
|
suite,
|
|
1319
1566
|
SuiteContext,
|
|
1320
1567
|
test,
|
|
@@ -172,6 +172,15 @@ declare module "zlib" {
|
|
|
172
172
|
interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams {}
|
|
173
173
|
interface InflateRaw extends stream.Transform, Zlib, ZlibReset {}
|
|
174
174
|
interface Unzip extends stream.Transform, Zlib {}
|
|
175
|
+
/**
|
|
176
|
+
* Computes a 32-bit [Cyclic Redundancy Check](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) checksum of `data`.
|
|
177
|
+
* If `value` is specified, it is used as the starting value of the checksum, otherwise, 0 is used as the starting value.
|
|
178
|
+
* @param data When `data` is a string, it will be encoded as UTF-8 before being used for computation.
|
|
179
|
+
* @param value An optional starting value. It must be a 32-bit unsigned integer. @default 0
|
|
180
|
+
* @returns A 32-bit unsigned integer containing the checksum.
|
|
181
|
+
* @since v22.2.0
|
|
182
|
+
*/
|
|
183
|
+
function crc32(data: string | Buffer | NodeJS.ArrayBufferView, value?: number): number;
|
|
175
184
|
/**
|
|
176
185
|
* Creates and returns a new `BrotliCompress` object.
|
|
177
186
|
* @since v11.7.0, v10.16.0
|
|
@@ -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.
|
|
23
|
-
compose(...dispatchers: Dispatcher.
|
|
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
|
|
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. */
|
package/node_modules/@types/cacheable-request/node_modules/undici-types/env-http-proxy-agent.d.ts
ADDED
|
@@ -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
|
|
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]: () =>
|
|
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
|
|
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.
|
|
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
|
package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-interceptor.d.ts
CHANGED
|
@@ -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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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> = (
|
|
@@ -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
|
-
|
|
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:
|
|
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.
|
|
@@ -21,6 +21,8 @@ declare module "fs/promises" {
|
|
|
21
21
|
Dir,
|
|
22
22
|
Dirent,
|
|
23
23
|
GlobOptions,
|
|
24
|
+
GlobOptionsWithFileTypes,
|
|
25
|
+
GlobOptionsWithoutFileTypes,
|
|
24
26
|
MakeDirectoryOptions,
|
|
25
27
|
Mode,
|
|
26
28
|
ObjectEncodingOptions,
|
|
@@ -1243,7 +1245,19 @@ declare module "fs/promises" {
|
|
|
1243
1245
|
/**
|
|
1244
1246
|
* Retrieves the files matching the specified pattern.
|
|
1245
1247
|
*/
|
|
1246
|
-
function glob(pattern: string | string[]
|
|
1248
|
+
function glob(pattern: string | string[]): AsyncIterableIterator<string>;
|
|
1249
|
+
function glob(
|
|
1250
|
+
pattern: string | string[],
|
|
1251
|
+
opt: GlobOptionsWithFileTypes,
|
|
1252
|
+
): AsyncIterableIterator<Dirent>;
|
|
1253
|
+
function glob(
|
|
1254
|
+
pattern: string | string[],
|
|
1255
|
+
opt: GlobOptionsWithoutFileTypes,
|
|
1256
|
+
): AsyncIterableIterator<string>;
|
|
1257
|
+
function glob(
|
|
1258
|
+
pattern: string | string[],
|
|
1259
|
+
opt: GlobOptions,
|
|
1260
|
+
): AsyncIterableIterator<Dirent> | AsyncIterableIterator<string>;
|
|
1247
1261
|
}
|
|
1248
1262
|
declare module "node:fs/promises" {
|
|
1249
1263
|
export * from "fs/promises";
|