@chainlink/external-adapter-framework 2.13.1 → 2.13.2
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/adapter/market-status.d.ts +5 -0
- package/adapter/market-status.js +5 -0
- package/adapter/market-status.js.map +1 -1
- package/generator-adapter/generators/app/templates/src/index.ts.ejs +1 -1
- package/generator-adapter/node_modules/.yarn-integrity +4 -4
- package/generator-adapter/node_modules/@types/node/README.md +1 -1
- package/generator-adapter/node_modules/@types/node/child_process.d.ts +6 -6
- package/generator-adapter/node_modules/@types/node/crypto.d.ts +8 -8
- package/generator-adapter/node_modules/@types/node/http.d.ts +31 -11
- package/generator-adapter/node_modules/@types/node/https.d.ts +6 -0
- package/generator-adapter/node_modules/@types/node/inspector.generated.d.ts +14 -1
- package/generator-adapter/node_modules/@types/node/module.d.ts +27 -16
- package/generator-adapter/node_modules/@types/node/net.d.ts +21 -2
- package/generator-adapter/node_modules/@types/node/package.json +3 -3
- package/generator-adapter/node_modules/@types/node/perf_hooks.d.ts +125 -65
- package/generator-adapter/node_modules/@types/node/process.d.ts +2 -7
- package/generator-adapter/node_modules/@types/node/sqlite.d.ts +31 -10
- package/generator-adapter/node_modules/@types/node/stream/web.d.ts +5 -5
- package/generator-adapter/node_modules/@types/node/stream.d.ts +27 -4
- package/generator-adapter/node_modules/@types/node/tls.d.ts +7 -7
- package/generator-adapter/node_modules/@types/node/url.d.ts +2 -2
- package/generator-adapter/node_modules/@types/node/util.d.ts +9 -1
- package/generator-adapter/node_modules/@types/node/v8.d.ts +26 -0
- package/generator-adapter/node_modules/@types/node/vm.d.ts +30 -15
- package/generator-adapter/node_modules/@types/node/worker_threads.d.ts +17 -19
- package/generator-adapter/node_modules/@types/node/zlib.d.ts +68 -4
- package/generator-adapter/node_modules/@yeoman/types/package.json +3 -7
- package/generator-adapter/node_modules/@yeoman/types/types/environment/environment.d.ts +7 -5
- package/generator-adapter/package.json +2 -2
- package/package.json +13 -13
|
@@ -200,14 +200,6 @@ declare module "perf_hooks" {
|
|
|
200
200
|
active: number;
|
|
201
201
|
utilization: number;
|
|
202
202
|
}
|
|
203
|
-
/**
|
|
204
|
-
* @param utilization1 The result of a previous call to `eventLoopUtilization()`.
|
|
205
|
-
* @param utilization2 The result of a previous call to `eventLoopUtilization()` prior to `utilization1`.
|
|
206
|
-
*/
|
|
207
|
-
type EventLoopUtilityFunction = (
|
|
208
|
-
utilization1?: EventLoopUtilization,
|
|
209
|
-
utilization2?: EventLoopUtilization,
|
|
210
|
-
) => EventLoopUtilization;
|
|
211
203
|
interface MarkOptions {
|
|
212
204
|
/**
|
|
213
205
|
* Additional optional detail to include with the mark.
|
|
@@ -264,11 +256,19 @@ declare module "perf_hooks" {
|
|
|
264
256
|
*/
|
|
265
257
|
clearResourceTimings(name?: string): void;
|
|
266
258
|
/**
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
259
|
+
* This is an alias of `perf_hooks.eventLoopUtilization()`.
|
|
260
|
+
*
|
|
261
|
+
* _This property is an extension by Node.js. It is not available in Web browsers._
|
|
262
|
+
* @since v14.10.0, v12.19.0
|
|
263
|
+
* @param utilization1 The result of a previous call to
|
|
264
|
+
* `eventLoopUtilization()`.
|
|
265
|
+
* @param utilization2 The result of a previous call to
|
|
266
|
+
* `eventLoopUtilization()` prior to `utilization1`.
|
|
270
267
|
*/
|
|
271
|
-
eventLoopUtilization
|
|
268
|
+
eventLoopUtilization(
|
|
269
|
+
utilization1?: EventLoopUtilization,
|
|
270
|
+
utilization2?: EventLoopUtilization,
|
|
271
|
+
): EventLoopUtilization;
|
|
272
272
|
/**
|
|
273
273
|
* Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`.
|
|
274
274
|
* If you are only interested in performance entries of certain types or that have certain names, see
|
|
@@ -371,41 +371,12 @@ declare module "perf_hooks" {
|
|
|
371
371
|
*/
|
|
372
372
|
readonly timeOrigin: number;
|
|
373
373
|
/**
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
* Wraps a function within a new function that measures the running time of the wrapped function.
|
|
377
|
-
* A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed.
|
|
378
|
-
*
|
|
379
|
-
* ```js
|
|
380
|
-
* import {
|
|
381
|
-
* performance,
|
|
382
|
-
* PerformanceObserver,
|
|
383
|
-
* } from 'node:perf_hooks';
|
|
384
|
-
*
|
|
385
|
-
* function someFunction() {
|
|
386
|
-
* console.log('hello world');
|
|
387
|
-
* }
|
|
388
|
-
*
|
|
389
|
-
* const wrapped = performance.timerify(someFunction);
|
|
390
|
-
*
|
|
391
|
-
* const obs = new PerformanceObserver((list) => {
|
|
392
|
-
* console.log(list.getEntries()[0].duration);
|
|
393
|
-
*
|
|
394
|
-
* performance.clearMarks();
|
|
395
|
-
* performance.clearMeasures();
|
|
396
|
-
* obs.disconnect();
|
|
397
|
-
* });
|
|
398
|
-
* obs.observe({ entryTypes: ['function'] });
|
|
399
|
-
*
|
|
400
|
-
* // A performance timeline entry will be created
|
|
401
|
-
* wrapped();
|
|
402
|
-
* ```
|
|
374
|
+
* This is an alias of `perf_hooks.timerify()`.
|
|
403
375
|
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
* @param fn
|
|
376
|
+
* _This property is an extension by Node.js. It is not available in Web browsers._
|
|
377
|
+
* @since v8.5.0
|
|
407
378
|
*/
|
|
408
|
-
timerify<T extends (...
|
|
379
|
+
timerify<T extends (...args: any[]) => any>(fn: T, options?: TimerifyOptions): T;
|
|
409
380
|
/**
|
|
410
381
|
* An object which is JSON representation of the performance object. It is similar to
|
|
411
382
|
* [`window.performance.toJSON`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON) in browsers.
|
|
@@ -844,6 +815,83 @@ declare module "perf_hooks" {
|
|
|
844
815
|
*/
|
|
845
816
|
add(other: RecordableHistogram): void;
|
|
846
817
|
}
|
|
818
|
+
interface CreateHistogramOptions {
|
|
819
|
+
/**
|
|
820
|
+
* The lowest discernible value. Must be an integer value greater than 0.
|
|
821
|
+
* @default 1
|
|
822
|
+
*/
|
|
823
|
+
lowest?: number | bigint | undefined;
|
|
824
|
+
/**
|
|
825
|
+
* The highest recordable value. Must be an integer value that is equal to
|
|
826
|
+
* or greater than two times `lowest`.
|
|
827
|
+
* @default Number.MAX_SAFE_INTEGER
|
|
828
|
+
*/
|
|
829
|
+
highest?: number | bigint | undefined;
|
|
830
|
+
/**
|
|
831
|
+
* The number of accuracy digits. Must be a number between `1` and `5`.
|
|
832
|
+
* @default 3
|
|
833
|
+
*/
|
|
834
|
+
figures?: number | undefined;
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Returns a {@link RecordableHistogram `RecordableHistogram`}.
|
|
838
|
+
* @since v15.9.0, v14.18.0
|
|
839
|
+
*/
|
|
840
|
+
function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
|
|
841
|
+
/**
|
|
842
|
+
* The `eventLoopUtilization()` function returns an object that contains the
|
|
843
|
+
* cumulative duration of time the event loop has been both idle and active as a
|
|
844
|
+
* high resolution milliseconds timer. The `utilization` value is the calculated
|
|
845
|
+
* Event Loop Utilization (ELU).
|
|
846
|
+
*
|
|
847
|
+
* If bootstrapping has not yet finished on the main thread the properties have
|
|
848
|
+
* the value of `0`. The ELU is immediately available on
|
|
849
|
+
* [Worker threads](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html#worker-threads)
|
|
850
|
+
* since bootstrap happens within the event loop.
|
|
851
|
+
*
|
|
852
|
+
* Both `utilization1` and `utilization2` are optional parameters.
|
|
853
|
+
*
|
|
854
|
+
* If `utilization1` is passed, then the delta between the current call's `active`
|
|
855
|
+
* and `idle` times, as well as the corresponding `utilization` value are
|
|
856
|
+
* calculated and returned (similar to `process.hrtime()`).
|
|
857
|
+
*
|
|
858
|
+
* If `utilization1` and `utilization2` are both passed, then the delta is
|
|
859
|
+
* calculated between the two arguments. This is a convenience option because,
|
|
860
|
+
* unlike `process.hrtime()`, calculating the ELU is more complex than a
|
|
861
|
+
* single subtraction.
|
|
862
|
+
*
|
|
863
|
+
* ELU is similar to CPU utilization, except that it only measures event loop
|
|
864
|
+
* statistics and not CPU usage. It represents the percentage of time the event
|
|
865
|
+
* loop has spent outside the event loop's event provider (e.g. `epoll_wait`).
|
|
866
|
+
* No other CPU idle time is taken into consideration. The following is an example
|
|
867
|
+
* of how a mostly idle process will have a high ELU.
|
|
868
|
+
*
|
|
869
|
+
* ```js
|
|
870
|
+
* import { eventLoopUtilization } from 'node:perf_hooks';
|
|
871
|
+
* import { spawnSync } from 'node:child_process';
|
|
872
|
+
*
|
|
873
|
+
* setImmediate(() => {
|
|
874
|
+
* const elu = eventLoopUtilization();
|
|
875
|
+
* spawnSync('sleep', ['5']);
|
|
876
|
+
* console.log(eventLoopUtilization(elu).utilization);
|
|
877
|
+
* });
|
|
878
|
+
* ```
|
|
879
|
+
*
|
|
880
|
+
* Although the CPU is mostly idle while running this script, the value of `utilization`
|
|
881
|
+
* is `1`. This is because the call to `child_process.spawnSync()` blocks the event loop
|
|
882
|
+
* from proceeding.
|
|
883
|
+
*
|
|
884
|
+
* Passing in a user-defined object instead of the result of a previous call to
|
|
885
|
+
* `eventLoopUtilization()` will lead to undefined behavior. The return values are not
|
|
886
|
+
* guaranteed to reflect any correct state of the event loop.
|
|
887
|
+
* @since v24.12.0
|
|
888
|
+
* @param utilization1 The result of a previous call to `eventLoopUtilization()`.
|
|
889
|
+
* @param utilization2 The result of a previous call to `eventLoopUtilization()` prior to `utilization1`.
|
|
890
|
+
*/
|
|
891
|
+
function eventLoopUtilization(
|
|
892
|
+
utilization1?: EventLoopUtilization,
|
|
893
|
+
utilization2?: EventLoopUtilization,
|
|
894
|
+
): EventLoopUtilization;
|
|
847
895
|
/**
|
|
848
896
|
* _This property is an extension by Node.js. It is not available in Web browsers._
|
|
849
897
|
*
|
|
@@ -873,28 +921,40 @@ declare module "perf_hooks" {
|
|
|
873
921
|
* @since v11.10.0
|
|
874
922
|
*/
|
|
875
923
|
function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram;
|
|
876
|
-
interface CreateHistogramOptions {
|
|
877
|
-
/**
|
|
878
|
-
* The minimum recordable value. Must be an integer value greater than 0.
|
|
879
|
-
* @default 1
|
|
880
|
-
*/
|
|
881
|
-
lowest?: number | bigint | undefined;
|
|
882
|
-
/**
|
|
883
|
-
* The maximum recordable value. Must be an integer value greater than min.
|
|
884
|
-
* @default Number.MAX_SAFE_INTEGER
|
|
885
|
-
*/
|
|
886
|
-
highest?: number | bigint | undefined;
|
|
887
|
-
/**
|
|
888
|
-
* The number of accuracy digits. Must be a number between 1 and 5.
|
|
889
|
-
* @default 3
|
|
890
|
-
*/
|
|
891
|
-
figures?: number | undefined;
|
|
892
|
-
}
|
|
893
924
|
/**
|
|
894
|
-
*
|
|
895
|
-
*
|
|
925
|
+
* _This property is an extension by Node.js. It is not available in Web browsers._
|
|
926
|
+
*
|
|
927
|
+
* Wraps a function within a new function that measures the running time of the
|
|
928
|
+
* wrapped function. A `PerformanceObserver` must be subscribed to the `'function'`
|
|
929
|
+
* event type in order for the timing details to be accessed.
|
|
930
|
+
*
|
|
931
|
+
* ```js
|
|
932
|
+
* import { timerify, performance, PerformanceObserver } from 'node:perf_hooks';
|
|
933
|
+
*
|
|
934
|
+
* function someFunction() {
|
|
935
|
+
* console.log('hello world');
|
|
936
|
+
* }
|
|
937
|
+
*
|
|
938
|
+
* const wrapped = timerify(someFunction);
|
|
939
|
+
*
|
|
940
|
+
* const obs = new PerformanceObserver((list) => {
|
|
941
|
+
* console.log(list.getEntries()[0].duration);
|
|
942
|
+
*
|
|
943
|
+
* performance.clearMarks();
|
|
944
|
+
* performance.clearMeasures();
|
|
945
|
+
* obs.disconnect();
|
|
946
|
+
* });
|
|
947
|
+
* obs.observe({ entryTypes: ['function'] });
|
|
948
|
+
*
|
|
949
|
+
* // A performance timeline entry will be created
|
|
950
|
+
* wrapped();
|
|
951
|
+
* ```
|
|
952
|
+
*
|
|
953
|
+
* If the wrapped function returns a promise, a finally handler will be attached
|
|
954
|
+
* to the promise and the duration will be reported once the finally handler is invoked.
|
|
955
|
+
* @since v24.12.0
|
|
896
956
|
*/
|
|
897
|
-
function
|
|
957
|
+
function timerify<T extends (...params: any[]) => any>(fn: T, options?: TimerifyOptions): T;
|
|
898
958
|
import {
|
|
899
959
|
performance as _performance,
|
|
900
960
|
PerformanceEntry as _PerformanceEntry,
|
|
@@ -235,7 +235,7 @@ declare module "process" {
|
|
|
235
235
|
/**
|
|
236
236
|
* A value that is `"strip"` by default,
|
|
237
237
|
* `"transform"` if Node.js is run with `--experimental-transform-types`, and `false` if
|
|
238
|
-
* Node.js is run with `--no-
|
|
238
|
+
* Node.js is run with `--no-strip-types`.
|
|
239
239
|
* @since v22.10.0
|
|
240
240
|
*/
|
|
241
241
|
readonly typescript: "strip" | "transform" | false;
|
|
@@ -344,12 +344,7 @@ declare module "process" {
|
|
|
344
344
|
isTTY?: true | undefined;
|
|
345
345
|
}
|
|
346
346
|
// Alias for compatibility
|
|
347
|
-
interface ProcessEnv extends Dict<string> {
|
|
348
|
-
/**
|
|
349
|
-
* Can be used to change the default timezone at runtime
|
|
350
|
-
*/
|
|
351
|
-
TZ?: string | undefined;
|
|
352
|
-
}
|
|
347
|
+
interface ProcessEnv extends Dict<string> {}
|
|
353
348
|
interface HRTime {
|
|
354
349
|
/**
|
|
355
350
|
* This is the legacy version of {@link process.hrtime.bigint()}
|
|
@@ -6,12 +6,7 @@
|
|
|
6
6
|
* import sqlite from 'node:sqlite';
|
|
7
7
|
* ```
|
|
8
8
|
*
|
|
9
|
-
* This module is only available under the `node:` scheme.
|
|
10
|
-
* work:
|
|
11
|
-
*
|
|
12
|
-
* ```js
|
|
13
|
-
* import sqlite from 'sqlite';
|
|
14
|
-
* ```
|
|
9
|
+
* This module is only available under the `node:` scheme.
|
|
15
10
|
*
|
|
16
11
|
* The following example shows the basic usage of the `node:sqlite` module to open
|
|
17
12
|
* an in-memory database, write data to the database, and then read the data back.
|
|
@@ -123,6 +118,14 @@ declare module "node:sqlite" {
|
|
|
123
118
|
* @default false
|
|
124
119
|
*/
|
|
125
120
|
allowUnknownNamedParameters?: boolean | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* If `true`, enables the defensive flag. When the defensive flag is enabled,
|
|
123
|
+
* language features that allow ordinary SQL to deliberately corrupt the database
|
|
124
|
+
* file are disabled. The defensive flag can also be set using `enableDefensive()`.
|
|
125
|
+
* @since v24.12.0
|
|
126
|
+
* @default true
|
|
127
|
+
*/
|
|
128
|
+
defensive?: boolean | undefined;
|
|
126
129
|
}
|
|
127
130
|
interface CreateSessionOptions {
|
|
128
131
|
/**
|
|
@@ -294,6 +297,16 @@ declare module "node:sqlite" {
|
|
|
294
297
|
* @param allow Whether to allow loading extensions.
|
|
295
298
|
*/
|
|
296
299
|
enableLoadExtension(allow: boolean): void;
|
|
300
|
+
/**
|
|
301
|
+
* Enables or disables the defensive flag. When the defensive flag is active,
|
|
302
|
+
* language features that allow ordinary SQL to deliberately corrupt the
|
|
303
|
+
* database file are disabled.
|
|
304
|
+
* See [`SQLITE_DBCONFIG_DEFENSIVE`](https://www.sqlite.org/c3ref/c_dbconfig_defensive.html#sqlitedbconfigdefensive)
|
|
305
|
+
* in the SQLite documentation for details.
|
|
306
|
+
* @since v24.12.0
|
|
307
|
+
* @param active Whether to set the defensive flag.
|
|
308
|
+
*/
|
|
309
|
+
enableDefensive(active: boolean): void;
|
|
297
310
|
/**
|
|
298
311
|
* This method is a wrapper around [`sqlite3_db_filename()`](https://sqlite.org/c3ref/db_filename.html)
|
|
299
312
|
* @since v24.0.0
|
|
@@ -413,7 +426,7 @@ declare module "node:sqlite" {
|
|
|
413
426
|
*/
|
|
414
427
|
prepare(sql: string): StatementSync;
|
|
415
428
|
/**
|
|
416
|
-
* Creates a new `SQLTagStore
|
|
429
|
+
* Creates a new {@link SQLTagStore `SQLTagStore`}, which is an LRU (Least Recently Used) cache for
|
|
417
430
|
* storing prepared statements. This allows for the efficient reuse of prepared
|
|
418
431
|
* statements by tagging them with a unique identifier.
|
|
419
432
|
*
|
|
@@ -427,7 +440,7 @@ declare module "node:sqlite" {
|
|
|
427
440
|
* import { DatabaseSync } from 'node:sqlite';
|
|
428
441
|
*
|
|
429
442
|
* const db = new DatabaseSync(':memory:');
|
|
430
|
-
* const sql = db.
|
|
443
|
+
* const sql = db.createTagStore();
|
|
431
444
|
*
|
|
432
445
|
* db.exec('CREATE TABLE users (id INT, name TEXT)');
|
|
433
446
|
*
|
|
@@ -450,6 +463,7 @@ declare module "node:sqlite" {
|
|
|
450
463
|
* // ]
|
|
451
464
|
* ```
|
|
452
465
|
* @since v24.9.0
|
|
466
|
+
* @param maxSize The maximum number of prepared statements to cache. **Default**: `1000`.
|
|
453
467
|
* @returns A new SQL tag store for caching prepared statements.
|
|
454
468
|
*/
|
|
455
469
|
createTagStore(maxSize?: number): SQLTagStore;
|
|
@@ -468,6 +482,8 @@ declare module "node:sqlite" {
|
|
|
468
482
|
* [`sqlite3changeset_apply()`](https://www.sqlite.org/session/sqlite3changeset_apply.html).
|
|
469
483
|
*
|
|
470
484
|
* ```js
|
|
485
|
+
* import { DatabaseSync } from 'node:sqlite';
|
|
486
|
+
*
|
|
471
487
|
* const sourceDb = new DatabaseSync(':memory:');
|
|
472
488
|
* const targetDb = new DatabaseSync(':memory:');
|
|
473
489
|
*
|
|
@@ -525,19 +541,24 @@ declare module "node:sqlite" {
|
|
|
525
541
|
* [`sqlite3session_delete()`](https://www.sqlite.org/session/sqlite3session_delete.html).
|
|
526
542
|
*/
|
|
527
543
|
close(): void;
|
|
544
|
+
/**
|
|
545
|
+
* Closes the session. If the session is already closed, does nothing.
|
|
546
|
+
* @since v24.9.0
|
|
547
|
+
*/
|
|
548
|
+
[Symbol.dispose](): void;
|
|
528
549
|
}
|
|
529
550
|
/**
|
|
530
551
|
* This class represents a single LRU (Least Recently Used) cache for storing
|
|
531
552
|
* prepared statements.
|
|
532
553
|
*
|
|
533
|
-
* Instances of this class are created via the database.
|
|
554
|
+
* Instances of this class are created via the database.createTagStore() method,
|
|
534
555
|
* not by using a constructor. The store caches prepared statements based on the
|
|
535
556
|
* provided SQL query string. When the same query is seen again, the store
|
|
536
557
|
* retrieves the cached statement and safely applies the new values through
|
|
537
558
|
* parameter binding, thereby preventing attacks like SQL injection.
|
|
538
559
|
*
|
|
539
560
|
* The cache has a maxSize that defaults to 1000 statements, but a custom size can
|
|
540
|
-
* be provided (e.g., database.
|
|
561
|
+
* be provided (e.g., database.createTagStore(100)). All APIs exposed by this
|
|
541
562
|
* class execute synchronously.
|
|
542
563
|
* @since v24.9.0
|
|
543
564
|
*/
|
|
@@ -105,7 +105,7 @@ declare module "stream/web" {
|
|
|
105
105
|
}
|
|
106
106
|
interface ReadableStreamReadDoneResult<T> {
|
|
107
107
|
done: true;
|
|
108
|
-
value
|
|
108
|
+
value: T | undefined;
|
|
109
109
|
}
|
|
110
110
|
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
|
|
111
111
|
interface ReadableByteStreamControllerCallback {
|
|
@@ -250,7 +250,7 @@ declare module "stream/web" {
|
|
|
250
250
|
interface ReadableStreamDefaultController<R = any> {
|
|
251
251
|
readonly desiredSize: number | null;
|
|
252
252
|
close(): void;
|
|
253
|
-
enqueue(chunk
|
|
253
|
+
enqueue(chunk: R): void;
|
|
254
254
|
error(e?: any): void;
|
|
255
255
|
}
|
|
256
256
|
const ReadableStreamDefaultController: {
|
|
@@ -279,7 +279,7 @@ declare module "stream/web" {
|
|
|
279
279
|
};
|
|
280
280
|
interface TransformStreamDefaultController<O = any> {
|
|
281
281
|
readonly desiredSize: number | null;
|
|
282
|
-
enqueue(chunk
|
|
282
|
+
enqueue(chunk: O): void;
|
|
283
283
|
error(reason?: any): void;
|
|
284
284
|
terminate(): void;
|
|
285
285
|
}
|
|
@@ -315,7 +315,7 @@ declare module "stream/web" {
|
|
|
315
315
|
abort(reason?: any): Promise<void>;
|
|
316
316
|
close(): Promise<void>;
|
|
317
317
|
releaseLock(): void;
|
|
318
|
-
write(chunk
|
|
318
|
+
write(chunk: W): Promise<void>;
|
|
319
319
|
}
|
|
320
320
|
const WritableStreamDefaultWriter: {
|
|
321
321
|
prototype: WritableStreamDefaultWriter;
|
|
@@ -339,7 +339,7 @@ declare module "stream/web" {
|
|
|
339
339
|
size?: QueuingStrategySize<T>;
|
|
340
340
|
}
|
|
341
341
|
interface QueuingStrategySize<T = any> {
|
|
342
|
-
(chunk
|
|
342
|
+
(chunk: T): number;
|
|
343
343
|
}
|
|
344
344
|
interface QueuingStrategyInit {
|
|
345
345
|
/**
|
|
@@ -863,11 +863,20 @@ declare module "stream" {
|
|
|
863
863
|
* @since v0.9.4
|
|
864
864
|
* @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
|
|
865
865
|
* {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
|
|
866
|
-
* @param [encoding='utf8'] The encoding, if `chunk` is a string.
|
|
867
866
|
* @param callback Callback for when this chunk of data is flushed.
|
|
868
867
|
* @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
|
869
868
|
*/
|
|
870
869
|
write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean;
|
|
870
|
+
/**
|
|
871
|
+
* Writes data to the stream, with an explicit encoding for string data.
|
|
872
|
+
* @see {@link Writable.write} for full details.
|
|
873
|
+
* @since v0.9.4
|
|
874
|
+
* @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
|
|
875
|
+
* {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
|
|
876
|
+
* @param encoding The encoding, if `chunk` is a string.
|
|
877
|
+
* @param callback Callback for when this chunk of data is flushed.
|
|
878
|
+
* @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
|
879
|
+
*/
|
|
871
880
|
write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean;
|
|
872
881
|
/**
|
|
873
882
|
* The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream.
|
|
@@ -892,13 +901,27 @@ declare module "stream" {
|
|
|
892
901
|
* // Writing more now is not allowed!
|
|
893
902
|
* ```
|
|
894
903
|
* @since v0.9.4
|
|
904
|
+
* @param cb Callback for when the stream is finished.
|
|
905
|
+
*/
|
|
906
|
+
end(cb?: () => void): this;
|
|
907
|
+
/**
|
|
908
|
+
* Signals that no more data will be written, with one final chunk of data.
|
|
909
|
+
* @see {@link Writable.end} for full details.
|
|
910
|
+
* @since v0.9.4
|
|
895
911
|
* @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
|
|
896
912
|
* {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
|
|
897
|
-
* @param
|
|
898
|
-
* @param callback Callback for when the stream is finished.
|
|
913
|
+
* @param cb Callback for when the stream is finished.
|
|
899
914
|
*/
|
|
900
|
-
end(cb?: () => void): this;
|
|
901
915
|
end(chunk: any, cb?: () => void): this;
|
|
916
|
+
/**
|
|
917
|
+
* Signals that no more data will be written, with one final chunk of data.
|
|
918
|
+
* @see {@link Writable.end} for full details.
|
|
919
|
+
* @since v0.9.4
|
|
920
|
+
* @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
|
|
921
|
+
* {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
|
|
922
|
+
* @param encoding The encoding if `chunk` is a string
|
|
923
|
+
* @param cb Callback for when the stream is finished.
|
|
924
|
+
*/
|
|
902
925
|
end(chunk: any, encoding: BufferEncoding, cb?: () => void): this;
|
|
903
926
|
/**
|
|
904
927
|
* The `writable.cork()` method forces all written data to be buffered in memory.
|
|
@@ -15,31 +15,31 @@ declare module "tls" {
|
|
|
15
15
|
import * as stream from "stream";
|
|
16
16
|
const CLIENT_RENEG_LIMIT: number;
|
|
17
17
|
const CLIENT_RENEG_WINDOW: number;
|
|
18
|
-
interface Certificate {
|
|
18
|
+
interface Certificate extends NodeJS.Dict<string | string[]> {
|
|
19
19
|
/**
|
|
20
20
|
* Country code.
|
|
21
21
|
*/
|
|
22
|
-
C
|
|
22
|
+
C?: string | string[];
|
|
23
23
|
/**
|
|
24
24
|
* Street.
|
|
25
25
|
*/
|
|
26
|
-
ST
|
|
26
|
+
ST?: string | string[];
|
|
27
27
|
/**
|
|
28
28
|
* Locality.
|
|
29
29
|
*/
|
|
30
|
-
L
|
|
30
|
+
L?: string | string[];
|
|
31
31
|
/**
|
|
32
32
|
* Organization.
|
|
33
33
|
*/
|
|
34
|
-
O
|
|
34
|
+
O?: string | string[];
|
|
35
35
|
/**
|
|
36
36
|
* Organizational unit.
|
|
37
37
|
*/
|
|
38
|
-
OU
|
|
38
|
+
OU?: string | string[];
|
|
39
39
|
/**
|
|
40
40
|
* Common name.
|
|
41
41
|
*/
|
|
42
|
-
CN
|
|
42
|
+
CN?: string | string[];
|
|
43
43
|
}
|
|
44
44
|
interface PeerCertificate {
|
|
45
45
|
/**
|
|
@@ -80,7 +80,7 @@ declare module "url" {
|
|
|
80
80
|
* function getURL(req) {
|
|
81
81
|
* const proto = req.headers['x-forwarded-proto'] || 'https';
|
|
82
82
|
* const host = req.headers['x-forwarded-host'] || req.headers.host || 'example.com';
|
|
83
|
-
* return new URL(req.url || '/'
|
|
83
|
+
* return new URL(`${proto}://${host}${req.url || '/'}`);
|
|
84
84
|
* }
|
|
85
85
|
* ```
|
|
86
86
|
*
|
|
@@ -90,7 +90,7 @@ declare module "url" {
|
|
|
90
90
|
*
|
|
91
91
|
* ```js
|
|
92
92
|
* function getURL(req) {
|
|
93
|
-
* return new URL(req.url || '/'
|
|
93
|
+
* return new URL(`https://example.com${req.url || '/'}`);
|
|
94
94
|
* }
|
|
95
95
|
* ```
|
|
96
96
|
* @since v0.1.25
|
|
@@ -792,6 +792,14 @@ declare module "util" {
|
|
|
792
792
|
*/
|
|
793
793
|
export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger;
|
|
794
794
|
export { debuglog as debug };
|
|
795
|
+
export interface DeprecateOptions {
|
|
796
|
+
/**
|
|
797
|
+
* When false do not change the prototype of object while emitting the deprecation warning.
|
|
798
|
+
* @since v24.12.0
|
|
799
|
+
* @default true
|
|
800
|
+
*/
|
|
801
|
+
modifyPrototype?: boolean | undefined;
|
|
802
|
+
}
|
|
795
803
|
/**
|
|
796
804
|
* The `util.deprecate()` method wraps `fn` (which may be a function or class) in
|
|
797
805
|
* such a way that it is marked as deprecated.
|
|
@@ -852,7 +860,7 @@ declare module "util" {
|
|
|
852
860
|
* @param code A deprecation code. See the `list of deprecated APIs` for a list of codes.
|
|
853
861
|
* @return The deprecated function wrapped to emit a warning.
|
|
854
862
|
*/
|
|
855
|
-
export function deprecate<T extends Function>(fn: T, msg: string, code?: string): T;
|
|
863
|
+
export function deprecate<T extends Function>(fn: T, msg: string, code?: string, options?: DeprecateOptions): T;
|
|
856
864
|
export interface IsDeepStrictEqualOptions {
|
|
857
865
|
/**
|
|
858
866
|
* If `true`, prototype and constructor
|
|
@@ -401,6 +401,21 @@ declare module "v8" {
|
|
|
401
401
|
* @since v12.8.0
|
|
402
402
|
*/
|
|
403
403
|
function getHeapCodeStatistics(): HeapCodeStatistics;
|
|
404
|
+
/**
|
|
405
|
+
* @since v24.12.0
|
|
406
|
+
*/
|
|
407
|
+
interface SyncCPUProfileHandle {
|
|
408
|
+
/**
|
|
409
|
+
* Stopping collecting the profile and return the profile data.
|
|
410
|
+
* @since v24.12.0
|
|
411
|
+
*/
|
|
412
|
+
stop(): string;
|
|
413
|
+
/**
|
|
414
|
+
* Stopping collecting the profile and the profile will be discarded.
|
|
415
|
+
* @since v24.12.0
|
|
416
|
+
*/
|
|
417
|
+
[Symbol.dispose](): void;
|
|
418
|
+
}
|
|
404
419
|
/**
|
|
405
420
|
* @since v24.8.0
|
|
406
421
|
*/
|
|
@@ -466,6 +481,17 @@ declare module "v8" {
|
|
|
466
481
|
* @since v23.10.0, v22.15.0
|
|
467
482
|
*/
|
|
468
483
|
function isStringOneByteRepresentation(content: string): boolean;
|
|
484
|
+
/**
|
|
485
|
+
* Starting a CPU profile then return a `SyncCPUProfileHandle` object. This API supports `using` syntax.
|
|
486
|
+
*
|
|
487
|
+
* ```js
|
|
488
|
+
* const handle = v8.startCpuProfile();
|
|
489
|
+
* const profile = handle.stop();
|
|
490
|
+
* console.log(profile);
|
|
491
|
+
* ```
|
|
492
|
+
* @since v24.12.0
|
|
493
|
+
*/
|
|
494
|
+
function startCpuProfile(): SyncCPUProfileHandle;
|
|
469
495
|
/**
|
|
470
496
|
* @since v8.0.0
|
|
471
497
|
*/
|
|
@@ -748,8 +748,8 @@ declare module "vm" {
|
|
|
748
748
|
* // The "secret" variable refers to the global variable we added to
|
|
749
749
|
* // "contextifiedObject" when creating the context.
|
|
750
750
|
* export default secret;
|
|
751
|
-
* `, { context:
|
|
752
|
-
* moduleMap.set(specifier,
|
|
751
|
+
* `, { context: module.context });
|
|
752
|
+
* moduleMap.set(specifier, requestedModule);
|
|
753
753
|
* // Resolve the dependencies of the new module as well.
|
|
754
754
|
* resolveAndLinkDependencies(requestedModule);
|
|
755
755
|
* }
|
|
@@ -819,19 +819,34 @@ declare module "vm" {
|
|
|
819
819
|
*/
|
|
820
820
|
status: ModuleStatus;
|
|
821
821
|
/**
|
|
822
|
-
* Evaluate the module.
|
|
823
|
-
*
|
|
824
|
-
*
|
|
825
|
-
*
|
|
826
|
-
*
|
|
827
|
-
*
|
|
828
|
-
*
|
|
829
|
-
*
|
|
830
|
-
*
|
|
831
|
-
*
|
|
832
|
-
*
|
|
833
|
-
*
|
|
834
|
-
*
|
|
822
|
+
* Evaluate the module and its depenendencies. Corresponds to the [Evaluate() concrete method](https://tc39.es/ecma262/#sec-moduleevaluation)
|
|
823
|
+
* field of [Cyclic Module Record](https://tc39.es/ecma262/#sec-cyclic-module-records)s in the ECMAScript specification.
|
|
824
|
+
*
|
|
825
|
+
* If the module is a `vm.SourceTextModule`, `evaluate()` must be called after the module has been instantiated;
|
|
826
|
+
* otherwise `evaluate()` will return a rejected promise.
|
|
827
|
+
*
|
|
828
|
+
* For a `vm.SourceTextModule`, the promise returned by `evaluate()` may be fulfilled either synchronously or asynchronously:
|
|
829
|
+
* 1. If the `vm.SourceTextModule` has no top-level `await` in itself or any of its dependencies, the promise will be
|
|
830
|
+
* fulfilled synchronously after the module and all its dependencies have been evaluated.
|
|
831
|
+
* 1. If the evaluation succeeds, the promise will be _synchronously_ resolved to `undefined`.
|
|
832
|
+
* 2. If the evaluation results in an exception, the promise will be _synchronously_ rejected with the exception that causes the evaluation to fail, which is the same as `module.error`.
|
|
833
|
+
* 2. If the `vm.SourceTextModule` has top-level `await` in itself or any of its dependencies, the promise will be fulfilled asynchronously after the module and all its dependencies have been evaluated.
|
|
834
|
+
* 1. If the evaluation succeeds, the promise will be _asynchronously_ resolved to `undefined`.
|
|
835
|
+
* 2. If the evaluation results in an exception, the promise will be _asynchronously_ rejected with the exception that causes the evaluation to fail.
|
|
836
|
+
*
|
|
837
|
+
* If the module is a `vm.SyntheticModule`, `evaluate()` always returns a promise that fulfills synchronously,
|
|
838
|
+
* see the specification of [Evaluate() of a Synthetic Module Record](https://tc39.es/ecma262/#sec-smr-Evaluate):
|
|
839
|
+
* 1. If the `evaluateCallback` passed to its constructor throws an exception synchronously, `evaluate()` returns a promise that will be synchronously rejected with that exception.
|
|
840
|
+
* 2. If the `evaluateCallback` does not throw an exception, `evaluate()` returns a promise that will be synchronously resolved to `undefined`.
|
|
841
|
+
*
|
|
842
|
+
* The `evaluateCallback` of a `vm.SyntheticModule` is executed synchronously within the `evaluate()` call, and its return value is discarded. This means if `evaluateCallback` is an asynchronous function, the promise
|
|
843
|
+
* returned by `evaluate()` will not reflect its asynchronous behavior, and any rejections from an asynchronous `evaluateCallback` will be lost.
|
|
844
|
+
*
|
|
845
|
+
* evaluate() could also be called again after the module has already been evaluated, in which case:
|
|
846
|
+
* 1. If the initial evaluation ended in success (`module.status` is `'evaluated'`), it will do nothing and return a promise that resolves to `undefined`.
|
|
847
|
+
* 2. If the initial evaluation resulted in an exception (`module.status` is `'errored'`), it will re-reject the exception that the initial evaluation resulted in.
|
|
848
|
+
*
|
|
849
|
+
* This method cannot be called while the module is being evaluated (`module.status` is `'evaluating'`).
|
|
835
850
|
* @return Fulfills with `undefined` upon success.
|
|
836
851
|
*/
|
|
837
852
|
evaluate(options?: ModuleEvaluateOptions): Promise<void>;
|