cdk-common 2.0.1245 → 2.0.1247
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 +9 -3
- package/API.md +6 -0
- package/lib/main.js +1 -1
- package/lib/managed-policies.d.ts +2 -1
- package/lib/managed-policies.js +2 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/crypto.d.ts +17 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/fs/promises.d.ts +7 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/fs.d.ts +0 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/http2.d.ts +13 -11
- package/node_modules/@types/concat-stream/node_modules/@types/node/inspector.d.ts +110 -6
- package/node_modules/@types/concat-stream/node_modules/@types/node/module.d.ts +24 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +4 -4
- package/node_modules/@types/concat-stream/node_modules/@types/node/perf_hooks.d.ts +14 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/repl.d.ts +11 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/sqlite.d.ts +0 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/stream.d.ts +17 -6
- package/node_modules/@types/concat-stream/node_modules/@types/node/test.d.ts +16 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/timers.d.ts +0 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/url.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/util.d.ts +6 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/worker_threads.d.ts +12 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/zlib.d.ts +8 -2
- package/node_modules/@types/concat-stream/node_modules/undici-types/agent.d.ts +4 -0
- package/node_modules/@types/concat-stream/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/@types/concat-stream/node_modules/undici-types/client.d.ts +6 -3
- package/node_modules/@types/concat-stream/node_modules/undici-types/mock-agent.d.ts +3 -0
- package/node_modules/@types/concat-stream/node_modules/undici-types/package.json +1 -1
- package/node_modules/@types/concat-stream/node_modules/undici-types/pool.d.ts +2 -0
- package/node_modules/@types/concat-stream/node_modules/undici-types/proxy-agent.d.ts +1 -0
- package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/crypto.d.ts +17 -1
- package/node_modules/@types/form-data/node_modules/@types/node/fs/promises.d.ts +7 -3
- package/node_modules/@types/form-data/node_modules/@types/node/fs.d.ts +0 -2
- package/node_modules/@types/form-data/node_modules/@types/node/http2.d.ts +13 -11
- package/node_modules/@types/form-data/node_modules/@types/node/inspector.d.ts +110 -6
- package/node_modules/@types/form-data/node_modules/@types/node/module.d.ts +24 -0
- package/node_modules/@types/form-data/node_modules/@types/node/package.json +4 -4
- package/node_modules/@types/form-data/node_modules/@types/node/perf_hooks.d.ts +14 -0
- package/node_modules/@types/form-data/node_modules/@types/node/repl.d.ts +11 -1
- package/node_modules/@types/form-data/node_modules/@types/node/sqlite.d.ts +0 -1
- package/node_modules/@types/form-data/node_modules/@types/node/stream.d.ts +17 -6
- package/node_modules/@types/form-data/node_modules/@types/node/test.d.ts +16 -1
- package/node_modules/@types/form-data/node_modules/@types/node/timers.d.ts +0 -2
- package/node_modules/@types/form-data/node_modules/@types/node/url.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/util.d.ts +6 -2
- package/node_modules/@types/form-data/node_modules/@types/node/worker_threads.d.ts +12 -0
- package/node_modules/@types/form-data/node_modules/@types/node/zlib.d.ts +8 -2
- package/node_modules/@types/form-data/node_modules/undici-types/agent.d.ts +4 -0
- package/node_modules/@types/form-data/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/@types/form-data/node_modules/undici-types/client.d.ts +6 -3
- package/node_modules/@types/form-data/node_modules/undici-types/mock-agent.d.ts +3 -0
- package/node_modules/@types/form-data/node_modules/undici-types/package.json +1 -1
- package/node_modules/@types/form-data/node_modules/undici-types/pool.d.ts +2 -0
- package/node_modules/@types/form-data/node_modules/undici-types/proxy-agent.d.ts +1 -0
- package/package.json +1 -1
|
@@ -685,6 +685,30 @@ declare module "module" {
|
|
|
685
685
|
* @returns The absolute URL string that the specifier would resolve to.
|
|
686
686
|
*/
|
|
687
687
|
resolve(specifier: string, parent?: string | URL): string;
|
|
688
|
+
/**
|
|
689
|
+
* `true` when the current module is the entry point of the current process; `false` otherwise.
|
|
690
|
+
*
|
|
691
|
+
* Equivalent to `require.main === module` in CommonJS.
|
|
692
|
+
*
|
|
693
|
+
* Analogous to Python's `__name__ == "__main__"`.
|
|
694
|
+
*
|
|
695
|
+
* ```js
|
|
696
|
+
* export function foo() {
|
|
697
|
+
* return 'Hello, world';
|
|
698
|
+
* }
|
|
699
|
+
*
|
|
700
|
+
* function main() {
|
|
701
|
+
* const message = foo();
|
|
702
|
+
* console.log(message);
|
|
703
|
+
* }
|
|
704
|
+
*
|
|
705
|
+
* if (import.meta.main) main();
|
|
706
|
+
* // `foo` can be imported from another module without possible side-effects from `main`
|
|
707
|
+
* ```
|
|
708
|
+
* @since v24.2.0
|
|
709
|
+
* @experimental
|
|
710
|
+
*/
|
|
711
|
+
main: boolean;
|
|
688
712
|
}
|
|
689
713
|
namespace NodeJS {
|
|
690
714
|
interface Module {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.2.0",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -152,9 +152,9 @@
|
|
|
152
152
|
},
|
|
153
153
|
"scripts": {},
|
|
154
154
|
"dependencies": {
|
|
155
|
-
"undici-types": "~7.
|
|
155
|
+
"undici-types": "~7.10.0"
|
|
156
156
|
},
|
|
157
157
|
"peerDependencies": {},
|
|
158
|
-
"typesPublisherContentHash": "
|
|
159
|
-
"typeScriptVersion": "5.
|
|
158
|
+
"typesPublisherContentHash": "592a3f00c1a1fd43b2d3e4b61e9a9840a9d22deac79f88625b217e5a14958a3d",
|
|
159
|
+
"typeScriptVersion": "5.2"
|
|
160
160
|
}
|
|
@@ -813,6 +813,20 @@ declare module "perf_hooks" {
|
|
|
813
813
|
* @since v11.10.0
|
|
814
814
|
*/
|
|
815
815
|
disable(): boolean;
|
|
816
|
+
/**
|
|
817
|
+
* Disables the update interval timer when the histogram is disposed.
|
|
818
|
+
*
|
|
819
|
+
* ```js
|
|
820
|
+
* const { monitorEventLoopDelay } = require('node:perf_hooks');
|
|
821
|
+
* {
|
|
822
|
+
* using hist = monitorEventLoopDelay({ resolution: 20 });
|
|
823
|
+
* hist.enable();
|
|
824
|
+
* // The histogram will be disabled when the block is exited.
|
|
825
|
+
* }
|
|
826
|
+
* ```
|
|
827
|
+
* @since v24.2.0
|
|
828
|
+
*/
|
|
829
|
+
[Symbol.dispose](): void;
|
|
816
830
|
}
|
|
817
831
|
interface RecordableHistogram extends Histogram {
|
|
818
832
|
/**
|
|
@@ -123,6 +123,12 @@ declare module "repl" {
|
|
|
123
123
|
*/
|
|
124
124
|
action: REPLCommandAction;
|
|
125
125
|
}
|
|
126
|
+
interface REPLServerSetupHistoryOptions {
|
|
127
|
+
filePath?: string | undefined;
|
|
128
|
+
size?: number | undefined;
|
|
129
|
+
removeHistoryDuplicates?: boolean | undefined;
|
|
130
|
+
onHistoryFileLoaded?: ((err: Error | null, repl: REPLServer) => void) | undefined;
|
|
131
|
+
}
|
|
126
132
|
/**
|
|
127
133
|
* Instances of `repl.REPLServer` are created using the {@link start} method
|
|
128
134
|
* or directly using the JavaScript `new` keyword.
|
|
@@ -316,7 +322,11 @@ declare module "repl" {
|
|
|
316
322
|
* @param historyPath the path to the history file
|
|
317
323
|
* @param callback called when history writes are ready or upon error
|
|
318
324
|
*/
|
|
319
|
-
setupHistory(
|
|
325
|
+
setupHistory(historyPath: string, callback: (err: Error | null, repl: this) => void): void;
|
|
326
|
+
setupHistory(
|
|
327
|
+
historyConfig?: REPLServerSetupHistoryOptions,
|
|
328
|
+
callback?: (err: Error | null, repl: this) => void,
|
|
329
|
+
): void;
|
|
320
330
|
/**
|
|
321
331
|
* events.EventEmitter
|
|
322
332
|
* 1. close - inherited from `readline.Interface`
|
|
@@ -615,6 +615,17 @@ declare module "stream" {
|
|
|
615
615
|
* @param error Error which will be passed as payload in `'error'` event
|
|
616
616
|
*/
|
|
617
617
|
destroy(error?: Error): this;
|
|
618
|
+
/**
|
|
619
|
+
* @returns `AsyncIterator` to fully consume the stream.
|
|
620
|
+
* @since v10.0.0
|
|
621
|
+
*/
|
|
622
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<any>;
|
|
623
|
+
/**
|
|
624
|
+
* Calls `readable.destroy()` with an `AbortError` and returns
|
|
625
|
+
* a promise that fulfills when the stream is finished.
|
|
626
|
+
* @since v20.4.0
|
|
627
|
+
*/
|
|
628
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
618
629
|
/**
|
|
619
630
|
* Event emitter
|
|
620
631
|
* The defined events on documents including:
|
|
@@ -682,12 +693,6 @@ declare module "stream" {
|
|
|
682
693
|
removeListener(event: "readable", listener: () => void): this;
|
|
683
694
|
removeListener(event: "resume", listener: () => void): this;
|
|
684
695
|
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
685
|
-
[Symbol.asyncIterator](): NodeJS.AsyncIterator<any>;
|
|
686
|
-
/**
|
|
687
|
-
* Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished.
|
|
688
|
-
* @since v20.4.0
|
|
689
|
-
*/
|
|
690
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
691
696
|
}
|
|
692
697
|
interface WritableOptions<T extends Writable = Writable> extends StreamOptions<T> {
|
|
693
698
|
decodeStrings?: boolean | undefined;
|
|
@@ -957,6 +962,12 @@ declare module "stream" {
|
|
|
957
962
|
* @param error Optional, an error to emit with `'error'` event.
|
|
958
963
|
*/
|
|
959
964
|
destroy(error?: Error): this;
|
|
965
|
+
/**
|
|
966
|
+
* Calls `writable.destroy()` with an `AbortError` and returns
|
|
967
|
+
* a promise that fulfills when the stream is finished.
|
|
968
|
+
* @since v22.4.0, v20.16.0
|
|
969
|
+
*/
|
|
970
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
960
971
|
/**
|
|
961
972
|
* Event emitter
|
|
962
973
|
* The defined events on documents including:
|
|
@@ -410,6 +410,7 @@ declare module "node:test" {
|
|
|
410
410
|
addListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
|
411
411
|
addListener(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
|
412
412
|
addListener(event: "test:watch:drained", listener: () => void): this;
|
|
413
|
+
addListener(event: "test:watch:restarted", listener: () => void): this;
|
|
413
414
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
414
415
|
emit(event: "test:coverage", data: EventData.TestCoverage): boolean;
|
|
415
416
|
emit(event: "test:complete", data: EventData.TestComplete): boolean;
|
|
@@ -424,6 +425,7 @@ declare module "node:test" {
|
|
|
424
425
|
emit(event: "test:stdout", data: EventData.TestStdout): boolean;
|
|
425
426
|
emit(event: "test:summary", data: EventData.TestSummary): boolean;
|
|
426
427
|
emit(event: "test:watch:drained"): boolean;
|
|
428
|
+
emit(event: "test:watch:restarted"): boolean;
|
|
427
429
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
428
430
|
on(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
|
|
429
431
|
on(event: "test:complete", listener: (data: EventData.TestComplete) => void): this;
|
|
@@ -438,6 +440,7 @@ declare module "node:test" {
|
|
|
438
440
|
on(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
|
439
441
|
on(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
|
440
442
|
on(event: "test:watch:drained", listener: () => void): this;
|
|
443
|
+
on(event: "test:watch:restarted", listener: () => void): this;
|
|
441
444
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
442
445
|
once(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
|
|
443
446
|
once(event: "test:complete", listener: (data: EventData.TestComplete) => void): this;
|
|
@@ -452,6 +455,7 @@ declare module "node:test" {
|
|
|
452
455
|
once(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
|
453
456
|
once(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
|
454
457
|
once(event: "test:watch:drained", listener: () => void): this;
|
|
458
|
+
once(event: "test:watch:restarted", listener: () => void): this;
|
|
455
459
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
456
460
|
prependListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
|
|
457
461
|
prependListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this;
|
|
@@ -466,6 +470,7 @@ declare module "node:test" {
|
|
|
466
470
|
prependListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
|
467
471
|
prependListener(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
|
468
472
|
prependListener(event: "test:watch:drained", listener: () => void): this;
|
|
473
|
+
prependListener(event: "test:watch:restarted", listener: () => void): this;
|
|
469
474
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
470
475
|
prependOnceListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
|
|
471
476
|
prependOnceListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this;
|
|
@@ -480,6 +485,7 @@ declare module "node:test" {
|
|
|
480
485
|
prependOnceListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
|
481
486
|
prependOnceListener(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
|
482
487
|
prependOnceListener(event: "test:watch:drained", listener: () => void): this;
|
|
488
|
+
prependOnceListener(event: "test:watch:restarted", listener: () => void): this;
|
|
483
489
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
484
490
|
}
|
|
485
491
|
namespace EventData {
|
|
@@ -510,6 +516,14 @@ declare module "node:test" {
|
|
|
510
516
|
* The nesting level of the test.
|
|
511
517
|
*/
|
|
512
518
|
nesting: number;
|
|
519
|
+
/**
|
|
520
|
+
* The severity level of the diagnostic message.
|
|
521
|
+
* Possible values are:
|
|
522
|
+
* * `'info'`: Informational messages.
|
|
523
|
+
* * `'warn'`: Warnings.
|
|
524
|
+
* * `'error'`: Errors.
|
|
525
|
+
*/
|
|
526
|
+
level: "info" | "warn" | "error";
|
|
513
527
|
}
|
|
514
528
|
interface TestCoverage {
|
|
515
529
|
/**
|
|
@@ -2168,7 +2182,8 @@ declare module "node:test/reporters" {
|
|
|
2168
2182
|
| { type: "test:stderr"; data: EventData.TestStderr }
|
|
2169
2183
|
| { type: "test:stdout"; data: EventData.TestStdout }
|
|
2170
2184
|
| { type: "test:summary"; data: EventData.TestSummary }
|
|
2171
|
-
| { type: "test:watch:drained"; data: undefined }
|
|
2185
|
+
| { type: "test:watch:drained"; data: undefined }
|
|
2186
|
+
| { type: "test:watch:restarted"; data: undefined };
|
|
2172
2187
|
type TestEventGenerator = AsyncGenerator<TestEvent, void>;
|
|
2173
2188
|
|
|
2174
2189
|
interface ReporterConstructorWrapper<T extends new(...args: any[]) => Transform> {
|
|
@@ -60,7 +60,6 @@ declare module "timers" {
|
|
|
60
60
|
/**
|
|
61
61
|
* Cancels the immediate. This is similar to calling `clearImmediate()`.
|
|
62
62
|
* @since v20.5.0, v18.18.0
|
|
63
|
-
* @experimental
|
|
64
63
|
*/
|
|
65
64
|
[Symbol.dispose](): void;
|
|
66
65
|
_onImmediate(...args: any[]): void;
|
|
@@ -141,7 +140,6 @@ declare module "timers" {
|
|
|
141
140
|
/**
|
|
142
141
|
* Cancels the timeout.
|
|
143
142
|
* @since v20.5.0, v18.18.0
|
|
144
|
-
* @experimental
|
|
145
143
|
*/
|
|
146
144
|
[Symbol.dispose](): void;
|
|
147
145
|
_onTimeout(...args: any[]): void;
|
|
@@ -874,7 +874,7 @@ declare module "url" {
|
|
|
874
874
|
* Returns an ES6 `Iterator` over each of the name-value pairs in the query.
|
|
875
875
|
* Each item of the iterator is a JavaScript `Array`. The first item of the `Array` is the `name`, the second item of the `Array` is the `value`.
|
|
876
876
|
*
|
|
877
|
-
* Alias for `urlSearchParams[
|
|
877
|
+
* Alias for `urlSearchParams[Symbol.iterator]()`.
|
|
878
878
|
*/
|
|
879
879
|
entries(): URLSearchParamsIterator<[string, string]>;
|
|
880
880
|
/**
|
|
@@ -431,8 +431,8 @@ declare module "util" {
|
|
|
431
431
|
* intended for debugging. The output of `util.inspect` may change at any time
|
|
432
432
|
* and should not be depended upon programmatically. Additional `options` may be
|
|
433
433
|
* passed that alter the result.
|
|
434
|
-
* `util.inspect()` will use the constructor's name and/or
|
|
435
|
-
* an identifiable tag for an inspected value.
|
|
434
|
+
* `util.inspect()` will use the constructor's name and/or `Symbol.toStringTag`
|
|
435
|
+
* property to make an identifiable tag for an inspected value.
|
|
436
436
|
*
|
|
437
437
|
* ```js
|
|
438
438
|
* class Foo {
|
|
@@ -1172,6 +1172,7 @@ declare module "util" {
|
|
|
1172
1172
|
| "hidden"
|
|
1173
1173
|
| "inverse"
|
|
1174
1174
|
| "italic"
|
|
1175
|
+
| "none"
|
|
1175
1176
|
| "overlined"
|
|
1176
1177
|
| "reset"
|
|
1177
1178
|
| "strikethrough"
|
|
@@ -1228,6 +1229,8 @@ declare module "util" {
|
|
|
1228
1229
|
* );
|
|
1229
1230
|
* ```
|
|
1230
1231
|
*
|
|
1232
|
+
* The special format value `none` applies no additional styling to the text.
|
|
1233
|
+
*
|
|
1231
1234
|
* The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v24.x/api/util.html#modifiers).
|
|
1232
1235
|
* @param format A text format or an Array of text formats defined in `util.inspect.colors`.
|
|
1233
1236
|
* @param text The text to to be formatted.
|
|
@@ -2108,6 +2111,7 @@ declare module "util/types" {
|
|
|
2108
2111
|
* console.log(myError instanceof Error); // true
|
|
2109
2112
|
* ```
|
|
2110
2113
|
* @since v10.0.0
|
|
2114
|
+
* @deprecated The `util.types.isNativeError` API is deprecated. Please use `Error.isError` instead.
|
|
2111
2115
|
*/
|
|
2112
2116
|
function isNativeError(object: unknown): object is Error;
|
|
2113
2117
|
/**
|
|
@@ -482,6 +482,18 @@ declare module "worker_threads" {
|
|
|
482
482
|
* @since v24.0.0
|
|
483
483
|
*/
|
|
484
484
|
getHeapStatistics(): Promise<HeapInfo>;
|
|
485
|
+
/**
|
|
486
|
+
* Calls `worker.terminate()` when the dispose scope is exited.
|
|
487
|
+
*
|
|
488
|
+
* ```js
|
|
489
|
+
* async function example() {
|
|
490
|
+
* await using worker = new Worker('for (;;) {}', { eval: true });
|
|
491
|
+
* // Worker is automatically terminate when the scope is exited.
|
|
492
|
+
* }
|
|
493
|
+
* ```
|
|
494
|
+
* @since v24.2.0
|
|
495
|
+
*/
|
|
496
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
485
497
|
addListener(event: "error", listener: (err: Error) => void): this;
|
|
486
498
|
addListener(event: "exit", listener: (exitCode: number) => void): this;
|
|
487
499
|
addListener(event: "message", listener: (value: any) => void): this;
|
|
@@ -147,6 +147,10 @@ declare module "zlib" {
|
|
|
147
147
|
* @default buffer.kMaxLength
|
|
148
148
|
*/
|
|
149
149
|
maxOutputLength?: number | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* If `true`, returns an object with `buffer` and `engine`.
|
|
152
|
+
*/
|
|
153
|
+
info?: boolean | undefined;
|
|
150
154
|
}
|
|
151
155
|
interface ZstdOptions {
|
|
152
156
|
/**
|
|
@@ -172,6 +176,10 @@ declare module "zlib" {
|
|
|
172
176
|
* @default buffer.kMaxLength
|
|
173
177
|
*/
|
|
174
178
|
maxOutputLength?: number | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* If `true`, returns an object with `buffer` and `engine`.
|
|
181
|
+
*/
|
|
182
|
+
info?: boolean | undefined;
|
|
175
183
|
}
|
|
176
184
|
interface Zlib {
|
|
177
185
|
readonly bytesWritten: number;
|
|
@@ -610,8 +618,6 @@ declare module "zlib" {
|
|
|
610
618
|
const Z_FINISH: number;
|
|
611
619
|
/** @deprecated Use `constants.Z_BLOCK` */
|
|
612
620
|
const Z_BLOCK: number;
|
|
613
|
-
/** @deprecated Use `constants.Z_TREES` */
|
|
614
|
-
const Z_TREES: number;
|
|
615
621
|
// Return codes for the compression/decompression functions.
|
|
616
622
|
// Negative values are errors, positive values are used for special but normal events.
|
|
617
623
|
/** @deprecated Use `constants.Z_OK` */
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { URL } from 'url'
|
|
2
2
|
import Pool from './pool'
|
|
3
3
|
import Dispatcher from './dispatcher'
|
|
4
|
+
import TClientStats from './client-stats'
|
|
5
|
+
import TPoolStats from './pool-stats'
|
|
4
6
|
|
|
5
7
|
export default Agent
|
|
6
8
|
|
|
@@ -12,6 +14,8 @@ declare class Agent extends Dispatcher {
|
|
|
12
14
|
destroyed: boolean
|
|
13
15
|
/** Dispatches a request. */
|
|
14
16
|
dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
|
|
17
|
+
/** Aggregate stats for a Agent by origin. */
|
|
18
|
+
readonly stats: Record<string, TClientStats | TPoolStats>
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
declare namespace Agent {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Client from './client'
|
|
2
|
+
|
|
3
|
+
export default ClientStats
|
|
4
|
+
|
|
5
|
+
declare class ClientStats {
|
|
6
|
+
constructor (pool: Client)
|
|
7
|
+
/** If socket has open connection. */
|
|
8
|
+
connected: boolean
|
|
9
|
+
/** Number of open socket connections in this client that do not have an active request. */
|
|
10
|
+
pending: number
|
|
11
|
+
/** Number of currently active requests of this client. */
|
|
12
|
+
running: number
|
|
13
|
+
/** Number of active, pending, or queued requests of this client. */
|
|
14
|
+
size: number
|
|
15
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { URL } from 'url'
|
|
2
2
|
import Dispatcher from './dispatcher'
|
|
3
3
|
import buildConnector from './connector'
|
|
4
|
+
import TClientStats from './client-stats'
|
|
4
5
|
|
|
5
6
|
type ClientConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
|
|
6
7
|
|
|
@@ -15,6 +16,8 @@ export class Client extends Dispatcher {
|
|
|
15
16
|
closed: boolean
|
|
16
17
|
/** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */
|
|
17
18
|
destroyed: boolean
|
|
19
|
+
/** Aggregate stats for a Client. */
|
|
20
|
+
readonly stats: TClientStats
|
|
18
21
|
|
|
19
22
|
// Override dispatcher APIs.
|
|
20
23
|
override connect (
|
|
@@ -84,13 +87,13 @@ export declare namespace Client {
|
|
|
84
87
|
/**
|
|
85
88
|
* @description Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation.
|
|
86
89
|
* @default false
|
|
87
|
-
|
|
90
|
+
*/
|
|
88
91
|
allowH2?: boolean;
|
|
89
92
|
/**
|
|
90
93
|
* @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
|
|
91
94
|
* @default 100
|
|
92
|
-
|
|
93
|
-
maxConcurrentStreams?: number
|
|
95
|
+
*/
|
|
96
|
+
maxConcurrentStreams?: number;
|
|
94
97
|
}
|
|
95
98
|
export interface SocketInfo {
|
|
96
99
|
localAddress?: string
|
|
@@ -59,6 +59,9 @@ declare namespace MockAgent {
|
|
|
59
59
|
/** Ignore trailing slashes in the path */
|
|
60
60
|
ignoreTrailingSlash?: boolean;
|
|
61
61
|
|
|
62
|
+
/** Accept URLs with search parameters using non standard syntaxes. default false */
|
|
63
|
+
acceptNonStandardSearchParameters?: boolean;
|
|
64
|
+
|
|
62
65
|
/** Enable call history. you can either call MockAgent.enableCallHistory(). default false */
|
|
63
66
|
enableCallHistory?: boolean
|
|
64
67
|
}
|
|
@@ -33,6 +33,8 @@ declare namespace Pool {
|
|
|
33
33
|
factory?(origin: URL, opts: object): Dispatcher;
|
|
34
34
|
/** The max number of clients to create. `null` if no limit. Default `null`. */
|
|
35
35
|
connections?: number | null;
|
|
36
|
+
/** The amount of time before a client is removed from the pool and closed. `null` if no time limit. Default `null` */
|
|
37
|
+
clientTtl?: number | null;
|
|
36
38
|
|
|
37
39
|
interceptors?: { Pool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options['interceptors']
|
|
38
40
|
}
|