@chainlink/external-adapter-framework 2.8.0 → 2.9.0
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/README.md +1 -1
- package/adapter/basic.js +21 -4
- package/adapter/basic.js.map +1 -1
- package/adapter/endpoint.js +13 -0
- package/adapter/endpoint.js.map +1 -1
- package/adapter/por.js +6 -6
- package/adapter/por.js.map +1 -1
- package/adapter/price.js +1 -0
- package/adapter/price.js.map +1 -1
- package/cache/local.js +5 -1
- package/cache/local.js.map +1 -1
- package/cache/redis.js +3 -1
- package/cache/redis.js.map +1 -1
- package/cache/response.js +5 -0
- package/cache/response.js.map +1 -1
- package/config/index.js +9 -6
- package/config/index.js.map +1 -1
- package/generator-adapter/node_modules/.yarn-integrity +4 -4
- package/generator-adapter/node_modules/@types/node/README.md +3 -3
- package/generator-adapter/node_modules/@types/node/assert/strict.d.ts +105 -2
- package/generator-adapter/node_modules/@types/node/assert.d.ts +162 -101
- package/generator-adapter/node_modules/@types/node/async_hooks.d.ts +25 -5
- package/generator-adapter/node_modules/@types/node/buffer.buffer.d.ts +9 -0
- package/generator-adapter/node_modules/@types/node/buffer.d.ts +9 -5
- package/generator-adapter/node_modules/@types/node/child_process.d.ts +67 -44
- package/generator-adapter/node_modules/@types/node/cluster.d.ts +19 -20
- package/generator-adapter/node_modules/@types/node/compatibility/iterators.d.ts +1 -0
- package/generator-adapter/node_modules/@types/node/console.d.ts +19 -18
- package/generator-adapter/node_modules/@types/node/crypto.d.ts +1247 -355
- package/generator-adapter/node_modules/@types/node/dgram.d.ts +10 -9
- package/generator-adapter/node_modules/@types/node/diagnostics_channel.d.ts +1 -3
- package/generator-adapter/node_modules/@types/node/dns/promises.d.ts +1 -1
- package/generator-adapter/node_modules/@types/node/dns.d.ts +23 -18
- package/generator-adapter/node_modules/@types/node/domain.d.ts +1 -1
- package/generator-adapter/node_modules/@types/node/events.d.ts +81 -35
- package/generator-adapter/node_modules/@types/node/fs/promises.d.ts +62 -22
- package/generator-adapter/node_modules/@types/node/fs.d.ts +364 -98
- package/generator-adapter/node_modules/@types/node/globals.d.ts +4 -4
- package/generator-adapter/node_modules/@types/node/globals.typedarray.d.ts +20 -0
- package/generator-adapter/node_modules/@types/node/http.d.ts +120 -32
- package/generator-adapter/node_modules/@types/node/http2.d.ts +185 -65
- package/generator-adapter/node_modules/@types/node/https.d.ts +92 -63
- package/generator-adapter/node_modules/@types/node/index.d.ts +10 -5
- package/generator-adapter/node_modules/@types/node/inspector.d.ts +277 -0
- package/generator-adapter/node_modules/@types/node/inspector.generated.d.ts +908 -886
- package/generator-adapter/node_modules/@types/node/module.d.ts +21 -18
- package/generator-adapter/node_modules/@types/node/net.d.ts +35 -16
- package/generator-adapter/node_modules/@types/node/os.d.ts +22 -10
- package/generator-adapter/node_modules/@types/node/package.json +13 -3
- package/generator-adapter/node_modules/@types/node/path.d.ts +1 -1
- package/generator-adapter/node_modules/@types/node/perf_hooks.d.ts +28 -16
- package/generator-adapter/node_modules/@types/node/process.d.ts +30 -30
- package/generator-adapter/node_modules/@types/node/punycode.d.ts +1 -1
- package/generator-adapter/node_modules/@types/node/querystring.d.ts +1 -1
- package/generator-adapter/node_modules/@types/node/readline/promises.d.ts +1 -1
- package/generator-adapter/node_modules/@types/node/readline.d.ts +13 -13
- package/generator-adapter/node_modules/@types/node/repl.d.ts +23 -13
- package/generator-adapter/node_modules/@types/node/sea.d.ts +10 -1
- package/generator-adapter/node_modules/@types/node/sqlite.d.ts +245 -23
- package/generator-adapter/node_modules/@types/node/stream/consumers.d.ts +2 -2
- package/generator-adapter/node_modules/@types/node/stream/web.d.ts +6 -55
- package/generator-adapter/node_modules/@types/node/stream.d.ts +63 -37
- package/generator-adapter/node_modules/@types/node/string_decoder.d.ts +3 -3
- package/generator-adapter/node_modules/@types/node/test.d.ts +196 -40
- package/generator-adapter/node_modules/@types/node/timers/promises.d.ts +1 -1
- package/generator-adapter/node_modules/@types/node/timers.d.ts +1 -3
- package/generator-adapter/node_modules/@types/node/tls.d.ts +124 -114
- package/generator-adapter/node_modules/@types/node/trace_events.d.ts +6 -6
- package/generator-adapter/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +10 -2
- package/generator-adapter/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/generator-adapter/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +17 -0
- package/generator-adapter/node_modules/@types/node/ts5.6/index.d.ts +12 -5
- package/generator-adapter/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/generator-adapter/node_modules/@types/node/ts5.7/index.d.ts +103 -0
- package/generator-adapter/node_modules/@types/node/tty.d.ts +1 -1
- package/generator-adapter/node_modules/@types/node/url.d.ts +109 -33
- package/generator-adapter/node_modules/@types/node/util.d.ts +31 -305
- package/generator-adapter/node_modules/@types/node/v8.d.ts +41 -8
- package/generator-adapter/node_modules/@types/node/vm.d.ts +258 -107
- package/generator-adapter/node_modules/@types/node/wasi.d.ts +23 -2
- package/generator-adapter/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
- package/generator-adapter/node_modules/@types/node/web-globals/events.d.ts +3 -0
- package/generator-adapter/node_modules/@types/node/web-globals/fetch.d.ts +4 -0
- package/generator-adapter/node_modules/@types/node/web-globals/navigator.d.ts +3 -0
- package/generator-adapter/node_modules/@types/node/web-globals/streams.d.ts +22 -0
- package/generator-adapter/node_modules/@types/node/worker_threads.d.ts +142 -51
- package/generator-adapter/node_modules/@types/node/zlib.d.ts +36 -31
- package/generator-adapter/node_modules/undici-types/agent.d.ts +12 -11
- package/generator-adapter/node_modules/undici-types/api.d.ts +24 -24
- package/generator-adapter/node_modules/undici-types/balanced-pool.d.ts +11 -11
- package/generator-adapter/node_modules/undici-types/cache-interceptor.d.ts +172 -0
- package/generator-adapter/node_modules/undici-types/client-stats.d.ts +15 -0
- package/generator-adapter/node_modules/undici-types/client.d.ts +18 -18
- package/generator-adapter/node_modules/undici-types/cookies.d.ts +2 -0
- package/generator-adapter/node_modules/undici-types/diagnostics-channel.d.ts +18 -10
- package/generator-adapter/node_modules/undici-types/dispatcher.d.ts +119 -99
- package/generator-adapter/node_modules/undici-types/env-http-proxy-agent.d.ts +4 -3
- package/generator-adapter/node_modules/undici-types/errors.d.ts +66 -54
- package/generator-adapter/node_modules/undici-types/eventsource.d.ts +9 -4
- package/generator-adapter/node_modules/undici-types/fetch.d.ts +18 -16
- package/generator-adapter/node_modules/undici-types/formdata.d.ts +7 -7
- package/generator-adapter/node_modules/undici-types/global-dispatcher.d.ts +4 -4
- package/generator-adapter/node_modules/undici-types/global-origin.d.ts +5 -5
- package/generator-adapter/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/generator-adapter/node_modules/undici-types/handlers.d.ts +8 -8
- package/generator-adapter/node_modules/undici-types/header.d.ts +157 -1
- package/generator-adapter/node_modules/undici-types/index.d.ts +56 -47
- package/generator-adapter/node_modules/undici-types/interceptors.d.ts +30 -8
- package/generator-adapter/node_modules/undici-types/mock-agent.d.ts +36 -18
- package/generator-adapter/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/generator-adapter/node_modules/undici-types/mock-client.d.ts +6 -4
- package/generator-adapter/node_modules/undici-types/mock-errors.d.ts +3 -3
- package/generator-adapter/node_modules/undici-types/mock-interceptor.d.ts +21 -20
- package/generator-adapter/node_modules/undici-types/mock-pool.d.ts +6 -4
- package/generator-adapter/node_modules/undici-types/package.json +1 -1
- package/generator-adapter/node_modules/undici-types/patch.d.ts +0 -4
- package/generator-adapter/node_modules/undici-types/pool-stats.d.ts +8 -8
- package/generator-adapter/node_modules/undici-types/pool.d.ts +14 -12
- package/generator-adapter/node_modules/undici-types/proxy-agent.d.ts +5 -4
- package/generator-adapter/node_modules/undici-types/readable.d.ts +18 -15
- package/generator-adapter/node_modules/undici-types/retry-agent.d.ts +1 -1
- package/generator-adapter/node_modules/undici-types/retry-handler.d.ts +19 -10
- package/generator-adapter/node_modules/undici-types/snapshot-agent.d.ts +109 -0
- package/generator-adapter/node_modules/undici-types/util.d.ts +3 -3
- package/generator-adapter/node_modules/undici-types/utility.d.ts +7 -0
- package/generator-adapter/node_modules/undici-types/webidl.d.ts +142 -29
- package/generator-adapter/node_modules/undici-types/websocket.d.ts +38 -2
- package/generator-adapter/package.json +1 -1
- package/metrics/index.js +3 -0
- package/metrics/index.js.map +1 -1
- package/package.json +8 -8
- package/rate-limiting/burst.js +6 -6
- package/rate-limiting/burst.js.map +1 -1
- package/rate-limiting/fixed-interval.js +2 -3
- package/rate-limiting/fixed-interval.js.map +1 -1
- package/transports/abstract/streaming.js +7 -10
- package/transports/abstract/streaming.js.map +1 -1
- package/transports/abstract/subscription.js +4 -0
- package/transports/abstract/subscription.js.map +1 -1
- package/transports/http.js +5 -3
- package/transports/http.js.map +1 -1
- package/transports/index.js +1 -3
- package/transports/index.js.map +1 -1
- package/transports/sse.js +6 -2
- package/transports/sse.js.map +1 -1
- package/transports/websocket.d.ts +9 -1
- package/transports/websocket.js +25 -13
- package/transports/websocket.js.map +1 -1
- package/util/censor/censor-list.js +1 -1
- package/util/censor/censor-list.js.map +1 -1
- package/util/group-runner.js +3 -2
- package/util/group-runner.js.map +1 -1
- package/util/index.js +8 -1
- package/util/index.js.map +1 -1
- package/util/logger.js +8 -1
- package/util/logger.js.map +1 -1
- package/util/requester.js +11 -3
- package/util/requester.js.map +1 -1
- package/util/subscription-set/expiring-sorted-set.js +3 -0
- package/util/subscription-set/expiring-sorted-set.js.map +1 -1
- package/util/subscription-set/redis-sorted-set.js +3 -0
- package/util/subscription-set/redis-sorted-set.js.map +1 -1
- package/util/subscription-set/subscription-set.js +5 -0
- package/util/subscription-set/subscription-set.js.map +1 -1
- package/util/testing-utils.js +13 -6
- package/util/testing-utils.js.map +1 -1
- package/validation/error.js +13 -0
- package/validation/error.js.map +1 -1
- package/validation/input-params.js +14 -0
- package/validation/input-params.js.map +1 -1
- package/generator-adapter/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
- package/generator-adapter/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/generator-adapter/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
- package/generator-adapter/node_modules/undici-types/file.d.ts +0 -39
- package/generator-adapter/node_modules/undici-types/filereader.d.ts +0 -54
|
@@ -1,20 +1,166 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `node:assert` module provides a set of assertion functions for verifying
|
|
3
3
|
* invariants.
|
|
4
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
4
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/assert.js)
|
|
5
5
|
*/
|
|
6
6
|
declare module "assert" {
|
|
7
|
+
import strict = require("assert/strict");
|
|
7
8
|
/**
|
|
8
|
-
* An alias of {@link ok}.
|
|
9
|
+
* An alias of {@link assert.ok}.
|
|
9
10
|
* @since v0.5.9
|
|
10
11
|
* @param value The input that is checked for being truthy.
|
|
11
12
|
*/
|
|
12
13
|
function assert(value: unknown, message?: string | Error): asserts value;
|
|
14
|
+
const kOptions: unique symbol;
|
|
13
15
|
namespace assert {
|
|
16
|
+
type AssertMethodNames =
|
|
17
|
+
| "deepEqual"
|
|
18
|
+
| "deepStrictEqual"
|
|
19
|
+
| "doesNotMatch"
|
|
20
|
+
| "doesNotReject"
|
|
21
|
+
| "doesNotThrow"
|
|
22
|
+
| "equal"
|
|
23
|
+
| "fail"
|
|
24
|
+
| "ifError"
|
|
25
|
+
| "match"
|
|
26
|
+
| "notDeepEqual"
|
|
27
|
+
| "notDeepStrictEqual"
|
|
28
|
+
| "notEqual"
|
|
29
|
+
| "notStrictEqual"
|
|
30
|
+
| "ok"
|
|
31
|
+
| "partialDeepStrictEqual"
|
|
32
|
+
| "rejects"
|
|
33
|
+
| "strictEqual"
|
|
34
|
+
| "throws";
|
|
35
|
+
interface AssertOptions {
|
|
36
|
+
/**
|
|
37
|
+
* If set to `'full'`, shows the full diff in assertion errors.
|
|
38
|
+
* @default 'simple'
|
|
39
|
+
*/
|
|
40
|
+
diff?: "simple" | "full" | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* If set to `true`, non-strict methods behave like their
|
|
43
|
+
* corresponding strict methods.
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
strict?: boolean | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* If set to `true`, skips prototype and constructor
|
|
49
|
+
* comparison in deep equality checks.
|
|
50
|
+
* @since v24.9.0
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
skipPrototype?: boolean | undefined;
|
|
54
|
+
}
|
|
55
|
+
interface Assert extends Pick<typeof assert, AssertMethodNames> {
|
|
56
|
+
readonly [kOptions]: AssertOptions & { strict: false };
|
|
57
|
+
}
|
|
58
|
+
interface AssertStrict extends Pick<typeof strict, AssertMethodNames> {
|
|
59
|
+
readonly [kOptions]: AssertOptions & { strict: true };
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The `Assert` class allows creating independent assertion instances with custom options.
|
|
63
|
+
* @since v24.6.0
|
|
64
|
+
*/
|
|
65
|
+
var Assert: {
|
|
66
|
+
/**
|
|
67
|
+
* Creates a new assertion instance. The `diff` option controls the verbosity of diffs in assertion error messages.
|
|
68
|
+
*
|
|
69
|
+
* ```js
|
|
70
|
+
* const { Assert } = require('node:assert');
|
|
71
|
+
* const assertInstance = new Assert({ diff: 'full' });
|
|
72
|
+
* assertInstance.deepStrictEqual({ a: 1 }, { a: 2 });
|
|
73
|
+
* // Shows a full diff in the error message.
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* **Important**: When destructuring assertion methods from an `Assert` instance,
|
|
77
|
+
* the methods lose their connection to the instance's configuration options (such
|
|
78
|
+
* as `diff`, `strict`, and `skipPrototype` settings).
|
|
79
|
+
* The destructured methods will fall back to default behavior instead.
|
|
80
|
+
*
|
|
81
|
+
* ```js
|
|
82
|
+
* const myAssert = new Assert({ diff: 'full' });
|
|
83
|
+
*
|
|
84
|
+
* // This works as expected - uses 'full' diff
|
|
85
|
+
* myAssert.strictEqual({ a: 1 }, { b: { c: 1 } });
|
|
86
|
+
*
|
|
87
|
+
* // This loses the 'full' diff setting - falls back to default 'simple' diff
|
|
88
|
+
* const { strictEqual } = myAssert;
|
|
89
|
+
* strictEqual({ a: 1 }, { b: { c: 1 } });
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* The `skipPrototype` option affects all deep equality methods:
|
|
93
|
+
*
|
|
94
|
+
* ```js
|
|
95
|
+
* class Foo {
|
|
96
|
+
* constructor(a) {
|
|
97
|
+
* this.a = a;
|
|
98
|
+
* }
|
|
99
|
+
* }
|
|
100
|
+
*
|
|
101
|
+
* class Bar {
|
|
102
|
+
* constructor(a) {
|
|
103
|
+
* this.a = a;
|
|
104
|
+
* }
|
|
105
|
+
* }
|
|
106
|
+
*
|
|
107
|
+
* const foo = new Foo(1);
|
|
108
|
+
* const bar = new Bar(1);
|
|
109
|
+
*
|
|
110
|
+
* // Default behavior - fails due to different constructors
|
|
111
|
+
* const assert1 = new Assert();
|
|
112
|
+
* assert1.deepStrictEqual(foo, bar); // AssertionError
|
|
113
|
+
*
|
|
114
|
+
* // Skip prototype comparison - passes if properties are equal
|
|
115
|
+
* const assert2 = new Assert({ skipPrototype: true });
|
|
116
|
+
* assert2.deepStrictEqual(foo, bar); // OK
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* When destructured, methods lose access to the instance's `this` context and revert to default assertion behavior
|
|
120
|
+
* (diff: 'simple', non-strict mode).
|
|
121
|
+
* To maintain custom options when using destructured methods, avoid
|
|
122
|
+
* destructuring and call methods directly on the instance.
|
|
123
|
+
* @since v24.6.0
|
|
124
|
+
*/
|
|
125
|
+
new(
|
|
126
|
+
options?: AssertOptions & { strict?: true | undefined },
|
|
127
|
+
): AssertStrict;
|
|
128
|
+
new(
|
|
129
|
+
options: AssertOptions,
|
|
130
|
+
): Assert;
|
|
131
|
+
};
|
|
132
|
+
interface AssertionErrorOptions {
|
|
133
|
+
/**
|
|
134
|
+
* If provided, the error message is set to this value.
|
|
135
|
+
*/
|
|
136
|
+
message?: string | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* The `actual` property on the error instance.
|
|
139
|
+
*/
|
|
140
|
+
actual?: unknown;
|
|
141
|
+
/**
|
|
142
|
+
* The `expected` property on the error instance.
|
|
143
|
+
*/
|
|
144
|
+
expected?: unknown;
|
|
145
|
+
/**
|
|
146
|
+
* The `operator` property on the error instance.
|
|
147
|
+
*/
|
|
148
|
+
operator?: string | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* If provided, the generated stack trace omits frames before this function.
|
|
151
|
+
*/
|
|
152
|
+
stackStartFn?: Function | undefined;
|
|
153
|
+
/**
|
|
154
|
+
* If set to `'full'`, shows the full diff in assertion errors.
|
|
155
|
+
* @default 'simple'
|
|
156
|
+
*/
|
|
157
|
+
diff?: "simple" | "full" | undefined;
|
|
158
|
+
}
|
|
14
159
|
/**
|
|
15
160
|
* Indicates the failure of an assertion. All errors thrown by the `node:assert` module will be instances of the `AssertionError` class.
|
|
16
161
|
*/
|
|
17
162
|
class AssertionError extends Error {
|
|
163
|
+
constructor(options: AssertionErrorOptions);
|
|
18
164
|
/**
|
|
19
165
|
* Set to the `actual` argument for methods such as {@link assert.strictEqual()}.
|
|
20
166
|
*/
|
|
@@ -23,10 +169,6 @@ declare module "assert" {
|
|
|
23
169
|
* Set to the `expected` argument for methods such as {@link assert.strictEqual()}.
|
|
24
170
|
*/
|
|
25
171
|
expected: unknown;
|
|
26
|
-
/**
|
|
27
|
-
* Set to the passed in operator value.
|
|
28
|
-
*/
|
|
29
|
-
operator: string;
|
|
30
172
|
/**
|
|
31
173
|
* Indicates if the message was auto-generated (`true`) or not.
|
|
32
174
|
*/
|
|
@@ -35,19 +177,10 @@ declare module "assert" {
|
|
|
35
177
|
* Value is always `ERR_ASSERTION` to show that the error is an assertion error.
|
|
36
178
|
*/
|
|
37
179
|
code: "ERR_ASSERTION";
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
actual?: unknown | undefined;
|
|
43
|
-
/** The `expected` property on the error instance. */
|
|
44
|
-
expected?: unknown | undefined;
|
|
45
|
-
/** The `operator` property on the error instance. */
|
|
46
|
-
operator?: string | undefined;
|
|
47
|
-
/** If provided, the generated stack trace omits frames before this function. */
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
49
|
-
stackStartFn?: Function | undefined;
|
|
50
|
-
});
|
|
180
|
+
/**
|
|
181
|
+
* Set to the passed in operator value.
|
|
182
|
+
*/
|
|
183
|
+
operator: string;
|
|
51
184
|
}
|
|
52
185
|
/**
|
|
53
186
|
* This feature is deprecated and will be removed in a future version.
|
|
@@ -79,7 +212,9 @@ declare module "assert" {
|
|
|
79
212
|
* @return A function that wraps `fn`.
|
|
80
213
|
*/
|
|
81
214
|
calls(exact?: number): () => void;
|
|
82
|
-
calls
|
|
215
|
+
calls(fn: undefined, exact?: number): () => void;
|
|
216
|
+
calls<Func extends (...args: any[]) => any>(fn: Func, exact?: number): Func;
|
|
217
|
+
calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func | (() => void);
|
|
83
218
|
/**
|
|
84
219
|
* Example:
|
|
85
220
|
*
|
|
@@ -796,7 +931,7 @@ declare module "assert" {
|
|
|
796
931
|
* check that the promise is rejected.
|
|
797
932
|
*
|
|
798
933
|
* If `asyncFn` is a function and it throws an error synchronously, `assert.rejects()` will return a rejected `Promise` with that error. If the
|
|
799
|
-
* function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-
|
|
934
|
+
* function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v24.x/api/errors.html#err_invalid_return_value)
|
|
800
935
|
* error. In both cases the error handler is skipped.
|
|
801
936
|
*
|
|
802
937
|
* Besides the async nature to await the completion behaves identically to {@link throws}.
|
|
@@ -866,7 +1001,7 @@ declare module "assert" {
|
|
|
866
1001
|
*
|
|
867
1002
|
* If `asyncFn` is a function and it throws an error synchronously, `assert.doesNotReject()` will return a rejected `Promise` with that error. If
|
|
868
1003
|
* the function does not return a promise, `assert.doesNotReject()` will return a
|
|
869
|
-
* rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-
|
|
1004
|
+
* rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v24.x/api/errors.html#err_invalid_return_value) error. In both cases
|
|
870
1005
|
* the error handler is skipped.
|
|
871
1006
|
*
|
|
872
1007
|
* Using `assert.doesNotReject()` is actually not useful because there is little
|
|
@@ -929,7 +1064,7 @@ declare module "assert" {
|
|
|
929
1064
|
* If the values do not match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal
|
|
930
1065
|
* to the value of the `message` parameter. If the `message` parameter is
|
|
931
1066
|
* undefined, a default error message is assigned. If the `message` parameter is an
|
|
932
|
-
* instance of an [Error](https://nodejs.org/docs/latest-
|
|
1067
|
+
* instance of an [Error](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`.
|
|
933
1068
|
* @since v13.6.0, v12.16.0
|
|
934
1069
|
*/
|
|
935
1070
|
function match(value: string, regExp: RegExp, message?: string | Error): void;
|
|
@@ -952,7 +1087,7 @@ declare module "assert" {
|
|
|
952
1087
|
* If the values do match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal
|
|
953
1088
|
* to the value of the `message` parameter. If the `message` parameter is
|
|
954
1089
|
* undefined, a default error message is assigned. If the `message` parameter is an
|
|
955
|
-
* instance of an [Error](https://nodejs.org/docs/latest-
|
|
1090
|
+
* instance of an [Error](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`.
|
|
956
1091
|
* @since v13.6.0, v12.16.0
|
|
957
1092
|
*/
|
|
958
1093
|
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
|
@@ -968,83 +1103,9 @@ declare module "assert" {
|
|
|
968
1103
|
* @since v22.13.0
|
|
969
1104
|
*/
|
|
970
1105
|
function partialDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
*
|
|
975
|
-
* In strict assertion mode, error messages for objects display a diff. In legacy assertion mode, error
|
|
976
|
-
* messages for objects display the objects, often truncated.
|
|
977
|
-
*
|
|
978
|
-
* To use strict assertion mode:
|
|
979
|
-
*
|
|
980
|
-
* ```js
|
|
981
|
-
* import { strict as assert } from 'node:assert';
|
|
982
|
-
* import assert from 'node:assert/strict';
|
|
983
|
-
* ```
|
|
984
|
-
*
|
|
985
|
-
* Example error diff:
|
|
986
|
-
*
|
|
987
|
-
* ```js
|
|
988
|
-
* import { strict as assert } from 'node:assert';
|
|
989
|
-
*
|
|
990
|
-
* assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]);
|
|
991
|
-
* // AssertionError: Expected inputs to be strictly deep-equal:
|
|
992
|
-
* // + actual - expected ... Lines skipped
|
|
993
|
-
* //
|
|
994
|
-
* // [
|
|
995
|
-
* // [
|
|
996
|
-
* // ...
|
|
997
|
-
* // 2,
|
|
998
|
-
* // + 3
|
|
999
|
-
* // - '3'
|
|
1000
|
-
* // ],
|
|
1001
|
-
* // ...
|
|
1002
|
-
* // 5
|
|
1003
|
-
* // ]
|
|
1004
|
-
* ```
|
|
1005
|
-
*
|
|
1006
|
-
* To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS` environment variables. This will also
|
|
1007
|
-
* deactivate the colors in the REPL. For more on color support in terminal environments, read the tty
|
|
1008
|
-
* `getColorDepth()` documentation.
|
|
1009
|
-
*
|
|
1010
|
-
* @since v15.0.0, v13.9.0, v12.16.2, v9.9.0
|
|
1011
|
-
*/
|
|
1012
|
-
namespace strict {
|
|
1013
|
-
type AssertionError = assert.AssertionError;
|
|
1014
|
-
type AssertPredicate = assert.AssertPredicate;
|
|
1015
|
-
type CallTrackerCall = assert.CallTrackerCall;
|
|
1016
|
-
type CallTrackerReportInformation = assert.CallTrackerReportInformation;
|
|
1017
|
-
}
|
|
1018
|
-
const strict:
|
|
1019
|
-
& Omit<
|
|
1020
|
-
typeof assert,
|
|
1021
|
-
| "equal"
|
|
1022
|
-
| "notEqual"
|
|
1023
|
-
| "deepEqual"
|
|
1024
|
-
| "notDeepEqual"
|
|
1025
|
-
| "ok"
|
|
1026
|
-
| "strictEqual"
|
|
1027
|
-
| "deepStrictEqual"
|
|
1028
|
-
| "ifError"
|
|
1029
|
-
| "strict"
|
|
1030
|
-
| "AssertionError"
|
|
1031
|
-
>
|
|
1032
|
-
& {
|
|
1033
|
-
(value: unknown, message?: string | Error): asserts value;
|
|
1034
|
-
equal: typeof strictEqual;
|
|
1035
|
-
notEqual: typeof notStrictEqual;
|
|
1036
|
-
deepEqual: typeof deepStrictEqual;
|
|
1037
|
-
notDeepEqual: typeof notDeepStrictEqual;
|
|
1038
|
-
// Mapped types and assertion functions are incompatible?
|
|
1039
|
-
// TS2775: Assertions require every name in the call target
|
|
1040
|
-
// to be declared with an explicit type annotation.
|
|
1041
|
-
ok: typeof ok;
|
|
1042
|
-
strictEqual: typeof strictEqual;
|
|
1043
|
-
deepStrictEqual: typeof deepStrictEqual;
|
|
1044
|
-
ifError: typeof ifError;
|
|
1045
|
-
strict: typeof strict;
|
|
1046
|
-
AssertionError: typeof AssertionError;
|
|
1047
|
-
};
|
|
1106
|
+
}
|
|
1107
|
+
namespace assert {
|
|
1108
|
+
export { strict };
|
|
1048
1109
|
}
|
|
1049
1110
|
export = assert;
|
|
1050
1111
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* We strongly discourage the use of the `async_hooks` API.
|
|
3
3
|
* Other APIs that can cover most of its use cases include:
|
|
4
4
|
*
|
|
5
|
-
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-
|
|
6
|
-
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-
|
|
5
|
+
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v24.x/api/async_context.html#class-asynclocalstorage) tracks async context
|
|
6
|
+
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v24.x/api/process.html#processgetactiveresourcesinfo) tracks active resources
|
|
7
7
|
*
|
|
8
8
|
* The `node:async_hooks` module provides an API to track asynchronous resources.
|
|
9
9
|
* It can be accessed using:
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* import async_hooks from 'node:async_hooks';
|
|
13
13
|
* ```
|
|
14
14
|
* @experimental
|
|
15
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
15
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/async_hooks.js)
|
|
16
16
|
*/
|
|
17
17
|
declare module "async_hooks" {
|
|
18
18
|
/**
|
|
@@ -44,7 +44,7 @@ declare module "async_hooks" {
|
|
|
44
44
|
* ```
|
|
45
45
|
*
|
|
46
46
|
* Promise contexts may not get precise `executionAsyncIds` by default.
|
|
47
|
-
* See the section on [promise execution tracking](https://nodejs.org/docs/latest-
|
|
47
|
+
* See the section on [promise execution tracking](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#promise-execution-tracking).
|
|
48
48
|
* @since v8.1.0
|
|
49
49
|
* @return The `asyncId` of the current execution context. Useful to track when something calls.
|
|
50
50
|
*/
|
|
@@ -117,7 +117,7 @@ declare module "async_hooks" {
|
|
|
117
117
|
* ```
|
|
118
118
|
*
|
|
119
119
|
* Promise contexts may not get valid `triggerAsyncId`s by default. See
|
|
120
|
-
* the section on [promise execution tracking](https://nodejs.org/docs/latest-
|
|
120
|
+
* the section on [promise execution tracking](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#promise-execution-tracking).
|
|
121
121
|
* @return The ID of the resource responsible for calling the callback that is currently being executed.
|
|
122
122
|
*/
|
|
123
123
|
function triggerAsyncId(): number;
|
|
@@ -320,6 +320,16 @@ declare module "async_hooks" {
|
|
|
320
320
|
*/
|
|
321
321
|
triggerAsyncId(): number;
|
|
322
322
|
}
|
|
323
|
+
interface AsyncLocalStorageOptions {
|
|
324
|
+
/**
|
|
325
|
+
* The default value to be used when no store is provided.
|
|
326
|
+
*/
|
|
327
|
+
defaultValue?: any;
|
|
328
|
+
/**
|
|
329
|
+
* A name for the `AsyncLocalStorage` value.
|
|
330
|
+
*/
|
|
331
|
+
name?: string | undefined;
|
|
332
|
+
}
|
|
323
333
|
/**
|
|
324
334
|
* This class creates stores that stay coherent through asynchronous operations.
|
|
325
335
|
*
|
|
@@ -369,6 +379,11 @@ declare module "async_hooks" {
|
|
|
369
379
|
* @since v13.10.0, v12.17.0
|
|
370
380
|
*/
|
|
371
381
|
class AsyncLocalStorage<T> {
|
|
382
|
+
/**
|
|
383
|
+
* Creates a new instance of `AsyncLocalStorage`. Store is only provided within a
|
|
384
|
+
* `run()` call or after an `enterWith()` call.
|
|
385
|
+
*/
|
|
386
|
+
constructor(options?: AsyncLocalStorageOptions);
|
|
372
387
|
/**
|
|
373
388
|
* Binds the given function to the current execution context.
|
|
374
389
|
* @since v19.8.0
|
|
@@ -430,6 +445,11 @@ declare module "async_hooks" {
|
|
|
430
445
|
* @since v13.10.0, v12.17.0
|
|
431
446
|
*/
|
|
432
447
|
getStore(): T | undefined;
|
|
448
|
+
/**
|
|
449
|
+
* The name of the `AsyncLocalStorage` instance if provided.
|
|
450
|
+
* @since v24.0.0
|
|
451
|
+
*/
|
|
452
|
+
readonly name: string;
|
|
433
453
|
/**
|
|
434
454
|
* Runs a function synchronously within a context and returns its
|
|
435
455
|
* return value. The store is not accessible outside of the callback function.
|
|
@@ -451,7 +451,16 @@ declare module "buffer" {
|
|
|
451
451
|
*/
|
|
452
452
|
subarray(start?: number, end?: number): Buffer<TArrayBuffer>;
|
|
453
453
|
}
|
|
454
|
+
// TODO: remove globals in future version
|
|
455
|
+
/**
|
|
456
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
457
|
+
* TypeScript versions earlier than 5.7.
|
|
458
|
+
*/
|
|
454
459
|
type NonSharedBuffer = Buffer<ArrayBuffer>;
|
|
460
|
+
/**
|
|
461
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
462
|
+
* TypeScript versions earlier than 5.7.
|
|
463
|
+
*/
|
|
455
464
|
type AllowSharedBuffer = Buffer<ArrayBufferLike>;
|
|
456
465
|
}
|
|
457
466
|
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
|
@@ -46,7 +46,7 @@ type _File = typeof globalThis extends { onmessage: any; File: any } ? {} : impo
|
|
|
46
46
|
* // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
|
|
47
47
|
* const buf7 = Buffer.from('tést', 'latin1');
|
|
48
48
|
* ```
|
|
49
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
49
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/buffer.js)
|
|
50
50
|
*/
|
|
51
51
|
declare module "buffer" {
|
|
52
52
|
import { BinaryLike } from "node:crypto";
|
|
@@ -59,7 +59,7 @@ declare module "buffer" {
|
|
|
59
59
|
* @since v19.4.0, v18.14.0
|
|
60
60
|
* @param input The input to validate.
|
|
61
61
|
*/
|
|
62
|
-
export function isUtf8(input:
|
|
62
|
+
export function isUtf8(input: ArrayBuffer | NodeJS.TypedArray): boolean;
|
|
63
63
|
/**
|
|
64
64
|
* This function returns `true` if `input` contains only valid ASCII-encoded data,
|
|
65
65
|
* including the case in which `input` is empty.
|
|
@@ -68,7 +68,7 @@ declare module "buffer" {
|
|
|
68
68
|
* @since v19.6.0, v18.15.0
|
|
69
69
|
* @param input The input to validate.
|
|
70
70
|
*/
|
|
71
|
-
export function isAscii(input:
|
|
71
|
+
export function isAscii(input: ArrayBuffer | NodeJS.TypedArray): boolean;
|
|
72
72
|
export let INSPECT_MAX_BYTES: number;
|
|
73
73
|
export const kMaxLength: number;
|
|
74
74
|
export const kStringMaxLength: number;
|
|
@@ -113,7 +113,11 @@ declare module "buffer" {
|
|
|
113
113
|
* @param fromEnc The current encoding.
|
|
114
114
|
* @param toEnc To target encoding.
|
|
115
115
|
*/
|
|
116
|
-
export function transcode(
|
|
116
|
+
export function transcode(
|
|
117
|
+
source: Uint8Array,
|
|
118
|
+
fromEnc: TranscodeEncoding,
|
|
119
|
+
toEnc: TranscodeEncoding,
|
|
120
|
+
): NonSharedBuffer;
|
|
117
121
|
/**
|
|
118
122
|
* Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
|
|
119
123
|
* a prior call to `URL.createObjectURL()`.
|
|
@@ -330,7 +334,7 @@ declare module "buffer" {
|
|
|
330
334
|
* @return The number of bytes contained within `string`.
|
|
331
335
|
*/
|
|
332
336
|
byteLength(
|
|
333
|
-
string: string |
|
|
337
|
+
string: string | NodeJS.ArrayBufferView | ArrayBufferLike,
|
|
334
338
|
encoding?: BufferEncoding,
|
|
335
339
|
): number;
|
|
336
340
|
/**
|