cdk-common 2.0.545 → 2.0.546
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/lib/main.js +1 -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 +9 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/index.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/module.d.ts +17 -4
- package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/test.d.ts +213 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/tls.d.ts +11 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/ts4.8/crypto.d.ts +9 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/ts4.8/module.d.ts +17 -4
- package/node_modules/@types/concat-stream/node_modules/@types/node/ts4.8/test.d.ts +213 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/ts4.8/tls.d.ts +11 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/ts4.8/util.d.ts +75 -11
- package/node_modules/@types/concat-stream/node_modules/@types/node/util.d.ts +75 -11
- 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 +9 -1
- package/node_modules/@types/form-data/node_modules/@types/node/index.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/module.d.ts +17 -4
- package/node_modules/@types/form-data/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/test.d.ts +213 -2
- package/node_modules/@types/form-data/node_modules/@types/node/tls.d.ts +11 -0
- package/node_modules/@types/form-data/node_modules/@types/node/ts4.8/crypto.d.ts +9 -1
- package/node_modules/@types/form-data/node_modules/@types/node/ts4.8/module.d.ts +17 -4
- package/node_modules/@types/form-data/node_modules/@types/node/ts4.8/test.d.ts +213 -2
- package/node_modules/@types/form-data/node_modules/@types/node/ts4.8/tls.d.ts +11 -0
- package/node_modules/@types/form-data/node_modules/@types/node/ts4.8/util.d.ts +75 -11
- package/node_modules/@types/form-data/node_modules/@types/node/util.d.ts +75 -11
- package/package.json +2 -2
package/.jsii
CHANGED
|
@@ -9691,6 +9691,6 @@
|
|
|
9691
9691
|
"symbolId": "src/main:LambdaArmFunctionProps"
|
|
9692
9692
|
}
|
|
9693
9693
|
},
|
|
9694
|
-
"version": "2.0.
|
|
9695
|
-
"fingerprint": "
|
|
9694
|
+
"version": "2.0.546",
|
|
9695
|
+
"fingerprint": "DWd5CNi1GGV9uGD5Ly+TojCPBtil9nG5qq0lyjcfXbk="
|
|
9696
9696
|
}
|
package/lib/main.js
CHANGED
|
@@ -41,5 +41,5 @@ class LambdaArmFunction extends constructs_1.Construct {
|
|
|
41
41
|
}
|
|
42
42
|
exports.LambdaArmFunction = LambdaArmFunction;
|
|
43
43
|
_a = JSII_RTTI_SYMBOL_1;
|
|
44
|
-
LambdaArmFunction[_a] = { fqn: "cdk-common.LambdaArmFunction", version: "2.0.
|
|
44
|
+
LambdaArmFunction[_a] = { fqn: "cdk-common.LambdaArmFunction", version: "2.0.546" };
|
|
45
45
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9tYWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsbUNBQW1DO0FBQ25DLGlEQUFpRDtBQUNqRCwyQ0FBdUM7QUFLdkMsTUFBYSxpQkFBa0IsU0FBUSxzQkFBUztJQUU5QyxZQUFZLEtBQWdCLEVBQUUsRUFBVSxFQUFFLEtBQTRCO1FBQ3BFLEtBQUssQ0FBQyxLQUFLLEVBQUUsRUFBRSxDQUFDLENBQUM7UUFFakIsSUFBSSxLQUFLLENBQ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kZ1bmN0aW9uKHRoaXMsICdMYW1iZGFGdW5jdGlvbicsIHsgYXJjaGl0ZWN0dXJlOiBsYW1iZGEuQXJjaGl0ZWN0dXJlLkFSTV82NCwgLi4ucHJvcHMgfSk7XG4gIH1cbn0iXX0=
|
|
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (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, 05 Jul 2023 21:32:40 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
|
|
14
14
|
|
|
@@ -1516,10 +1516,15 @@ declare module 'crypto' {
|
|
|
1516
1516
|
class DiffieHellman {
|
|
1517
1517
|
private constructor();
|
|
1518
1518
|
/**
|
|
1519
|
-
* Generates private and public Diffie-Hellman key values
|
|
1519
|
+
* Generates private and public Diffie-Hellman key values unless they have been
|
|
1520
|
+
* generated or computed already, and returns
|
|
1520
1521
|
* the public key in the specified `encoding`. This key should be
|
|
1521
1522
|
* transferred to the other party.
|
|
1522
1523
|
* If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
|
|
1524
|
+
*
|
|
1525
|
+
* This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular,
|
|
1526
|
+
* once a private key has been generated or set, calling this function only updates
|
|
1527
|
+
* the public key but does not generate a new private key.
|
|
1523
1528
|
* @since v0.5.0
|
|
1524
1529
|
* @param encoding The `encoding` of the return value.
|
|
1525
1530
|
*/
|
|
@@ -1591,6 +1596,9 @@ declare module 'crypto' {
|
|
|
1591
1596
|
* Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected
|
|
1592
1597
|
* to be a string. If no `encoding` is provided, `privateKey` is expected
|
|
1593
1598
|
* to be a `Buffer`, `TypedArray`, or `DataView`.
|
|
1599
|
+
*
|
|
1600
|
+
* This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be
|
|
1601
|
+
* used to manually provide the public key or to automatically derive it.
|
|
1594
1602
|
* @since v0.5.0
|
|
1595
1603
|
* @param encoding The `encoding` of the `privateKey` string.
|
|
1596
1604
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for non-npm package Node.js 20.
|
|
1
|
+
// Type definitions for non-npm package Node.js 20.4
|
|
2
2
|
// Project: https://nodejs.org/
|
|
3
3
|
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
|
|
4
4
|
// DefinitelyTyped <https://github.com/DefinitelyTyped>
|
|
@@ -73,11 +73,24 @@ declare module 'module' {
|
|
|
73
73
|
readonly payload: SourceMapPayload;
|
|
74
74
|
constructor(payload: SourceMapPayload);
|
|
75
75
|
/**
|
|
76
|
-
* Given a line
|
|
77
|
-
* an object representing the
|
|
78
|
-
*
|
|
76
|
+
* Given a line offset and column offset in the generated source
|
|
77
|
+
* file, returns an object representing the SourceMap range in the
|
|
78
|
+
* original file if found, or an empty object if not.
|
|
79
|
+
*
|
|
80
|
+
* The object returned contains the following keys:
|
|
81
|
+
*
|
|
82
|
+
* The returned value represents the raw range as it appears in the
|
|
83
|
+
* SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and
|
|
84
|
+
* column numbers as they appear in Error messages and CallSite
|
|
85
|
+
* objects.
|
|
86
|
+
*
|
|
87
|
+
* To get the corresponding 1-indexed line and column numbers from a
|
|
88
|
+
* lineNumber and columnNumber as they are reported by Error stacks
|
|
89
|
+
* and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)`
|
|
90
|
+
* @param lineOffset The zero-indexed line number offset in the generated source
|
|
91
|
+
* @param columnOffset The zero-indexed column number offset in the generated source
|
|
79
92
|
*/
|
|
80
|
-
findEntry(
|
|
93
|
+
findEntry(lineOffset: number, columnOffset: number): SourceMapping;
|
|
81
94
|
}
|
|
82
95
|
}
|
|
83
96
|
interface Module extends NodeModule {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.4.0",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -232,6 +232,6 @@
|
|
|
232
232
|
},
|
|
233
233
|
"scripts": {},
|
|
234
234
|
"dependencies": {},
|
|
235
|
-
"typesPublisherContentHash": "
|
|
235
|
+
"typesPublisherContentHash": "c342b7a9708bb206f3dfc674c1d142bfdaf5a01b59dc5d8bd88d18fc226c2de3",
|
|
236
236
|
"typeScriptVersion": "4.3"
|
|
237
237
|
}
|
|
@@ -159,7 +159,7 @@ declare module 'node:test' {
|
|
|
159
159
|
* @param [name='The name'] The name of the suite, which is displayed when reporting test results.
|
|
160
160
|
* @param options Configuration options for the suite. supports the same options as `test([name][, options][, fn])`.
|
|
161
161
|
* @param [fn='A no-op function'] The function under suite declaring all subtests and subsuites. The first argument to this function is a {@link SuiteContext} object.
|
|
162
|
-
* @return `undefined`.
|
|
162
|
+
* @return Immediately fulfilled with `undefined`.
|
|
163
163
|
*/
|
|
164
164
|
function describe(name?: string, options?: TestOptions, fn?: SuiteFn): void;
|
|
165
165
|
function describe(name?: string, fn?: SuiteFn): void;
|
|
@@ -821,6 +821,7 @@ declare module 'node:test' {
|
|
|
821
821
|
* @since v19.1.0, v18.13.0
|
|
822
822
|
*/
|
|
823
823
|
restoreAll(): void;
|
|
824
|
+
timers: MockTimers;
|
|
824
825
|
}
|
|
825
826
|
const mock: MockTracker;
|
|
826
827
|
interface MockFunctionCall<
|
|
@@ -964,6 +965,216 @@ declare module 'node:test' {
|
|
|
964
965
|
*/
|
|
965
966
|
restore(): void;
|
|
966
967
|
}
|
|
968
|
+
type Timer = 'setInterval' | 'clearInterval' | 'setTimeout' | 'clearTimeout';
|
|
969
|
+
/**
|
|
970
|
+
* Mocking timers is a technique commonly used in software testing to simulate and
|
|
971
|
+
* control the behavior of timers, such as `setInterval` and `setTimeout`,
|
|
972
|
+
* without actually waiting for the specified time intervals.
|
|
973
|
+
*
|
|
974
|
+
* The `MockTracker` provides a top-level `timers` export
|
|
975
|
+
* which is a `MockTimers` instance.
|
|
976
|
+
* @since v20.4.0
|
|
977
|
+
* @experimental
|
|
978
|
+
*/
|
|
979
|
+
class MockTimers {
|
|
980
|
+
/**
|
|
981
|
+
* Enables timer mocking for the specified timers.
|
|
982
|
+
*
|
|
983
|
+
* **Note:** When you enable mocking for a specific timer, its associated
|
|
984
|
+
* clear function will also be implicitly mocked.
|
|
985
|
+
*
|
|
986
|
+
* Example usage:
|
|
987
|
+
*
|
|
988
|
+
* ```js
|
|
989
|
+
* import { mock } from 'node:test';
|
|
990
|
+
* mock.timers.enable(['setInterval']);
|
|
991
|
+
* ```
|
|
992
|
+
*
|
|
993
|
+
* ```js
|
|
994
|
+
* const { mock } = require('node:test');
|
|
995
|
+
* mock.timers.enable(['setInterval']);
|
|
996
|
+
* ```
|
|
997
|
+
*
|
|
998
|
+
* The above example enables mocking for the `setInterval` timer and
|
|
999
|
+
* implicitly mocks the `clearInterval` function. Only the `setInterval`and `clearInterval` functions from `node:timers`,`node:timers/promises`, and`globalThis` will be mocked.
|
|
1000
|
+
*
|
|
1001
|
+
* Alternatively, if you call `mock.timers.enable()` without any parameters:
|
|
1002
|
+
*
|
|
1003
|
+
* All timers (`'setInterval'`, `'clearInterval'`, `'setTimeout'`, and `'clearTimeout'`)
|
|
1004
|
+
* will be mocked. The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout`functions from `node:timers`, `node:timers/promises`,
|
|
1005
|
+
* and `globalThis` will be mocked.
|
|
1006
|
+
* @since v20.4.0
|
|
1007
|
+
*/
|
|
1008
|
+
enable(timers?: Timer[]): void;
|
|
1009
|
+
/**
|
|
1010
|
+
* This function restores the default behavior of all mocks that were previously
|
|
1011
|
+
* created by this `MockTimers` instance and disassociates the mocks
|
|
1012
|
+
* from the `MockTracker` instance.
|
|
1013
|
+
*
|
|
1014
|
+
* **Note:** After each test completes, this function is called on
|
|
1015
|
+
* the test context's `MockTracker`.
|
|
1016
|
+
*
|
|
1017
|
+
* ```js
|
|
1018
|
+
* import { mock } from 'node:test';
|
|
1019
|
+
* mock.timers.reset();
|
|
1020
|
+
* ```
|
|
1021
|
+
*
|
|
1022
|
+
* ```js
|
|
1023
|
+
* const { mock } = require('node:test');
|
|
1024
|
+
* mock.timers.reset();
|
|
1025
|
+
* ```
|
|
1026
|
+
* @since v20.4.0
|
|
1027
|
+
*/
|
|
1028
|
+
reset(): void;
|
|
1029
|
+
/**
|
|
1030
|
+
* Advances time for all mocked timers.
|
|
1031
|
+
*
|
|
1032
|
+
* **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts
|
|
1033
|
+
* only positive numbers. In Node.js, `setTimeout` with negative numbers is
|
|
1034
|
+
* only supported for web compatibility reasons.
|
|
1035
|
+
*
|
|
1036
|
+
* The following example mocks a `setTimeout` function and
|
|
1037
|
+
* by using `.tick` advances in
|
|
1038
|
+
* time triggering all pending timers.
|
|
1039
|
+
*
|
|
1040
|
+
* ```js
|
|
1041
|
+
* import assert from 'node:assert';
|
|
1042
|
+
* import { test } from 'node:test';
|
|
1043
|
+
*
|
|
1044
|
+
* test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
|
|
1045
|
+
* const fn = context.mock.fn();
|
|
1046
|
+
*
|
|
1047
|
+
* context.mock.timers.enable(['setTimeout']);
|
|
1048
|
+
*
|
|
1049
|
+
* setTimeout(fn, 9999);
|
|
1050
|
+
*
|
|
1051
|
+
* assert.strictEqual(fn.mock.callCount(), 0);
|
|
1052
|
+
*
|
|
1053
|
+
* // Advance in time
|
|
1054
|
+
* context.mock.timers.tick(9999);
|
|
1055
|
+
*
|
|
1056
|
+
* assert.strictEqual(fn.mock.callCount(), 1);
|
|
1057
|
+
* });
|
|
1058
|
+
* ```
|
|
1059
|
+
*
|
|
1060
|
+
* ```js
|
|
1061
|
+
* const assert = require('node:assert');
|
|
1062
|
+
* const { test } = require('node:test');
|
|
1063
|
+
*
|
|
1064
|
+
* test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
|
|
1065
|
+
* const fn = context.mock.fn();
|
|
1066
|
+
* context.mock.timers.enable(['setTimeout']);
|
|
1067
|
+
*
|
|
1068
|
+
* setTimeout(fn, 9999);
|
|
1069
|
+
* assert.strictEqual(fn.mock.callCount(), 0);
|
|
1070
|
+
*
|
|
1071
|
+
* // Advance in time
|
|
1072
|
+
* context.mock.timers.tick(9999);
|
|
1073
|
+
*
|
|
1074
|
+
* assert.strictEqual(fn.mock.callCount(), 1);
|
|
1075
|
+
* });
|
|
1076
|
+
* ```
|
|
1077
|
+
*
|
|
1078
|
+
* Alternativelly, the `.tick` function can be called many times
|
|
1079
|
+
*
|
|
1080
|
+
* ```js
|
|
1081
|
+
* import assert from 'node:assert';
|
|
1082
|
+
* import { test } from 'node:test';
|
|
1083
|
+
*
|
|
1084
|
+
* test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
|
|
1085
|
+
* const fn = context.mock.fn();
|
|
1086
|
+
* context.mock.timers.enable(['setTimeout']);
|
|
1087
|
+
* const nineSecs = 9000;
|
|
1088
|
+
* setTimeout(fn, nineSecs);
|
|
1089
|
+
*
|
|
1090
|
+
* const twoSeconds = 3000;
|
|
1091
|
+
* context.mock.timers.tick(twoSeconds);
|
|
1092
|
+
* context.mock.timers.tick(twoSeconds);
|
|
1093
|
+
* context.mock.timers.tick(twoSeconds);
|
|
1094
|
+
*
|
|
1095
|
+
* assert.strictEqual(fn.mock.callCount(), 1);
|
|
1096
|
+
* });
|
|
1097
|
+
* ```
|
|
1098
|
+
*
|
|
1099
|
+
* ```js
|
|
1100
|
+
* const assert = require('node:assert');
|
|
1101
|
+
* const { test } = require('node:test');
|
|
1102
|
+
*
|
|
1103
|
+
* test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
|
|
1104
|
+
* const fn = context.mock.fn();
|
|
1105
|
+
* context.mock.timers.enable(['setTimeout']);
|
|
1106
|
+
* const nineSecs = 9000;
|
|
1107
|
+
* setTimeout(fn, nineSecs);
|
|
1108
|
+
*
|
|
1109
|
+
* const twoSeconds = 3000;
|
|
1110
|
+
* context.mock.timers.tick(twoSeconds);
|
|
1111
|
+
* context.mock.timers.tick(twoSeconds);
|
|
1112
|
+
* context.mock.timers.tick(twoSeconds);
|
|
1113
|
+
*
|
|
1114
|
+
* assert.strictEqual(fn.mock.callCount(), 1);
|
|
1115
|
+
* });
|
|
1116
|
+
* ```
|
|
1117
|
+
* @since v20.4.0
|
|
1118
|
+
*/
|
|
1119
|
+
tick(milliseconds: number): void;
|
|
1120
|
+
/**
|
|
1121
|
+
* Triggers all pending mocked timers immediately.
|
|
1122
|
+
*
|
|
1123
|
+
* The example below triggers all pending timers immediately,
|
|
1124
|
+
* causing them to execute without any delay.
|
|
1125
|
+
*
|
|
1126
|
+
* ```js
|
|
1127
|
+
* import assert from 'node:assert';
|
|
1128
|
+
* import { test } from 'node:test';
|
|
1129
|
+
*
|
|
1130
|
+
* test('runAll functions following the given order', (context) => {
|
|
1131
|
+
* context.mock.timers.enable(['setTimeout']);
|
|
1132
|
+
* const results = [];
|
|
1133
|
+
* setTimeout(() => results.push(1), 9999);
|
|
1134
|
+
*
|
|
1135
|
+
* // Notice that if both timers have the same timeout,
|
|
1136
|
+
* // the order of execution is guaranteed
|
|
1137
|
+
* setTimeout(() => results.push(3), 8888);
|
|
1138
|
+
* setTimeout(() => results.push(2), 8888);
|
|
1139
|
+
*
|
|
1140
|
+
* assert.deepStrictEqual(results, []);
|
|
1141
|
+
*
|
|
1142
|
+
* context.mock.timers.runAll();
|
|
1143
|
+
*
|
|
1144
|
+
* assert.deepStrictEqual(results, [3, 2, 1]);
|
|
1145
|
+
* });
|
|
1146
|
+
* ```
|
|
1147
|
+
*
|
|
1148
|
+
* ```js
|
|
1149
|
+
* const assert = require('node:assert');
|
|
1150
|
+
* const { test } = require('node:test');
|
|
1151
|
+
*
|
|
1152
|
+
* test('runAll functions following the given order', (context) => {
|
|
1153
|
+
* context.mock.timers.enable(['setTimeout']);
|
|
1154
|
+
* const results = [];
|
|
1155
|
+
* setTimeout(() => results.push(1), 9999);
|
|
1156
|
+
*
|
|
1157
|
+
* // Notice that if both timers have the same timeout,
|
|
1158
|
+
* // the order of execution is guaranteed
|
|
1159
|
+
* setTimeout(() => results.push(3), 8888);
|
|
1160
|
+
* setTimeout(() => results.push(2), 8888);
|
|
1161
|
+
*
|
|
1162
|
+
* assert.deepStrictEqual(results, []);
|
|
1163
|
+
*
|
|
1164
|
+
* context.mock.timers.runAll();
|
|
1165
|
+
*
|
|
1166
|
+
* assert.deepStrictEqual(results, [3, 2, 1]);
|
|
1167
|
+
* });
|
|
1168
|
+
* ```
|
|
1169
|
+
*
|
|
1170
|
+
* **Note:** The `runAll()` function is specifically designed for
|
|
1171
|
+
* triggering timers in the context of timer mocking.
|
|
1172
|
+
* It does not have any effect on real-time system
|
|
1173
|
+
* clocks or actual timers outside of the mocking environment.
|
|
1174
|
+
* @since v20.4.0
|
|
1175
|
+
*/
|
|
1176
|
+
runAll(): void;
|
|
1177
|
+
}
|
|
967
1178
|
export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock, skip, only, todo };
|
|
968
1179
|
}
|
|
969
1180
|
|
|
@@ -1139,7 +1350,7 @@ declare module 'node:test/reporters' {
|
|
|
1139
1350
|
* where each passing test is represented by a `.`,
|
|
1140
1351
|
* and each failing test is represented by a `X`.
|
|
1141
1352
|
*/
|
|
1142
|
-
function dot(source: TestEventGenerator): AsyncGenerator<
|
|
1353
|
+
function dot(source: TestEventGenerator): AsyncGenerator<'\n' | '.' | 'X', void>;
|
|
1143
1354
|
/**
|
|
1144
1355
|
* The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.
|
|
1145
1356
|
*/
|
|
@@ -728,6 +728,17 @@ declare module 'tls' {
|
|
|
728
728
|
}
|
|
729
729
|
type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1';
|
|
730
730
|
interface SecureContextOptions {
|
|
731
|
+
/**
|
|
732
|
+
* If set, this will be called when a client opens a connection using the ALPN extension.
|
|
733
|
+
* One argument will be passed to the callback: an object containing `servername` and `protocols` fields,
|
|
734
|
+
* respectively containing the server name from the SNI extension (if any) and an array of
|
|
735
|
+
* ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`,
|
|
736
|
+
* which will be returned to the client as the selected ALPN protocol, or `undefined`,
|
|
737
|
+
* to reject the connection with a fatal alert. If a string is returned that does not match one of
|
|
738
|
+
* the client's ALPN protocols, an error will be thrown.
|
|
739
|
+
* This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error.
|
|
740
|
+
*/
|
|
741
|
+
ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined;
|
|
731
742
|
/**
|
|
732
743
|
* Optionally override the trusted CA certificates. Default is to trust
|
|
733
744
|
* the well-known CAs curated by Mozilla. Mozilla's CAs are completely
|
|
@@ -1516,10 +1516,15 @@ declare module 'crypto' {
|
|
|
1516
1516
|
class DiffieHellman {
|
|
1517
1517
|
private constructor();
|
|
1518
1518
|
/**
|
|
1519
|
-
* Generates private and public Diffie-Hellman key values
|
|
1519
|
+
* Generates private and public Diffie-Hellman key values unless they have been
|
|
1520
|
+
* generated or computed already, and returns
|
|
1520
1521
|
* the public key in the specified `encoding`. This key should be
|
|
1521
1522
|
* transferred to the other party.
|
|
1522
1523
|
* If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
|
|
1524
|
+
*
|
|
1525
|
+
* This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular,
|
|
1526
|
+
* once a private key has been generated or set, calling this function only updates
|
|
1527
|
+
* the public key but does not generate a new private key.
|
|
1523
1528
|
* @since v0.5.0
|
|
1524
1529
|
* @param encoding The `encoding` of the return value.
|
|
1525
1530
|
*/
|
|
@@ -1591,6 +1596,9 @@ declare module 'crypto' {
|
|
|
1591
1596
|
* Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected
|
|
1592
1597
|
* to be a string. If no `encoding` is provided, `privateKey` is expected
|
|
1593
1598
|
* to be a `Buffer`, `TypedArray`, or `DataView`.
|
|
1599
|
+
*
|
|
1600
|
+
* This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be
|
|
1601
|
+
* used to manually provide the public key or to automatically derive it.
|
|
1594
1602
|
* @since v0.5.0
|
|
1595
1603
|
* @param encoding The `encoding` of the `privateKey` string.
|
|
1596
1604
|
*/
|
|
@@ -73,11 +73,24 @@ declare module 'module' {
|
|
|
73
73
|
readonly payload: SourceMapPayload;
|
|
74
74
|
constructor(payload: SourceMapPayload);
|
|
75
75
|
/**
|
|
76
|
-
* Given a line
|
|
77
|
-
* an object representing the
|
|
78
|
-
*
|
|
76
|
+
* Given a line offset and column offset in the generated source
|
|
77
|
+
* file, returns an object representing the SourceMap range in the
|
|
78
|
+
* original file if found, or an empty object if not.
|
|
79
|
+
*
|
|
80
|
+
* The object returned contains the following keys:
|
|
81
|
+
*
|
|
82
|
+
* The returned value represents the raw range as it appears in the
|
|
83
|
+
* SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and
|
|
84
|
+
* column numbers as they appear in Error messages and CallSite
|
|
85
|
+
* objects.
|
|
86
|
+
*
|
|
87
|
+
* To get the corresponding 1-indexed line and column numbers from a
|
|
88
|
+
* lineNumber and columnNumber as they are reported by Error stacks
|
|
89
|
+
* and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)`
|
|
90
|
+
* @param lineOffset The zero-indexed line number offset in the generated source
|
|
91
|
+
* @param columnOffset The zero-indexed column number offset in the generated source
|
|
79
92
|
*/
|
|
80
|
-
findEntry(
|
|
93
|
+
findEntry(lineOffset: number, columnOffset: number): SourceMapping;
|
|
81
94
|
}
|
|
82
95
|
}
|
|
83
96
|
interface Module extends NodeModule {}
|