Update package dependencies and types for improved compatibility and functionality
This commit updates the package-lock.json and package.json files to reflect the latest versions of dependencies, including @types/node and validator. Additionally, it removes unused type definitions and enhances the overall structure of the project, ensuring better compatibility and performance across the application.
This commit is contained in:
1451
backend/node_modules/.package-lock.json
generated
vendored
1451
backend/node_modules/.package-lock.json
generated
vendored
File diff suppressed because it is too large
Load Diff
4
backend/node_modules/@types/node/README.md
generated
vendored
4
backend/node_modules/@types/node/README.md
generated
vendored
@@ -8,8 +8,8 @@ This package contains type definitions for node (https://nodejs.org/).
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 23 Jul 2024 18:09:25 GMT
|
||||
* Last updated: Mon, 03 Nov 2025 01:29:59 GMT
|
||||
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).
|
||||
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), [René](https://github.com/Renegade334), and [Yagiz Nizipli](https://github.com/anonrig).
|
||||
|
||||
269
backend/node_modules/@types/node/assert.d.ts
generated
vendored
269
backend/node_modules/@types/node/assert.d.ts
generated
vendored
@@ -1,20 +1,166 @@
|
||||
/**
|
||||
* The `node:assert` module provides a set of assertion functions for verifying
|
||||
* invariants.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/assert.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/assert.js)
|
||||
*/
|
||||
declare module "assert" {
|
||||
import strict = require("assert/strict");
|
||||
/**
|
||||
* An alias of {@link ok}.
|
||||
* An alias of {@link assert.ok}.
|
||||
* @since v0.5.9
|
||||
* @param value The input that is checked for being truthy.
|
||||
*/
|
||||
function assert(value: unknown, message?: string | Error): asserts value;
|
||||
const kOptions: unique symbol;
|
||||
namespace assert {
|
||||
type AssertMethodNames =
|
||||
| "deepEqual"
|
||||
| "deepStrictEqual"
|
||||
| "doesNotMatch"
|
||||
| "doesNotReject"
|
||||
| "doesNotThrow"
|
||||
| "equal"
|
||||
| "fail"
|
||||
| "ifError"
|
||||
| "match"
|
||||
| "notDeepEqual"
|
||||
| "notDeepStrictEqual"
|
||||
| "notEqual"
|
||||
| "notStrictEqual"
|
||||
| "ok"
|
||||
| "partialDeepStrictEqual"
|
||||
| "rejects"
|
||||
| "strictEqual"
|
||||
| "throws";
|
||||
interface AssertOptions {
|
||||
/**
|
||||
* If set to `'full'`, shows the full diff in assertion errors.
|
||||
* @default 'simple'
|
||||
*/
|
||||
diff?: "simple" | "full" | undefined;
|
||||
/**
|
||||
* If set to `true`, non-strict methods behave like their
|
||||
* corresponding strict methods.
|
||||
* @default true
|
||||
*/
|
||||
strict?: boolean | undefined;
|
||||
/**
|
||||
* If set to `true`, skips prototype and constructor
|
||||
* comparison in deep equality checks.
|
||||
* @since v24.9.0
|
||||
* @default false
|
||||
*/
|
||||
skipPrototype?: boolean | undefined;
|
||||
}
|
||||
interface Assert extends Pick<typeof assert, AssertMethodNames> {
|
||||
readonly [kOptions]: AssertOptions & { strict: false };
|
||||
}
|
||||
interface AssertStrict extends Pick<typeof strict, AssertMethodNames> {
|
||||
readonly [kOptions]: AssertOptions & { strict: true };
|
||||
}
|
||||
/**
|
||||
* The `Assert` class allows creating independent assertion instances with custom options.
|
||||
* @since v24.6.0
|
||||
*/
|
||||
var Assert: {
|
||||
/**
|
||||
* Creates a new assertion instance. The `diff` option controls the verbosity of diffs in assertion error messages.
|
||||
*
|
||||
* ```js
|
||||
* const { Assert } = require('node:assert');
|
||||
* const assertInstance = new Assert({ diff: 'full' });
|
||||
* assertInstance.deepStrictEqual({ a: 1 }, { a: 2 });
|
||||
* // Shows a full diff in the error message.
|
||||
* ```
|
||||
*
|
||||
* **Important**: When destructuring assertion methods from an `Assert` instance,
|
||||
* the methods lose their connection to the instance's configuration options (such
|
||||
* as `diff`, `strict`, and `skipPrototype` settings).
|
||||
* The destructured methods will fall back to default behavior instead.
|
||||
*
|
||||
* ```js
|
||||
* const myAssert = new Assert({ diff: 'full' });
|
||||
*
|
||||
* // This works as expected - uses 'full' diff
|
||||
* myAssert.strictEqual({ a: 1 }, { b: { c: 1 } });
|
||||
*
|
||||
* // This loses the 'full' diff setting - falls back to default 'simple' diff
|
||||
* const { strictEqual } = myAssert;
|
||||
* strictEqual({ a: 1 }, { b: { c: 1 } });
|
||||
* ```
|
||||
*
|
||||
* The `skipPrototype` option affects all deep equality methods:
|
||||
*
|
||||
* ```js
|
||||
* class Foo {
|
||||
* constructor(a) {
|
||||
* this.a = a;
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* class Bar {
|
||||
* constructor(a) {
|
||||
* this.a = a;
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* const foo = new Foo(1);
|
||||
* const bar = new Bar(1);
|
||||
*
|
||||
* // Default behavior - fails due to different constructors
|
||||
* const assert1 = new Assert();
|
||||
* assert1.deepStrictEqual(foo, bar); // AssertionError
|
||||
*
|
||||
* // Skip prototype comparison - passes if properties are equal
|
||||
* const assert2 = new Assert({ skipPrototype: true });
|
||||
* assert2.deepStrictEqual(foo, bar); // OK
|
||||
* ```
|
||||
*
|
||||
* When destructured, methods lose access to the instance's `this` context and revert to default assertion behavior
|
||||
* (diff: 'simple', non-strict mode).
|
||||
* To maintain custom options when using destructured methods, avoid
|
||||
* destructuring and call methods directly on the instance.
|
||||
* @since v24.6.0
|
||||
*/
|
||||
new(
|
||||
options?: AssertOptions & { strict?: true | undefined },
|
||||
): AssertStrict;
|
||||
new(
|
||||
options: AssertOptions,
|
||||
): Assert;
|
||||
};
|
||||
interface AssertionErrorOptions {
|
||||
/**
|
||||
* If provided, the error message is set to this value.
|
||||
*/
|
||||
message?: string | undefined;
|
||||
/**
|
||||
* The `actual` property on the error instance.
|
||||
*/
|
||||
actual?: unknown;
|
||||
/**
|
||||
* The `expected` property on the error instance.
|
||||
*/
|
||||
expected?: unknown;
|
||||
/**
|
||||
* The `operator` property on the error instance.
|
||||
*/
|
||||
operator?: string | undefined;
|
||||
/**
|
||||
* If provided, the generated stack trace omits frames before this function.
|
||||
*/
|
||||
stackStartFn?: Function | undefined;
|
||||
/**
|
||||
* If set to `'full'`, shows the full diff in assertion errors.
|
||||
* @default 'simple'
|
||||
*/
|
||||
diff?: "simple" | "full" | undefined;
|
||||
}
|
||||
/**
|
||||
* Indicates the failure of an assertion. All errors thrown by the `node:assert` module will be instances of the `AssertionError` class.
|
||||
*/
|
||||
class AssertionError extends Error {
|
||||
constructor(options: AssertionErrorOptions);
|
||||
/**
|
||||
* Set to the `actual` argument for methods such as {@link assert.strictEqual()}.
|
||||
*/
|
||||
@@ -23,10 +169,6 @@ declare module "assert" {
|
||||
* Set to the `expected` argument for methods such as {@link assert.strictEqual()}.
|
||||
*/
|
||||
expected: unknown;
|
||||
/**
|
||||
* Set to the passed in operator value.
|
||||
*/
|
||||
operator: string;
|
||||
/**
|
||||
* Indicates if the message was auto-generated (`true`) or not.
|
||||
*/
|
||||
@@ -35,19 +177,10 @@ declare module "assert" {
|
||||
* Value is always `ERR_ASSERTION` to show that the error is an assertion error.
|
||||
*/
|
||||
code: "ERR_ASSERTION";
|
||||
constructor(options?: {
|
||||
/** If provided, the error message is set to this value. */
|
||||
message?: string | undefined;
|
||||
/** The `actual` property on the error instance. */
|
||||
actual?: unknown | undefined;
|
||||
/** The `expected` property on the error instance. */
|
||||
expected?: unknown | undefined;
|
||||
/** The `operator` property on the error instance. */
|
||||
operator?: string | undefined;
|
||||
/** If provided, the generated stack trace omits frames before this function. */
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
stackStartFn?: Function | undefined;
|
||||
});
|
||||
/**
|
||||
* Set to the passed in operator value.
|
||||
*/
|
||||
operator: string;
|
||||
}
|
||||
/**
|
||||
* This feature is deprecated and will be removed in a future version.
|
||||
@@ -79,7 +212,9 @@ declare module "assert" {
|
||||
* @return A function that wraps `fn`.
|
||||
*/
|
||||
calls(exact?: number): () => void;
|
||||
calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
|
||||
calls(fn: undefined, exact?: number): () => void;
|
||||
calls<Func extends (...args: any[]) => any>(fn: Func, exact?: number): Func;
|
||||
calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func | (() => void);
|
||||
/**
|
||||
* Example:
|
||||
*
|
||||
@@ -226,7 +361,7 @@ declare module "assert" {
|
||||
expected: unknown,
|
||||
message?: string | Error,
|
||||
operator?: string,
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
stackStartFn?: Function,
|
||||
): never;
|
||||
/**
|
||||
@@ -796,7 +931,7 @@ declare module "assert" {
|
||||
* check that the promise is rejected.
|
||||
*
|
||||
* If `asyncFn` is a function and it throws an error synchronously, `assert.rejects()` will return a rejected `Promise` with that error. If the
|
||||
* function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v20.x/api/errors.html#err_invalid_return_value)
|
||||
* 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)
|
||||
* error. In both cases the error handler is skipped.
|
||||
*
|
||||
* Besides the async nature to await the completion behaves identically to {@link throws}.
|
||||
@@ -866,7 +1001,7 @@ declare module "assert" {
|
||||
*
|
||||
* If `asyncFn` is a function and it throws an error synchronously, `assert.doesNotReject()` will return a rejected `Promise` with that error. If
|
||||
* the function does not return a promise, `assert.doesNotReject()` will return a
|
||||
* rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v20.x/api/errors.html#err_invalid_return_value) error. In both cases
|
||||
* 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
|
||||
* the error handler is skipped.
|
||||
*
|
||||
* Using `assert.doesNotReject()` is actually not useful because there is little
|
||||
@@ -929,7 +1064,7 @@ declare module "assert" {
|
||||
* 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
|
||||
* to the value of the `message` parameter. If the `message` parameter is
|
||||
* undefined, a default error message is assigned. If the `message` parameter is an
|
||||
* instance of an [Error](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`.
|
||||
* 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}`.
|
||||
* @since v13.6.0, v12.16.0
|
||||
*/
|
||||
function match(value: string, regExp: RegExp, message?: string | Error): void;
|
||||
@@ -952,85 +1087,25 @@ declare module "assert" {
|
||||
* 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
|
||||
* to the value of the `message` parameter. If the `message` parameter is
|
||||
* undefined, a default error message is assigned. If the `message` parameter is an
|
||||
* instance of an [Error](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`.
|
||||
* 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}`.
|
||||
* @since v13.6.0, v12.16.0
|
||||
*/
|
||||
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
||||
/**
|
||||
* In strict assertion mode, non-strict methods behave like their corresponding strict methods. For example,
|
||||
* {@link deepEqual} will behave like {@link deepStrictEqual}.
|
||||
* Tests for partial deep equality between the `actual` and `expected` parameters.
|
||||
* "Deep" equality means that the enumerable "own" properties of child objects
|
||||
* are recursively evaluated also by the following rules. "Partial" equality means
|
||||
* that only properties that exist on the `expected` parameter are going to be
|
||||
* compared.
|
||||
*
|
||||
* In strict assertion mode, error messages for objects display a diff. In legacy assertion mode, error
|
||||
* messages for objects display the objects, often truncated.
|
||||
*
|
||||
* To use strict assertion mode:
|
||||
*
|
||||
* ```js
|
||||
* import { strict as assert } from 'node:assert';COPY
|
||||
* import assert from 'node:assert/strict';
|
||||
* ```
|
||||
*
|
||||
* Example error diff:
|
||||
*
|
||||
* ```js
|
||||
* import { strict as assert } from 'node:assert';
|
||||
*
|
||||
* assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]);
|
||||
* // AssertionError: Expected inputs to be strictly deep-equal:
|
||||
* // + actual - expected ... Lines skipped
|
||||
* //
|
||||
* // [
|
||||
* // [
|
||||
* // ...
|
||||
* // 2,
|
||||
* // + 3
|
||||
* // - '3'
|
||||
* // ],
|
||||
* // ...
|
||||
* // 5
|
||||
* // ]
|
||||
* ```
|
||||
*
|
||||
* To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS` environment variables. This will also
|
||||
* deactivate the colors in the REPL. For more on color support in terminal environments, read the tty
|
||||
* `getColorDepth()` documentation.
|
||||
*
|
||||
* @since v15.0.0, v13.9.0, v12.16.2, v9.9.0
|
||||
* This method always passes the same test cases as `assert.deepStrictEqual()`,
|
||||
* behaving as a super set of it.
|
||||
* @since v22.13.0
|
||||
*/
|
||||
namespace strict {
|
||||
type AssertionError = assert.AssertionError;
|
||||
type AssertPredicate = assert.AssertPredicate;
|
||||
type CallTrackerCall = assert.CallTrackerCall;
|
||||
type CallTrackerReportInformation = assert.CallTrackerReportInformation;
|
||||
}
|
||||
const strict:
|
||||
& Omit<
|
||||
typeof assert,
|
||||
| "equal"
|
||||
| "notEqual"
|
||||
| "deepEqual"
|
||||
| "notDeepEqual"
|
||||
| "ok"
|
||||
| "strictEqual"
|
||||
| "deepStrictEqual"
|
||||
| "ifError"
|
||||
| "strict"
|
||||
>
|
||||
& {
|
||||
(value: unknown, message?: string | Error): asserts value;
|
||||
equal: typeof strictEqual;
|
||||
notEqual: typeof notStrictEqual;
|
||||
deepEqual: typeof deepStrictEqual;
|
||||
notDeepEqual: typeof notDeepStrictEqual;
|
||||
// Mapped types and assertion functions are incompatible?
|
||||
// TS2775: Assertions require every name in the call target
|
||||
// to be declared with an explicit type annotation.
|
||||
ok: typeof ok;
|
||||
strictEqual: typeof strictEqual;
|
||||
deepStrictEqual: typeof deepStrictEqual;
|
||||
ifError: typeof ifError;
|
||||
strict: typeof strict;
|
||||
};
|
||||
function partialDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
||||
}
|
||||
namespace assert {
|
||||
export { strict };
|
||||
}
|
||||
export = assert;
|
||||
}
|
||||
|
||||
107
backend/node_modules/@types/node/assert/strict.d.ts
generated
vendored
107
backend/node_modules/@types/node/assert/strict.d.ts
generated
vendored
@@ -1,8 +1,111 @@
|
||||
/**
|
||||
* In strict assertion mode, non-strict methods behave like their corresponding
|
||||
* strict methods. For example, `assert.deepEqual()` will behave like
|
||||
* `assert.deepStrictEqual()`.
|
||||
*
|
||||
* In strict assertion mode, error messages for objects display a diff. In legacy
|
||||
* assertion mode, error messages for objects display the objects, often truncated.
|
||||
*
|
||||
* To use strict assertion mode:
|
||||
*
|
||||
* ```js
|
||||
* import { strict as assert } from 'node:assert';
|
||||
* ```
|
||||
*
|
||||
* ```js
|
||||
* import assert from 'node:assert/strict';
|
||||
* ```
|
||||
*
|
||||
* Example error diff:
|
||||
*
|
||||
* ```js
|
||||
* import { strict as assert } from 'node:assert';
|
||||
*
|
||||
* assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]);
|
||||
* // AssertionError: Expected inputs to be strictly deep-equal:
|
||||
* // + actual - expected ... Lines skipped
|
||||
* //
|
||||
* // [
|
||||
* // [
|
||||
* // ...
|
||||
* // 2,
|
||||
* // + 3
|
||||
* // - '3'
|
||||
* // ],
|
||||
* // ...
|
||||
* // 5
|
||||
* // ]
|
||||
* ```
|
||||
*
|
||||
* To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS`
|
||||
* environment variables. This will also deactivate the colors in the REPL. For
|
||||
* more on color support in terminal environments, read the tty
|
||||
* [`getColorDepth()`](https://nodejs.org/docs/latest-v24.x/api/tty.html#writestreamgetcolordepthenv) documentation.
|
||||
* @since v15.0.0
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/assert/strict.js)
|
||||
*/
|
||||
declare module "assert/strict" {
|
||||
import { strict } from "node:assert";
|
||||
import {
|
||||
Assert,
|
||||
AssertionError,
|
||||
AssertionErrorOptions,
|
||||
AssertOptions,
|
||||
AssertPredicate,
|
||||
AssertStrict,
|
||||
CallTracker,
|
||||
CallTrackerCall,
|
||||
CallTrackerReportInformation,
|
||||
deepStrictEqual,
|
||||
doesNotMatch,
|
||||
doesNotReject,
|
||||
doesNotThrow,
|
||||
fail,
|
||||
ifError,
|
||||
match,
|
||||
notDeepStrictEqual,
|
||||
notStrictEqual,
|
||||
ok,
|
||||
partialDeepStrictEqual,
|
||||
rejects,
|
||||
strictEqual,
|
||||
throws,
|
||||
} from "node:assert";
|
||||
function strict(value: unknown, message?: string | Error): asserts value;
|
||||
namespace strict {
|
||||
export {
|
||||
Assert,
|
||||
AssertionError,
|
||||
AssertionErrorOptions,
|
||||
AssertOptions,
|
||||
AssertPredicate,
|
||||
AssertStrict,
|
||||
CallTracker,
|
||||
CallTrackerCall,
|
||||
CallTrackerReportInformation,
|
||||
deepStrictEqual,
|
||||
deepStrictEqual as deepEqual,
|
||||
doesNotMatch,
|
||||
doesNotReject,
|
||||
doesNotThrow,
|
||||
fail,
|
||||
ifError,
|
||||
match,
|
||||
notDeepStrictEqual,
|
||||
notDeepStrictEqual as notDeepEqual,
|
||||
notStrictEqual,
|
||||
notStrictEqual as notEqual,
|
||||
ok,
|
||||
partialDeepStrictEqual,
|
||||
rejects,
|
||||
strict,
|
||||
strictEqual,
|
||||
strictEqual as equal,
|
||||
throws,
|
||||
};
|
||||
}
|
||||
export = strict;
|
||||
}
|
||||
declare module "node:assert/strict" {
|
||||
import { strict } from "node:assert";
|
||||
import strict = require("assert/strict");
|
||||
export = strict;
|
||||
}
|
||||
|
||||
100
backend/node_modules/@types/node/async_hooks.d.ts
generated
vendored
100
backend/node_modules/@types/node/async_hooks.d.ts
generated
vendored
@@ -2,8 +2,8 @@
|
||||
* We strongly discourage the use of the `async_hooks` API.
|
||||
* Other APIs that can cover most of its use cases include:
|
||||
*
|
||||
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v20.x/api/async_context.html#class-asynclocalstorage) tracks async context
|
||||
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v20.x/api/process.html#processgetactiveresourcesinfo) tracks active resources
|
||||
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v24.x/api/async_context.html#class-asynclocalstorage) tracks async context
|
||||
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v24.x/api/process.html#processgetactiveresourcesinfo) tracks active resources
|
||||
*
|
||||
* The `node:async_hooks` module provides an API to track asynchronous resources.
|
||||
* It can be accessed using:
|
||||
@@ -12,7 +12,7 @@
|
||||
* import async_hooks from 'node:async_hooks';
|
||||
* ```
|
||||
* @experimental
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/async_hooks.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/async_hooks.js)
|
||||
*/
|
||||
declare module "async_hooks" {
|
||||
/**
|
||||
@@ -44,7 +44,7 @@ declare module "async_hooks" {
|
||||
* ```
|
||||
*
|
||||
* Promise contexts may not get precise `executionAsyncIds` by default.
|
||||
* See the section on [promise execution tracking](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html#promise-execution-tracking).
|
||||
* See the section on [promise execution tracking](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#promise-execution-tracking).
|
||||
* @since v8.1.0
|
||||
* @return The `asyncId` of the current execution context. Useful to track when something calls.
|
||||
*/
|
||||
@@ -77,7 +77,7 @@ declare module "async_hooks" {
|
||||
* executionAsyncId,
|
||||
* executionAsyncResource,
|
||||
* createHook,
|
||||
* } from 'async_hooks';
|
||||
* } from 'node:async_hooks';
|
||||
* const sym = Symbol('state'); // Private symbol to avoid pollution
|
||||
*
|
||||
* createHook({
|
||||
@@ -117,7 +117,7 @@ declare module "async_hooks" {
|
||||
* ```
|
||||
*
|
||||
* Promise contexts may not get valid `triggerAsyncId`s by default. See
|
||||
* the section on [promise execution tracking](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html#promise-execution-tracking).
|
||||
* the section on [promise execution tracking](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#promise-execution-tracking).
|
||||
* @return The ID of the resource responsible for calling the callback that is currently being executed.
|
||||
*/
|
||||
function triggerAsyncId(): number;
|
||||
@@ -320,6 +320,16 @@ declare module "async_hooks" {
|
||||
*/
|
||||
triggerAsyncId(): number;
|
||||
}
|
||||
interface AsyncLocalStorageOptions {
|
||||
/**
|
||||
* The default value to be used when no store is provided.
|
||||
*/
|
||||
defaultValue?: any;
|
||||
/**
|
||||
* A name for the `AsyncLocalStorage` value.
|
||||
*/
|
||||
name?: string | undefined;
|
||||
}
|
||||
/**
|
||||
* This class creates stores that stay coherent through asynchronous operations.
|
||||
*
|
||||
@@ -358,8 +368,8 @@ declare module "async_hooks" {
|
||||
* http.get('http://localhost:8080');
|
||||
* // Prints:
|
||||
* // 0: start
|
||||
* // 1: start
|
||||
* // 0: finish
|
||||
* // 1: start
|
||||
* // 1: finish
|
||||
* ```
|
||||
*
|
||||
@@ -369,10 +379,14 @@ declare module "async_hooks" {
|
||||
* @since v13.10.0, v12.17.0
|
||||
*/
|
||||
class AsyncLocalStorage<T> {
|
||||
/**
|
||||
* Creates a new instance of `AsyncLocalStorage`. Store is only provided within a
|
||||
* `run()` call or after an `enterWith()` call.
|
||||
*/
|
||||
constructor(options?: AsyncLocalStorageOptions);
|
||||
/**
|
||||
* Binds the given function to the current execution context.
|
||||
* @since v19.8.0
|
||||
* @experimental
|
||||
* @param fn The function to bind to the current execution context.
|
||||
* @return A new function that calls `fn` within the captured execution context.
|
||||
*/
|
||||
@@ -403,7 +417,6 @@ declare module "async_hooks" {
|
||||
* console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123
|
||||
* ```
|
||||
* @since v19.8.0
|
||||
* @experimental
|
||||
* @return A new function with the signature `(fn: (...args) : R, ...args) : R`.
|
||||
*/
|
||||
static snapshot(): <R, TArgs extends any[]>(fn: (...args: TArgs) => R, ...args: TArgs) => R;
|
||||
@@ -432,6 +445,11 @@ declare module "async_hooks" {
|
||||
* @since v13.10.0, v12.17.0
|
||||
*/
|
||||
getStore(): T | undefined;
|
||||
/**
|
||||
* The name of the `AsyncLocalStorage` instance if provided.
|
||||
* @since v24.0.0
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* Runs a function synchronously within a context and returns its
|
||||
* return value. The store is not accessible outside of the callback function.
|
||||
@@ -535,6 +553,70 @@ declare module "async_hooks" {
|
||||
*/
|
||||
enterWith(store: T): void;
|
||||
}
|
||||
/**
|
||||
* @since v17.2.0, v16.14.0
|
||||
* @return A map of provider types to the corresponding numeric id.
|
||||
* This map contains all the event types that might be emitted by the `async_hooks.init()` event.
|
||||
*/
|
||||
namespace asyncWrapProviders {
|
||||
const NONE: number;
|
||||
const DIRHANDLE: number;
|
||||
const DNSCHANNEL: number;
|
||||
const ELDHISTOGRAM: number;
|
||||
const FILEHANDLE: number;
|
||||
const FILEHANDLECLOSEREQ: number;
|
||||
const FIXEDSIZEBLOBCOPY: number;
|
||||
const FSEVENTWRAP: number;
|
||||
const FSREQCALLBACK: number;
|
||||
const FSREQPROMISE: number;
|
||||
const GETADDRINFOREQWRAP: number;
|
||||
const GETNAMEINFOREQWRAP: number;
|
||||
const HEAPSNAPSHOT: number;
|
||||
const HTTP2SESSION: number;
|
||||
const HTTP2STREAM: number;
|
||||
const HTTP2PING: number;
|
||||
const HTTP2SETTINGS: number;
|
||||
const HTTPINCOMINGMESSAGE: number;
|
||||
const HTTPCLIENTREQUEST: number;
|
||||
const JSSTREAM: number;
|
||||
const JSUDPWRAP: number;
|
||||
const MESSAGEPORT: number;
|
||||
const PIPECONNECTWRAP: number;
|
||||
const PIPESERVERWRAP: number;
|
||||
const PIPEWRAP: number;
|
||||
const PROCESSWRAP: number;
|
||||
const PROMISE: number;
|
||||
const QUERYWRAP: number;
|
||||
const SHUTDOWNWRAP: number;
|
||||
const SIGNALWRAP: number;
|
||||
const STATWATCHER: number;
|
||||
const STREAMPIPE: number;
|
||||
const TCPCONNECTWRAP: number;
|
||||
const TCPSERVERWRAP: number;
|
||||
const TCPWRAP: number;
|
||||
const TTYWRAP: number;
|
||||
const UDPSENDWRAP: number;
|
||||
const UDPWRAP: number;
|
||||
const SIGINTWATCHDOG: number;
|
||||
const WORKER: number;
|
||||
const WORKERHEAPSNAPSHOT: number;
|
||||
const WRITEWRAP: number;
|
||||
const ZLIB: number;
|
||||
const CHECKPRIMEREQUEST: number;
|
||||
const PBKDF2REQUEST: number;
|
||||
const KEYPAIRGENREQUEST: number;
|
||||
const KEYGENREQUEST: number;
|
||||
const KEYEXPORTREQUEST: number;
|
||||
const CIPHERREQUEST: number;
|
||||
const DERIVEBITSREQUEST: number;
|
||||
const HASHREQUEST: number;
|
||||
const RANDOMBYTESREQUEST: number;
|
||||
const RANDOMPRIMEREQUEST: number;
|
||||
const SCRYPTREQUEST: number;
|
||||
const SIGNREQUEST: number;
|
||||
const TLSWRAP: number;
|
||||
const VERIFYREQUEST: number;
|
||||
}
|
||||
}
|
||||
declare module "node:async_hooks" {
|
||||
export * from "async_hooks";
|
||||
|
||||
470
backend/node_modules/@types/node/buffer.d.ts
generated
vendored
470
backend/node_modules/@types/node/buffer.d.ts
generated
vendored
@@ -1,3 +1,8 @@
|
||||
// If lib.dom.d.ts or lib.webworker.d.ts is loaded, then use the global types.
|
||||
// Otherwise, use the types from node.
|
||||
type _Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : import("buffer").Blob;
|
||||
type _File = typeof globalThis extends { onmessage: any; File: any } ? {} : import("buffer").File;
|
||||
|
||||
/**
|
||||
* `Buffer` objects are used to represent a fixed-length sequence of bytes. Many
|
||||
* Node.js APIs support `Buffer`s.
|
||||
@@ -41,7 +46,7 @@
|
||||
* // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
|
||||
* const buf7 = Buffer.from('tést', 'latin1');
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/buffer.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/buffer.js)
|
||||
*/
|
||||
declare module "buffer" {
|
||||
import { BinaryLike } from "node:crypto";
|
||||
@@ -54,7 +59,7 @@ declare module "buffer" {
|
||||
* @since v19.4.0, v18.14.0
|
||||
* @param input The input to validate.
|
||||
*/
|
||||
export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
|
||||
export function isUtf8(input: ArrayBuffer | NodeJS.TypedArray): boolean;
|
||||
/**
|
||||
* This function returns `true` if `input` contains only valid ASCII-encoded data,
|
||||
* including the case in which `input` is empty.
|
||||
@@ -63,8 +68,8 @@ declare module "buffer" {
|
||||
* @since v19.6.0, v18.15.0
|
||||
* @param input The input to validate.
|
||||
*/
|
||||
export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
|
||||
export const INSPECT_MAX_BYTES: number;
|
||||
export function isAscii(input: ArrayBuffer | NodeJS.TypedArray): boolean;
|
||||
export let INSPECT_MAX_BYTES: number;
|
||||
export const kMaxLength: number;
|
||||
export const kStringMaxLength: number;
|
||||
export const constants: {
|
||||
@@ -108,28 +113,26 @@ declare module "buffer" {
|
||||
* @param fromEnc The current encoding.
|
||||
* @param toEnc To target encoding.
|
||||
*/
|
||||
export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
|
||||
export const SlowBuffer: {
|
||||
/** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
|
||||
new(size: number): Buffer;
|
||||
prototype: Buffer;
|
||||
};
|
||||
export function transcode(
|
||||
source: Uint8Array,
|
||||
fromEnc: TranscodeEncoding,
|
||||
toEnc: TranscodeEncoding,
|
||||
): NonSharedBuffer;
|
||||
/**
|
||||
* Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
|
||||
* a prior call to `URL.createObjectURL()`.
|
||||
* @since v16.7.0
|
||||
* @experimental
|
||||
* @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
|
||||
*/
|
||||
export function resolveObjectURL(id: string): Blob | undefined;
|
||||
export { Buffer };
|
||||
export { type AllowSharedBuffer, Buffer, type NonSharedBuffer };
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export interface BlobOptions {
|
||||
/**
|
||||
* One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts
|
||||
* will be converted to the platform native line-ending as specified by `require('node:os').EOL`.
|
||||
* will be converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`.
|
||||
*/
|
||||
endings?: "transparent" | "native";
|
||||
/**
|
||||
@@ -140,7 +143,7 @@ declare module "buffer" {
|
||||
type?: string | undefined;
|
||||
}
|
||||
/**
|
||||
* A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across
|
||||
* A `Blob` encapsulates immutable, raw data that can be safely shared across
|
||||
* multiple worker threads.
|
||||
* @since v15.7.0, v14.18.0
|
||||
*/
|
||||
@@ -170,6 +173,17 @@ declare module "buffer" {
|
||||
* @since v15.7.0, v14.18.0
|
||||
*/
|
||||
arrayBuffer(): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise<Uint8Array>`.
|
||||
*
|
||||
* ```js
|
||||
* const blob = new Blob(['hello']);
|
||||
* blob.bytes().then((bytes) => {
|
||||
* console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
bytes(): Promise<Uint8Array>;
|
||||
/**
|
||||
* Creates and returns a new `Blob` containing a subset of this `Blob` objects
|
||||
* data. The original `Blob` is not altered.
|
||||
@@ -194,7 +208,7 @@ declare module "buffer" {
|
||||
export interface FileOptions {
|
||||
/**
|
||||
* One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
|
||||
* converted to the platform native line-ending as specified by `require('node:os').EOL`.
|
||||
* converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`.
|
||||
*/
|
||||
endings?: "native" | "transparent";
|
||||
/** The File content-type. */
|
||||
@@ -221,10 +235,10 @@ declare module "buffer" {
|
||||
}
|
||||
export import atob = globalThis.atob;
|
||||
export import btoa = globalThis.btoa;
|
||||
import { Blob as NodeBlob } from "buffer";
|
||||
// This conditional type will be the existing global Blob in a browser, or
|
||||
// the copy below in a Node environment.
|
||||
type __Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : NodeBlob;
|
||||
export type WithImplicitCoercion<T> =
|
||||
| T
|
||||
| { valueOf(): T }
|
||||
| (T extends string ? { [Symbol.toPrimitive](hint: "string"): T } : never);
|
||||
global {
|
||||
namespace NodeJS {
|
||||
export { BufferEncoding };
|
||||
@@ -243,111 +257,15 @@ declare module "buffer" {
|
||||
| "latin1"
|
||||
| "binary"
|
||||
| "hex";
|
||||
type WithImplicitCoercion<T> =
|
||||
| T
|
||||
| {
|
||||
valueOf(): T;
|
||||
};
|
||||
/**
|
||||
* Raw data is stored in instances of the Buffer class.
|
||||
* A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
|
||||
* Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex'
|
||||
*/
|
||||
interface BufferConstructor {
|
||||
/**
|
||||
* Allocates a new buffer containing the given {str}.
|
||||
*
|
||||
* @param str String to store in buffer.
|
||||
* @param encoding encoding to use, optional. Default is 'utf8'
|
||||
* @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
|
||||
*/
|
||||
new(str: string, encoding?: BufferEncoding): Buffer;
|
||||
/**
|
||||
* Allocates a new buffer of {size} octets.
|
||||
*
|
||||
* @param size count of octets to allocate.
|
||||
* @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
|
||||
*/
|
||||
new(size: number): Buffer;
|
||||
/**
|
||||
* Allocates a new buffer containing the given {array} of octets.
|
||||
*
|
||||
* @param array The octets to store.
|
||||
* @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
|
||||
*/
|
||||
new(array: Uint8Array): Buffer;
|
||||
/**
|
||||
* Produces a Buffer backed by the same allocated memory as
|
||||
* the given {ArrayBuffer}/{SharedArrayBuffer}.
|
||||
*
|
||||
* @param arrayBuffer The ArrayBuffer with which to share memory.
|
||||
* @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
|
||||
*/
|
||||
new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
|
||||
/**
|
||||
* Allocates a new buffer containing the given {array} of octets.
|
||||
*
|
||||
* @param array The octets to store.
|
||||
* @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
|
||||
*/
|
||||
new(array: readonly any[]): Buffer;
|
||||
/**
|
||||
* Copies the passed {buffer} data onto a new {Buffer} instance.
|
||||
*
|
||||
* @param buffer The buffer to copy.
|
||||
* @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
|
||||
*/
|
||||
new(buffer: Buffer): Buffer;
|
||||
/**
|
||||
* Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
|
||||
* Array entries outside that range will be truncated to fit into it.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
|
||||
* const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
|
||||
* ```
|
||||
*
|
||||
* If `array` is an `Array`\-like object (that is, one with a `length` property of
|
||||
* type `number`), it is treated as if it is an array, unless it is a `Buffer` or
|
||||
* a `Uint8Array`. This means all other `TypedArray` variants get treated as an `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`.
|
||||
*
|
||||
* A `TypeError` will be thrown if `array` is not an `Array` or another type
|
||||
* appropriate for `Buffer.from()` variants.
|
||||
*
|
||||
* `Buffer.from(array)` and `Buffer.from(string)` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
|
||||
* @since v5.10.0
|
||||
*/
|
||||
from(
|
||||
arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
|
||||
byteOffset?: number,
|
||||
length?: number,
|
||||
): Buffer;
|
||||
/**
|
||||
* Creates a new Buffer using the passed {data}
|
||||
* @param data data to create a new Buffer
|
||||
*/
|
||||
from(data: Uint8Array | readonly number[]): Buffer;
|
||||
from(data: WithImplicitCoercion<Uint8Array | readonly number[] | string>): Buffer;
|
||||
/**
|
||||
* Creates a new Buffer containing the given JavaScript string {str}.
|
||||
* If provided, the {encoding} parameter identifies the character encoding.
|
||||
* If not provided, {encoding} defaults to 'utf8'.
|
||||
*/
|
||||
from(
|
||||
str:
|
||||
| WithImplicitCoercion<string>
|
||||
| {
|
||||
[Symbol.toPrimitive](hint: "string"): string;
|
||||
},
|
||||
encoding?: BufferEncoding,
|
||||
): Buffer;
|
||||
/**
|
||||
* Creates a new Buffer using the passed {data}
|
||||
* @param values to create a new Buffer
|
||||
*/
|
||||
of(...items: number[]): Buffer;
|
||||
// see buffer.buffer.d.ts for implementation specific to TypeScript 5.7 and later
|
||||
// see ts5.6/buffer.buffer.d.ts for implementation specific to TypeScript 5.6 and earlier
|
||||
|
||||
/**
|
||||
* Returns `true` if `obj` is a `Buffer`, `false` otherwise.
|
||||
*
|
||||
@@ -416,65 +334,9 @@ declare module "buffer" {
|
||||
* @return The number of bytes contained within `string`.
|
||||
*/
|
||||
byteLength(
|
||||
string: string | Buffer | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
|
||||
string: string | NodeJS.ArrayBufferView | ArrayBufferLike,
|
||||
encoding?: BufferEncoding,
|
||||
): number;
|
||||
/**
|
||||
* Returns a new `Buffer` which is the result of concatenating all the `Buffer` instances in the `list` together.
|
||||
*
|
||||
* If the list has no items, or if the `totalLength` is 0, then a new zero-length `Buffer` is returned.
|
||||
*
|
||||
* If `totalLength` is not provided, it is calculated from the `Buffer` instances
|
||||
* in `list` by adding their lengths.
|
||||
*
|
||||
* If `totalLength` is provided, it is coerced to an unsigned integer. If the
|
||||
* combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
|
||||
* truncated to `totalLength`.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* // Create a single `Buffer` from a list of three `Buffer` instances.
|
||||
*
|
||||
* const buf1 = Buffer.alloc(10);
|
||||
* const buf2 = Buffer.alloc(14);
|
||||
* const buf3 = Buffer.alloc(18);
|
||||
* const totalLength = buf1.length + buf2.length + buf3.length;
|
||||
*
|
||||
* console.log(totalLength);
|
||||
* // Prints: 42
|
||||
*
|
||||
* const bufA = Buffer.concat([buf1, buf2, buf3], totalLength);
|
||||
*
|
||||
* console.log(bufA);
|
||||
* // Prints: <Buffer 00 00 00 00 ...>
|
||||
* console.log(bufA.length);
|
||||
* // Prints: 42
|
||||
* ```
|
||||
*
|
||||
* `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
|
||||
* @since v0.7.11
|
||||
* @param list List of `Buffer` or {@link Uint8Array} instances to concatenate.
|
||||
* @param totalLength Total length of the `Buffer` instances in `list` when concatenated.
|
||||
*/
|
||||
concat(list: readonly Uint8Array[], totalLength?: number): Buffer;
|
||||
/**
|
||||
* Copies the underlying memory of `view` into a new `Buffer`.
|
||||
*
|
||||
* ```js
|
||||
* const u16 = new Uint16Array([0, 0xffff]);
|
||||
* const buf = Buffer.copyBytesFrom(u16, 1, 1);
|
||||
* u16[1] = 0;
|
||||
* console.log(buf.length); // 2
|
||||
* console.log(buf[0]); // 255
|
||||
* console.log(buf[1]); // 255
|
||||
* ```
|
||||
* @since v19.8.0
|
||||
* @param view The {TypedArray} to copy.
|
||||
* @param [offset=0] The starting offset within `view`.
|
||||
* @param [length=view.length - offset] The number of elements from `view` to copy.
|
||||
*/
|
||||
copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer;
|
||||
/**
|
||||
* Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of `Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`.
|
||||
*
|
||||
@@ -493,135 +355,6 @@ declare module "buffer" {
|
||||
* @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details.
|
||||
*/
|
||||
compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1;
|
||||
/**
|
||||
* Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf = Buffer.alloc(5);
|
||||
*
|
||||
* console.log(buf);
|
||||
* // Prints: <Buffer 00 00 00 00 00>
|
||||
* ```
|
||||
*
|
||||
* If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
|
||||
*
|
||||
* If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf = Buffer.alloc(5, 'a');
|
||||
*
|
||||
* console.log(buf);
|
||||
* // Prints: <Buffer 61 61 61 61 61>
|
||||
* ```
|
||||
*
|
||||
* If both `fill` and `encoding` are specified, the allocated `Buffer` will be
|
||||
* initialized by calling `buf.fill(fill, encoding)`.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
|
||||
*
|
||||
* console.log(buf);
|
||||
* // Prints: <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>
|
||||
* ```
|
||||
*
|
||||
* Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance
|
||||
* contents will never contain sensitive data from previous allocations, including
|
||||
* data that might not have been allocated for `Buffer`s.
|
||||
*
|
||||
* A `TypeError` will be thrown if `size` is not a number.
|
||||
* @since v5.10.0
|
||||
* @param size The desired length of the new `Buffer`.
|
||||
* @param [fill=0] A value to pre-fill the new `Buffer` with.
|
||||
* @param [encoding='utf8'] If `fill` is a string, this is its encoding.
|
||||
*/
|
||||
alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer;
|
||||
/**
|
||||
* Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
|
||||
*
|
||||
* The underlying memory for `Buffer` instances created in this way is _not_
|
||||
* _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf = Buffer.allocUnsafe(10);
|
||||
*
|
||||
* console.log(buf);
|
||||
* // Prints (contents may vary): <Buffer a0 8b 28 3f 01 00 00 00 50 32>
|
||||
*
|
||||
* buf.fill(0);
|
||||
*
|
||||
* console.log(buf);
|
||||
* // Prints: <Buffer 00 00 00 00 00 00 00 00 00 00>
|
||||
* ```
|
||||
*
|
||||
* A `TypeError` will be thrown if `size` is not a number.
|
||||
*
|
||||
* The `Buffer` module pre-allocates an internal `Buffer` instance of
|
||||
* size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`,
|
||||
* and `Buffer.concat()` only when `size` is less than `Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two).
|
||||
*
|
||||
* Use of this pre-allocated internal memory pool is a key difference between
|
||||
* calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
|
||||
* Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less
|
||||
* than or equal to half `Buffer.poolSize`. The
|
||||
* difference is subtle but can be important when an application requires the
|
||||
* additional performance that `Buffer.allocUnsafe()` provides.
|
||||
* @since v5.10.0
|
||||
* @param size The desired length of the new `Buffer`.
|
||||
*/
|
||||
allocUnsafe(size: number): Buffer;
|
||||
/**
|
||||
* Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if
|
||||
* `size` is 0.
|
||||
*
|
||||
* The underlying memory for `Buffer` instances created in this way is _not_
|
||||
* _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize
|
||||
* such `Buffer` instances with zeroes.
|
||||
*
|
||||
* When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
|
||||
* allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This
|
||||
* allows applications to avoid the garbage collection overhead of creating many
|
||||
* individually allocated `Buffer` instances. This approach improves both
|
||||
* performance and memory usage by eliminating the need to track and clean up as
|
||||
* many individual `ArrayBuffer` objects.
|
||||
*
|
||||
* However, in the case where a developer may need to retain a small chunk of
|
||||
* memory from a pool for an indeterminate amount of time, it may be appropriate
|
||||
* to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and
|
||||
* then copying out the relevant bits.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* // Need to keep around a few small chunks of memory.
|
||||
* const store = [];
|
||||
*
|
||||
* socket.on('readable', () => {
|
||||
* let data;
|
||||
* while (null !== (data = readable.read())) {
|
||||
* // Allocate for retained data.
|
||||
* const sb = Buffer.allocUnsafeSlow(10);
|
||||
*
|
||||
* // Copy the data into the new allocation.
|
||||
* data.copy(sb, 0, 0, 10);
|
||||
*
|
||||
* store.push(sb);
|
||||
* }
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* A `TypeError` will be thrown if `size` is not a number.
|
||||
* @since v5.12.0
|
||||
* @param size The desired length of the new `Buffer`.
|
||||
*/
|
||||
allocUnsafeSlow(size: number): Buffer;
|
||||
/**
|
||||
* This is the size (in bytes) of pre-allocated internal `Buffer` instances used
|
||||
* for pooling. This value may be modified.
|
||||
@@ -629,7 +362,10 @@ declare module "buffer" {
|
||||
*/
|
||||
poolSize: number;
|
||||
}
|
||||
interface Buffer extends Uint8Array {
|
||||
interface Buffer {
|
||||
// see buffer.buffer.d.ts for implementation specific to TypeScript 5.7 and later
|
||||
// see ts5.6/buffer.buffer.d.ts for implementation specific to TypeScript 5.6 and earlier
|
||||
|
||||
/**
|
||||
* Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did
|
||||
* not contain enough space to fit the entire string, only part of `string` will be
|
||||
@@ -866,100 +602,6 @@ declare module "buffer" {
|
||||
* @return The number of bytes copied.
|
||||
*/
|
||||
copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
|
||||
/**
|
||||
* Returns a new `Buffer` that references the same memory as the original, but
|
||||
* offset and cropped by the `start` and `end` indices.
|
||||
*
|
||||
* This method is not compatible with the `Uint8Array.prototype.slice()`,
|
||||
* which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf = Buffer.from('buffer');
|
||||
*
|
||||
* const copiedBuf = Uint8Array.prototype.slice.call(buf);
|
||||
* copiedBuf[0]++;
|
||||
* console.log(copiedBuf.toString());
|
||||
* // Prints: cuffer
|
||||
*
|
||||
* console.log(buf.toString());
|
||||
* // Prints: buffer
|
||||
*
|
||||
* // With buf.slice(), the original buffer is modified.
|
||||
* const notReallyCopiedBuf = buf.slice();
|
||||
* notReallyCopiedBuf[0]++;
|
||||
* console.log(notReallyCopiedBuf.toString());
|
||||
* // Prints: cuffer
|
||||
* console.log(buf.toString());
|
||||
* // Also prints: cuffer (!)
|
||||
* ```
|
||||
* @since v0.3.0
|
||||
* @deprecated Use `subarray` instead.
|
||||
* @param [start=0] Where the new `Buffer` will start.
|
||||
* @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
|
||||
*/
|
||||
slice(start?: number, end?: number): Buffer;
|
||||
/**
|
||||
* Returns a new `Buffer` that references the same memory as the original, but
|
||||
* offset and cropped by the `start` and `end` indices.
|
||||
*
|
||||
* Specifying `end` greater than `buf.length` will return the same result as
|
||||
* that of `end` equal to `buf.length`.
|
||||
*
|
||||
* This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray).
|
||||
*
|
||||
* Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
|
||||
* // from the original `Buffer`.
|
||||
*
|
||||
* const buf1 = Buffer.allocUnsafe(26);
|
||||
*
|
||||
* for (let i = 0; i < 26; i++) {
|
||||
* // 97 is the decimal ASCII value for 'a'.
|
||||
* buf1[i] = i + 97;
|
||||
* }
|
||||
*
|
||||
* const buf2 = buf1.subarray(0, 3);
|
||||
*
|
||||
* console.log(buf2.toString('ascii', 0, buf2.length));
|
||||
* // Prints: abc
|
||||
*
|
||||
* buf1[0] = 33;
|
||||
*
|
||||
* console.log(buf2.toString('ascii', 0, buf2.length));
|
||||
* // Prints: !bc
|
||||
* ```
|
||||
*
|
||||
* Specifying negative indexes causes the slice to be generated relative to the
|
||||
* end of `buf` rather than the beginning.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf = Buffer.from('buffer');
|
||||
*
|
||||
* console.log(buf.subarray(-6, -1).toString());
|
||||
* // Prints: buffe
|
||||
* // (Equivalent to buf.subarray(0, 5).)
|
||||
*
|
||||
* console.log(buf.subarray(-6, -2).toString());
|
||||
* // Prints: buff
|
||||
* // (Equivalent to buf.subarray(0, 4).)
|
||||
*
|
||||
* console.log(buf.subarray(-5, -2).toString());
|
||||
* // Prints: uff
|
||||
* // (Equivalent to buf.subarray(1, 4).)
|
||||
* ```
|
||||
* @since v3.0.0
|
||||
* @param [start=0] Where the new `Buffer` will start.
|
||||
* @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
|
||||
*/
|
||||
subarray(start?: number, end?: number): Buffer;
|
||||
/**
|
||||
* Writes `value` to `buf` at the specified `offset` as big-endian.
|
||||
*
|
||||
@@ -1617,7 +1259,7 @@ declare module "buffer" {
|
||||
* @since v5.10.0
|
||||
* @return A reference to `buf`.
|
||||
*/
|
||||
swap16(): Buffer;
|
||||
swap16(): this;
|
||||
/**
|
||||
* Interprets `buf` as an array of unsigned 32-bit integers and swaps the
|
||||
* byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
|
||||
@@ -1643,7 +1285,7 @@ declare module "buffer" {
|
||||
* @since v5.10.0
|
||||
* @return A reference to `buf`.
|
||||
*/
|
||||
swap32(): Buffer;
|
||||
swap32(): this;
|
||||
/**
|
||||
* Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_.
|
||||
* Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
|
||||
@@ -1669,7 +1311,7 @@ declare module "buffer" {
|
||||
* @since v6.3.0
|
||||
* @return A reference to `buf`.
|
||||
*/
|
||||
swap64(): Buffer;
|
||||
swap64(): this;
|
||||
/**
|
||||
* Writes `value` to `buf` at the specified `offset`. `value` must be a
|
||||
* valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
|
||||
@@ -2063,6 +1705,8 @@ declare module "buffer" {
|
||||
* @return A reference to `buf`.
|
||||
*/
|
||||
fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
|
||||
fill(value: string | Uint8Array | number, offset: number, encoding: BufferEncoding): this;
|
||||
fill(value: string | Uint8Array | number, encoding: BufferEncoding): this;
|
||||
/**
|
||||
* If `value` is:
|
||||
*
|
||||
@@ -2132,6 +1776,7 @@ declare module "buffer" {
|
||||
* @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
|
||||
*/
|
||||
indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
|
||||
indexOf(value: string | number | Uint8Array, encoding: BufferEncoding): number;
|
||||
/**
|
||||
* Identical to `buf.indexOf()`, except the last occurrence of `value` is found
|
||||
* rather than the first occurrence.
|
||||
@@ -2200,6 +1845,7 @@ declare module "buffer" {
|
||||
* @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
|
||||
*/
|
||||
lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
|
||||
lastIndexOf(value: string | number | Uint8Array, encoding: BufferEncoding): number;
|
||||
/**
|
||||
* Equivalent to `buf.indexOf() !== -1`.
|
||||
*
|
||||
@@ -2230,6 +1876,7 @@ declare module "buffer" {
|
||||
* @return `true` if `value` was found in `buf`, `false` otherwise.
|
||||
*/
|
||||
includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
|
||||
includes(value: string | number | Buffer, encoding: BufferEncoding): boolean;
|
||||
}
|
||||
var Buffer: BufferConstructor;
|
||||
/**
|
||||
@@ -2264,17 +1911,22 @@ declare module "buffer" {
|
||||
* @param data An ASCII (Latin1) string.
|
||||
*/
|
||||
function btoa(data: string): string;
|
||||
interface Blob extends __Blob {}
|
||||
interface Blob extends _Blob {}
|
||||
/**
|
||||
* `Blob` class is a global reference for `require('node:buffer').Blob`
|
||||
* `Blob` class is a global reference for `import { Blob } from 'node:buffer'`
|
||||
* https://nodejs.org/api/buffer.html#class-blob
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var Blob: typeof globalThis extends {
|
||||
onmessage: any;
|
||||
Blob: infer T;
|
||||
} ? T
|
||||
: typeof NodeBlob;
|
||||
var Blob: typeof globalThis extends { onmessage: any; Blob: infer T } ? T
|
||||
: typeof import("buffer").Blob;
|
||||
interface File extends _File {}
|
||||
/**
|
||||
* `File` class is a global reference for `import { File } from 'node:buffer'`
|
||||
* https://nodejs.org/api/buffer.html#class-file
|
||||
* @since v20.0.0
|
||||
*/
|
||||
var File: typeof globalThis extends { onmessage: any; File: infer T } ? T
|
||||
: typeof import("buffer").File;
|
||||
}
|
||||
}
|
||||
declare module "node:buffer" {
|
||||
|
||||
318
backend/node_modules/@types/node/child_process.d.ts
generated
vendored
318
backend/node_modules/@types/node/child_process.d.ts
generated
vendored
@@ -4,7 +4,7 @@
|
||||
* is primarily provided by the {@link spawn} function:
|
||||
*
|
||||
* ```js
|
||||
* const { spawn } = require('node:child_process');
|
||||
* import { spawn } from 'node:child_process';
|
||||
* const ls = spawn('ls', ['-lh', '/usr']);
|
||||
*
|
||||
* ls.stdout.on('data', (data) => {
|
||||
@@ -24,7 +24,7 @@
|
||||
* the parent Node.js process and the spawned subprocess. These pipes have
|
||||
* limited (and platform-specific) capacity. If the subprocess writes to
|
||||
* stdout in excess of that limit without the output being captured, the
|
||||
* subprocess blocks waiting for the pipe buffer to accept more data. This is
|
||||
* subprocess blocks, waiting for the pipe buffer to accept more data. This is
|
||||
* identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed.
|
||||
*
|
||||
* The command lookup is performed using the `options.env.PATH` environment
|
||||
@@ -63,14 +63,14 @@
|
||||
* For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however,
|
||||
* the synchronous methods can have significant impact on performance due to
|
||||
* stalling the event loop while spawned processes complete.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/child_process.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/child_process.js)
|
||||
*/
|
||||
declare module "child_process" {
|
||||
import { ObjectEncodingOptions } from "node:fs";
|
||||
import { NonSharedBuffer } from "node:buffer";
|
||||
import { Abortable, EventEmitter } from "node:events";
|
||||
import * as dgram from "node:dgram";
|
||||
import * as net from "node:net";
|
||||
import { Pipe, Readable, Stream, Writable } from "node:stream";
|
||||
import { Readable, Stream, Writable } from "node:stream";
|
||||
import { URL } from "node:url";
|
||||
type Serializable = string | object | number | boolean | bigint;
|
||||
type SendHandle = net.Socket | net.Server | dgram.Socket | undefined;
|
||||
@@ -109,7 +109,7 @@ declare module "child_process" {
|
||||
* refer to the same value.
|
||||
*
|
||||
* ```js
|
||||
* const { spawn } = require('node:child_process');
|
||||
* import { spawn } from 'node:child_process';
|
||||
*
|
||||
* const subprocess = spawn('ls');
|
||||
*
|
||||
@@ -140,7 +140,7 @@ declare module "child_process" {
|
||||
* no IPC channel exists, this property is `undefined`.
|
||||
* @since v7.1.0
|
||||
*/
|
||||
readonly channel?: Pipe | null | undefined;
|
||||
readonly channel?: Control | null;
|
||||
/**
|
||||
* A sparse array of pipes to the child process, corresponding with positions in
|
||||
* the `stdio` option passed to {@link spawn} that have been set
|
||||
@@ -152,9 +152,9 @@ declare module "child_process" {
|
||||
* in the array are `null`.
|
||||
*
|
||||
* ```js
|
||||
* const assert = require('node:assert');
|
||||
* const fs = require('node:fs');
|
||||
* const child_process = require('node:child_process');
|
||||
* import assert from 'node:assert';
|
||||
* import fs from 'node:fs';
|
||||
* import child_process from 'node:child_process';
|
||||
*
|
||||
* const subprocess = child_process.spawn('ls', {
|
||||
* stdio: [
|
||||
@@ -202,7 +202,7 @@ declare module "child_process" {
|
||||
* emitted.
|
||||
*
|
||||
* ```js
|
||||
* const { spawn } = require('node:child_process');
|
||||
* import { spawn } from 'node:child_process';
|
||||
* const grep = spawn('grep', ['ssh']);
|
||||
*
|
||||
* console.log(`Spawned child pid: ${grep.pid}`);
|
||||
@@ -249,7 +249,7 @@ declare module "child_process" {
|
||||
* returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise.
|
||||
*
|
||||
* ```js
|
||||
* const { spawn } = require('node:child_process');
|
||||
* import { spawn } from 'node:child_process';
|
||||
* const grep = spawn('grep', ['ssh']);
|
||||
*
|
||||
* grep.on('close', (code, signal) => {
|
||||
@@ -282,7 +282,7 @@ declare module "child_process" {
|
||||
*
|
||||
* ```js
|
||||
* 'use strict';
|
||||
* const { spawn } = require('node:child_process');
|
||||
* import { spawn } from 'node:child_process';
|
||||
*
|
||||
* const subprocess = spawn(
|
||||
* 'sh',
|
||||
@@ -320,7 +320,7 @@ declare module "child_process" {
|
||||
* For example, in the parent script:
|
||||
*
|
||||
* ```js
|
||||
* const cp = require('node:child_process');
|
||||
* import cp from 'node:child_process';
|
||||
* const n = cp.fork(`${__dirname}/sub.js`);
|
||||
*
|
||||
* n.on('message', (m) => {
|
||||
@@ -374,10 +374,12 @@ declare module "child_process" {
|
||||
* a TCP server object to the child process as illustrated in the example below:
|
||||
*
|
||||
* ```js
|
||||
* const subprocess = require('node:child_process').fork('subprocess.js');
|
||||
* import { createServer } from 'node:net';
|
||||
* import { fork } from 'node:child_process';
|
||||
* const subprocess = fork('subprocess.js');
|
||||
*
|
||||
* // Open up the server object and send the handle.
|
||||
* const server = require('node:net').createServer();
|
||||
* const server = createServer();
|
||||
* server.on('connection', (socket) => {
|
||||
* socket.end('handled by parent');
|
||||
* });
|
||||
@@ -412,13 +414,14 @@ declare module "child_process" {
|
||||
* handle connections with "normal" or "special" priority:
|
||||
*
|
||||
* ```js
|
||||
* const { fork } = require('node:child_process');
|
||||
* import { createServer } from 'node:net';
|
||||
* import { fork } from 'node:child_process';
|
||||
* const normal = fork('subprocess.js', ['normal']);
|
||||
* const special = fork('subprocess.js', ['special']);
|
||||
*
|
||||
* // Open up the server and send sockets to child. Use pauseOnConnect to prevent
|
||||
* // the sockets from being read before they are sent to the child process.
|
||||
* const server = require('node:net').createServer({ pauseOnConnect: true });
|
||||
* const server = createServer({ pauseOnConnect: true });
|
||||
* server.on('connection', (socket) => {
|
||||
*
|
||||
* // If this is special priority...
|
||||
@@ -455,7 +458,7 @@ declare module "child_process" {
|
||||
* as the connection may have been closed during the time it takes to send the
|
||||
* connection to the child.
|
||||
* @since v0.5.9
|
||||
* @param sendHandle `undefined`, or a [`net.Socket`](https://nodejs.org/docs/latest-v20.x/api/net.html#class-netsocket), [`net.Server`](https://nodejs.org/docs/latest-v20.x/api/net.html#class-netserver), or [`dgram.Socket`](https://nodejs.org/docs/latest-v20.x/api/dgram.html#class-dgramsocket) object.
|
||||
* @param sendHandle `undefined`, or a [`net.Socket`](https://nodejs.org/docs/latest-v24.x/api/net.html#class-netsocket), [`net.Server`](https://nodejs.org/docs/latest-v24.x/api/net.html#class-netserver), or [`dgram.Socket`](https://nodejs.org/docs/latest-v24.x/api/dgram.html#class-dgramsocket) object.
|
||||
* @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:
|
||||
*/
|
||||
send(message: Serializable, callback?: (error: Error | null) => void): boolean;
|
||||
@@ -490,7 +493,7 @@ declare module "child_process" {
|
||||
* the child and the parent.
|
||||
*
|
||||
* ```js
|
||||
* const { spawn } = require('node:child_process');
|
||||
* import { spawn } from 'node:child_process';
|
||||
*
|
||||
* const subprocess = spawn(process.argv[0], ['child_program.js'], {
|
||||
* detached: true,
|
||||
@@ -508,7 +511,7 @@ declare module "child_process" {
|
||||
* to wait for the child to exit before exiting itself.
|
||||
*
|
||||
* ```js
|
||||
* const { spawn } = require('node:child_process');
|
||||
* import { spawn } from 'node:child_process';
|
||||
*
|
||||
* const subprocess = spawn(process.argv[0], ['child_program.js'], {
|
||||
* detached: true,
|
||||
@@ -610,6 +613,10 @@ declare module "child_process" {
|
||||
Readable | Writable | null | undefined, // extra, no modification
|
||||
];
|
||||
}
|
||||
interface Control extends EventEmitter {
|
||||
ref(): void;
|
||||
unref(): void;
|
||||
}
|
||||
interface MessageOptions {
|
||||
keepOpen?: boolean | undefined;
|
||||
}
|
||||
@@ -711,7 +718,7 @@ declare module "child_process" {
|
||||
* exit code:
|
||||
*
|
||||
* ```js
|
||||
* const { spawn } = require('node:child_process');
|
||||
* import { spawn } from 'node:child_process';
|
||||
* const ls = spawn('ls', ['-lh', '/usr']);
|
||||
*
|
||||
* ls.stdout.on('data', (data) => {
|
||||
@@ -730,7 +737,7 @@ declare module "child_process" {
|
||||
* Example: A very elaborate way to run `ps ax | grep ssh`
|
||||
*
|
||||
* ```js
|
||||
* const { spawn } = require('node:child_process');
|
||||
* import { spawn } from 'node:child_process';
|
||||
* const ps = spawn('ps', ['ax']);
|
||||
* const grep = spawn('grep', ['ssh']);
|
||||
*
|
||||
@@ -767,7 +774,7 @@ declare module "child_process" {
|
||||
* Example of checking for failed `spawn`:
|
||||
*
|
||||
* ```js
|
||||
* const { spawn } = require('node:child_process');
|
||||
* import { spawn } from 'node:child_process';
|
||||
* const subprocess = spawn('bad_command');
|
||||
*
|
||||
* subprocess.on('error', (err) => {
|
||||
@@ -785,7 +792,7 @@ declare module "child_process" {
|
||||
* the error passed to the callback will be an `AbortError`:
|
||||
*
|
||||
* ```js
|
||||
* const { spawn } = require('node:child_process');
|
||||
* import { spawn } from 'node:child_process';
|
||||
* const controller = new AbortController();
|
||||
* const { signal } = controller;
|
||||
* const grep = spawn('grep', ['ssh'], { signal });
|
||||
@@ -884,18 +891,20 @@ declare module "child_process" {
|
||||
signal?: AbortSignal | undefined;
|
||||
maxBuffer?: number | undefined;
|
||||
killSignal?: NodeJS.Signals | number | undefined;
|
||||
encoding?: string | null | undefined;
|
||||
}
|
||||
interface ExecOptionsWithStringEncoding extends ExecOptions {
|
||||
encoding: BufferEncoding;
|
||||
encoding?: BufferEncoding | undefined;
|
||||
}
|
||||
interface ExecOptionsWithBufferEncoding extends ExecOptions {
|
||||
encoding: BufferEncoding | null; // specify `null`.
|
||||
encoding: "buffer" | null; // specify `null`.
|
||||
}
|
||||
// TODO: Just Plain Wrong™ (see also nodejs/node#57392)
|
||||
interface ExecException extends Error {
|
||||
cmd?: string | undefined;
|
||||
killed?: boolean | undefined;
|
||||
code?: number | undefined;
|
||||
signal?: NodeJS.Signals | undefined;
|
||||
cmd?: string;
|
||||
killed?: boolean;
|
||||
code?: number;
|
||||
signal?: NodeJS.Signals;
|
||||
stdout?: string;
|
||||
stderr?: string;
|
||||
}
|
||||
@@ -906,7 +915,7 @@ declare module "child_process" {
|
||||
* need to be dealt with accordingly:
|
||||
*
|
||||
* ```js
|
||||
* const { exec } = require('node:child_process');
|
||||
* import { exec } from 'node:child_process';
|
||||
*
|
||||
* exec('"/path/to/test file/test.sh" arg1 arg2');
|
||||
* // Double quotes are used so that the space in the path is not interpreted as
|
||||
@@ -932,7 +941,7 @@ declare module "child_process" {
|
||||
* encoding, `Buffer` objects will be passed to the callback instead.
|
||||
*
|
||||
* ```js
|
||||
* const { exec } = require('node:child_process');
|
||||
* import { exec } from 'node:child_process';
|
||||
* exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => {
|
||||
* if (error) {
|
||||
* console.error(`exec error: ${error}`);
|
||||
@@ -957,8 +966,9 @@ declare module "child_process" {
|
||||
* callback, but with two additional properties `stdout` and `stderr`.
|
||||
*
|
||||
* ```js
|
||||
* const util = require('node:util');
|
||||
* const exec = util.promisify(require('node:child_process').exec);
|
||||
* import util from 'node:util';
|
||||
* import child_process from 'node:child_process';
|
||||
* const exec = util.promisify(child_process.exec);
|
||||
*
|
||||
* async function lsExample() {
|
||||
* const { stdout, stderr } = await exec('ls');
|
||||
@@ -972,7 +982,7 @@ declare module "child_process" {
|
||||
* the error passed to the callback will be an `AbortError`:
|
||||
*
|
||||
* ```js
|
||||
* const { exec } = require('node:child_process');
|
||||
* import { exec } from 'node:child_process';
|
||||
* const controller = new AbortController();
|
||||
* const { signal } = controller;
|
||||
* const child = exec('grep ssh', { signal }, (error) => {
|
||||
@@ -991,39 +1001,24 @@ declare module "child_process" {
|
||||
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
||||
function exec(
|
||||
command: string,
|
||||
options: {
|
||||
encoding: "buffer" | null;
|
||||
} & ExecOptions,
|
||||
callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
|
||||
options: ExecOptionsWithBufferEncoding,
|
||||
callback?: (error: ExecException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
|
||||
): ChildProcess;
|
||||
// `options` with well known `encoding` means stdout/stderr are definitely `string`.
|
||||
// `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
|
||||
function exec(
|
||||
command: string,
|
||||
options: {
|
||||
encoding: BufferEncoding;
|
||||
} & ExecOptions,
|
||||
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
||||
): ChildProcess;
|
||||
// `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
|
||||
// There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
|
||||
function exec(
|
||||
command: string,
|
||||
options: {
|
||||
encoding: BufferEncoding;
|
||||
} & ExecOptions,
|
||||
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
||||
): ChildProcess;
|
||||
// `options` without an `encoding` means stdout/stderr are definitely `string`.
|
||||
function exec(
|
||||
command: string,
|
||||
options: ExecOptions,
|
||||
options: ExecOptionsWithStringEncoding,
|
||||
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
||||
): ChildProcess;
|
||||
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
||||
function exec(
|
||||
command: string,
|
||||
options: (ObjectEncodingOptions & ExecOptions) | undefined | null,
|
||||
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
||||
options: ExecOptions | undefined | null,
|
||||
callback?: (
|
||||
error: ExecException | null,
|
||||
stdout: string | NonSharedBuffer,
|
||||
stderr: string | NonSharedBuffer,
|
||||
) => void,
|
||||
): ChildProcess;
|
||||
interface PromiseWithChild<T> extends Promise<T> {
|
||||
child: ChildProcess;
|
||||
@@ -1035,35 +1030,24 @@ declare module "child_process" {
|
||||
}>;
|
||||
function __promisify__(
|
||||
command: string,
|
||||
options: {
|
||||
encoding: "buffer" | null;
|
||||
} & ExecOptions,
|
||||
options: ExecOptionsWithBufferEncoding,
|
||||
): PromiseWithChild<{
|
||||
stdout: Buffer;
|
||||
stderr: Buffer;
|
||||
stdout: NonSharedBuffer;
|
||||
stderr: NonSharedBuffer;
|
||||
}>;
|
||||
function __promisify__(
|
||||
command: string,
|
||||
options: {
|
||||
encoding: BufferEncoding;
|
||||
} & ExecOptions,
|
||||
options: ExecOptionsWithStringEncoding,
|
||||
): PromiseWithChild<{
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
}>;
|
||||
function __promisify__(
|
||||
command: string,
|
||||
options: ExecOptions,
|
||||
options: ExecOptions | undefined | null,
|
||||
): PromiseWithChild<{
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
}>;
|
||||
function __promisify__(
|
||||
command: string,
|
||||
options?: (ObjectEncodingOptions & ExecOptions) | null,
|
||||
): PromiseWithChild<{
|
||||
stdout: string | Buffer;
|
||||
stderr: string | Buffer;
|
||||
stdout: string | NonSharedBuffer;
|
||||
stderr: string | NonSharedBuffer;
|
||||
}>;
|
||||
}
|
||||
interface ExecFileOptions extends CommonOptions, Abortable {
|
||||
@@ -1072,20 +1056,21 @@ declare module "child_process" {
|
||||
windowsVerbatimArguments?: boolean | undefined;
|
||||
shell?: boolean | string | undefined;
|
||||
signal?: AbortSignal | undefined;
|
||||
encoding?: string | null | undefined;
|
||||
}
|
||||
interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
|
||||
encoding: BufferEncoding;
|
||||
encoding?: BufferEncoding | undefined;
|
||||
}
|
||||
interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
|
||||
encoding: "buffer" | null;
|
||||
}
|
||||
interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
|
||||
encoding: BufferEncoding;
|
||||
}
|
||||
/** @deprecated Use `ExecFileOptions` instead. */
|
||||
interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {}
|
||||
// TODO: execFile exceptions can take many forms... this accurately describes none of them
|
||||
type ExecFileException =
|
||||
& Omit<ExecException, "code">
|
||||
& Omit<NodeJS.ErrnoException, "code">
|
||||
& { code?: string | number | undefined | null };
|
||||
& { code?: string | number | null };
|
||||
/**
|
||||
* The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
|
||||
* executable `file` is spawned directly as a new process making it slightly more
|
||||
@@ -1096,7 +1081,7 @@ declare module "child_process" {
|
||||
* supported.
|
||||
*
|
||||
* ```js
|
||||
* const { execFile } = require('node:child_process');
|
||||
* import { execFile } from 'node:child_process';
|
||||
* const child = execFile('node', ['--version'], (error, stdout, stderr) => {
|
||||
* if (error) {
|
||||
* throw error;
|
||||
@@ -1119,8 +1104,9 @@ declare module "child_process" {
|
||||
* callback, but with two additional properties `stdout` and `stderr`.
|
||||
*
|
||||
* ```js
|
||||
* const util = require('node:util');
|
||||
* const execFile = util.promisify(require('node:child_process').execFile);
|
||||
* import util from 'node:util';
|
||||
* import child_process from 'node:child_process';
|
||||
* const execFile = util.promisify(child_process.execFile);
|
||||
* async function getVersion() {
|
||||
* const { stdout } = await execFile('node', ['--version']);
|
||||
* console.log(stdout);
|
||||
@@ -1136,7 +1122,7 @@ declare module "child_process" {
|
||||
* the error passed to the callback will be an `AbortError`:
|
||||
*
|
||||
* ```js
|
||||
* const { execFile } = require('node:child_process');
|
||||
* import { execFile } from 'node:child_process';
|
||||
* const controller = new AbortController();
|
||||
* const { signal } = controller;
|
||||
* const child = execFile('node', ['--version'], { signal }, (error) => {
|
||||
@@ -1149,91 +1135,63 @@ declare module "child_process" {
|
||||
* @param args List of string arguments.
|
||||
* @param callback Called with the output when process terminates.
|
||||
*/
|
||||
function execFile(file: string): ChildProcess;
|
||||
function execFile(
|
||||
file: string,
|
||||
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
||||
): ChildProcess;
|
||||
function execFile(file: string, args?: readonly string[] | null): ChildProcess;
|
||||
function execFile(
|
||||
file: string,
|
||||
args: readonly string[] | undefined | null,
|
||||
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
||||
): ChildProcess;
|
||||
// no `options` definitely means stdout/stderr are `string`.
|
||||
function execFile(
|
||||
file: string,
|
||||
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
||||
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
||||
): ChildProcess;
|
||||
function execFile(
|
||||
file: string,
|
||||
args: readonly string[] | undefined | null,
|
||||
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
||||
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
||||
): ChildProcess;
|
||||
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
||||
function execFile(
|
||||
file: string,
|
||||
options: ExecFileOptionsWithBufferEncoding,
|
||||
callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
|
||||
callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
|
||||
): ChildProcess;
|
||||
function execFile(
|
||||
file: string,
|
||||
args: readonly string[] | undefined | null,
|
||||
options: ExecFileOptionsWithBufferEncoding,
|
||||
callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
|
||||
callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
|
||||
): ChildProcess;
|
||||
// `options` with well known `encoding` means stdout/stderr are definitely `string`.
|
||||
// `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
|
||||
function execFile(
|
||||
file: string,
|
||||
options: ExecFileOptionsWithStringEncoding,
|
||||
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
||||
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
||||
): ChildProcess;
|
||||
function execFile(
|
||||
file: string,
|
||||
args: readonly string[] | undefined | null,
|
||||
options: ExecFileOptionsWithStringEncoding,
|
||||
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
||||
): ChildProcess;
|
||||
// `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
|
||||
// There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
|
||||
function execFile(
|
||||
file: string,
|
||||
options: ExecFileOptionsWithOtherEncoding,
|
||||
callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
||||
): ChildProcess;
|
||||
function execFile(
|
||||
file: string,
|
||||
args: readonly string[] | undefined | null,
|
||||
options: ExecFileOptionsWithOtherEncoding,
|
||||
callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
||||
): ChildProcess;
|
||||
// `options` without an `encoding` means stdout/stderr are definitely `string`.
|
||||
function execFile(
|
||||
file: string,
|
||||
options: ExecFileOptions,
|
||||
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
||||
): ChildProcess;
|
||||
function execFile(
|
||||
file: string,
|
||||
args: readonly string[] | undefined | null,
|
||||
options: ExecFileOptions,
|
||||
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
||||
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
||||
): ChildProcess;
|
||||
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
||||
function execFile(
|
||||
file: string,
|
||||
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
||||
options: ExecFileOptions | undefined | null,
|
||||
callback:
|
||||
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
||||
| ((
|
||||
error: ExecFileException | null,
|
||||
stdout: string | NonSharedBuffer,
|
||||
stderr: string | NonSharedBuffer,
|
||||
) => void)
|
||||
| undefined
|
||||
| null,
|
||||
): ChildProcess;
|
||||
function execFile(
|
||||
file: string,
|
||||
args: readonly string[] | undefined | null,
|
||||
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
||||
options: ExecFileOptions | undefined | null,
|
||||
callback:
|
||||
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
||||
| ((
|
||||
error: ExecFileException | null,
|
||||
stdout: string | NonSharedBuffer,
|
||||
stderr: string | NonSharedBuffer,
|
||||
) => void)
|
||||
| undefined
|
||||
| null,
|
||||
): ChildProcess;
|
||||
@@ -1253,16 +1211,16 @@ declare module "child_process" {
|
||||
file: string,
|
||||
options: ExecFileOptionsWithBufferEncoding,
|
||||
): PromiseWithChild<{
|
||||
stdout: Buffer;
|
||||
stderr: Buffer;
|
||||
stdout: NonSharedBuffer;
|
||||
stderr: NonSharedBuffer;
|
||||
}>;
|
||||
function __promisify__(
|
||||
file: string,
|
||||
args: readonly string[] | undefined | null,
|
||||
options: ExecFileOptionsWithBufferEncoding,
|
||||
): PromiseWithChild<{
|
||||
stdout: Buffer;
|
||||
stderr: Buffer;
|
||||
stdout: NonSharedBuffer;
|
||||
stderr: NonSharedBuffer;
|
||||
}>;
|
||||
function __promisify__(
|
||||
file: string,
|
||||
@@ -1281,48 +1239,18 @@ declare module "child_process" {
|
||||
}>;
|
||||
function __promisify__(
|
||||
file: string,
|
||||
options: ExecFileOptionsWithOtherEncoding,
|
||||
options: ExecFileOptions | undefined | null,
|
||||
): PromiseWithChild<{
|
||||
stdout: string | Buffer;
|
||||
stderr: string | Buffer;
|
||||
stdout: string | NonSharedBuffer;
|
||||
stderr: string | NonSharedBuffer;
|
||||
}>;
|
||||
function __promisify__(
|
||||
file: string,
|
||||
args: readonly string[] | undefined | null,
|
||||
options: ExecFileOptionsWithOtherEncoding,
|
||||
options: ExecFileOptions | undefined | null,
|
||||
): PromiseWithChild<{
|
||||
stdout: string | Buffer;
|
||||
stderr: string | Buffer;
|
||||
}>;
|
||||
function __promisify__(
|
||||
file: string,
|
||||
options: ExecFileOptions,
|
||||
): PromiseWithChild<{
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
}>;
|
||||
function __promisify__(
|
||||
file: string,
|
||||
args: readonly string[] | undefined | null,
|
||||
options: ExecFileOptions,
|
||||
): PromiseWithChild<{
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
}>;
|
||||
function __promisify__(
|
||||
file: string,
|
||||
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
||||
): PromiseWithChild<{
|
||||
stdout: string | Buffer;
|
||||
stderr: string | Buffer;
|
||||
}>;
|
||||
function __promisify__(
|
||||
file: string,
|
||||
args: readonly string[] | undefined | null,
|
||||
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
||||
): PromiseWithChild<{
|
||||
stdout: string | Buffer;
|
||||
stderr: string | Buffer;
|
||||
stdout: string | NonSharedBuffer;
|
||||
stderr: string | NonSharedBuffer;
|
||||
}>;
|
||||
}
|
||||
interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable {
|
||||
@@ -1377,7 +1305,7 @@ declare module "child_process" {
|
||||
* console.log(`Hello from ${process.argv[2]}!`);
|
||||
* }, 1_000);
|
||||
* } else {
|
||||
* const { fork } = require('node:child_process');
|
||||
* import { fork } from 'node:child_process';
|
||||
* const controller = new AbortController();
|
||||
* const { signal } = controller;
|
||||
* const child = fork(__filename, ['child'], { signal });
|
||||
@@ -1411,7 +1339,7 @@ declare module "child_process" {
|
||||
stderr: T;
|
||||
status: number | null;
|
||||
signal: NodeJS.Signals | null;
|
||||
error?: Error | undefined;
|
||||
error?: Error;
|
||||
}
|
||||
/**
|
||||
* The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return
|
||||
@@ -1428,11 +1356,11 @@ declare module "child_process" {
|
||||
* @param command The command to run.
|
||||
* @param args List of string arguments.
|
||||
*/
|
||||
function spawnSync(command: string): SpawnSyncReturns<Buffer>;
|
||||
function spawnSync(command: string): SpawnSyncReturns<NonSharedBuffer>;
|
||||
function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
|
||||
function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
|
||||
function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
|
||||
function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<Buffer>;
|
||||
function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<NonSharedBuffer>;
|
||||
function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | NonSharedBuffer>;
|
||||
function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<NonSharedBuffer>;
|
||||
function spawnSync(
|
||||
command: string,
|
||||
args: readonly string[],
|
||||
@@ -1442,12 +1370,12 @@ declare module "child_process" {
|
||||
command: string,
|
||||
args: readonly string[],
|
||||
options: SpawnSyncOptionsWithBufferEncoding,
|
||||
): SpawnSyncReturns<Buffer>;
|
||||
): SpawnSyncReturns<NonSharedBuffer>;
|
||||
function spawnSync(
|
||||
command: string,
|
||||
args?: readonly string[],
|
||||
options?: SpawnSyncOptions,
|
||||
): SpawnSyncReturns<string | Buffer>;
|
||||
): SpawnSyncReturns<string | NonSharedBuffer>;
|
||||
interface CommonExecOptions extends CommonOptions {
|
||||
input?: string | NodeJS.ArrayBufferView | undefined;
|
||||
/**
|
||||
@@ -1489,10 +1417,10 @@ declare module "child_process" {
|
||||
* @param command The command to run.
|
||||
* @return The stdout from the command.
|
||||
*/
|
||||
function execSync(command: string): Buffer;
|
||||
function execSync(command: string): NonSharedBuffer;
|
||||
function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
|
||||
function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer;
|
||||
function execSync(command: string, options?: ExecSyncOptions): string | Buffer;
|
||||
function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): NonSharedBuffer;
|
||||
function execSync(command: string, options?: ExecSyncOptions): string | NonSharedBuffer;
|
||||
interface ExecFileSyncOptions extends CommonExecOptions {
|
||||
shell?: boolean | string | undefined;
|
||||
}
|
||||
@@ -1500,7 +1428,7 @@ declare module "child_process" {
|
||||
encoding: BufferEncoding;
|
||||
}
|
||||
interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
|
||||
encoding?: "buffer" | null; // specify `null`.
|
||||
encoding?: "buffer" | null | undefined; // specify `null`.
|
||||
}
|
||||
/**
|
||||
* The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
|
||||
@@ -1522,11 +1450,11 @@ declare module "child_process" {
|
||||
* @param args List of string arguments.
|
||||
* @return The stdout from the command.
|
||||
*/
|
||||
function execFileSync(file: string): Buffer;
|
||||
function execFileSync(file: string): NonSharedBuffer;
|
||||
function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string;
|
||||
function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
||||
function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer;
|
||||
function execFileSync(file: string, args: readonly string[]): Buffer;
|
||||
function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): NonSharedBuffer;
|
||||
function execFileSync(file: string, options?: ExecFileSyncOptions): string | NonSharedBuffer;
|
||||
function execFileSync(file: string, args: readonly string[]): NonSharedBuffer;
|
||||
function execFileSync(
|
||||
file: string,
|
||||
args: readonly string[],
|
||||
@@ -1536,8 +1464,12 @@ declare module "child_process" {
|
||||
file: string,
|
||||
args: readonly string[],
|
||||
options: ExecFileSyncOptionsWithBufferEncoding,
|
||||
): Buffer;
|
||||
function execFileSync(file: string, args?: readonly string[], options?: ExecFileSyncOptions): string | Buffer;
|
||||
): NonSharedBuffer;
|
||||
function execFileSync(
|
||||
file: string,
|
||||
args?: readonly string[],
|
||||
options?: ExecFileSyncOptions,
|
||||
): string | NonSharedBuffer;
|
||||
}
|
||||
declare module "node:child_process" {
|
||||
export * from "child_process";
|
||||
|
||||
44
backend/node_modules/@types/node/cluster.d.ts
generated
vendored
44
backend/node_modules/@types/node/cluster.d.ts
generated
vendored
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Clusters of Node.js processes can be used to run multiple instances of Node.js
|
||||
* that can distribute workloads among their application threads. When process isolation
|
||||
* is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html)
|
||||
* is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html)
|
||||
* module instead, which allows running multiple application threads within a single Node.js instance.
|
||||
*
|
||||
* The cluster module allows easy creation of child processes that all share
|
||||
@@ -50,7 +50,7 @@
|
||||
* ```
|
||||
*
|
||||
* On Windows, it is not yet possible to set up a named pipe server in a worker.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/cluster.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/cluster.js)
|
||||
*/
|
||||
declare module "cluster" {
|
||||
import * as child from "node:child_process";
|
||||
@@ -72,7 +72,7 @@ declare module "cluster" {
|
||||
* String arguments passed to worker.
|
||||
* @default process.argv.slice(2)
|
||||
*/
|
||||
args?: string[] | undefined;
|
||||
args?: readonly string[] | undefined;
|
||||
/**
|
||||
* Whether or not to send output to parent's stdio.
|
||||
* @default false
|
||||
@@ -80,8 +80,8 @@ declare module "cluster" {
|
||||
silent?: boolean | undefined;
|
||||
/**
|
||||
* Configures the stdio of forked processes. Because the cluster module relies on IPC to function, this configuration must
|
||||
* contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See [`child_prcess.spawn()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processspawncommand-args-options)'s
|
||||
* [`stdio`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#optionsstdio).
|
||||
* contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See [`child_prcess.spawn()`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#child_processspawncommand-args-options)'s
|
||||
* [`stdio`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#optionsstdio).
|
||||
*/
|
||||
stdio?: any[] | undefined;
|
||||
/**
|
||||
@@ -99,7 +99,7 @@ declare module "cluster" {
|
||||
inspectPort?: number | (() => number) | undefined;
|
||||
/**
|
||||
* Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`.
|
||||
* See [Advanced serialization for `child_process`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#advanced-serialization) for more details.
|
||||
* See [Advanced serialization for `child_process`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#advanced-serialization) for more details.
|
||||
* @default false
|
||||
*/
|
||||
serialization?: SerializationType | undefined;
|
||||
@@ -142,10 +142,10 @@ declare module "cluster" {
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* All workers are created using [`child_process.fork()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processforkmodulepath-args-options), the returned object
|
||||
* All workers are created using [`child_process.fork()`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#child_processforkmodulepath-args-options), the returned object
|
||||
* from this function is stored as `.process`. In a worker, the global `process` is stored.
|
||||
*
|
||||
* See: [Child Process module](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processforkmodulepath-args-options).
|
||||
* See: [Child Process module](https://nodejs.org/docs/latest-v24.x/api/child_process.html#child_processforkmodulepath-args-options).
|
||||
*
|
||||
* Workers will call `process.exit(0)` if the `'disconnect'` event occurs
|
||||
* on `process` and `.exitedAfterDisconnect` is not `true`. This protects against
|
||||
@@ -156,7 +156,7 @@ declare module "cluster" {
|
||||
/**
|
||||
* Send a message to a worker or primary, optionally with a handle.
|
||||
*
|
||||
* In the primary, this sends a message to a specific worker. It is identical to [`ChildProcess.send()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#subprocesssendmessage-sendhandle-options-callback).
|
||||
* In the primary, this sends a message to a specific worker. It is identical to [`ChildProcess.send()`](https://nodejs.org/docs/latest-v24.x/api/child_process.html#subprocesssendmessage-sendhandle-options-callback).
|
||||
*
|
||||
* In a worker, this sends a message to the primary. It is identical to `process.send()`.
|
||||
*
|
||||
@@ -198,7 +198,7 @@ declare module "cluster" {
|
||||
* This method is aliased as `worker.destroy()` for backwards compatibility.
|
||||
*
|
||||
* In a worker, `process.kill()` exists, but it is not this function;
|
||||
* it is [`kill()`](https://nodejs.org/docs/latest-v20.x/api/process.html#processkillpid-signal).
|
||||
* it is [`kill()`](https://nodejs.org/docs/latest-v24.x/api/process.html#processkillpid-signal).
|
||||
* @since v0.9.12
|
||||
* @param [signal='SIGTERM'] Name of the kill signal to send to the worker process.
|
||||
*/
|
||||
@@ -231,6 +231,8 @@ declare module "cluster" {
|
||||
* the `'disconnect'` event has not been emitted after some time.
|
||||
*
|
||||
* ```js
|
||||
* import net from 'node:net';
|
||||
*
|
||||
* if (cluster.isPrimary) {
|
||||
* const worker = cluster.fork();
|
||||
* let timeout;
|
||||
@@ -248,7 +250,6 @@ declare module "cluster" {
|
||||
* });
|
||||
*
|
||||
* } else if (cluster.isWorker) {
|
||||
* const net = require('node:net');
|
||||
* const server = net.createServer((socket) => {
|
||||
* // Connections never end
|
||||
* });
|
||||
@@ -265,7 +266,7 @@ declare module "cluster" {
|
||||
* @since v0.7.7
|
||||
* @return A reference to `worker`.
|
||||
*/
|
||||
disconnect(): void;
|
||||
disconnect(): this;
|
||||
/**
|
||||
* This function returns `true` if the worker is connected to its primary via its
|
||||
* IPC channel, `false` otherwise. A worker is connected to its primary after it
|
||||
@@ -411,7 +412,7 @@ declare module "cluster" {
|
||||
readonly isWorker: boolean;
|
||||
/**
|
||||
* The scheduling policy, either `cluster.SCHED_RR` for round-robin or `cluster.SCHED_NONE` to leave it to the operating system. This is a
|
||||
* global setting and effectively frozen once either the first worker is spawned, or [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings)
|
||||
* global setting and effectively frozen once either the first worker is spawned, or [`.setupPrimary()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clustersetupprimarysettings)
|
||||
* is called, whichever comes first.
|
||||
*
|
||||
* `SCHED_RR` is the default on all operating systems except Windows. Windows will change to `SCHED_RR` once libuv is able to effectively distribute
|
||||
@@ -422,24 +423,24 @@ declare module "cluster" {
|
||||
*/
|
||||
schedulingPolicy: number;
|
||||
/**
|
||||
* After calling [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings)
|
||||
* (or [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv)) this settings object will contain
|
||||
* After calling [`.setupPrimary()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clustersetupprimarysettings)
|
||||
* (or [`.fork()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clusterforkenv)) this settings object will contain
|
||||
* the settings, including the default values.
|
||||
*
|
||||
* This object is not intended to be changed or set manually.
|
||||
* @since v0.7.1
|
||||
*/
|
||||
readonly settings: ClusterSettings;
|
||||
/** @deprecated since v16.0.0 - use [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings) instead. */
|
||||
/** @deprecated since v16.0.0 - use [`.setupPrimary()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clustersetupprimarysettings) instead. */
|
||||
setupMaster(settings?: ClusterSettings): void;
|
||||
/**
|
||||
* `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in `cluster.settings`.
|
||||
*
|
||||
* Any settings changes only affect future calls to [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv)
|
||||
* Any settings changes only affect future calls to [`.fork()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clusterforkenv)
|
||||
* and have no effect on workers that are already running.
|
||||
*
|
||||
* The only attribute of a worker that cannot be set via `.setupPrimary()` is the `env` passed to
|
||||
* [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv).
|
||||
* [`.fork()`](https://nodejs.org/docs/latest-v24.x/api/cluster.html#clusterforkenv).
|
||||
*
|
||||
* The defaults above apply to the first call only; the defaults for later calls are the current values at the time of
|
||||
* `cluster.setupPrimary()` is called.
|
||||
@@ -480,7 +481,7 @@ declare module "cluster" {
|
||||
* ```
|
||||
* @since v0.7.0
|
||||
*/
|
||||
readonly worker?: Worker | undefined;
|
||||
readonly worker?: Worker;
|
||||
/**
|
||||
* A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process.
|
||||
*
|
||||
@@ -496,7 +497,7 @@ declare module "cluster" {
|
||||
* ```
|
||||
* @since v0.7.0
|
||||
*/
|
||||
readonly workers?: NodeJS.Dict<Worker> | undefined;
|
||||
readonly workers?: NodeJS.Dict<Worker>;
|
||||
readonly SCHED_NONE: number;
|
||||
readonly SCHED_RR: number;
|
||||
/**
|
||||
@@ -549,10 +550,9 @@ declare module "cluster" {
|
||||
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
prependListener(event: "fork", listener: (worker: Worker) => void): this;
|
||||
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
||||
// the handle is a net.Socket or net.Server object, or undefined.
|
||||
prependListener(
|
||||
event: "message",
|
||||
listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void,
|
||||
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
||||
): this;
|
||||
prependListener(event: "online", listener: (worker: Worker) => void): this;
|
||||
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
||||
|
||||
37
backend/node_modules/@types/node/console.d.ts
generated
vendored
37
backend/node_modules/@types/node/console.d.ts
generated
vendored
@@ -5,12 +5,12 @@
|
||||
* The module exports two specific components:
|
||||
*
|
||||
* * A `Console` class with methods such as `console.log()`, `console.error()`, and `console.warn()` that can be used to write to any Node.js stream.
|
||||
* * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdout) and
|
||||
* [`process.stderr`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstderr). The global `console` can be used without calling `require('node:console')`.
|
||||
* * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdout) and
|
||||
* [`process.stderr`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module.
|
||||
*
|
||||
* _**Warning**_: The global console object's methods are neither consistently
|
||||
* synchronous like the browser APIs they resemble, nor are they consistently
|
||||
* asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v20.x/api/process.html#a-note-on-process-io) for
|
||||
* asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v24.x/api/process.html#a-note-on-process-io) for
|
||||
* more information.
|
||||
*
|
||||
* Example using the global `console`:
|
||||
@@ -54,7 +54,7 @@
|
||||
* myConsole.warn(`Danger ${name}! Danger!`);
|
||||
* // Prints: Danger Will Robinson! Danger!, to err
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/console.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/console.js)
|
||||
*/
|
||||
declare module "console" {
|
||||
import console = require("node:console");
|
||||
@@ -70,7 +70,7 @@ declare module "node:console" {
|
||||
* `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only
|
||||
* writes a message and does not otherwise affect execution. The output always
|
||||
* starts with `"Assertion failed"`. If provided, `message` is formatted using
|
||||
* [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args).
|
||||
* [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args).
|
||||
*
|
||||
* If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens.
|
||||
*
|
||||
@@ -152,7 +152,7 @@ declare module "node:console" {
|
||||
*/
|
||||
debug(message?: any, ...optionalParams: any[]): void;
|
||||
/**
|
||||
* Uses [`util.inspect()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilinspectobject-options) on `obj` and prints the resulting string to `stdout`.
|
||||
* Uses [`util.inspect()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilinspectobject-options) on `obj` and prints the resulting string to `stdout`.
|
||||
* This function bypasses any custom `inspect()` function defined on `obj`.
|
||||
* @since v0.1.101
|
||||
*/
|
||||
@@ -167,7 +167,7 @@ declare module "node:console" {
|
||||
* Prints to `stderr` with newline. Multiple arguments can be passed, with the
|
||||
* first used as the primary message and all additional used as substitution
|
||||
* values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html)
|
||||
* (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args)).
|
||||
* (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)).
|
||||
*
|
||||
* ```js
|
||||
* const code = 5;
|
||||
@@ -178,8 +178,8 @@ declare module "node:console" {
|
||||
* ```
|
||||
*
|
||||
* If formatting elements (e.g. `%d`) are not found in the first string then
|
||||
* [`util.inspect()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilinspectobject-options) is called on each argument and the
|
||||
* resulting string values are concatenated. See [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args)
|
||||
* [`util.inspect()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilinspectobject-options) is called on each argument and the
|
||||
* resulting string values are concatenated. See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)
|
||||
* for more information.
|
||||
* @since v0.1.100
|
||||
*/
|
||||
@@ -211,7 +211,7 @@ declare module "node:console" {
|
||||
* Prints to `stdout` with newline. Multiple arguments can be passed, with the
|
||||
* first used as the primary message and all additional used as substitution
|
||||
* values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html)
|
||||
* (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args)).
|
||||
* (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)).
|
||||
*
|
||||
* ```js
|
||||
* const count = 5;
|
||||
@@ -221,7 +221,7 @@ declare module "node:console" {
|
||||
* // Prints: count: 5, to stdout
|
||||
* ```
|
||||
*
|
||||
* See [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args) for more information.
|
||||
* See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information.
|
||||
* @since v0.1.100
|
||||
*/
|
||||
log(message?: any, ...optionalParams: any[]): void;
|
||||
@@ -297,7 +297,7 @@ declare module "node:console" {
|
||||
*/
|
||||
timeLog(label?: string, ...data: any[]): void;
|
||||
/**
|
||||
* Prints to `stderr` the string `'Trace: '`, followed by the [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args)
|
||||
* Prints to `stderr` the string `'Trace: '`, followed by the [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)
|
||||
* formatted message and stack trace to the current position in the code.
|
||||
*
|
||||
* ```js
|
||||
@@ -361,12 +361,12 @@ declare module "node:console" {
|
||||
* The module exports two specific components:
|
||||
*
|
||||
* * A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream.
|
||||
* * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdout) and
|
||||
* [`process.stderr`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstderr). The global `console` can be used without calling `require('console')`.
|
||||
* * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdout) and
|
||||
* [`process.stderr`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module.
|
||||
*
|
||||
* _**Warning**_: The global console object's methods are neither consistently
|
||||
* synchronous like the browser APIs they resemble, nor are they consistently
|
||||
* asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v20.x/api/process.html#a-note-on-process-io) for
|
||||
* asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v24.x/api/process.html#a-note-on-process-io) for
|
||||
* more information.
|
||||
*
|
||||
* Example using the global `console`:
|
||||
@@ -410,7 +410,7 @@ declare module "node:console" {
|
||||
* myConsole.warn(`Danger ${name}! Danger!`);
|
||||
* // Prints: Danger Will Robinson! Danger!, to err
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.11.1/lib/console.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/console.js)
|
||||
*/
|
||||
namespace console {
|
||||
interface ConsoleConstructorOptions {
|
||||
@@ -431,9 +431,10 @@ declare module "node:console" {
|
||||
colorMode?: boolean | "auto" | undefined;
|
||||
/**
|
||||
* Specifies options that are passed along to
|
||||
* [`util.inspect()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilinspectobject-options).
|
||||
* `util.inspect()`. Can be an options object or, if different options
|
||||
* for stdout and stderr are desired, a `Map` from stream objects to options.
|
||||
*/
|
||||
inspectOptions?: InspectOptions | undefined;
|
||||
inspectOptions?: InspectOptions | ReadonlyMap<NodeJS.WritableStream, InspectOptions> | undefined;
|
||||
/**
|
||||
* Set group indentation.
|
||||
* @default 2
|
||||
|
||||
26
backend/node_modules/@types/node/constants.d.ts
generated
vendored
26
backend/node_modules/@types/node/constants.d.ts
generated
vendored
@@ -1,16 +1,18 @@
|
||||
/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
|
||||
/**
|
||||
* @deprecated The `node:constants` module is deprecated. When requiring access to constants
|
||||
* relevant to specific Node.js builtin modules, developers should instead refer
|
||||
* to the `constants` property exposed by the relevant module. For instance,
|
||||
* `require('node:fs').constants` and `require('node:os').constants`.
|
||||
*/
|
||||
declare module "constants" {
|
||||
import { constants as osConstants, SignalConstants } from "node:os";
|
||||
import { constants as cryptoConstants } from "node:crypto";
|
||||
import { constants as fsConstants } from "node:fs";
|
||||
|
||||
const exp:
|
||||
& typeof osConstants.errno
|
||||
& typeof osConstants.priority
|
||||
& SignalConstants
|
||||
& typeof cryptoConstants
|
||||
& typeof fsConstants;
|
||||
export = exp;
|
||||
const constants:
|
||||
& typeof import("node:os").constants.dlopen
|
||||
& typeof import("node:os").constants.errno
|
||||
& typeof import("node:os").constants.priority
|
||||
& typeof import("node:os").constants.signals
|
||||
& typeof import("node:fs").constants
|
||||
& typeof import("node:crypto").constants;
|
||||
export = constants;
|
||||
}
|
||||
|
||||
declare module "node:constants" {
|
||||
|
||||
1779
backend/node_modules/@types/node/crypto.d.ts
generated
vendored
1779
backend/node_modules/@types/node/crypto.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
36
backend/node_modules/@types/node/dgram.d.ts
generated
vendored
36
backend/node_modules/@types/node/dgram.d.ts
generated
vendored
@@ -23,10 +23,11 @@
|
||||
* server.bind(41234);
|
||||
* // Prints: server listening 0.0.0.0:41234
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/dgram.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/dgram.js)
|
||||
*/
|
||||
declare module "dgram" {
|
||||
import { AddressInfo } from "node:net";
|
||||
import { NonSharedBuffer } from "node:buffer";
|
||||
import { AddressInfo, BlockList } from "node:net";
|
||||
import * as dns from "node:dns";
|
||||
import { Abortable, EventEmitter } from "node:events";
|
||||
interface RemoteInfo {
|
||||
@@ -45,6 +46,7 @@ declare module "dgram" {
|
||||
interface SocketOptions extends Abortable {
|
||||
type: SocketType;
|
||||
reuseAddr?: boolean | undefined;
|
||||
reusePort?: boolean | undefined;
|
||||
/**
|
||||
* @default false
|
||||
*/
|
||||
@@ -58,6 +60,8 @@ declare module "dgram" {
|
||||
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
|
||||
) => void)
|
||||
| undefined;
|
||||
receiveBlockList?: BlockList | undefined;
|
||||
sendBlockList?: BlockList | undefined;
|
||||
}
|
||||
/**
|
||||
* Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram
|
||||
@@ -82,8 +86,8 @@ declare module "dgram" {
|
||||
* @param options Available options are:
|
||||
* @param callback Attached as a listener for `'message'` events. Optional.
|
||||
*/
|
||||
function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
||||
function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
||||
function createSocket(type: SocketType, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket;
|
||||
function createSocket(options: SocketOptions, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket;
|
||||
/**
|
||||
* Encapsulates the datagram functionality.
|
||||
*
|
||||
@@ -352,22 +356,22 @@ declare module "dgram" {
|
||||
* @param callback Called when the message has been sent.
|
||||
*/
|
||||
send(
|
||||
msg: string | Uint8Array | readonly any[],
|
||||
msg: string | NodeJS.ArrayBufferView | readonly any[],
|
||||
port?: number,
|
||||
address?: string,
|
||||
callback?: (error: Error | null, bytes: number) => void,
|
||||
): void;
|
||||
send(
|
||||
msg: string | Uint8Array | readonly any[],
|
||||
msg: string | NodeJS.ArrayBufferView | readonly any[],
|
||||
port?: number,
|
||||
callback?: (error: Error | null, bytes: number) => void,
|
||||
): void;
|
||||
send(
|
||||
msg: string | Uint8Array | readonly any[],
|
||||
msg: string | NodeJS.ArrayBufferView | readonly any[],
|
||||
callback?: (error: Error | null, bytes: number) => void,
|
||||
): void;
|
||||
send(
|
||||
msg: string | Uint8Array,
|
||||
msg: string | NodeJS.ArrayBufferView,
|
||||
offset: number,
|
||||
length: number,
|
||||
port?: number,
|
||||
@@ -375,14 +379,14 @@ declare module "dgram" {
|
||||
callback?: (error: Error | null, bytes: number) => void,
|
||||
): void;
|
||||
send(
|
||||
msg: string | Uint8Array,
|
||||
msg: string | NodeJS.ArrayBufferView,
|
||||
offset: number,
|
||||
length: number,
|
||||
port?: number,
|
||||
callback?: (error: Error | null, bytes: number) => void,
|
||||
): void;
|
||||
send(
|
||||
msg: string | Uint8Array,
|
||||
msg: string | NodeJS.ArrayBufferView,
|
||||
offset: number,
|
||||
length: number,
|
||||
callback?: (error: Error | null, bytes: number) => void,
|
||||
@@ -553,37 +557,37 @@ declare module "dgram" {
|
||||
addListener(event: "connect", listener: () => void): this;
|
||||
addListener(event: "error", listener: (err: Error) => void): this;
|
||||
addListener(event: "listening", listener: () => void): this;
|
||||
addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||
addListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "close"): boolean;
|
||||
emit(event: "connect"): boolean;
|
||||
emit(event: "error", err: Error): boolean;
|
||||
emit(event: "listening"): boolean;
|
||||
emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
|
||||
emit(event: "message", msg: NonSharedBuffer, rinfo: RemoteInfo): boolean;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "close", listener: () => void): this;
|
||||
on(event: "connect", listener: () => void): this;
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
on(event: "listening", listener: () => void): this;
|
||||
on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||
on(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "close", listener: () => void): this;
|
||||
once(event: "connect", listener: () => void): this;
|
||||
once(event: "error", listener: (err: Error) => void): this;
|
||||
once(event: "listening", listener: () => void): this;
|
||||
once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||
once(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "close", listener: () => void): this;
|
||||
prependListener(event: "connect", listener: () => void): this;
|
||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependListener(event: "listening", listener: () => void): this;
|
||||
prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||
prependListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "close", listener: () => void): this;
|
||||
prependOnceListener(event: "connect", listener: () => void): this;
|
||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependOnceListener(event: "listening", listener: () => void): this;
|
||||
prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
||||
prependOnceListener(event: "message", listener: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): this;
|
||||
/**
|
||||
* Calls `socket.close()` and returns a promise that fulfills when the socket has closed.
|
||||
* @since v20.5.0
|
||||
|
||||
58
backend/node_modules/@types/node/diagnostics_channel.d.ts
generated
vendored
58
backend/node_modules/@types/node/diagnostics_channel.d.ts
generated
vendored
@@ -20,7 +20,7 @@
|
||||
* should generally include the module name to avoid collisions with data from
|
||||
* other modules.
|
||||
* @since v15.1.0, v14.17.0
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/diagnostics_channel.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/diagnostics_channel.js)
|
||||
*/
|
||||
declare module "diagnostics_channel" {
|
||||
import { AsyncLocalStorage } from "node:async_hooks";
|
||||
@@ -189,7 +189,6 @@ declare module "diagnostics_channel" {
|
||||
* });
|
||||
* ```
|
||||
* @since v15.1.0, v14.17.0
|
||||
* @deprecated Since v18.7.0,v16.17.0 - Use {@link subscribe(name, onMessage)}
|
||||
* @param onMessage The handler to receive channel messages
|
||||
*/
|
||||
subscribe(onMessage: ChannelListener): void;
|
||||
@@ -210,7 +209,6 @@ declare module "diagnostics_channel" {
|
||||
* channel.unsubscribe(onMessage);
|
||||
* ```
|
||||
* @since v15.1.0, v14.17.0
|
||||
* @deprecated Since v18.7.0,v16.17.0 - Use {@link unsubscribe(name, onMessage)}
|
||||
* @param onMessage The previous subscribed handler to remove
|
||||
* @return `true` if the handler was found, `false` otherwise.
|
||||
*/
|
||||
@@ -259,7 +257,7 @@ declare module "diagnostics_channel" {
|
||||
* @param store The store to unbind from the channel.
|
||||
* @return `true` if the store was found, `false` otherwise.
|
||||
*/
|
||||
unbindStore(store: any): void;
|
||||
unbindStore(store: AsyncLocalStorage<StoreType>): boolean;
|
||||
/**
|
||||
* Applies the given data to any AsyncLocalStorage instances bound to the channel
|
||||
* for the duration of the given function, then publishes to the channel within
|
||||
@@ -297,7 +295,12 @@ declare module "diagnostics_channel" {
|
||||
* @param thisArg The receiver to be used for the function call.
|
||||
* @param args Optional arguments to pass to the function.
|
||||
*/
|
||||
runStores(): void;
|
||||
runStores<ThisArg = any, Args extends any[] = any[], Result = any>(
|
||||
context: ContextType,
|
||||
fn: (this: ThisArg, ...args: Args) => Result,
|
||||
thisArg?: ThisArg,
|
||||
...args: Args
|
||||
): Result;
|
||||
}
|
||||
interface TracingChannelSubscribers<ContextType extends object> {
|
||||
start: (message: ContextType) => void;
|
||||
@@ -441,12 +444,12 @@ declare module "diagnostics_channel" {
|
||||
* @param args Optional arguments to pass to the function
|
||||
* @return The return value of the given function
|
||||
*/
|
||||
traceSync<ThisArg = any, Args extends any[] = any[]>(
|
||||
fn: (this: ThisArg, ...args: Args) => any,
|
||||
traceSync<ThisArg = any, Args extends any[] = any[], Result = any>(
|
||||
fn: (this: ThisArg, ...args: Args) => Result,
|
||||
context?: ContextType,
|
||||
thisArg?: ThisArg,
|
||||
...args: Args
|
||||
): void;
|
||||
): Result;
|
||||
/**
|
||||
* Trace a promise-returning function call. This will always produce a `start event` and `end event` around the synchronous portion of the
|
||||
* function execution, and will produce an `asyncStart event` and `asyncEnd event` when a promise continuation is reached. It may also
|
||||
@@ -476,12 +479,12 @@ declare module "diagnostics_channel" {
|
||||
* @param args Optional arguments to pass to the function
|
||||
* @return Chained from promise returned by the given function
|
||||
*/
|
||||
tracePromise<ThisArg = any, Args extends any[] = any[]>(
|
||||
fn: (this: ThisArg, ...args: Args) => Promise<any>,
|
||||
tracePromise<ThisArg = any, Args extends any[] = any[], Result = any>(
|
||||
fn: (this: ThisArg, ...args: Args) => Promise<Result>,
|
||||
context?: ContextType,
|
||||
thisArg?: ThisArg,
|
||||
...args: Args
|
||||
): void;
|
||||
): Promise<Result>;
|
||||
/**
|
||||
* Trace a callback-receiving function call. This will always produce a `start event` and `end event` around the synchronous portion of the
|
||||
* function execution, and will produce a `asyncStart event` and `asyncEnd event` around the callback execution. It may also produce an `error event` if the given function throws an error or
|
||||
@@ -540,13 +543,32 @@ declare module "diagnostics_channel" {
|
||||
* @param args Optional arguments to pass to the function
|
||||
* @return The return value of the given function
|
||||
*/
|
||||
traceCallback<Fn extends (this: any, ...args: any) => any>(
|
||||
fn: Fn,
|
||||
position: number | undefined,
|
||||
context: ContextType | undefined,
|
||||
thisArg: any,
|
||||
...args: Parameters<Fn>
|
||||
): void;
|
||||
traceCallback<ThisArg = any, Args extends any[] = any[], Result = any>(
|
||||
fn: (this: ThisArg, ...args: Args) => Result,
|
||||
position?: number,
|
||||
context?: ContextType,
|
||||
thisArg?: ThisArg,
|
||||
...args: Args
|
||||
): Result;
|
||||
/**
|
||||
* `true` if any of the individual channels has a subscriber, `false` if not.
|
||||
*
|
||||
* This is a helper method available on a {@link TracingChannel} instance to check
|
||||
* if any of the [TracingChannel Channels](https://nodejs.org/api/diagnostics_channel.html#tracingchannel-channels) have subscribers.
|
||||
* A `true` is returned if any of them have at least one subscriber, a `false` is returned otherwise.
|
||||
*
|
||||
* ```js
|
||||
* const diagnostics_channel = require('node:diagnostics_channel');
|
||||
*
|
||||
* const channels = diagnostics_channel.tracingChannel('my-channel');
|
||||
*
|
||||
* if (channels.hasSubscribers) {
|
||||
* // Do something
|
||||
* }
|
||||
* ```
|
||||
* @since v22.0.0, v20.13.0
|
||||
*/
|
||||
readonly hasSubscribers: boolean;
|
||||
}
|
||||
}
|
||||
declare module "node:diagnostics_channel" {
|
||||
|
||||
145
backend/node_modules/@types/node/dns.d.ts
generated
vendored
145
backend/node_modules/@types/node/dns.d.ts
generated
vendored
@@ -9,7 +9,7 @@
|
||||
* system do, use {@link lookup}.
|
||||
*
|
||||
* ```js
|
||||
* const dns = require('node:dns');
|
||||
* import dns from 'node:dns';
|
||||
*
|
||||
* dns.lookup('example.org', (err, address, family) => {
|
||||
* console.log('address: %j family: IPv%s', address, family);
|
||||
@@ -23,7 +23,7 @@
|
||||
* DNS queries, bypassing other name-resolution facilities.
|
||||
*
|
||||
* ```js
|
||||
* const dns = require('node:dns');
|
||||
* import dns from 'node:dns';
|
||||
*
|
||||
* dns.resolve4('archive.org', (err, addresses) => {
|
||||
* if (err) throw err;
|
||||
@@ -41,8 +41,8 @@
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* See the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) for more information.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/dns.js)
|
||||
* See the [Implementation considerations section](https://nodejs.org/docs/latest-v24.x/api/dns.html#implementation-considerations) for more information.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/dns.js)
|
||||
*/
|
||||
declare module "dns" {
|
||||
import * as dnsPromises from "node:dns/promises";
|
||||
@@ -71,7 +71,7 @@ declare module "dns" {
|
||||
*/
|
||||
family?: number | "IPv4" | "IPv6" | undefined;
|
||||
/**
|
||||
* One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v20.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be
|
||||
* One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v24.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be
|
||||
* passed by bitwise `OR`ing their values.
|
||||
*/
|
||||
hints?: number | undefined;
|
||||
@@ -84,16 +84,17 @@ declare module "dns" {
|
||||
* When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted
|
||||
* by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6
|
||||
* addresses before IPv4 addresses. Default value is configurable using
|
||||
* {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
|
||||
* {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--dns-result-orderorder).
|
||||
* @default `verbatim` (addresses are not reordered)
|
||||
* @since v22.1.0
|
||||
*/
|
||||
order?: "ipv4first" | "ipv6first" | "verbatim" | undefined;
|
||||
/**
|
||||
* When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4
|
||||
* addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified,
|
||||
* `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder}
|
||||
* or [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
|
||||
* @default true (addresses are not reordered)
|
||||
* @deprecated Please use `order` option
|
||||
*/
|
||||
verbatim?: boolean | undefined;
|
||||
}
|
||||
@@ -132,13 +133,13 @@ declare module "dns" {
|
||||
* The implementation uses an operating system facility that can associate names
|
||||
* with addresses and vice versa. This implementation can have subtle but
|
||||
* important consequences on the behavior of any Node.js program. Please take some
|
||||
* time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations)
|
||||
* time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v24.x/api/dns.html#implementation-considerations)
|
||||
* before using `dns.lookup()`.
|
||||
*
|
||||
* Example usage:
|
||||
*
|
||||
* ```js
|
||||
* const dns = require('node:dns');
|
||||
* import dns from 'node:dns';
|
||||
* const options = {
|
||||
* family: 6,
|
||||
* hints: dns.ADDRCONFIG | dns.V4MAPPED,
|
||||
@@ -154,7 +155,7 @@ declare module "dns" {
|
||||
* // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}]
|
||||
* ```
|
||||
*
|
||||
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v20.x/api/util.html#utilpromisifyoriginal) ed
|
||||
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v24.x/api/util.html#utilpromisifyoriginal) ed
|
||||
* version, and `all` is not set to `true`, it returns a `Promise` for an `Object` with `address` and `family` properties.
|
||||
* @since v0.1.90
|
||||
*/
|
||||
@@ -194,18 +195,18 @@ declare module "dns" {
|
||||
* If `address` is not a valid IP address, a `TypeError` will be thrown.
|
||||
* The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown.
|
||||
*
|
||||
* On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object,
|
||||
* On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object,
|
||||
* where `err.code` is the error code.
|
||||
*
|
||||
* ```js
|
||||
* const dns = require('node:dns');
|
||||
* import dns from 'node:dns';
|
||||
* dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
|
||||
* console.log(hostname, service);
|
||||
* // Prints: localhost ssh
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v20.x/api/util.html#utilpromisifyoriginal) ed
|
||||
* If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v24.x/api/util.html#utilpromisifyoriginal) ed
|
||||
* version, it returns a `Promise` for an `Object` with `hostname` and `service` properties.
|
||||
* @since v0.11.14
|
||||
*/
|
||||
@@ -249,6 +250,9 @@ declare module "dns" {
|
||||
contactemail?: string | undefined;
|
||||
contactphone?: string | undefined;
|
||||
}
|
||||
export interface AnyCaaRecord extends CaaRecord {
|
||||
type: "CAA";
|
||||
}
|
||||
export interface MxRecord {
|
||||
priority: number;
|
||||
exchange: string;
|
||||
@@ -288,6 +292,15 @@ declare module "dns" {
|
||||
export interface AnySrvRecord extends SrvRecord {
|
||||
type: "SRV";
|
||||
}
|
||||
export interface TlsaRecord {
|
||||
certUsage: number;
|
||||
selector: number;
|
||||
match: number;
|
||||
data: ArrayBuffer;
|
||||
}
|
||||
export interface AnyTlsaRecord extends TlsaRecord {
|
||||
type: "TLSA";
|
||||
}
|
||||
export interface AnyTxtRecord {
|
||||
type: "TXT";
|
||||
entries: string[];
|
||||
@@ -307,6 +320,7 @@ declare module "dns" {
|
||||
export type AnyRecord =
|
||||
| AnyARecord
|
||||
| AnyAaaaRecord
|
||||
| AnyCaaRecord
|
||||
| AnyCnameRecord
|
||||
| AnyMxRecord
|
||||
| AnyNaptrRecord
|
||||
@@ -314,6 +328,7 @@ declare module "dns" {
|
||||
| AnyPtrRecord
|
||||
| AnySoaRecord
|
||||
| AnySrvRecord
|
||||
| AnyTlsaRecord
|
||||
| AnyTxtRecord;
|
||||
/**
|
||||
* Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
|
||||
@@ -322,7 +337,7 @@ declare module "dns" {
|
||||
*
|
||||
* <omitted>
|
||||
*
|
||||
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object,
|
||||
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object,
|
||||
* where `err.code` is one of the `DNS error codes`.
|
||||
* @since v0.1.27
|
||||
* @param hostname Host name to resolve.
|
||||
@@ -334,12 +349,7 @@ declare module "dns" {
|
||||
): void;
|
||||
export function resolve(
|
||||
hostname: string,
|
||||
rrtype: "A",
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
||||
): void;
|
||||
export function resolve(
|
||||
hostname: string,
|
||||
rrtype: "AAAA",
|
||||
rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR",
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
||||
): void;
|
||||
export function resolve(
|
||||
@@ -349,8 +359,8 @@ declare module "dns" {
|
||||
): void;
|
||||
export function resolve(
|
||||
hostname: string,
|
||||
rrtype: "CNAME",
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
||||
rrtype: "CAA",
|
||||
callback: (err: NodeJS.ErrnoException | null, address: CaaRecord[]) => void,
|
||||
): void;
|
||||
export function resolve(
|
||||
hostname: string,
|
||||
@@ -362,16 +372,6 @@ declare module "dns" {
|
||||
rrtype: "NAPTR",
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
|
||||
): void;
|
||||
export function resolve(
|
||||
hostname: string,
|
||||
rrtype: "NS",
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
||||
): void;
|
||||
export function resolve(
|
||||
hostname: string,
|
||||
rrtype: "PTR",
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
|
||||
): void;
|
||||
export function resolve(
|
||||
hostname: string,
|
||||
rrtype: "SOA",
|
||||
@@ -382,6 +382,11 @@ declare module "dns" {
|
||||
rrtype: "SRV",
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
|
||||
): void;
|
||||
export function resolve(
|
||||
hostname: string,
|
||||
rrtype: "TLSA",
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void,
|
||||
): void;
|
||||
export function resolve(
|
||||
hostname: string,
|
||||
rrtype: "TXT",
|
||||
@@ -392,21 +397,42 @@ declare module "dns" {
|
||||
rrtype: string,
|
||||
callback: (
|
||||
err: NodeJS.ErrnoException | null,
|
||||
addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[],
|
||||
addresses:
|
||||
| string[]
|
||||
| CaaRecord[]
|
||||
| MxRecord[]
|
||||
| NaptrRecord[]
|
||||
| SoaRecord
|
||||
| SrvRecord[]
|
||||
| TlsaRecord[]
|
||||
| string[][]
|
||||
| AnyRecord[],
|
||||
) => void,
|
||||
): void;
|
||||
export namespace resolve {
|
||||
function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
|
||||
function __promisify__(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
||||
function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
||||
function __promisify__(
|
||||
hostname: string,
|
||||
rrtype: string,
|
||||
): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
||||
): Promise<
|
||||
| string[]
|
||||
| CaaRecord[]
|
||||
| MxRecord[]
|
||||
| NaptrRecord[]
|
||||
| SoaRecord
|
||||
| SrvRecord[]
|
||||
| TlsaRecord[]
|
||||
| string[][]
|
||||
| AnyRecord[]
|
||||
>;
|
||||
}
|
||||
/**
|
||||
* Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the `hostname`. The `addresses` argument passed to the `callback` function
|
||||
@@ -608,6 +634,33 @@ declare module "dns" {
|
||||
export namespace resolveSrv {
|
||||
function __promisify__(hostname: string): Promise<SrvRecord[]>;
|
||||
}
|
||||
/**
|
||||
* Uses the DNS protocol to resolve certificate associations (`TLSA` records) for
|
||||
* the `hostname`. The `records` argument passed to the `callback` function is an
|
||||
* array of objects with these properties:
|
||||
*
|
||||
* * `certUsage`
|
||||
* * `selector`
|
||||
* * `match`
|
||||
* * `data`
|
||||
*
|
||||
* ```js
|
||||
* {
|
||||
* certUsage: 3,
|
||||
* selector: 1,
|
||||
* match: 1,
|
||||
* data: [ArrayBuffer]
|
||||
* }
|
||||
* ```
|
||||
* @since v23.9.0, v22.15.0
|
||||
*/
|
||||
export function resolveTlsa(
|
||||
hostname: string,
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void,
|
||||
): void;
|
||||
export namespace resolveTlsa {
|
||||
function __promisify__(hostname: string): Promise<TlsaRecord[]>;
|
||||
}
|
||||
/**
|
||||
* Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. The `records` argument passed to the `callback` function is a
|
||||
* two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
|
||||
@@ -663,8 +716,8 @@ declare module "dns" {
|
||||
* Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
|
||||
* array of host names.
|
||||
*
|
||||
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is
|
||||
* one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes).
|
||||
* On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-error) object, where `err.code` is
|
||||
* one of the [DNS error codes](https://nodejs.org/docs/latest-v24.x/api/dns.html#error-codes).
|
||||
* @since v0.1.16
|
||||
*/
|
||||
export function reverse(
|
||||
@@ -672,7 +725,7 @@ declare module "dns" {
|
||||
callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
|
||||
): void;
|
||||
/**
|
||||
* Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
|
||||
* Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnspromiseslookuphostname-options).
|
||||
* The value could be:
|
||||
*
|
||||
* * `ipv4first`: for `order` defaulting to `ipv4first`.
|
||||
@@ -727,7 +780,7 @@ declare module "dns" {
|
||||
*/
|
||||
export function getServers(): string[];
|
||||
/**
|
||||
* Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
|
||||
* Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnspromiseslookuphostname-options).
|
||||
* The value could be:
|
||||
*
|
||||
* * `ipv4first`: sets default `order` to `ipv4first`.
|
||||
@@ -735,8 +788,8 @@ declare module "dns" {
|
||||
* * `verbatim`: sets default `order` to `verbatim`.
|
||||
*
|
||||
* The default is `verbatim` and {@link setDefaultResultOrder} have higher
|
||||
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder). When using
|
||||
* [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
|
||||
* priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--dns-result-orderorder). When using
|
||||
* [worker threads](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
|
||||
* thread won't affect the default dns orders in workers.
|
||||
* @since v16.4.0, v14.18.0
|
||||
* @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
|
||||
@@ -776,17 +829,22 @@ declare module "dns" {
|
||||
* The number of tries the resolver will try contacting each name server before giving up.
|
||||
* @default 4
|
||||
*/
|
||||
tries?: number;
|
||||
tries?: number | undefined;
|
||||
/**
|
||||
* The max retry timeout, in milliseconds.
|
||||
* @default 0
|
||||
*/
|
||||
maxTimeout?: number | undefined;
|
||||
}
|
||||
/**
|
||||
* An independent resolver for DNS requests.
|
||||
*
|
||||
* Creating a new resolver uses the default server settings. Setting
|
||||
* the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnssetserversservers) does not affect
|
||||
* the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v24.x/api/dns.html#dnssetserversservers) does not affect
|
||||
* other resolvers:
|
||||
*
|
||||
* ```js
|
||||
* const { Resolver } = require('node:dns');
|
||||
* import { Resolver } from 'node:dns';
|
||||
* const resolver = new Resolver();
|
||||
* resolver.setServers(['4.4.4.4']);
|
||||
*
|
||||
@@ -837,6 +895,7 @@ declare module "dns" {
|
||||
resolvePtr: typeof resolvePtr;
|
||||
resolveSoa: typeof resolveSoa;
|
||||
resolveSrv: typeof resolveSrv;
|
||||
resolveTlsa: typeof resolveTlsa;
|
||||
resolveTxt: typeof resolveTxt;
|
||||
reverse: typeof reverse;
|
||||
/**
|
||||
|
||||
55
backend/node_modules/@types/node/dns/promises.d.ts
generated
vendored
55
backend/node_modules/@types/node/dns/promises.d.ts
generated
vendored
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* The `dns.promises` API provides an alternative set of asynchronous DNS methods
|
||||
* that return `Promise` objects rather than using callbacks. The API is accessible
|
||||
* via `require('node:dns').promises` or `require('node:dns/promises')`.
|
||||
* via `import { promises as dnsPromises } from 'node:dns'` or `import dnsPromises from 'node:dns/promises'`.
|
||||
* @since v10.6.0
|
||||
*/
|
||||
declare module "dns/promises" {
|
||||
@@ -20,6 +20,7 @@ declare module "dns/promises" {
|
||||
ResolveWithTtlOptions,
|
||||
SoaRecord,
|
||||
SrvRecord,
|
||||
TlsaRecord,
|
||||
} from "node:dns";
|
||||
/**
|
||||
* Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),
|
||||
@@ -60,7 +61,7 @@ declare module "dns/promises" {
|
||||
* Example usage:
|
||||
*
|
||||
* ```js
|
||||
* const dns = require('node:dns');
|
||||
* import dns from 'node:dns';
|
||||
* const dnsPromises = dns.promises;
|
||||
* const options = {
|
||||
* family: 6,
|
||||
@@ -96,7 +97,7 @@ declare module "dns/promises" {
|
||||
* On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code.
|
||||
*
|
||||
* ```js
|
||||
* const dnsPromises = require('node:dns').promises;
|
||||
* import dnsPromises from 'node:dns';
|
||||
* dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
|
||||
* console.log(result.hostname, result.service);
|
||||
* // Prints: localhost ssh
|
||||
@@ -126,22 +127,26 @@ declare module "dns/promises" {
|
||||
* @param [rrtype='A'] Resource record type.
|
||||
*/
|
||||
function resolve(hostname: string): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
||||
function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
||||
function resolve(
|
||||
hostname: string,
|
||||
rrtype: string,
|
||||
): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
||||
function resolve(hostname: string, rrtype: string): Promise<
|
||||
| string[]
|
||||
| CaaRecord[]
|
||||
| MxRecord[]
|
||||
| NaptrRecord[]
|
||||
| SoaRecord
|
||||
| SrvRecord[]
|
||||
| TlsaRecord[]
|
||||
| string[][]
|
||||
| AnyRecord[]
|
||||
>;
|
||||
/**
|
||||
* Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4
|
||||
* addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
|
||||
@@ -292,6 +297,27 @@ declare module "dns/promises" {
|
||||
* @since v10.6.0
|
||||
*/
|
||||
function resolveSrv(hostname: string): Promise<SrvRecord[]>;
|
||||
/**
|
||||
* Uses the DNS protocol to resolve certificate associations (`TLSA` records) for
|
||||
* the `hostname`. On success, the `Promise` is resolved with an array of objectsAdd commentMore actions
|
||||
* with these properties:
|
||||
*
|
||||
* * `certUsage`
|
||||
* * `selector`
|
||||
* * `match`
|
||||
* * `data`
|
||||
*
|
||||
* ```js
|
||||
* {
|
||||
* certUsage: 3,
|
||||
* selector: 1,
|
||||
* match: 1,
|
||||
* data: [ArrayBuffer]
|
||||
* }
|
||||
* ```
|
||||
* @since v23.9.0, v22.15.0
|
||||
*/
|
||||
function resolveTlsa(hostname: string): Promise<TlsaRecord[]>;
|
||||
/**
|
||||
* Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array
|
||||
* of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
|
||||
@@ -394,8 +420,8 @@ declare module "dns/promises" {
|
||||
* other resolvers:
|
||||
*
|
||||
* ```js
|
||||
* const { Resolver } = require('node:dns').promises;
|
||||
* const resolver = new Resolver();
|
||||
* import { promises } from 'node:dns';
|
||||
* const resolver = new promises.Resolver();
|
||||
* resolver.setServers(['4.4.4.4']);
|
||||
*
|
||||
* // This request will use the server at 4.4.4.4, independent of global settings.
|
||||
@@ -450,6 +476,7 @@ declare module "dns/promises" {
|
||||
resolvePtr: typeof resolvePtr;
|
||||
resolveSoa: typeof resolveSoa;
|
||||
resolveSrv: typeof resolveSrv;
|
||||
resolveTlsa: typeof resolveTlsa;
|
||||
resolveTxt: typeof resolveTxt;
|
||||
reverse: typeof reverse;
|
||||
/**
|
||||
|
||||
124
backend/node_modules/@types/node/dom-events.d.ts
generated
vendored
124
backend/node_modules/@types/node/dom-events.d.ts
generated
vendored
@@ -1,124 +0,0 @@
|
||||
export {}; // Don't export anything!
|
||||
|
||||
//// DOM-like Events
|
||||
// NB: The Event / EventTarget / EventListener implementations below were copied
|
||||
// from lib.dom.d.ts, then edited to reflect Node's documentation at
|
||||
// https://nodejs.org/api/events.html#class-eventtarget.
|
||||
// Please read that link to understand important implementation differences.
|
||||
|
||||
// This conditional type will be the existing global Event in a browser, or
|
||||
// the copy below in a Node environment.
|
||||
type __Event = typeof globalThis extends { onmessage: any; Event: any } ? {}
|
||||
: {
|
||||
/** This is not used in Node.js and is provided purely for completeness. */
|
||||
readonly bubbles: boolean;
|
||||
/** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */
|
||||
cancelBubble: () => void;
|
||||
/** True if the event was created with the cancelable option */
|
||||
readonly cancelable: boolean;
|
||||
/** This is not used in Node.js and is provided purely for completeness. */
|
||||
readonly composed: boolean;
|
||||
/** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */
|
||||
composedPath(): [EventTarget?];
|
||||
/** Alias for event.target. */
|
||||
readonly currentTarget: EventTarget | null;
|
||||
/** Is true if cancelable is true and event.preventDefault() has been called. */
|
||||
readonly defaultPrevented: boolean;
|
||||
/** This is not used in Node.js and is provided purely for completeness. */
|
||||
readonly eventPhase: 0 | 2;
|
||||
/** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */
|
||||
readonly isTrusted: boolean;
|
||||
/** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */
|
||||
preventDefault(): void;
|
||||
/** This is not used in Node.js and is provided purely for completeness. */
|
||||
returnValue: boolean;
|
||||
/** Alias for event.target. */
|
||||
readonly srcElement: EventTarget | null;
|
||||
/** Stops the invocation of event listeners after the current one completes. */
|
||||
stopImmediatePropagation(): void;
|
||||
/** This is not used in Node.js and is provided purely for completeness. */
|
||||
stopPropagation(): void;
|
||||
/** The `EventTarget` dispatching the event */
|
||||
readonly target: EventTarget | null;
|
||||
/** The millisecond timestamp when the Event object was created. */
|
||||
readonly timeStamp: number;
|
||||
/** Returns the type of event, e.g. "click", "hashchange", or "submit". */
|
||||
readonly type: string;
|
||||
};
|
||||
|
||||
// See comment above explaining conditional type
|
||||
type __EventTarget = typeof globalThis extends { onmessage: any; EventTarget: any } ? {}
|
||||
: {
|
||||
/**
|
||||
* Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value.
|
||||
*
|
||||
* If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched.
|
||||
*
|
||||
* The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification.
|
||||
* Specifically, the `capture` option is used as part of the key when registering a `listener`.
|
||||
* Any individual `listener` may be added once with `capture = false`, and once with `capture = true`.
|
||||
*/
|
||||
addEventListener(
|
||||
type: string,
|
||||
listener: EventListener | EventListenerObject,
|
||||
options?: AddEventListenerOptions | boolean,
|
||||
): void;
|
||||
/** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */
|
||||
dispatchEvent(event: Event): boolean;
|
||||
/** Removes the event listener in target's event listener list with the same type, callback, and options. */
|
||||
removeEventListener(
|
||||
type: string,
|
||||
listener: EventListener | EventListenerObject,
|
||||
options?: EventListenerOptions | boolean,
|
||||
): void;
|
||||
};
|
||||
|
||||
interface EventInit {
|
||||
bubbles?: boolean;
|
||||
cancelable?: boolean;
|
||||
composed?: boolean;
|
||||
}
|
||||
|
||||
interface EventListenerOptions {
|
||||
/** Not directly used by Node.js. Added for API completeness. Default: `false`. */
|
||||
capture?: boolean;
|
||||
}
|
||||
|
||||
interface AddEventListenerOptions extends EventListenerOptions {
|
||||
/** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */
|
||||
once?: boolean;
|
||||
/** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */
|
||||
passive?: boolean;
|
||||
/** The listener will be removed when the given AbortSignal object's `abort()` method is called. */
|
||||
signal?: AbortSignal;
|
||||
}
|
||||
|
||||
interface EventListener {
|
||||
(evt: Event): void;
|
||||
}
|
||||
|
||||
interface EventListenerObject {
|
||||
handleEvent(object: Event): void;
|
||||
}
|
||||
|
||||
import {} from "events"; // Make this an ambient declaration
|
||||
declare global {
|
||||
/** An event which takes place in the DOM. */
|
||||
interface Event extends __Event {}
|
||||
var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T
|
||||
: {
|
||||
prototype: __Event;
|
||||
new(type: string, eventInitDict?: EventInit): __Event;
|
||||
};
|
||||
|
||||
/**
|
||||
* EventTarget is a DOM interface implemented by objects that can
|
||||
* receive events and may have listeners for them.
|
||||
*/
|
||||
interface EventTarget extends __EventTarget {}
|
||||
var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T
|
||||
: {
|
||||
prototype: __EventTarget;
|
||||
new(): __EventTarget;
|
||||
};
|
||||
}
|
||||
6
backend/node_modules/@types/node/domain.d.ts
generated
vendored
6
backend/node_modules/@types/node/domain.d.ts
generated
vendored
@@ -12,7 +12,7 @@
|
||||
* will be notified, rather than losing the context of the error in the `process.on('uncaughtException')` handler, or causing the program to
|
||||
* exit immediately with an error code.
|
||||
* @deprecated Since v1.4.2 - Deprecated
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/domain.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/domain.js)
|
||||
*/
|
||||
declare module "domain" {
|
||||
import EventEmitter = require("node:events");
|
||||
@@ -63,8 +63,8 @@ declare module "domain" {
|
||||
* This is the most basic way to use a domain.
|
||||
*
|
||||
* ```js
|
||||
* const domain = require('node:domain');
|
||||
* const fs = require('node:fs');
|
||||
* import domain from 'node:domain';
|
||||
* import fs from 'node:fs';
|
||||
* const d = domain.create();
|
||||
* d.on('error', (er) => {
|
||||
* console.error('Caught error!', er);
|
||||
|
||||
125
backend/node_modules/@types/node/events.d.ts
generated
vendored
125
backend/node_modules/@types/node/events.d.ts
generated
vendored
@@ -32,43 +32,10 @@
|
||||
* });
|
||||
* myEmitter.emit('event');
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/events.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/events.js)
|
||||
*/
|
||||
declare module "events" {
|
||||
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
|
||||
// NOTE: This class is in the docs but is **not actually exported** by Node.
|
||||
// If https://github.com/nodejs/node/issues/39903 gets resolved and Node
|
||||
// actually starts exporting the class, uncomment below.
|
||||
// import { EventListener, EventListenerObject } from '__dom-events';
|
||||
// /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */
|
||||
// interface NodeEventTarget extends EventTarget {
|
||||
// /**
|
||||
// * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API.
|
||||
// * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget.
|
||||
// */
|
||||
// addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this;
|
||||
// /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */
|
||||
// eventNames(): string[];
|
||||
// /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */
|
||||
// listenerCount(type: string): number;
|
||||
// /** Node.js-specific alias for `eventTarget.removeListener()`. */
|
||||
// off(type: string, listener: EventListener | EventListenerObject): this;
|
||||
// /** Node.js-specific alias for `eventTarget.addListener()`. */
|
||||
// on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this;
|
||||
// /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */
|
||||
// once(type: string, listener: EventListener | EventListenerObject): this;
|
||||
// /**
|
||||
// * Node.js-specific extension to the `EventTarget` class.
|
||||
// * If `type` is specified, removes all registered listeners for `type`,
|
||||
// * otherwise removes all registered listeners.
|
||||
// */
|
||||
// removeAllListeners(type: string): this;
|
||||
// /**
|
||||
// * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`.
|
||||
// * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`.
|
||||
// */
|
||||
// removeListener(type: string, listener: EventListener | EventListenerObject): this;
|
||||
// }
|
||||
interface EventEmitterOptions {
|
||||
/**
|
||||
* Enables automatic capturing of promise rejection.
|
||||
@@ -304,12 +271,12 @@ declare module "events" {
|
||||
emitter: NodeJS.EventEmitter,
|
||||
eventName: string | symbol,
|
||||
options?: StaticEventEmitterIteratorOptions,
|
||||
): AsyncIterableIterator<any[]>;
|
||||
): NodeJS.AsyncIterator<any[]>;
|
||||
static on(
|
||||
emitter: EventTarget,
|
||||
eventName: string,
|
||||
options?: StaticEventEmitterIteratorOptions,
|
||||
): AsyncIterableIterator<any[]>;
|
||||
): NodeJS.AsyncIterator<any[]>;
|
||||
/**
|
||||
* A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`.
|
||||
*
|
||||
@@ -396,7 +363,7 @@ declare module "events" {
|
||||
* ```
|
||||
* @since v15.4.0
|
||||
* @param n A non-negative number. The maximum number of listeners per `EventTarget` event.
|
||||
* @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter}
|
||||
* @param eventTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter}
|
||||
* objects.
|
||||
*/
|
||||
static setMaxListeners(n?: number, ...eventTargets: Array<EventTarget | NodeJS.EventEmitter>): void;
|
||||
@@ -431,7 +398,6 @@ declare module "events" {
|
||||
* }
|
||||
* ```
|
||||
* @since v20.5.0
|
||||
* @experimental
|
||||
* @return Disposable that removes the `abort` listener.
|
||||
*/
|
||||
static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
|
||||
@@ -518,7 +484,7 @@ declare module "events" {
|
||||
* directly rather than as a child class.
|
||||
* @default new.target.name if instantiated as a child class.
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -585,6 +551,85 @@ declare module "events" {
|
||||
*/
|
||||
readonly asyncResource: EventEmitterReferencingAsyncResource;
|
||||
}
|
||||
/**
|
||||
* The `NodeEventTarget` is a Node.js-specific extension to `EventTarget`
|
||||
* that emulates a subset of the `EventEmitter` API.
|
||||
* @since v14.5.0
|
||||
*/
|
||||
export interface NodeEventTarget extends EventTarget {
|
||||
/**
|
||||
* Node.js-specific extension to the `EventTarget` class that emulates the
|
||||
* equivalent `EventEmitter` API. The only difference between `addListener()` and
|
||||
* `addEventListener()` is that `addListener()` will return a reference to the
|
||||
* `EventTarget`.
|
||||
* @since v14.5.0
|
||||
*/
|
||||
addListener(type: string, listener: (arg: any) => void): this;
|
||||
/**
|
||||
* Node.js-specific extension to the `EventTarget` class that dispatches the
|
||||
* `arg` to the list of handlers for `type`.
|
||||
* @since v15.2.0
|
||||
* @returns `true` if event listeners registered for the `type` exist,
|
||||
* otherwise `false`.
|
||||
*/
|
||||
emit(type: string, arg: any): boolean;
|
||||
/**
|
||||
* Node.js-specific extension to the `EventTarget` class that returns an array
|
||||
* of event `type` names for which event listeners are registered.
|
||||
* @since 14.5.0
|
||||
*/
|
||||
eventNames(): string[];
|
||||
/**
|
||||
* Node.js-specific extension to the `EventTarget` class that returns the number
|
||||
* of event listeners registered for the `type`.
|
||||
* @since v14.5.0
|
||||
*/
|
||||
listenerCount(type: string): number;
|
||||
/**
|
||||
* Node.js-specific extension to the `EventTarget` class that sets the number
|
||||
* of max event listeners as `n`.
|
||||
* @since v14.5.0
|
||||
*/
|
||||
setMaxListeners(n: number): void;
|
||||
/**
|
||||
* Node.js-specific extension to the `EventTarget` class that returns the number
|
||||
* of max event listeners.
|
||||
* @since v14.5.0
|
||||
*/
|
||||
getMaxListeners(): number;
|
||||
/**
|
||||
* Node.js-specific alias for `eventTarget.removeEventListener()`.
|
||||
* @since v14.5.0
|
||||
*/
|
||||
off(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
|
||||
/**
|
||||
* Node.js-specific alias for `eventTarget.addEventListener()`.
|
||||
* @since v14.5.0
|
||||
*/
|
||||
on(type: string, listener: (arg: any) => void): this;
|
||||
/**
|
||||
* Node.js-specific extension to the `EventTarget` class that adds a `once`
|
||||
* listener for the given event `type`. This is equivalent to calling `on`
|
||||
* with the `once` option set to `true`.
|
||||
* @since v14.5.0
|
||||
*/
|
||||
once(type: string, listener: (arg: any) => void): this;
|
||||
/**
|
||||
* Node.js-specific extension to the `EventTarget` class. If `type` is specified,
|
||||
* removes all registered listeners for `type`, otherwise removes all registered
|
||||
* listeners.
|
||||
* @since v14.5.0
|
||||
*/
|
||||
removeAllListeners(type?: string): this;
|
||||
/**
|
||||
* Node.js-specific extension to the `EventTarget` class that removes the
|
||||
* `listener` for the given `type`. The only difference between `removeListener()`
|
||||
* and `removeEventListener()` is that `removeListener()` will return a reference
|
||||
* to the `EventTarget`.
|
||||
* @since v14.5.0
|
||||
*/
|
||||
removeListener(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
|
||||
}
|
||||
}
|
||||
global {
|
||||
namespace NodeJS {
|
||||
@@ -768,7 +813,7 @@ declare module "events" {
|
||||
setMaxListeners(n: number): this;
|
||||
/**
|
||||
* Returns the current max listener value for the `EventEmitter` which is either
|
||||
* set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}.
|
||||
* set by `emitter.setMaxListeners(n)` or defaults to {@link EventEmitter.defaultMaxListeners}.
|
||||
* @since v1.0.0
|
||||
*/
|
||||
getMaxListeners(): number;
|
||||
|
||||
881
backend/node_modules/@types/node/fs.d.ts
generated
vendored
881
backend/node_modules/@types/node/fs.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
218
backend/node_modules/@types/node/fs/promises.d.ts
generated
vendored
218
backend/node_modules/@types/node/fs/promises.d.ts
generated
vendored
@@ -9,6 +9,7 @@
|
||||
* @since v10.0.0
|
||||
*/
|
||||
declare module "fs/promises" {
|
||||
import { NonSharedBuffer } from "node:buffer";
|
||||
import { Abortable } from "node:events";
|
||||
import { Stream } from "node:stream";
|
||||
import { ReadableStream } from "node:stream/web";
|
||||
@@ -20,12 +21,20 @@ declare module "fs/promises" {
|
||||
CopyOptions,
|
||||
Dir,
|
||||
Dirent,
|
||||
DisposableTempDir,
|
||||
EncodingOption,
|
||||
GlobOptions,
|
||||
GlobOptionsWithFileTypes,
|
||||
GlobOptionsWithoutFileTypes,
|
||||
MakeDirectoryOptions,
|
||||
Mode,
|
||||
ObjectEncodingOptions,
|
||||
OpenDirOptions,
|
||||
OpenMode,
|
||||
PathLike,
|
||||
ReadOptions,
|
||||
ReadOptionsWithBuffer,
|
||||
ReadPosition,
|
||||
ReadStream,
|
||||
ReadVResult,
|
||||
RmDirOptions,
|
||||
@@ -36,7 +45,7 @@ declare module "fs/promises" {
|
||||
StatsFs,
|
||||
TimeLike,
|
||||
WatchEventType,
|
||||
WatchOptions,
|
||||
WatchOptions as _WatchOptions,
|
||||
WriteStream,
|
||||
WriteVResult,
|
||||
} from "node:fs";
|
||||
@@ -53,6 +62,7 @@ declare module "fs/promises" {
|
||||
bytesRead: number;
|
||||
buffer: T;
|
||||
}
|
||||
/** @deprecated This interface will be removed in a future version. Use `import { ReadOptionsWithBuffer } from "node:fs"` instead. */
|
||||
interface FileReadOptions<T extends NodeJS.ArrayBufferView = Buffer> {
|
||||
/**
|
||||
* @default `Buffer.alloc(0xffff)`
|
||||
@@ -66,9 +76,9 @@ declare module "fs/promises" {
|
||||
* @default `buffer.byteLength`
|
||||
*/
|
||||
length?: number | null;
|
||||
position?: number | null;
|
||||
position?: ReadPosition | null;
|
||||
}
|
||||
interface CreateReadStreamOptions {
|
||||
interface CreateReadStreamOptions extends Abortable {
|
||||
encoding?: BufferEncoding | null | undefined;
|
||||
autoClose?: boolean | undefined;
|
||||
emitClose?: boolean | undefined;
|
||||
@@ -85,11 +95,7 @@ declare module "fs/promises" {
|
||||
flush?: boolean | undefined;
|
||||
}
|
||||
interface ReadableWebStreamOptions {
|
||||
/**
|
||||
* Whether to open a normal or a `'bytes'` stream.
|
||||
* @since v20.0.0
|
||||
*/
|
||||
type?: "bytes" | undefined;
|
||||
autoClose?: boolean | undefined;
|
||||
}
|
||||
// TODO: Add `EventEmitter` close
|
||||
interface FileHandle {
|
||||
@@ -109,7 +115,7 @@ declare module "fs/promises" {
|
||||
appendFile(
|
||||
data: string | Uint8Array,
|
||||
options?:
|
||||
| (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined })
|
||||
| (ObjectEncodingOptions & Abortable)
|
||||
| BufferEncoding
|
||||
| null,
|
||||
): Promise<void>;
|
||||
@@ -233,11 +239,18 @@ declare module "fs/promises" {
|
||||
buffer: T,
|
||||
offset?: number | null,
|
||||
length?: number | null,
|
||||
position?: number | null,
|
||||
position?: ReadPosition | null,
|
||||
): Promise<FileReadResult<T>>;
|
||||
read<T extends NodeJS.ArrayBufferView>(
|
||||
buffer: T,
|
||||
options?: ReadOptions,
|
||||
): Promise<FileReadResult<T>>;
|
||||
read<T extends NodeJS.ArrayBufferView = NonSharedBuffer>(
|
||||
options?: ReadOptionsWithBuffer<T>,
|
||||
): Promise<FileReadResult<T>>;
|
||||
read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
|
||||
/**
|
||||
* Returns a `ReadableStream` that may be used to read the files data.
|
||||
* Returns a byte-oriented `ReadableStream` that may be used to read the file's
|
||||
* contents.
|
||||
*
|
||||
* An error will be thrown if this method is called more than once or is called
|
||||
* after the `FileHandle` is closed or closing.
|
||||
@@ -258,7 +271,6 @@ declare module "fs/promises" {
|
||||
* While the `ReadableStream` will read the file to completion, it will not
|
||||
* close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method.
|
||||
* @since v17.0.0
|
||||
* @experimental
|
||||
*/
|
||||
readableWebStream(options?: ReadableWebStreamOptions): ReadableStream;
|
||||
/**
|
||||
@@ -276,39 +288,29 @@ declare module "fs/promises" {
|
||||
* data will be a string.
|
||||
*/
|
||||
readFile(
|
||||
options?: {
|
||||
encoding?: null | undefined;
|
||||
flag?: OpenMode | undefined;
|
||||
} | null,
|
||||
): Promise<Buffer>;
|
||||
options?:
|
||||
| ({ encoding?: null | undefined } & Abortable)
|
||||
| null,
|
||||
): Promise<NonSharedBuffer>;
|
||||
/**
|
||||
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
||||
* The `FileHandle` must have been opened for reading.
|
||||
* @param options An object that may contain an optional flag.
|
||||
* If a flag is not provided, it defaults to `'r'`.
|
||||
*/
|
||||
readFile(
|
||||
options:
|
||||
| {
|
||||
encoding: BufferEncoding;
|
||||
flag?: OpenMode | undefined;
|
||||
}
|
||||
| ({ encoding: BufferEncoding } & Abortable)
|
||||
| BufferEncoding,
|
||||
): Promise<string>;
|
||||
/**
|
||||
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
||||
* The `FileHandle` must have been opened for reading.
|
||||
* @param options An object that may contain an optional flag.
|
||||
* If a flag is not provided, it defaults to `'r'`.
|
||||
*/
|
||||
readFile(
|
||||
options?:
|
||||
| (ObjectEncodingOptions & {
|
||||
flag?: OpenMode | undefined;
|
||||
})
|
||||
| (ObjectEncodingOptions & Abortable)
|
||||
| BufferEncoding
|
||||
| null,
|
||||
): Promise<string | Buffer>;
|
||||
): Promise<string | NonSharedBuffer>;
|
||||
/**
|
||||
* Convenience method to create a `readline` interface and stream over the file.
|
||||
* See `filehandle.createReadStream()` for the options.
|
||||
@@ -395,7 +397,7 @@ declare module "fs/promises" {
|
||||
writeFile(
|
||||
data: string | Uint8Array,
|
||||
options?:
|
||||
| (ObjectEncodingOptions & FlagAndOpenMode & Abortable & { flush?: boolean | undefined })
|
||||
| (ObjectEncodingOptions & Abortable)
|
||||
| BufferEncoding
|
||||
| null,
|
||||
): Promise<void>;
|
||||
@@ -417,7 +419,7 @@ declare module "fs/promises" {
|
||||
* @param [position='null'] The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current
|
||||
* position. See the POSIX pwrite(2) documentation for more detail.
|
||||
*/
|
||||
write<TBuffer extends Uint8Array>(
|
||||
write<TBuffer extends NodeJS.ArrayBufferView>(
|
||||
buffer: TBuffer,
|
||||
offset?: number | null,
|
||||
length?: number | null,
|
||||
@@ -426,6 +428,13 @@ declare module "fs/promises" {
|
||||
bytesWritten: number;
|
||||
buffer: TBuffer;
|
||||
}>;
|
||||
write<TBuffer extends Uint8Array>(
|
||||
buffer: TBuffer,
|
||||
options?: { offset?: number; length?: number; position?: number },
|
||||
): Promise<{
|
||||
bytesWritten: number;
|
||||
buffer: TBuffer;
|
||||
}>;
|
||||
write(
|
||||
data: string,
|
||||
position?: number | null,
|
||||
@@ -449,14 +458,20 @@ declare module "fs/promises" {
|
||||
* @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current
|
||||
* position.
|
||||
*/
|
||||
writev(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise<WriteVResult>;
|
||||
writev<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
||||
buffers: TBuffers,
|
||||
position?: number,
|
||||
): Promise<WriteVResult<TBuffers>>;
|
||||
/**
|
||||
* Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s
|
||||
* @since v13.13.0, v12.17.0
|
||||
* @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.
|
||||
* @return Fulfills upon success an object containing two properties:
|
||||
*/
|
||||
readv(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise<ReadVResult>;
|
||||
readv<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
||||
buffers: TBuffers,
|
||||
position?: number,
|
||||
): Promise<ReadVResult<TBuffers>>;
|
||||
/**
|
||||
* Closes the file handle after waiting for any pending operation on the handle to
|
||||
* complete.
|
||||
@@ -476,8 +491,9 @@ declare module "fs/promises" {
|
||||
*/
|
||||
close(): Promise<void>;
|
||||
/**
|
||||
* An alias for {@link FileHandle.close()}.
|
||||
* @since v20.4.0
|
||||
* Calls `filehandle.close()` and returns a promise that fulfills when the
|
||||
* filehandle is closed.
|
||||
* @since v20.4.0, v18.8.0
|
||||
*/
|
||||
[Symbol.asyncDispose](): Promise<void>;
|
||||
}
|
||||
@@ -692,7 +708,7 @@ declare module "fs/promises" {
|
||||
recursive?: boolean | undefined;
|
||||
}
|
||||
| "buffer",
|
||||
): Promise<Buffer[]>;
|
||||
): Promise<NonSharedBuffer[]>;
|
||||
/**
|
||||
* Asynchronous readdir(3) - read a directory.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
@@ -707,7 +723,7 @@ declare module "fs/promises" {
|
||||
})
|
||||
| BufferEncoding
|
||||
| null,
|
||||
): Promise<string[] | Buffer[]>;
|
||||
): Promise<string[] | NonSharedBuffer[]>;
|
||||
/**
|
||||
* Asynchronous readdir(3) - read a directory.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
@@ -720,6 +736,19 @@ declare module "fs/promises" {
|
||||
recursive?: boolean | undefined;
|
||||
},
|
||||
): Promise<Dirent[]>;
|
||||
/**
|
||||
* Asynchronous readdir(3) - read a directory.
|
||||
* @param path A path to a directory. If a URL is provided, it must use the `file:` protocol.
|
||||
* @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
|
||||
*/
|
||||
function readdir(
|
||||
path: PathLike,
|
||||
options: {
|
||||
encoding: "buffer";
|
||||
withFileTypes: true;
|
||||
recursive?: boolean | undefined;
|
||||
},
|
||||
): Promise<Dirent<NonSharedBuffer>[]>;
|
||||
/**
|
||||
* Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is
|
||||
* fulfilled with the`linkString` upon success.
|
||||
@@ -737,13 +766,16 @@ declare module "fs/promises" {
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
||||
*/
|
||||
function readlink(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
|
||||
function readlink(path: PathLike, options: BufferEncodingOption): Promise<NonSharedBuffer>;
|
||||
/**
|
||||
* Asynchronous readlink(2) - read value of a symbolic link.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
||||
*/
|
||||
function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise<string | Buffer>;
|
||||
function readlink(
|
||||
path: PathLike,
|
||||
options?: ObjectEncodingOptions | string | null,
|
||||
): Promise<string | NonSharedBuffer>;
|
||||
/**
|
||||
* Creates a symbolic link.
|
||||
*
|
||||
@@ -894,7 +926,7 @@ declare module "fs/promises" {
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
||||
*/
|
||||
function realpath(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
|
||||
function realpath(path: PathLike, options: BufferEncodingOption): Promise<NonSharedBuffer>;
|
||||
/**
|
||||
* Asynchronous realpath(3) - return the canonicalized absolute pathname.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
@@ -903,7 +935,7 @@ declare module "fs/promises" {
|
||||
function realpath(
|
||||
path: PathLike,
|
||||
options?: ObjectEncodingOptions | BufferEncoding | null,
|
||||
): Promise<string | Buffer>;
|
||||
): Promise<string | NonSharedBuffer>;
|
||||
/**
|
||||
* Creates a unique temporary directory. A unique directory name is generated by
|
||||
* appending six random characters to the end of the provided `prefix`. Due to
|
||||
@@ -929,7 +961,7 @@ declare module "fs/promises" {
|
||||
* The `fsPromises.mkdtemp()` method will append the six randomly selected
|
||||
* characters directly to the `prefix` string. For instance, given a directory `/tmp`, if the intention is to create a temporary directory _within_ `/tmp`, the `prefix` must end with a trailing
|
||||
* platform-specific path separator
|
||||
* (`require('node:path').sep`).
|
||||
* (`import { sep } from 'node:path'`).
|
||||
* @since v10.0.0
|
||||
* @return Fulfills with a string containing the file system path of the newly created temporary directory.
|
||||
*/
|
||||
@@ -939,13 +971,36 @@ declare module "fs/promises" {
|
||||
* Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
|
||||
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
||||
*/
|
||||
function mkdtemp(prefix: string, options: BufferEncodingOption): Promise<Buffer>;
|
||||
function mkdtemp(prefix: string, options: BufferEncodingOption): Promise<NonSharedBuffer>;
|
||||
/**
|
||||
* Asynchronously creates a unique temporary directory.
|
||||
* Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
|
||||
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
||||
*/
|
||||
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
||||
function mkdtemp(
|
||||
prefix: string,
|
||||
options?: ObjectEncodingOptions | BufferEncoding | null,
|
||||
): Promise<string | NonSharedBuffer>;
|
||||
/**
|
||||
* The resulting Promise holds an async-disposable object whose `path` property
|
||||
* holds the created directory path. When the object is disposed, the directory
|
||||
* and its contents will be removed asynchronously if it still exists. If the
|
||||
* directory cannot be deleted, disposal will throw an error. The object has an
|
||||
* async `remove()` method which will perform the same task.
|
||||
*
|
||||
* Both this function and the disposal function on the resulting object are
|
||||
* async, so it should be used with `await` + `await using` as in
|
||||
* `await using dir = await fsPromises.mkdtempDisposable('prefix')`.
|
||||
*
|
||||
* <!-- TODO: link MDN docs for disposables once https://github.com/mdn/content/pull/38027 lands -->
|
||||
*
|
||||
* For detailed information, see the documentation of `fsPromises.mkdtemp()`.
|
||||
*
|
||||
* The optional `options` argument can be a string specifying an encoding, or an
|
||||
* object with an `encoding` property specifying the character encoding to use.
|
||||
* @since v24.4.0
|
||||
*/
|
||||
function mkdtempDisposable(prefix: PathLike, options?: EncodingOption): Promise<DisposableTempDir>;
|
||||
/**
|
||||
* Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an
|
||||
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an
|
||||
@@ -1101,7 +1156,7 @@ declare module "fs/promises" {
|
||||
flag?: OpenMode | undefined;
|
||||
} & Abortable)
|
||||
| null,
|
||||
): Promise<Buffer>;
|
||||
): Promise<NonSharedBuffer>;
|
||||
/**
|
||||
* Asynchronously reads the entire contents of a file.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
@@ -1137,7 +1192,7 @@ declare module "fs/promises" {
|
||||
)
|
||||
| BufferEncoding
|
||||
| null,
|
||||
): Promise<string | Buffer>;
|
||||
): Promise<string | NonSharedBuffer>;
|
||||
/**
|
||||
* Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail.
|
||||
*
|
||||
@@ -1167,11 +1222,21 @@ declare module "fs/promises" {
|
||||
* @return Fulfills with an {fs.Dir}.
|
||||
*/
|
||||
function opendir(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
|
||||
interface WatchOptions extends _WatchOptions {
|
||||
maxQueue?: number | undefined;
|
||||
overflow?: "ignore" | "throw" | undefined;
|
||||
}
|
||||
interface WatchOptionsWithBufferEncoding extends WatchOptions {
|
||||
encoding: "buffer";
|
||||
}
|
||||
interface WatchOptionsWithStringEncoding extends WatchOptions {
|
||||
encoding?: BufferEncoding | undefined;
|
||||
}
|
||||
/**
|
||||
* Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
|
||||
*
|
||||
* ```js
|
||||
* const { watch } = require('node:fs/promises');
|
||||
* import { watch } from 'node:fs/promises';
|
||||
*
|
||||
* const ac = new AbortController();
|
||||
* const { signal } = ac;
|
||||
@@ -1199,33 +1264,16 @@ declare module "fs/promises" {
|
||||
*/
|
||||
function watch(
|
||||
filename: PathLike,
|
||||
options:
|
||||
| (WatchOptions & {
|
||||
encoding: "buffer";
|
||||
})
|
||||
| "buffer",
|
||||
): AsyncIterable<FileChangeInfo<Buffer>>;
|
||||
/**
|
||||
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
||||
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
||||
* @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
|
||||
* If `encoding` is not supplied, the default of `'utf8'` is used.
|
||||
* If `persistent` is not supplied, the default of `true` is used.
|
||||
* If `recursive` is not supplied, the default of `false` is used.
|
||||
*/
|
||||
function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable<FileChangeInfo<string>>;
|
||||
/**
|
||||
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
||||
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
||||
* @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
|
||||
* If `encoding` is not supplied, the default of `'utf8'` is used.
|
||||
* If `persistent` is not supplied, the default of `true` is used.
|
||||
* If `recursive` is not supplied, the default of `false` is used.
|
||||
*/
|
||||
options?: WatchOptionsWithStringEncoding | BufferEncoding,
|
||||
): NodeJS.AsyncIterator<FileChangeInfo<string>>;
|
||||
function watch(
|
||||
filename: PathLike,
|
||||
options: WatchOptions | string,
|
||||
): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
|
||||
options: WatchOptionsWithBufferEncoding | "buffer",
|
||||
): NodeJS.AsyncIterator<FileChangeInfo<NonSharedBuffer>>;
|
||||
function watch(
|
||||
filename: PathLike,
|
||||
options: WatchOptions | BufferEncoding | "buffer",
|
||||
): NodeJS.AsyncIterator<FileChangeInfo<string | NonSharedBuffer>>;
|
||||
/**
|
||||
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
||||
* including subdirectories and files.
|
||||
@@ -1239,6 +1287,30 @@ declare module "fs/promises" {
|
||||
* @return Fulfills with `undefined` upon success.
|
||||
*/
|
||||
function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
|
||||
/**
|
||||
* ```js
|
||||
* import { glob } from 'node:fs/promises';
|
||||
*
|
||||
* for await (const entry of glob('*.js'))
|
||||
* console.log(entry);
|
||||
* ```
|
||||
* @since v22.0.0
|
||||
* @returns An AsyncIterator that yields the paths of files
|
||||
* that match the pattern.
|
||||
*/
|
||||
function glob(pattern: string | readonly string[]): NodeJS.AsyncIterator<string>;
|
||||
function glob(
|
||||
pattern: string | readonly string[],
|
||||
options: GlobOptionsWithFileTypes,
|
||||
): NodeJS.AsyncIterator<Dirent>;
|
||||
function glob(
|
||||
pattern: string | readonly string[],
|
||||
options: GlobOptionsWithoutFileTypes,
|
||||
): NodeJS.AsyncIterator<string>;
|
||||
function glob(
|
||||
pattern: string | readonly string[],
|
||||
options: GlobOptions,
|
||||
): NodeJS.AsyncIterator<Dirent | string>;
|
||||
}
|
||||
declare module "node:fs/promises" {
|
||||
export * from "fs/promises";
|
||||
|
||||
548
backend/node_modules/@types/node/globals.d.ts
generated
vendored
548
backend/node_modules/@types/node/globals.d.ts
generated
vendored
@@ -1,412 +1,170 @@
|
||||
export {}; // Make this a module
|
||||
declare var global: typeof globalThis;
|
||||
|
||||
// #region Fetch and friends
|
||||
// Conditional type aliases, used at the end of this file.
|
||||
// Will either be empty if lib-dom is included, or the undici version otherwise.
|
||||
type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request;
|
||||
type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response;
|
||||
type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData;
|
||||
type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers;
|
||||
type _RequestInit = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("undici-types").RequestInit;
|
||||
type _ResponseInit = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("undici-types").ResponseInit;
|
||||
type _File = typeof globalThis extends { onmessage: any } ? {} : import("node:buffer").File;
|
||||
// #endregion Fetch and friends
|
||||
|
||||
declare global {
|
||||
// Declare "static" methods in Error
|
||||
interface ErrorConstructor {
|
||||
/** Create .stack property on a target object */
|
||||
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
||||
|
||||
/**
|
||||
* Optional override for formatting stack traces
|
||||
*
|
||||
* @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
||||
*/
|
||||
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
||||
|
||||
stackTraceLimit: number;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------*
|
||||
* *
|
||||
* GLOBAL *
|
||||
* *
|
||||
------------------------------------------------*/
|
||||
|
||||
// For backwards compability
|
||||
interface NodeRequire extends NodeJS.Require {}
|
||||
interface RequireResolve extends NodeJS.RequireResolve {}
|
||||
interface NodeModule extends NodeJS.Module {}
|
||||
|
||||
var process: NodeJS.Process;
|
||||
var console: Console;
|
||||
|
||||
var __filename: string;
|
||||
var __dirname: string;
|
||||
|
||||
var require: NodeRequire;
|
||||
var module: NodeModule;
|
||||
|
||||
// Same as module.exports
|
||||
var exports: any;
|
||||
declare var process: NodeJS.Process;
|
||||
declare var console: Console;
|
||||
|
||||
interface ErrorConstructor {
|
||||
/**
|
||||
* Only available if `--expose-gc` is passed to the process.
|
||||
*/
|
||||
var gc: undefined | (() => void);
|
||||
|
||||
// #region borrowed
|
||||
// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib
|
||||
/** A controller object that allows you to abort one or more DOM requests as and when desired. */
|
||||
interface AbortController {
|
||||
/**
|
||||
* Returns the AbortSignal object associated with this object.
|
||||
*/
|
||||
|
||||
readonly signal: AbortSignal;
|
||||
/**
|
||||
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
|
||||
*/
|
||||
abort(reason?: any): void;
|
||||
}
|
||||
|
||||
/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
|
||||
interface AbortSignal extends EventTarget {
|
||||
/**
|
||||
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
||||
*/
|
||||
readonly aborted: boolean;
|
||||
readonly reason: any;
|
||||
onabort: null | ((this: AbortSignal, event: Event) => any);
|
||||
throwIfAborted(): void;
|
||||
}
|
||||
|
||||
var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
|
||||
: {
|
||||
prototype: AbortController;
|
||||
new(): AbortController;
|
||||
};
|
||||
|
||||
var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
|
||||
: {
|
||||
prototype: AbortSignal;
|
||||
new(): AbortSignal;
|
||||
abort(reason?: any): AbortSignal;
|
||||
timeout(milliseconds: number): AbortSignal;
|
||||
any(signals: AbortSignal[]): AbortSignal;
|
||||
};
|
||||
// #endregion borrowed
|
||||
|
||||
// #region Disposable
|
||||
interface SymbolConstructor {
|
||||
/**
|
||||
* A method that is used to release resources held by an object. Called by the semantics of the `using` statement.
|
||||
*/
|
||||
readonly dispose: unique symbol;
|
||||
|
||||
/**
|
||||
* A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement.
|
||||
*/
|
||||
readonly asyncDispose: unique symbol;
|
||||
}
|
||||
|
||||
interface Disposable {
|
||||
[Symbol.dispose](): void;
|
||||
}
|
||||
|
||||
interface AsyncDisposable {
|
||||
[Symbol.asyncDispose](): PromiseLike<void>;
|
||||
}
|
||||
// #endregion Disposable
|
||||
|
||||
// #region ArrayLike.at()
|
||||
interface RelativeIndexable<T> {
|
||||
/**
|
||||
* Takes an integer value and returns the item at that index,
|
||||
* allowing for positive and negative integers.
|
||||
* Negative integers count back from the last item in the array.
|
||||
*/
|
||||
at(index: number): T | undefined;
|
||||
}
|
||||
interface String extends RelativeIndexable<string> {}
|
||||
interface Array<T> extends RelativeIndexable<T> {}
|
||||
interface ReadonlyArray<T> extends RelativeIndexable<T> {}
|
||||
interface Int8Array extends RelativeIndexable<number> {}
|
||||
interface Uint8Array extends RelativeIndexable<number> {}
|
||||
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
||||
interface Int16Array extends RelativeIndexable<number> {}
|
||||
interface Uint16Array extends RelativeIndexable<number> {}
|
||||
interface Int32Array extends RelativeIndexable<number> {}
|
||||
interface Uint32Array extends RelativeIndexable<number> {}
|
||||
interface Float32Array extends RelativeIndexable<number> {}
|
||||
interface Float64Array extends RelativeIndexable<number> {}
|
||||
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
||||
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
||||
// #endregion ArrayLike.at() end
|
||||
|
||||
/**
|
||||
* @since v17.0.0
|
||||
* Creates a `.stack` property on `targetObject`, which when accessed returns
|
||||
* a string representing the location in the code at which
|
||||
* `Error.captureStackTrace()` was called.
|
||||
*
|
||||
* Creates a deep clone of an object.
|
||||
* ```js
|
||||
* const myObject = {};
|
||||
* Error.captureStackTrace(myObject);
|
||||
* myObject.stack; // Similar to `new Error().stack`
|
||||
* ```
|
||||
*
|
||||
* The first line of the trace will be prefixed with
|
||||
* `${myObject.name}: ${myObject.message}`.
|
||||
*
|
||||
* The optional `constructorOpt` argument accepts a function. If given, all frames
|
||||
* above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
||||
* generated stack trace.
|
||||
*
|
||||
* The `constructorOpt` argument is useful for hiding implementation
|
||||
* details of error generation from the user. For instance:
|
||||
*
|
||||
* ```js
|
||||
* function a() {
|
||||
* b();
|
||||
* }
|
||||
*
|
||||
* function b() {
|
||||
* c();
|
||||
* }
|
||||
*
|
||||
* function c() {
|
||||
* // Create an error without stack trace to avoid calculating the stack trace twice.
|
||||
* const { stackTraceLimit } = Error;
|
||||
* Error.stackTraceLimit = 0;
|
||||
* const error = new Error();
|
||||
* Error.stackTraceLimit = stackTraceLimit;
|
||||
*
|
||||
* // Capture the stack trace above function b
|
||||
* Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
||||
* throw error;
|
||||
* }
|
||||
*
|
||||
* a();
|
||||
* ```
|
||||
*/
|
||||
function structuredClone<T>(
|
||||
value: T,
|
||||
transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
|
||||
): T;
|
||||
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
||||
/**
|
||||
* @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
||||
*/
|
||||
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
||||
/**
|
||||
* The `Error.stackTraceLimit` property specifies the number of stack frames
|
||||
* collected by a stack trace (whether generated by `new Error().stack` or
|
||||
* `Error.captureStackTrace(obj)`).
|
||||
*
|
||||
* The default value is `10` but may be set to any valid JavaScript number. Changes
|
||||
* will affect any stack trace captured _after_ the value has been changed.
|
||||
*
|
||||
* If set to a non-number value, or set to a negative number, stack traces will
|
||||
* not capture any frames.
|
||||
*/
|
||||
stackTraceLimit: number;
|
||||
}
|
||||
|
||||
/*----------------------------------------------*
|
||||
* *
|
||||
* GLOBAL INTERFACES *
|
||||
* *
|
||||
*-----------------------------------------------*/
|
||||
namespace NodeJS {
|
||||
interface CallSite {
|
||||
/**
|
||||
* Value of "this"
|
||||
*/
|
||||
getThis(): unknown;
|
||||
/**
|
||||
* Enable this API with the `--expose-gc` CLI flag.
|
||||
*/
|
||||
declare var gc: NodeJS.GCFunction | undefined;
|
||||
|
||||
/**
|
||||
* Type of "this" as a string.
|
||||
* This is the name of the function stored in the constructor field of
|
||||
* "this", if available. Otherwise the object's [[Class]] internal
|
||||
* property.
|
||||
*/
|
||||
getTypeName(): string | null;
|
||||
|
||||
/**
|
||||
* Current function
|
||||
*/
|
||||
getFunction(): Function | undefined;
|
||||
|
||||
/**
|
||||
* Name of the current function, typically its name property.
|
||||
* If a name property is not available an attempt will be made to try
|
||||
* to infer a name from the function's context.
|
||||
*/
|
||||
getFunctionName(): string | null;
|
||||
|
||||
/**
|
||||
* Name of the property [of "this" or one of its prototypes] that holds
|
||||
* the current function
|
||||
*/
|
||||
getMethodName(): string | null;
|
||||
|
||||
/**
|
||||
* Name of the script [if this function was defined in a script]
|
||||
*/
|
||||
getFileName(): string | undefined;
|
||||
|
||||
/**
|
||||
* Current line number [if this function was defined in a script]
|
||||
*/
|
||||
getLineNumber(): number | null;
|
||||
|
||||
/**
|
||||
* Current column number [if this function was defined in a script]
|
||||
*/
|
||||
getColumnNumber(): number | null;
|
||||
|
||||
/**
|
||||
* A call site object representing the location where eval was called
|
||||
* [if this function was created using a call to eval]
|
||||
*/
|
||||
getEvalOrigin(): string | undefined;
|
||||
|
||||
/**
|
||||
* Is this a toplevel invocation, that is, is "this" the global object?
|
||||
*/
|
||||
isToplevel(): boolean;
|
||||
|
||||
/**
|
||||
* Does this call take place in code defined by a call to eval?
|
||||
*/
|
||||
isEval(): boolean;
|
||||
|
||||
/**
|
||||
* Is this call in native V8 code?
|
||||
*/
|
||||
isNative(): boolean;
|
||||
|
||||
/**
|
||||
* Is this a constructor call?
|
||||
*/
|
||||
isConstructor(): boolean;
|
||||
|
||||
/**
|
||||
* is this an async call (i.e. await, Promise.all(), or Promise.any())?
|
||||
*/
|
||||
isAsync(): boolean;
|
||||
|
||||
/**
|
||||
* is this an async call to Promise.all()?
|
||||
*/
|
||||
isPromiseAll(): boolean;
|
||||
|
||||
/**
|
||||
* returns the index of the promise element that was followed in
|
||||
* Promise.all() or Promise.any() for async stack traces, or null
|
||||
* if the CallSite is not an async
|
||||
*/
|
||||
getPromiseIndex(): number | null;
|
||||
|
||||
getScriptNameOrSourceURL(): string;
|
||||
getScriptHash(): string;
|
||||
|
||||
getEnclosingColumnNumber(): number;
|
||||
getEnclosingLineNumber(): number;
|
||||
getPosition(): number;
|
||||
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
interface ErrnoException extends Error {
|
||||
errno?: number | undefined;
|
||||
code?: string | undefined;
|
||||
path?: string | undefined;
|
||||
syscall?: string | undefined;
|
||||
}
|
||||
|
||||
interface ReadableStream extends EventEmitter {
|
||||
readable: boolean;
|
||||
read(size?: number): string | Buffer;
|
||||
setEncoding(encoding: BufferEncoding): this;
|
||||
pause(): this;
|
||||
resume(): this;
|
||||
isPaused(): boolean;
|
||||
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
|
||||
unpipe(destination?: WritableStream): this;
|
||||
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
||||
wrap(oldStream: ReadableStream): this;
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
|
||||
}
|
||||
|
||||
interface WritableStream extends EventEmitter {
|
||||
writable: boolean;
|
||||
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
|
||||
write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
|
||||
end(cb?: () => void): this;
|
||||
end(data: string | Uint8Array, cb?: () => void): this;
|
||||
end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
|
||||
}
|
||||
|
||||
interface ReadWriteStream extends ReadableStream, WritableStream {}
|
||||
|
||||
interface RefCounted {
|
||||
ref(): this;
|
||||
unref(): this;
|
||||
}
|
||||
|
||||
type TypedArray =
|
||||
| Uint8Array
|
||||
| Uint8ClampedArray
|
||||
| Uint16Array
|
||||
| Uint32Array
|
||||
| Int8Array
|
||||
| Int16Array
|
||||
| Int32Array
|
||||
| BigUint64Array
|
||||
| BigInt64Array
|
||||
| Float32Array
|
||||
| Float64Array;
|
||||
type ArrayBufferView = TypedArray | DataView;
|
||||
|
||||
interface Require {
|
||||
(id: string): any;
|
||||
resolve: RequireResolve;
|
||||
cache: Dict<NodeModule>;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
extensions: RequireExtensions;
|
||||
main: Module | undefined;
|
||||
}
|
||||
|
||||
interface RequireResolve {
|
||||
(id: string, options?: { paths?: string[] | undefined }): string;
|
||||
paths(request: string): string[] | null;
|
||||
}
|
||||
|
||||
interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
|
||||
".js": (m: Module, filename: string) => any;
|
||||
".json": (m: Module, filename: string) => any;
|
||||
".node": (m: Module, filename: string) => any;
|
||||
}
|
||||
interface Module {
|
||||
/**
|
||||
* `true` if the module is running during the Node.js preload
|
||||
*/
|
||||
isPreloading: boolean;
|
||||
exports: any;
|
||||
require: Require;
|
||||
id: string;
|
||||
filename: string;
|
||||
loaded: boolean;
|
||||
/** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */
|
||||
parent: Module | null | undefined;
|
||||
children: Module[];
|
||||
/**
|
||||
* @since v11.14.0
|
||||
*
|
||||
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
|
||||
*/
|
||||
path: string;
|
||||
paths: string[];
|
||||
}
|
||||
|
||||
interface Dict<T> {
|
||||
[key: string]: T | undefined;
|
||||
}
|
||||
|
||||
interface ReadOnlyDict<T> {
|
||||
readonly [key: string]: T | undefined;
|
||||
}
|
||||
declare namespace NodeJS {
|
||||
interface CallSite {
|
||||
getColumnNumber(): number | null;
|
||||
getEnclosingColumnNumber(): number | null;
|
||||
getEnclosingLineNumber(): number | null;
|
||||
getEvalOrigin(): string | undefined;
|
||||
getFileName(): string | null;
|
||||
getFunction(): Function | undefined;
|
||||
getFunctionName(): string | null;
|
||||
getLineNumber(): number | null;
|
||||
getMethodName(): string | null;
|
||||
getPosition(): number;
|
||||
getPromiseIndex(): number | null;
|
||||
getScriptHash(): string;
|
||||
getScriptNameOrSourceURL(): string | null;
|
||||
getThis(): unknown;
|
||||
getTypeName(): string | null;
|
||||
isAsync(): boolean;
|
||||
isConstructor(): boolean;
|
||||
isEval(): boolean;
|
||||
isNative(): boolean;
|
||||
isPromiseAll(): boolean;
|
||||
isToplevel(): boolean;
|
||||
}
|
||||
|
||||
interface RequestInit extends _RequestInit {}
|
||||
interface ErrnoException extends Error {
|
||||
errno?: number | undefined;
|
||||
code?: string | undefined;
|
||||
path?: string | undefined;
|
||||
syscall?: string | undefined;
|
||||
}
|
||||
|
||||
function fetch(
|
||||
input: string | URL | globalThis.Request,
|
||||
init?: RequestInit,
|
||||
): Promise<Response>;
|
||||
interface ReadableStream extends EventEmitter {
|
||||
readable: boolean;
|
||||
read(size?: number): string | Buffer;
|
||||
setEncoding(encoding: BufferEncoding): this;
|
||||
pause(): this;
|
||||
resume(): this;
|
||||
isPaused(): boolean;
|
||||
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
|
||||
unpipe(destination?: WritableStream): this;
|
||||
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
||||
wrap(oldStream: ReadableStream): this;
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
|
||||
}
|
||||
|
||||
interface Request extends _Request {}
|
||||
var Request: typeof globalThis extends {
|
||||
onmessage: any;
|
||||
Request: infer T;
|
||||
} ? T
|
||||
: typeof import("undici-types").Request;
|
||||
interface WritableStream extends EventEmitter {
|
||||
writable: boolean;
|
||||
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
|
||||
write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
|
||||
end(cb?: () => void): this;
|
||||
end(data: string | Uint8Array, cb?: () => void): this;
|
||||
end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
|
||||
}
|
||||
|
||||
interface ResponseInit extends _ResponseInit {}
|
||||
interface ReadWriteStream extends ReadableStream, WritableStream {}
|
||||
|
||||
interface Response extends _Response {}
|
||||
var Response: typeof globalThis extends {
|
||||
onmessage: any;
|
||||
Response: infer T;
|
||||
} ? T
|
||||
: typeof import("undici-types").Response;
|
||||
interface RefCounted {
|
||||
ref(): this;
|
||||
unref(): this;
|
||||
}
|
||||
|
||||
interface FormData extends _FormData {}
|
||||
var FormData: typeof globalThis extends {
|
||||
onmessage: any;
|
||||
FormData: infer T;
|
||||
} ? T
|
||||
: typeof import("undici-types").FormData;
|
||||
interface Dict<T> {
|
||||
[key: string]: T | undefined;
|
||||
}
|
||||
|
||||
interface Headers extends _Headers {}
|
||||
var Headers: typeof globalThis extends {
|
||||
onmessage: any;
|
||||
Headers: infer T;
|
||||
} ? T
|
||||
: typeof import("undici-types").Headers;
|
||||
interface ReadOnlyDict<T> {
|
||||
readonly [key: string]: T | undefined;
|
||||
}
|
||||
|
||||
interface File extends _File {}
|
||||
var File: typeof globalThis extends {
|
||||
onmessage: any;
|
||||
File: infer T;
|
||||
} ? T
|
||||
: typeof import("node:buffer").File;
|
||||
type PartialOptions<T> = { [K in keyof T]?: T[K] | undefined };
|
||||
|
||||
interface GCFunction {
|
||||
(minor?: boolean): void;
|
||||
(options: NodeJS.GCOptions & { execution: "async" }): Promise<void>;
|
||||
(options: NodeJS.GCOptions): void;
|
||||
}
|
||||
|
||||
interface GCOptions {
|
||||
execution?: "sync" | "async" | undefined;
|
||||
flavor?: "regular" | "last-resort" | undefined;
|
||||
type?: "major-snapshot" | "major" | "minor" | undefined;
|
||||
filename?: string | undefined;
|
||||
}
|
||||
|
||||
/** An iterable iterator returned by the Node.js API. */
|
||||
interface Iterator<T, TReturn = undefined, TNext = any> extends IteratorObject<T, TReturn, TNext> {
|
||||
[Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
|
||||
}
|
||||
|
||||
/** An async iterable iterator returned by the Node.js API. */
|
||||
interface AsyncIterator<T, TReturn = undefined, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
|
||||
[Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
|
||||
}
|
||||
}
|
||||
|
||||
1
backend/node_modules/@types/node/globals.global.d.ts
generated
vendored
1
backend/node_modules/@types/node/globals.global.d.ts
generated
vendored
@@ -1 +0,0 @@
|
||||
declare var global: typeof globalThis;
|
||||
314
backend/node_modules/@types/node/http.d.ts
generated
vendored
314
backend/node_modules/@types/node/http.d.ts
generated
vendored
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* To use the HTTP server and client one must `require('node:http')`.
|
||||
* To use the HTTP server and client one must import the `node:http` module.
|
||||
*
|
||||
* The HTTP interfaces in Node.js are designed to support many features
|
||||
* of the protocol which have been traditionally difficult to use.
|
||||
@@ -37,9 +37,10 @@
|
||||
* 'Host', 'example.com',
|
||||
* 'accepT', '*' ]
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/http.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/http.js)
|
||||
*/
|
||||
declare module "http" {
|
||||
import { NonSharedBuffer } from "node:buffer";
|
||||
import * as stream from "node:stream";
|
||||
import { URL } from "node:url";
|
||||
import { LookupOptions } from "node:dns";
|
||||
@@ -48,6 +49,7 @@ declare module "http" {
|
||||
// incoming headers will never contain number
|
||||
interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
|
||||
accept?: string | undefined;
|
||||
"accept-encoding"?: string | undefined;
|
||||
"accept-language"?: string | undefined;
|
||||
"accept-patch"?: string | undefined;
|
||||
"accept-ranges"?: string | undefined;
|
||||
@@ -94,6 +96,10 @@ declare module "http" {
|
||||
range?: string | undefined;
|
||||
referer?: string | undefined;
|
||||
"retry-after"?: string | undefined;
|
||||
"sec-fetch-site"?: string | undefined;
|
||||
"sec-fetch-mode"?: string | undefined;
|
||||
"sec-fetch-user"?: string | undefined;
|
||||
"sec-fetch-dest"?: string | undefined;
|
||||
"sec-websocket-accept"?: string | undefined;
|
||||
"sec-websocket-extensions"?: string | undefined;
|
||||
"sec-websocket-key"?: string | undefined;
|
||||
@@ -141,6 +147,7 @@ declare module "http" {
|
||||
"content-range"?: string | undefined;
|
||||
"content-security-policy"?: string | undefined;
|
||||
"content-security-policy-report-only"?: string | undefined;
|
||||
"content-type"?: string | undefined;
|
||||
cookie?: string | string[] | undefined;
|
||||
dav?: string | string[] | undefined;
|
||||
dnt?: string | undefined;
|
||||
@@ -161,7 +168,7 @@ declare module "http" {
|
||||
location?: string | undefined;
|
||||
"max-forwards"?: string | undefined;
|
||||
origin?: string | undefined;
|
||||
prgama?: string | string[] | undefined;
|
||||
pragma?: string | string[] | undefined;
|
||||
"proxy-authenticate"?: string | string[] | undefined;
|
||||
"proxy-authorization"?: string | undefined;
|
||||
"public-key-pins"?: string | undefined;
|
||||
@@ -194,7 +201,7 @@ declare module "http" {
|
||||
"x-frame-options"?: string | undefined;
|
||||
"x-xss-protection"?: string | undefined;
|
||||
}
|
||||
interface ClientRequestArgs {
|
||||
interface ClientRequestArgs extends Pick<LookupOptions, "hints"> {
|
||||
_defaultAgent?: Agent | undefined;
|
||||
agent?: Agent | boolean | undefined;
|
||||
auth?: string | null | undefined;
|
||||
@@ -206,8 +213,7 @@ declare module "http" {
|
||||
| undefined;
|
||||
defaultPort?: number | string | undefined;
|
||||
family?: number | undefined;
|
||||
headers?: OutgoingHttpHeaders | undefined;
|
||||
hints?: LookupOptions["hints"];
|
||||
headers?: OutgoingHttpHeaders | readonly string[] | undefined;
|
||||
host?: string | null | undefined;
|
||||
hostname?: string | null | undefined;
|
||||
insecureHTTPParser?: boolean | undefined;
|
||||
@@ -222,16 +228,17 @@ declare module "http" {
|
||||
path?: string | null | undefined;
|
||||
port?: number | string | null | undefined;
|
||||
protocol?: string | null | undefined;
|
||||
setDefaultHeaders?: boolean | undefined;
|
||||
setHost?: boolean | undefined;
|
||||
signal?: AbortSignal | undefined;
|
||||
socketPath?: string | undefined;
|
||||
timeout?: number | undefined;
|
||||
uniqueHeaders?: Array<string | string[]> | undefined;
|
||||
joinDuplicateHeaders?: boolean;
|
||||
joinDuplicateHeaders?: boolean | undefined;
|
||||
}
|
||||
interface ServerOptions<
|
||||
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
||||
Response extends typeof ServerResponse = typeof ServerResponse,
|
||||
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
|
||||
> {
|
||||
/**
|
||||
* Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`.
|
||||
@@ -253,7 +260,7 @@ declare module "http" {
|
||||
* @default false
|
||||
* @since v18.14.0
|
||||
*/
|
||||
joinDuplicateHeaders?: boolean;
|
||||
joinDuplicateHeaders?: boolean | undefined;
|
||||
/**
|
||||
* The number of milliseconds of inactivity a server needs to wait for additional incoming data,
|
||||
* after it has finished writing the last response, before a socket will be destroyed.
|
||||
@@ -262,11 +269,25 @@ declare module "http" {
|
||||
* @since v18.0.0
|
||||
*/
|
||||
keepAliveTimeout?: number | undefined;
|
||||
/**
|
||||
* An additional buffer time added to the
|
||||
* `server.keepAliveTimeout` to extend the internal socket timeout.
|
||||
* @since 24.6.0
|
||||
* @default 1000
|
||||
*/
|
||||
keepAliveTimeoutBuffer?: number | undefined;
|
||||
/**
|
||||
* Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests.
|
||||
* @default 30000
|
||||
*/
|
||||
connectionsCheckingInterval?: number | undefined;
|
||||
/**
|
||||
* Sets the timeout value in milliseconds for receiving the complete HTTP headers from the client.
|
||||
* See {@link Server.headersTimeout} for more information.
|
||||
* @default 60000
|
||||
* @since 18.0.0
|
||||
*/
|
||||
headersTimeout?: number | undefined;
|
||||
/**
|
||||
* Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`.
|
||||
* This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`.
|
||||
@@ -294,6 +315,13 @@ declare module "http" {
|
||||
* @since v16.5.0
|
||||
*/
|
||||
noDelay?: boolean | undefined;
|
||||
/**
|
||||
* If set to `true`, it forces the server to respond with a 400 (Bad Request) status code
|
||||
* to any HTTP/1.1 request message that lacks a Host header (as mandated by the specification).
|
||||
* @default true
|
||||
* @since 20.0.0
|
||||
*/
|
||||
requireHostHeader?: boolean | undefined;
|
||||
/**
|
||||
* If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
|
||||
* similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`.
|
||||
@@ -312,17 +340,34 @@ declare module "http" {
|
||||
* If the header's value is an array, the items will be joined using `; `.
|
||||
*/
|
||||
uniqueHeaders?: Array<string | string[]> | undefined;
|
||||
/**
|
||||
* A callback which receives an
|
||||
* incoming request and returns a boolean, to control which upgrade attempts
|
||||
* should be accepted. Accepted upgrades will fire an `'upgrade'` event (or
|
||||
* their sockets will be destroyed, if no listener is registered) while
|
||||
* rejected upgrades will fire a `'request'` event like any non-upgrade
|
||||
* request.
|
||||
* @since v24.9.0
|
||||
* @default () => server.listenerCount('upgrade') > 0
|
||||
*/
|
||||
shouldUpgradeCallback?: ((request: InstanceType<Request>) => boolean) | undefined;
|
||||
/**
|
||||
* If set to `true`, an error is thrown when writing to an HTTP response which does not have a body.
|
||||
* @default false
|
||||
* @since v18.17.0, v20.2.0
|
||||
*/
|
||||
rejectNonStandardBodyWrites?: boolean | undefined;
|
||||
}
|
||||
type RequestListener<
|
||||
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
||||
Response extends typeof ServerResponse = typeof ServerResponse,
|
||||
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
|
||||
> = (req: InstanceType<Request>, res: InstanceType<Response> & { req: InstanceType<Request> }) => void;
|
||||
/**
|
||||
* @since v0.1.17
|
||||
*/
|
||||
class Server<
|
||||
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
||||
Response extends typeof ServerResponse = typeof ServerResponse,
|
||||
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
|
||||
> extends NetServer {
|
||||
constructor(requestListener?: RequestListener<Request, Response>);
|
||||
constructor(options: ServerOptions<Request, Response>, requestListener?: RequestListener<Request, Response>);
|
||||
@@ -340,8 +385,8 @@ declare module "http" {
|
||||
* @since v0.9.12
|
||||
* @param [msecs=0 (no timeout)]
|
||||
*/
|
||||
setTimeout(msecs?: number, callback?: () => void): this;
|
||||
setTimeout(callback: () => void): this;
|
||||
setTimeout(msecs?: number, callback?: (socket: Socket) => void): this;
|
||||
setTimeout(callback: (socket: Socket) => void): this;
|
||||
/**
|
||||
* Limits maximum incoming headers count. If set to 0, no limit will be applied.
|
||||
* @since v0.7.0
|
||||
@@ -386,12 +431,18 @@ declare module "http" {
|
||||
/**
|
||||
* The number of milliseconds of inactivity a server needs to wait for additional
|
||||
* incoming data, after it has finished writing the last response, before a socket
|
||||
* will be destroyed. If the server receives new data before the keep-alive
|
||||
* timeout has fired, it will reset the regular inactivity timeout, i.e., `server.timeout`.
|
||||
* will be destroyed.
|
||||
*
|
||||
* This timeout value is combined with the
|
||||
* `server.keepAliveTimeoutBuffer` option to determine the actual socket
|
||||
* timeout, calculated as:
|
||||
* socketTimeout = keepAliveTimeout + keepAliveTimeoutBuffer
|
||||
* If the server receives new data before the keep-alive timeout has fired, it
|
||||
* will reset the regular inactivity timeout, i.e., `server.timeout`.
|
||||
*
|
||||
* A value of `0` will disable the keep-alive timeout behavior on incoming
|
||||
* connections.
|
||||
* A value of `0` makes the http server behave similarly to Node.js versions prior
|
||||
* A value of `0` makes the HTTP server behave similarly to Node.js versions prior
|
||||
* to 8.0.0, which did not have a keep-alive timeout.
|
||||
*
|
||||
* The socket timeout logic is set up on connection, so changing this value only
|
||||
@@ -399,6 +450,18 @@ declare module "http" {
|
||||
* @since v8.0.0
|
||||
*/
|
||||
keepAliveTimeout: number;
|
||||
/**
|
||||
* An additional buffer time added to the
|
||||
* `server.keepAliveTimeout` to extend the internal socket timeout.
|
||||
*
|
||||
* This buffer helps reduce connection reset (`ECONNRESET`) errors by increasing
|
||||
* the socket timeout slightly beyond the advertised keep-alive timeout.
|
||||
*
|
||||
* This option applies only to new incoming connections.
|
||||
* @since v24.6.0
|
||||
* @default 1000
|
||||
*/
|
||||
keepAliveTimeoutBuffer: number;
|
||||
/**
|
||||
* Sets the timeout value in milliseconds for receiving the entire request from
|
||||
* the client.
|
||||
@@ -433,13 +496,13 @@ declare module "http" {
|
||||
addListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
|
||||
addListener(
|
||||
event: "connect",
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
addListener(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
|
||||
addListener(event: "request", listener: RequestListener<Request, Response>): this;
|
||||
addListener(
|
||||
event: "upgrade",
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
emit(event: string, ...args: any[]): boolean;
|
||||
emit(event: "close"): boolean;
|
||||
@@ -457,14 +520,14 @@ declare module "http" {
|
||||
res: InstanceType<Response> & { req: InstanceType<Request> },
|
||||
): boolean;
|
||||
emit(event: "clientError", err: Error, socket: stream.Duplex): boolean;
|
||||
emit(event: "connect", req: InstanceType<Request>, socket: stream.Duplex, head: Buffer): boolean;
|
||||
emit(event: "connect", req: InstanceType<Request>, socket: stream.Duplex, head: NonSharedBuffer): boolean;
|
||||
emit(event: "dropRequest", req: InstanceType<Request>, socket: stream.Duplex): boolean;
|
||||
emit(
|
||||
event: "request",
|
||||
req: InstanceType<Request>,
|
||||
res: InstanceType<Response> & { req: InstanceType<Request> },
|
||||
): boolean;
|
||||
emit(event: "upgrade", req: InstanceType<Request>, socket: stream.Duplex, head: Buffer): boolean;
|
||||
emit(event: "upgrade", req: InstanceType<Request>, socket: stream.Duplex, head: NonSharedBuffer): boolean;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "close", listener: () => void): this;
|
||||
on(event: "connection", listener: (socket: Socket) => void): this;
|
||||
@@ -473,10 +536,16 @@ declare module "http" {
|
||||
on(event: "checkContinue", listener: RequestListener<Request, Response>): this;
|
||||
on(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
|
||||
on(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
|
||||
on(event: "connect", listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
|
||||
on(
|
||||
event: "connect",
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
on(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
|
||||
on(event: "request", listener: RequestListener<Request, Response>): this;
|
||||
on(event: "upgrade", listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
|
||||
on(
|
||||
event: "upgrade",
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "close", listener: () => void): this;
|
||||
once(event: "connection", listener: (socket: Socket) => void): this;
|
||||
@@ -487,13 +556,13 @@ declare module "http" {
|
||||
once(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
|
||||
once(
|
||||
event: "connect",
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
once(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
|
||||
once(event: "request", listener: RequestListener<Request, Response>): this;
|
||||
once(
|
||||
event: "upgrade",
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "close", listener: () => void): this;
|
||||
@@ -505,7 +574,7 @@ declare module "http" {
|
||||
prependListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
|
||||
prependListener(
|
||||
event: "connect",
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
prependListener(
|
||||
event: "dropRequest",
|
||||
@@ -514,7 +583,7 @@ declare module "http" {
|
||||
prependListener(event: "request", listener: RequestListener<Request, Response>): this;
|
||||
prependListener(
|
||||
event: "upgrade",
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "close", listener: () => void): this;
|
||||
@@ -526,7 +595,7 @@ declare module "http" {
|
||||
prependOnceListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
|
||||
prependOnceListener(
|
||||
event: "connect",
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
prependOnceListener(
|
||||
event: "dropRequest",
|
||||
@@ -535,7 +604,7 @@ declare module "http" {
|
||||
prependOnceListener(event: "request", listener: RequestListener<Request, Response>): this;
|
||||
prependOnceListener(
|
||||
event: "upgrade",
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: stream.Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
}
|
||||
/**
|
||||
@@ -588,6 +657,42 @@ declare module "http" {
|
||||
* @param value Header value
|
||||
*/
|
||||
setHeader(name: string, value: number | string | readonly string[]): this;
|
||||
/**
|
||||
* Sets multiple header values for implicit headers. headers must be an instance of
|
||||
* `Headers` or `Map`, if a header already exists in the to-be-sent headers, its
|
||||
* value will be replaced.
|
||||
*
|
||||
* ```js
|
||||
* const headers = new Headers({ foo: 'bar' });
|
||||
* outgoingMessage.setHeaders(headers);
|
||||
* ```
|
||||
*
|
||||
* or
|
||||
*
|
||||
* ```js
|
||||
* const headers = new Map([['foo', 'bar']]);
|
||||
* outgoingMessage.setHeaders(headers);
|
||||
* ```
|
||||
*
|
||||
* When headers have been set with `outgoingMessage.setHeaders()`, they will be
|
||||
* merged with any headers passed to `response.writeHead()`, with the headers passed
|
||||
* to `response.writeHead()` given precedence.
|
||||
*
|
||||
* ```js
|
||||
* // Returns content-type = text/plain
|
||||
* const server = http.createServer((req, res) => {
|
||||
* const headers = new Headers({ 'Content-Type': 'text/html' });
|
||||
* res.setHeaders(headers);
|
||||
* res.writeHead(200, { 'Content-Type': 'text/plain' });
|
||||
* res.end('ok');
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @since v19.6.0, v18.15.0
|
||||
* @param name Header name
|
||||
* @param value Header value
|
||||
*/
|
||||
setHeaders(headers: Headers | Map<string, number | string | readonly string[]>): this;
|
||||
/**
|
||||
* Append a single header value to the header object.
|
||||
*
|
||||
@@ -848,7 +953,7 @@ declare module "http" {
|
||||
* the request body should be sent.
|
||||
* @since v10.0.0
|
||||
*/
|
||||
writeProcessing(): void;
|
||||
writeProcessing(callback?: () => void): void;
|
||||
}
|
||||
interface InformationEvent {
|
||||
statusCode: number;
|
||||
@@ -1019,7 +1124,7 @@ declare module "http" {
|
||||
addListener(event: "abort", listener: () => void): this;
|
||||
addListener(
|
||||
event: "connect",
|
||||
listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
|
||||
listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
addListener(event: "continue", listener: () => void): this;
|
||||
addListener(event: "information", listener: (info: InformationEvent) => void): this;
|
||||
@@ -1028,7 +1133,7 @@ declare module "http" {
|
||||
addListener(event: "timeout", listener: () => void): this;
|
||||
addListener(
|
||||
event: "upgrade",
|
||||
listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
|
||||
listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
addListener(event: "close", listener: () => void): this;
|
||||
addListener(event: "drain", listener: () => void): this;
|
||||
@@ -1041,13 +1146,19 @@ declare module "http" {
|
||||
* @deprecated
|
||||
*/
|
||||
on(event: "abort", listener: () => void): this;
|
||||
on(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
|
||||
on(
|
||||
event: "connect",
|
||||
listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
on(event: "continue", listener: () => void): this;
|
||||
on(event: "information", listener: (info: InformationEvent) => void): this;
|
||||
on(event: "response", listener: (response: IncomingMessage) => void): this;
|
||||
on(event: "socket", listener: (socket: Socket) => void): this;
|
||||
on(event: "timeout", listener: () => void): this;
|
||||
on(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
|
||||
on(
|
||||
event: "upgrade",
|
||||
listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
on(event: "close", listener: () => void): this;
|
||||
on(event: "drain", listener: () => void): this;
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
@@ -1059,13 +1170,19 @@ declare module "http" {
|
||||
* @deprecated
|
||||
*/
|
||||
once(event: "abort", listener: () => void): this;
|
||||
once(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
|
||||
once(
|
||||
event: "connect",
|
||||
listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
once(event: "continue", listener: () => void): this;
|
||||
once(event: "information", listener: (info: InformationEvent) => void): this;
|
||||
once(event: "response", listener: (response: IncomingMessage) => void): this;
|
||||
once(event: "socket", listener: (socket: Socket) => void): this;
|
||||
once(event: "timeout", listener: () => void): this;
|
||||
once(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
|
||||
once(
|
||||
event: "upgrade",
|
||||
listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
once(event: "close", listener: () => void): this;
|
||||
once(event: "drain", listener: () => void): this;
|
||||
once(event: "error", listener: (err: Error) => void): this;
|
||||
@@ -1079,7 +1196,7 @@ declare module "http" {
|
||||
prependListener(event: "abort", listener: () => void): this;
|
||||
prependListener(
|
||||
event: "connect",
|
||||
listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
|
||||
listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
prependListener(event: "continue", listener: () => void): this;
|
||||
prependListener(event: "information", listener: (info: InformationEvent) => void): this;
|
||||
@@ -1088,7 +1205,7 @@ declare module "http" {
|
||||
prependListener(event: "timeout", listener: () => void): this;
|
||||
prependListener(
|
||||
event: "upgrade",
|
||||
listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
|
||||
listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
prependListener(event: "close", listener: () => void): this;
|
||||
prependListener(event: "drain", listener: () => void): this;
|
||||
@@ -1103,7 +1220,7 @@ declare module "http" {
|
||||
prependOnceListener(event: "abort", listener: () => void): this;
|
||||
prependOnceListener(
|
||||
event: "connect",
|
||||
listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
|
||||
listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
prependOnceListener(event: "continue", listener: () => void): this;
|
||||
prependOnceListener(event: "information", listener: (info: InformationEvent) => void): this;
|
||||
@@ -1112,7 +1229,7 @@ declare module "http" {
|
||||
prependOnceListener(event: "timeout", listener: () => void): this;
|
||||
prependOnceListener(
|
||||
event: "upgrade",
|
||||
listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
|
||||
listener: (response: IncomingMessage, socket: Socket, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
prependOnceListener(event: "close", listener: () => void): this;
|
||||
prependOnceListener(event: "drain", listener: () => void): this;
|
||||
@@ -1356,7 +1473,15 @@ declare module "http" {
|
||||
*/
|
||||
destroy(error?: Error): this;
|
||||
}
|
||||
interface AgentOptions extends Partial<TcpSocketConnectOpts> {
|
||||
interface ProxyEnv extends NodeJS.ProcessEnv {
|
||||
HTTP_PROXY?: string | undefined;
|
||||
HTTPS_PROXY?: string | undefined;
|
||||
NO_PROXY?: string | undefined;
|
||||
http_proxy?: string | undefined;
|
||||
https_proxy?: string | undefined;
|
||||
no_proxy?: string | undefined;
|
||||
}
|
||||
interface AgentOptions extends NodeJS.PartialOptions<TcpSocketConnectOpts> {
|
||||
/**
|
||||
* Keep sockets around in a pool to be used by other requests in the future. Default = false
|
||||
*/
|
||||
@@ -1366,6 +1491,16 @@ declare module "http" {
|
||||
* Only relevant if keepAlive is set to true.
|
||||
*/
|
||||
keepAliveMsecs?: number | undefined;
|
||||
/**
|
||||
* Milliseconds to subtract from
|
||||
* the server-provided `keep-alive: timeout=...` hint when determining socket
|
||||
* expiration time. This buffer helps ensure the agent closes the socket
|
||||
* slightly before the server does, reducing the chance of sending a request
|
||||
* on a socket that’s about to be closed by the server.
|
||||
* @since v24.7.0
|
||||
* @default 1000
|
||||
*/
|
||||
agentKeepAliveTimeoutBuffer?: number | undefined;
|
||||
/**
|
||||
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
|
||||
*/
|
||||
@@ -1387,6 +1522,22 @@ declare module "http" {
|
||||
* @default `lifo`
|
||||
*/
|
||||
scheduling?: "fifo" | "lifo" | undefined;
|
||||
/**
|
||||
* Environment variables for proxy configuration. See
|
||||
* [Built-in Proxy Support](https://nodejs.org/docs/latest-v24.x/api/http.html#built-in-proxy-support) for details.
|
||||
* @since v24.5.0
|
||||
*/
|
||||
proxyEnv?: ProxyEnv | undefined;
|
||||
/**
|
||||
* Default port to use when the port is not specified in requests.
|
||||
* @since v24.5.0
|
||||
*/
|
||||
defaultPort?: number | undefined;
|
||||
/**
|
||||
* The protocol to use for the agent.
|
||||
* @since v24.5.0
|
||||
*/
|
||||
protocol?: string | undefined;
|
||||
}
|
||||
/**
|
||||
* An `Agent` is responsible for managing connection persistence
|
||||
@@ -1442,12 +1593,12 @@ declare module "http" {
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v20.x/api/net.html#socketconnectoptions-connectlistener) are also supported.
|
||||
* `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v24.x/api/net.html#socketconnectoptions-connectlistener) are also supported.
|
||||
*
|
||||
* To configure any of them, a custom {@link Agent} instance must be created.
|
||||
*
|
||||
* ```js
|
||||
* const http = require('node:http');
|
||||
* import http from 'node:http';
|
||||
* const keepAliveAgent = new http.Agent({ keepAlive: true });
|
||||
* options.agent = keepAliveAgent;
|
||||
* http.request(options, onResponseCallback)
|
||||
@@ -1507,6 +1658,68 @@ declare module "http" {
|
||||
* @since v0.11.4
|
||||
*/
|
||||
destroy(): void;
|
||||
/**
|
||||
* Produces a socket/stream to be used for HTTP requests.
|
||||
*
|
||||
* By default, this function is the same as `net.createConnection()`. However,
|
||||
* custom agents may override this method in case greater flexibility is desired.
|
||||
*
|
||||
* A socket/stream can be supplied in one of two ways: by returning the
|
||||
* socket/stream from this function, or by passing the socket/stream to `callback`.
|
||||
*
|
||||
* This method is guaranteed to return an instance of the `net.Socket` class,
|
||||
* a subclass of `stream.Duplex`, unless the user specifies a socket
|
||||
* type other than `net.Socket`.
|
||||
*
|
||||
* `callback` has a signature of `(err, stream)`.
|
||||
* @since v0.11.4
|
||||
* @param options Options containing connection details. Check `createConnection` for the format of the options
|
||||
* @param callback Callback function that receives the created socket
|
||||
*/
|
||||
createConnection(
|
||||
options: ClientRequestArgs,
|
||||
callback?: (err: Error | null, stream: stream.Duplex) => void,
|
||||
): stream.Duplex | null | undefined;
|
||||
/**
|
||||
* Called when `socket` is detached from a request and could be persisted by the`Agent`. Default behavior is to:
|
||||
*
|
||||
* ```js
|
||||
* socket.setKeepAlive(true, this.keepAliveMsecs);
|
||||
* socket.unref();
|
||||
* return true;
|
||||
* ```
|
||||
*
|
||||
* This method can be overridden by a particular `Agent` subclass. If this
|
||||
* method returns a falsy value, the socket will be destroyed instead of persisting
|
||||
* it for use with the next request.
|
||||
*
|
||||
* The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
|
||||
* @since v8.1.0
|
||||
*/
|
||||
keepSocketAlive(socket: stream.Duplex): void;
|
||||
/**
|
||||
* Called when `socket` is attached to `request` after being persisted because of
|
||||
* the keep-alive options. Default behavior is to:
|
||||
*
|
||||
* ```js
|
||||
* socket.ref();
|
||||
* ```
|
||||
*
|
||||
* This method can be overridden by a particular `Agent` subclass.
|
||||
*
|
||||
* The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
|
||||
* @since v8.1.0
|
||||
*/
|
||||
reuseSocket(socket: stream.Duplex, request: ClientRequest): void;
|
||||
/**
|
||||
* Get a unique name for a set of request options, to determine whether a
|
||||
* connection can be reused. For an HTTP agent, this returns`host:port:localAddress` or `host:port:localAddress:family`. For an HTTPS agent,
|
||||
* the name includes the CA, cert, ciphers, and other HTTPS/TLS-specific options
|
||||
* that determine socket reusability.
|
||||
* @since v0.11.4
|
||||
* @param options A set of options providing information for name generation
|
||||
*/
|
||||
getName(options?: ClientRequestArgs): string;
|
||||
}
|
||||
const METHODS: string[];
|
||||
const STATUS_CODES: {
|
||||
@@ -1553,11 +1766,11 @@ declare module "http" {
|
||||
*/
|
||||
function createServer<
|
||||
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
||||
Response extends typeof ServerResponse = typeof ServerResponse,
|
||||
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
|
||||
>(requestListener?: RequestListener<Request, Response>): Server<Request, Response>;
|
||||
function createServer<
|
||||
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
||||
Response extends typeof ServerResponse = typeof ServerResponse,
|
||||
Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
|
||||
>(
|
||||
options: ServerOptions<Request, Response>,
|
||||
requestListener?: RequestListener<Request, Response>,
|
||||
@@ -1902,6 +2115,19 @@ declare module "http" {
|
||||
* Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option.
|
||||
*/
|
||||
const maxHeaderSize: number;
|
||||
/**
|
||||
* A browser-compatible implementation of `WebSocket`.
|
||||
* @since v22.5.0
|
||||
*/
|
||||
const WebSocket: typeof import("undici-types").WebSocket;
|
||||
/**
|
||||
* @since v22.5.0
|
||||
*/
|
||||
const CloseEvent: typeof import("undici-types").CloseEvent;
|
||||
/**
|
||||
* @since v22.5.0
|
||||
*/
|
||||
const MessageEvent: typeof import("undici-types").MessageEvent;
|
||||
}
|
||||
declare module "node:http" {
|
||||
export * from "http";
|
||||
|
||||
674
backend/node_modules/@types/node/http2.d.ts
generated
vendored
674
backend/node_modules/@types/node/http2.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
199
backend/node_modules/@types/node/https.d.ts
generated
vendored
199
backend/node_modules/@types/node/https.d.ts
generated
vendored
@@ -1,27 +1,26 @@
|
||||
/**
|
||||
* HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
|
||||
* separate module.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/https.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/https.js)
|
||||
*/
|
||||
declare module "https" {
|
||||
import { NonSharedBuffer } from "node:buffer";
|
||||
import { Duplex } from "node:stream";
|
||||
import * as tls from "node:tls";
|
||||
import * as http from "node:http";
|
||||
import { URL } from "node:url";
|
||||
type ServerOptions<
|
||||
interface ServerOptions<
|
||||
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
||||
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
||||
> = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions<Request, Response>;
|
||||
type RequestOptions =
|
||||
& http.RequestOptions
|
||||
& tls.SecureContextOptions
|
||||
& {
|
||||
checkServerIdentity?: typeof tls.checkServerIdentity | undefined;
|
||||
rejectUnauthorized?: boolean | undefined; // Defaults to true
|
||||
servername?: string | undefined; // SNI TLS Extension
|
||||
};
|
||||
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse,
|
||||
> extends http.ServerOptions<Request, Response>, tls.TlsOptions {}
|
||||
interface RequestOptions extends http.RequestOptions, tls.SecureContextOptions {
|
||||
checkServerIdentity?:
|
||||
| ((hostname: string, cert: tls.DetailedPeerCertificate) => Error | undefined)
|
||||
| undefined;
|
||||
rejectUnauthorized?: boolean | undefined; // Defaults to true
|
||||
servername?: string | undefined; // SNI TLS Extension
|
||||
}
|
||||
interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
|
||||
rejectUnauthorized?: boolean | undefined;
|
||||
maxCachedSessions?: number | undefined;
|
||||
}
|
||||
/**
|
||||
@@ -31,10 +30,15 @@ declare module "https" {
|
||||
class Agent extends http.Agent {
|
||||
constructor(options?: AgentOptions);
|
||||
options: AgentOptions;
|
||||
createConnection(
|
||||
options: RequestOptions,
|
||||
callback?: (err: Error | null, stream: Duplex) => void,
|
||||
): Duplex | null | undefined;
|
||||
getName(options?: RequestOptions): string;
|
||||
}
|
||||
interface Server<
|
||||
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
||||
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
||||
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse,
|
||||
> extends http.Server<Request, Response> {}
|
||||
/**
|
||||
* See `http.Server` for more information.
|
||||
@@ -42,7 +46,7 @@ declare module "https" {
|
||||
*/
|
||||
class Server<
|
||||
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
||||
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
||||
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse,
|
||||
> extends tls.Server {
|
||||
constructor(requestListener?: http.RequestListener<Request, Response>);
|
||||
constructor(
|
||||
@@ -60,22 +64,25 @@ declare module "https" {
|
||||
*/
|
||||
closeIdleConnections(): void;
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||
addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||
addListener(
|
||||
event: "newSession",
|
||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
||||
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
||||
): this;
|
||||
addListener(
|
||||
event: "OCSPRequest",
|
||||
listener: (
|
||||
certificate: Buffer,
|
||||
issuer: Buffer,
|
||||
callback: (err: Error | null, resp: Buffer) => void,
|
||||
certificate: NonSharedBuffer,
|
||||
issuer: NonSharedBuffer,
|
||||
callback: (err: Error | null, resp: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
addListener(
|
||||
event: "resumeSession",
|
||||
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
||||
listener: (
|
||||
sessionId: NonSharedBuffer,
|
||||
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
||||
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
||||
@@ -88,28 +95,32 @@ declare module "https" {
|
||||
addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
||||
addListener(
|
||||
event: "connect",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
addListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
||||
addListener(
|
||||
event: "upgrade",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
emit(event: string, ...args: any[]): boolean;
|
||||
emit(event: "keylog", line: Buffer, tlsSocket: tls.TLSSocket): boolean;
|
||||
emit(event: "keylog", line: NonSharedBuffer, tlsSocket: tls.TLSSocket): boolean;
|
||||
emit(
|
||||
event: "newSession",
|
||||
sessionId: Buffer,
|
||||
sessionData: Buffer,
|
||||
callback: (err: Error, resp: Buffer) => void,
|
||||
sessionId: NonSharedBuffer,
|
||||
sessionData: NonSharedBuffer,
|
||||
callback: () => void,
|
||||
): boolean;
|
||||
emit(
|
||||
event: "OCSPRequest",
|
||||
certificate: Buffer,
|
||||
issuer: Buffer,
|
||||
callback: (err: Error | null, resp: Buffer) => void,
|
||||
certificate: NonSharedBuffer,
|
||||
issuer: NonSharedBuffer,
|
||||
callback: (err: Error | null, resp: Buffer | null) => void,
|
||||
): boolean;
|
||||
emit(
|
||||
event: "resumeSession",
|
||||
sessionId: NonSharedBuffer,
|
||||
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
||||
): boolean;
|
||||
emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
|
||||
emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean;
|
||||
emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean;
|
||||
emit(event: "close"): boolean;
|
||||
@@ -119,44 +130,41 @@ declare module "https" {
|
||||
emit(
|
||||
event: "checkContinue",
|
||||
req: InstanceType<Request>,
|
||||
res: InstanceType<Response> & {
|
||||
req: InstanceType<Request>;
|
||||
},
|
||||
res: InstanceType<Response>,
|
||||
): boolean;
|
||||
emit(
|
||||
event: "checkExpectation",
|
||||
req: InstanceType<Request>,
|
||||
res: InstanceType<Response> & {
|
||||
req: InstanceType<Request>;
|
||||
},
|
||||
res: InstanceType<Response>,
|
||||
): boolean;
|
||||
emit(event: "clientError", err: Error, socket: Duplex): boolean;
|
||||
emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
|
||||
emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer): boolean;
|
||||
emit(
|
||||
event: "request",
|
||||
req: InstanceType<Request>,
|
||||
res: InstanceType<Response> & {
|
||||
req: InstanceType<Request>;
|
||||
},
|
||||
res: InstanceType<Response>,
|
||||
): boolean;
|
||||
emit(event: "upgrade", req: InstanceType<Request>, socket: Duplex, head: Buffer): boolean;
|
||||
emit(event: "upgrade", req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer): boolean;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||
on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||
on(
|
||||
event: "newSession",
|
||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
||||
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
||||
): this;
|
||||
on(
|
||||
event: "OCSPRequest",
|
||||
listener: (
|
||||
certificate: Buffer,
|
||||
issuer: Buffer,
|
||||
callback: (err: Error | null, resp: Buffer) => void,
|
||||
certificate: NonSharedBuffer,
|
||||
issuer: NonSharedBuffer,
|
||||
callback: (err: Error | null, resp: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
on(
|
||||
event: "resumeSession",
|
||||
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
||||
listener: (
|
||||
sessionId: NonSharedBuffer,
|
||||
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
||||
on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
||||
@@ -167,26 +175,35 @@ declare module "https" {
|
||||
on(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
|
||||
on(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
||||
on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
||||
on(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
||||
on(
|
||||
event: "connect",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
on(event: "request", listener: http.RequestListener<Request, Response>): this;
|
||||
on(event: "upgrade", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
||||
on(
|
||||
event: "upgrade",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||
once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||
once(
|
||||
event: "newSession",
|
||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
||||
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
||||
): this;
|
||||
once(
|
||||
event: "OCSPRequest",
|
||||
listener: (
|
||||
certificate: Buffer,
|
||||
issuer: Buffer,
|
||||
callback: (err: Error | null, resp: Buffer) => void,
|
||||
certificate: NonSharedBuffer,
|
||||
issuer: NonSharedBuffer,
|
||||
callback: (err: Error | null, resp: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
once(
|
||||
event: "resumeSession",
|
||||
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
||||
listener: (
|
||||
sessionId: NonSharedBuffer,
|
||||
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
||||
once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
||||
@@ -197,26 +214,35 @@ declare module "https" {
|
||||
once(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
|
||||
once(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
||||
once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
||||
once(event: "connect", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
||||
once(
|
||||
event: "connect",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
once(event: "request", listener: http.RequestListener<Request, Response>): this;
|
||||
once(event: "upgrade", listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void): this;
|
||||
once(
|
||||
event: "upgrade",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||
prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||
prependListener(
|
||||
event: "newSession",
|
||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
||||
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
||||
): this;
|
||||
prependListener(
|
||||
event: "OCSPRequest",
|
||||
listener: (
|
||||
certificate: Buffer,
|
||||
issuer: Buffer,
|
||||
callback: (err: Error | null, resp: Buffer) => void,
|
||||
certificate: NonSharedBuffer,
|
||||
issuer: NonSharedBuffer,
|
||||
callback: (err: Error | null, resp: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
prependListener(
|
||||
event: "resumeSession",
|
||||
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
||||
listener: (
|
||||
sessionId: NonSharedBuffer,
|
||||
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
||||
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
||||
@@ -229,30 +255,33 @@ declare module "https" {
|
||||
prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
||||
prependListener(
|
||||
event: "connect",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
prependListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
||||
prependListener(
|
||||
event: "upgrade",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||
prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
||||
prependOnceListener(
|
||||
event: "newSession",
|
||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void,
|
||||
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
||||
): this;
|
||||
prependOnceListener(
|
||||
event: "OCSPRequest",
|
||||
listener: (
|
||||
certificate: Buffer,
|
||||
issuer: Buffer,
|
||||
callback: (err: Error | null, resp: Buffer) => void,
|
||||
certificate: NonSharedBuffer,
|
||||
issuer: NonSharedBuffer,
|
||||
callback: (err: Error | null, resp: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
prependOnceListener(
|
||||
event: "resumeSession",
|
||||
listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void,
|
||||
listener: (
|
||||
sessionId: NonSharedBuffer,
|
||||
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
||||
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
||||
@@ -265,19 +294,19 @@ declare module "https" {
|
||||
prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
||||
prependOnceListener(
|
||||
event: "connect",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
prependOnceListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
||||
prependOnceListener(
|
||||
event: "upgrade",
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: Buffer) => void,
|
||||
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
||||
): this;
|
||||
}
|
||||
/**
|
||||
* ```js
|
||||
* // curl -k https://localhost:8000/
|
||||
* const https = require('node:https');
|
||||
* const fs = require('node:fs');
|
||||
* import https from 'node:https';
|
||||
* import fs from 'node:fs';
|
||||
*
|
||||
* const options = {
|
||||
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
||||
@@ -293,8 +322,8 @@ declare module "https" {
|
||||
* Or
|
||||
*
|
||||
* ```js
|
||||
* const https = require('node:https');
|
||||
* const fs = require('node:fs');
|
||||
* import https from 'node:https';
|
||||
* import fs from 'node:fs';
|
||||
*
|
||||
* const options = {
|
||||
* pfx: fs.readFileSync('test/fixtures/test_cert.pfx'),
|
||||
@@ -312,11 +341,11 @@ declare module "https" {
|
||||
*/
|
||||
function createServer<
|
||||
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
||||
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
||||
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse,
|
||||
>(requestListener?: http.RequestListener<Request, Response>): Server<Request, Response>;
|
||||
function createServer<
|
||||
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
||||
Response extends typeof http.ServerResponse = typeof http.ServerResponse,
|
||||
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse,
|
||||
>(
|
||||
options: ServerOptions<Request, Response>,
|
||||
requestListener?: http.RequestListener<Request, Response>,
|
||||
@@ -334,7 +363,7 @@ declare module "https" {
|
||||
* upload a file with a POST request, then write to the `ClientRequest` object.
|
||||
*
|
||||
* ```js
|
||||
* const https = require('node:https');
|
||||
* import https from 'node:https';
|
||||
*
|
||||
* const options = {
|
||||
* hostname: 'encrypted.google.com',
|
||||
@@ -407,9 +436,9 @@ declare module "https" {
|
||||
* Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`):
|
||||
*
|
||||
* ```js
|
||||
* const tls = require('node:tls');
|
||||
* const https = require('node:https');
|
||||
* const crypto = require('node:crypto');
|
||||
* import tls from 'node:tls';
|
||||
* import https from 'node:https';
|
||||
* import crypto from 'node:crypto';
|
||||
*
|
||||
* function sha256(s) {
|
||||
* return crypto.createHash('sha256').update(s).digest('base64');
|
||||
@@ -517,7 +546,7 @@ declare module "https" {
|
||||
* string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
|
||||
*
|
||||
* ```js
|
||||
* const https = require('node:https');
|
||||
* import https from 'node:https';
|
||||
*
|
||||
* https.get('https://encrypted.google.com/', (res) => {
|
||||
* console.log('statusCode:', res.statusCode);
|
||||
|
||||
34
backend/node_modules/@types/node/index.d.ts
generated
vendored
34
backend/node_modules/@types/node/index.d.ts
generated
vendored
@@ -22,18 +22,32 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// NOTE: These definitions support NodeJS and TypeScript 4.9+.
|
||||
// NOTE: These definitions support Node.js and TypeScript 5.8+.
|
||||
|
||||
// Reference required types from the default lib:
|
||||
// Reference required TypeScript libraries:
|
||||
/// <reference lib="es2020" />
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/// <reference lib="esnext.intl" />
|
||||
/// <reference lib="esnext.bigint" />
|
||||
/// <reference lib="esnext.disposable" />
|
||||
/// <reference lib="esnext.float16" />
|
||||
|
||||
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
|
||||
// Iterator definitions required for compatibility with TypeScript <5.6:
|
||||
/// <reference path="compatibility/iterators.d.ts" />
|
||||
|
||||
// Definitions for Node.js modules specific to TypeScript 5.7+:
|
||||
/// <reference path="globals.typedarray.d.ts" />
|
||||
/// <reference path="buffer.buffer.d.ts" />
|
||||
|
||||
// Definitions for Node.js modules that are not specific to any version of TypeScript:
|
||||
/// <reference path="globals.d.ts" />
|
||||
/// <reference path="web-globals/abortcontroller.d.ts" />
|
||||
/// <reference path="web-globals/crypto.d.ts" />
|
||||
/// <reference path="web-globals/domexception.d.ts" />
|
||||
/// <reference path="web-globals/events.d.ts" />
|
||||
/// <reference path="web-globals/fetch.d.ts" />
|
||||
/// <reference path="web-globals/navigator.d.ts" />
|
||||
/// <reference path="web-globals/storage.d.ts" />
|
||||
/// <reference path="web-globals/streams.d.ts" />
|
||||
/// <reference path="assert.d.ts" />
|
||||
/// <reference path="assert/strict.d.ts" />
|
||||
/// <reference path="globals.d.ts" />
|
||||
/// <reference path="async_hooks.d.ts" />
|
||||
/// <reference path="buffer.d.ts" />
|
||||
/// <reference path="child_process.d.ts" />
|
||||
@@ -45,9 +59,7 @@
|
||||
/// <reference path="diagnostics_channel.d.ts" />
|
||||
/// <reference path="dns.d.ts" />
|
||||
/// <reference path="dns/promises.d.ts" />
|
||||
/// <reference path="dns/promises.d.ts" />
|
||||
/// <reference path="domain.d.ts" />
|
||||
/// <reference path="dom-events.d.ts" />
|
||||
/// <reference path="events.d.ts" />
|
||||
/// <reference path="fs.d.ts" />
|
||||
/// <reference path="fs/promises.d.ts" />
|
||||
@@ -55,6 +67,7 @@
|
||||
/// <reference path="http2.d.ts" />
|
||||
/// <reference path="https.d.ts" />
|
||||
/// <reference path="inspector.d.ts" />
|
||||
/// <reference path="inspector.generated.d.ts" />
|
||||
/// <reference path="module.d.ts" />
|
||||
/// <reference path="net.d.ts" />
|
||||
/// <reference path="os.d.ts" />
|
||||
@@ -67,6 +80,7 @@
|
||||
/// <reference path="readline/promises.d.ts" />
|
||||
/// <reference path="repl.d.ts" />
|
||||
/// <reference path="sea.d.ts" />
|
||||
/// <reference path="sqlite.d.ts" />
|
||||
/// <reference path="stream.d.ts" />
|
||||
/// <reference path="stream/promises.d.ts" />
|
||||
/// <reference path="stream/consumers.d.ts" />
|
||||
@@ -85,5 +99,3 @@
|
||||
/// <reference path="wasi.d.ts" />
|
||||
/// <reference path="worker_threads.d.ts" />
|
||||
/// <reference path="zlib.d.ts" />
|
||||
|
||||
/// <reference path="globals.global.d.ts" />
|
||||
|
||||
2893
backend/node_modules/@types/node/inspector.d.ts
generated
vendored
2893
backend/node_modules/@types/node/inspector.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
925
backend/node_modules/@types/node/module.d.ts
generated
vendored
925
backend/node_modules/@types/node/module.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
137
backend/node_modules/@types/node/net.d.ts
generated
vendored
137
backend/node_modules/@types/node/net.d.ts
generated
vendored
@@ -8,11 +8,12 @@
|
||||
* It can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const net = require('node:net');
|
||||
* import net from 'node:net';
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/net.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/net.js)
|
||||
*/
|
||||
declare module "net" {
|
||||
import { NonSharedBuffer } from "node:buffer";
|
||||
import * as stream from "node:stream";
|
||||
import { Abortable, EventEmitter } from "node:events";
|
||||
import * as dns from "node:dns";
|
||||
@@ -29,28 +30,21 @@ declare module "net" {
|
||||
interface SocketConstructorOpts {
|
||||
fd?: number | undefined;
|
||||
allowHalfOpen?: boolean | undefined;
|
||||
onread?: OnReadOpts | undefined;
|
||||
readable?: boolean | undefined;
|
||||
writable?: boolean | undefined;
|
||||
signal?: AbortSignal;
|
||||
signal?: AbortSignal | undefined;
|
||||
}
|
||||
interface OnReadOpts {
|
||||
buffer: Uint8Array | (() => Uint8Array);
|
||||
/**
|
||||
* This function is called for every chunk of incoming data.
|
||||
* Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer.
|
||||
* Return false from this function to implicitly pause() the socket.
|
||||
* Two arguments are passed to it: the number of bytes written to `buffer` and a reference to `buffer`.
|
||||
* Return `false` from this function to implicitly `pause()` the socket.
|
||||
*/
|
||||
callback(bytesWritten: number, buf: Uint8Array): boolean;
|
||||
callback(bytesWritten: number, buffer: Uint8Array): boolean;
|
||||
}
|
||||
interface ConnectOpts {
|
||||
/**
|
||||
* If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket.
|
||||
* Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will
|
||||
* still be emitted as normal and methods like pause() and resume() will also behave as expected.
|
||||
*/
|
||||
onread?: OnReadOpts | undefined;
|
||||
}
|
||||
interface TcpSocketConnectOpts extends ConnectOpts {
|
||||
interface TcpSocketConnectOpts {
|
||||
port: number;
|
||||
host?: string | undefined;
|
||||
localAddress?: string | undefined;
|
||||
@@ -69,8 +63,9 @@ declare module "net" {
|
||||
* @since v18.13.0
|
||||
*/
|
||||
autoSelectFamilyAttemptTimeout?: number | undefined;
|
||||
blockList?: BlockList | undefined;
|
||||
}
|
||||
interface IpcSocketConnectOpts extends ConnectOpts {
|
||||
interface IpcSocketConnectOpts {
|
||||
path: string;
|
||||
}
|
||||
type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
|
||||
@@ -112,8 +107,8 @@ declare module "net" {
|
||||
* @since v0.1.90
|
||||
* @param [encoding='utf8'] Only used when data is `string`.
|
||||
*/
|
||||
write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
|
||||
write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean;
|
||||
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
|
||||
write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
|
||||
/**
|
||||
* Initiate a connection on a given socket.
|
||||
*
|
||||
@@ -327,25 +322,25 @@ declare module "net" {
|
||||
* the socket is destroyed (for example, if the client disconnected).
|
||||
* @since v0.5.10
|
||||
*/
|
||||
readonly remoteAddress?: string | undefined;
|
||||
readonly remoteAddress: string | undefined;
|
||||
/**
|
||||
* The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if
|
||||
* the socket is destroyed (for example, if the client disconnected).
|
||||
* @since v0.11.14
|
||||
*/
|
||||
readonly remoteFamily?: string | undefined;
|
||||
readonly remoteFamily: string | undefined;
|
||||
/**
|
||||
* The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if
|
||||
* the socket is destroyed (for example, if the client disconnected).
|
||||
* @since v0.5.10
|
||||
*/
|
||||
readonly remotePort?: number | undefined;
|
||||
readonly remotePort: number | undefined;
|
||||
/**
|
||||
* The socket timeout in milliseconds as set by `socket.setTimeout()`.
|
||||
* It is `undefined` if a timeout has not been set.
|
||||
* @since v10.7.0
|
||||
*/
|
||||
readonly timeout?: number | undefined;
|
||||
readonly timeout?: number;
|
||||
/**
|
||||
* Half-closes the socket. i.e., it sends a FIN packet. It is possible the
|
||||
* server will still send some data.
|
||||
@@ -380,13 +375,13 @@ declare module "net" {
|
||||
addListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
|
||||
addListener(
|
||||
event: "connectionAttemptFailed",
|
||||
listener: (ip: string, port: number, family: number) => void,
|
||||
listener: (ip: string, port: number, family: number, error: Error) => void,
|
||||
): this;
|
||||
addListener(
|
||||
event: "connectionAttemptTimeout",
|
||||
listener: (ip: string, port: number, family: number) => void,
|
||||
): this;
|
||||
addListener(event: "data", listener: (data: Buffer) => void): this;
|
||||
addListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
||||
addListener(event: "drain", listener: () => void): this;
|
||||
addListener(event: "end", listener: () => void): this;
|
||||
addListener(event: "error", listener: (err: Error) => void): this;
|
||||
@@ -400,9 +395,9 @@ declare module "net" {
|
||||
emit(event: "close", hadError: boolean): boolean;
|
||||
emit(event: "connect"): boolean;
|
||||
emit(event: "connectionAttempt", ip: string, port: number, family: number): boolean;
|
||||
emit(event: "connectionAttemptFailed", ip: string, port: number, family: number): boolean;
|
||||
emit(event: "connectionAttemptFailed", ip: string, port: number, family: number, error: Error): boolean;
|
||||
emit(event: "connectionAttemptTimeout", ip: string, port: number, family: number): boolean;
|
||||
emit(event: "data", data: Buffer): boolean;
|
||||
emit(event: "data", data: NonSharedBuffer): boolean;
|
||||
emit(event: "drain"): boolean;
|
||||
emit(event: "end"): boolean;
|
||||
emit(event: "error", err: Error): boolean;
|
||||
@@ -413,9 +408,12 @@ declare module "net" {
|
||||
on(event: "close", listener: (hadError: boolean) => void): this;
|
||||
on(event: "connect", listener: () => void): this;
|
||||
on(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
|
||||
on(event: "connectionAttemptFailed", listener: (ip: string, port: number, family: number) => void): this;
|
||||
on(
|
||||
event: "connectionAttemptFailed",
|
||||
listener: (ip: string, port: number, family: number, error: Error) => void,
|
||||
): this;
|
||||
on(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
|
||||
on(event: "data", listener: (data: Buffer) => void): this;
|
||||
on(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
||||
on(event: "drain", listener: () => void): this;
|
||||
on(event: "end", listener: () => void): this;
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
@@ -428,10 +426,13 @@ declare module "net" {
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "close", listener: (hadError: boolean) => void): this;
|
||||
once(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
|
||||
once(event: "connectionAttemptFailed", listener: (ip: string, port: number, family: number) => void): this;
|
||||
once(
|
||||
event: "connectionAttemptFailed",
|
||||
listener: (ip: string, port: number, family: number, error: Error) => void,
|
||||
): this;
|
||||
once(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
|
||||
once(event: "connect", listener: () => void): this;
|
||||
once(event: "data", listener: (data: Buffer) => void): this;
|
||||
once(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
||||
once(event: "drain", listener: () => void): this;
|
||||
once(event: "end", listener: () => void): this;
|
||||
once(event: "error", listener: (err: Error) => void): this;
|
||||
@@ -447,13 +448,13 @@ declare module "net" {
|
||||
prependListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
|
||||
prependListener(
|
||||
event: "connectionAttemptFailed",
|
||||
listener: (ip: string, port: number, family: number) => void,
|
||||
listener: (ip: string, port: number, family: number, error: Error) => void,
|
||||
): this;
|
||||
prependListener(
|
||||
event: "connectionAttemptTimeout",
|
||||
listener: (ip: string, port: number, family: number) => void,
|
||||
): this;
|
||||
prependListener(event: "data", listener: (data: Buffer) => void): this;
|
||||
prependListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
||||
prependListener(event: "drain", listener: () => void): this;
|
||||
prependListener(event: "end", listener: () => void): this;
|
||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
||||
@@ -472,13 +473,13 @@ declare module "net" {
|
||||
): this;
|
||||
prependOnceListener(
|
||||
event: "connectionAttemptFailed",
|
||||
listener: (ip: string, port: number, family: number) => void,
|
||||
listener: (ip: string, port: number, family: number, error: Error) => void,
|
||||
): this;
|
||||
prependOnceListener(
|
||||
event: "connectionAttemptTimeout",
|
||||
listener: (ip: string, port: number, family: number) => void,
|
||||
): this;
|
||||
prependOnceListener(event: "data", listener: (data: Buffer) => void): this;
|
||||
prependOnceListener(event: "data", listener: (data: NonSharedBuffer) => void): this;
|
||||
prependOnceListener(event: "drain", listener: () => void): this;
|
||||
prependOnceListener(event: "end", listener: () => void): this;
|
||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
||||
@@ -490,17 +491,18 @@ declare module "net" {
|
||||
prependOnceListener(event: "timeout", listener: () => void): this;
|
||||
}
|
||||
interface ListenOptions extends Abortable {
|
||||
port?: number | undefined;
|
||||
host?: string | undefined;
|
||||
backlog?: number | undefined;
|
||||
path?: string | undefined;
|
||||
exclusive?: boolean | undefined;
|
||||
readableAll?: boolean | undefined;
|
||||
writableAll?: boolean | undefined;
|
||||
host?: string | undefined;
|
||||
/**
|
||||
* @default false
|
||||
*/
|
||||
ipv6Only?: boolean | undefined;
|
||||
reusePort?: boolean | undefined;
|
||||
path?: string | undefined;
|
||||
port?: number | undefined;
|
||||
readableAll?: boolean | undefined;
|
||||
writableAll?: boolean | undefined;
|
||||
}
|
||||
interface ServerOpts {
|
||||
/**
|
||||
@@ -532,6 +534,21 @@ declare module "net" {
|
||||
* @since v16.5.0
|
||||
*/
|
||||
keepAliveInitialDelay?: number | undefined;
|
||||
/**
|
||||
* Optionally overrides all `net.Socket`s' `readableHighWaterMark` and `writableHighWaterMark`.
|
||||
* @default See [stream.getDefaultHighWaterMark()](https://nodejs.org/docs/latest-v24.x/api/stream.html#streamgetdefaulthighwatermarkobjectmode).
|
||||
* @since v18.17.0, v20.1.0
|
||||
*/
|
||||
highWaterMark?: number | undefined;
|
||||
/**
|
||||
* `blockList` can be used for disabling inbound
|
||||
* access to specific IP addresses, IP ranges, or IP subnets. This does not
|
||||
* work if the server is behind a reverse proxy, NAT, etc. because the address
|
||||
* checked against the block list is the address of the proxy, or the one
|
||||
* specified by the NAT.
|
||||
* @since v22.13.0
|
||||
*/
|
||||
blockList?: BlockList | undefined;
|
||||
}
|
||||
interface DropArgument {
|
||||
localAddress?: string;
|
||||
@@ -643,7 +660,7 @@ declare module "net" {
|
||||
* Callback should take two arguments `err` and `count`.
|
||||
* @since v0.9.7
|
||||
*/
|
||||
getConnections(cb: (error: Error | null, count: number) => void): void;
|
||||
getConnections(cb: (error: Error | null, count: number) => void): this;
|
||||
/**
|
||||
* Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior).
|
||||
* If the server is `ref`ed calling `ref()` again will have no effect.
|
||||
@@ -783,6 +800,33 @@ declare module "net" {
|
||||
* @since v15.0.0, v14.18.0
|
||||
*/
|
||||
rules: readonly string[];
|
||||
/**
|
||||
* Returns `true` if the `value` is a `net.BlockList`.
|
||||
* @since v22.13.0
|
||||
* @param value Any JS value
|
||||
*/
|
||||
static isBlockList(value: unknown): value is BlockList;
|
||||
/**
|
||||
* ```js
|
||||
* const blockList = new net.BlockList();
|
||||
* const data = [
|
||||
* 'Subnet: IPv4 192.168.1.0/24',
|
||||
* 'Address: IPv4 10.0.0.5',
|
||||
* 'Range: IPv4 192.168.2.1-192.168.2.10',
|
||||
* 'Range: IPv4 10.0.0.1-10.0.0.10',
|
||||
* ];
|
||||
* blockList.fromJSON(data);
|
||||
* blockList.fromJSON(JSON.stringify(data));
|
||||
* ```
|
||||
* @since v24.5.0
|
||||
* @experimental
|
||||
*/
|
||||
fromJSON(data: string | readonly string[]): void;
|
||||
/**
|
||||
* @since v24.5.0
|
||||
* @experimental
|
||||
*/
|
||||
toJSON(): readonly string[];
|
||||
}
|
||||
interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
|
||||
timeout?: number | undefined;
|
||||
@@ -812,7 +856,7 @@ declare module "net" {
|
||||
* on port 8124:
|
||||
*
|
||||
* ```js
|
||||
* const net = require('node:net');
|
||||
* import net from 'node:net';
|
||||
* const server = net.createServer((c) => {
|
||||
* // 'connection' listener.
|
||||
* console.log('client connected');
|
||||
@@ -894,6 +938,9 @@ declare module "net" {
|
||||
function getDefaultAutoSelectFamily(): boolean;
|
||||
/**
|
||||
* Sets the default value of the `autoSelectFamily` option of `socket.connect(options)`.
|
||||
* @param value The new default value.
|
||||
* The initial default value is `true`, unless the command line option
|
||||
* `--no-network-family-autoselection` is provided.
|
||||
* @since v19.4.0
|
||||
*/
|
||||
function setDefaultAutoSelectFamily(value: boolean): void;
|
||||
@@ -992,6 +1039,14 @@ declare module "net" {
|
||||
* @since v15.14.0, v14.18.0
|
||||
*/
|
||||
readonly flowlabel: number;
|
||||
/**
|
||||
* @since v22.13.0
|
||||
* @param input An input string containing an IP address and optional port,
|
||||
* e.g. `123.1.2.3:1234` or `[1::1]:1234`.
|
||||
* @returns Returns a `SocketAddress` if parsing was successful.
|
||||
* Otherwise returns `undefined`.
|
||||
*/
|
||||
static parse(input: string): SocketAddress | undefined;
|
||||
}
|
||||
}
|
||||
declare module "node:net" {
|
||||
|
||||
34
backend/node_modules/@types/node/os.d.ts
generated
vendored
34
backend/node_modules/@types/node/os.d.ts
generated
vendored
@@ -3,11 +3,12 @@
|
||||
* properties. It can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const os = require('node:os');
|
||||
* import os from 'node:os';
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/os.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/os.js)
|
||||
*/
|
||||
declare module "os" {
|
||||
import { NonSharedBuffer } from "buffer";
|
||||
interface CpuInfo {
|
||||
model: string;
|
||||
speed: number;
|
||||
@@ -30,10 +31,10 @@ declare module "os" {
|
||||
mac: string;
|
||||
internal: boolean;
|
||||
cidr: string | null;
|
||||
scopeid?: number;
|
||||
}
|
||||
interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
|
||||
family: "IPv4";
|
||||
scopeid?: undefined;
|
||||
}
|
||||
interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
|
||||
family: "IPv6";
|
||||
@@ -231,6 +232,15 @@ declare module "os" {
|
||||
* @since v2.3.0
|
||||
*/
|
||||
function homedir(): string;
|
||||
interface UserInfoOptions {
|
||||
encoding?: BufferEncoding | "buffer" | undefined;
|
||||
}
|
||||
interface UserInfoOptionsWithBufferEncoding extends UserInfoOptions {
|
||||
encoding: "buffer";
|
||||
}
|
||||
interface UserInfoOptionsWithStringEncoding extends UserInfoOptions {
|
||||
encoding?: BufferEncoding | undefined;
|
||||
}
|
||||
/**
|
||||
* Returns information about the currently effective user. On POSIX platforms,
|
||||
* this is typically a subset of the password file. The returned object includes
|
||||
@@ -241,11 +251,12 @@ declare module "os" {
|
||||
* environment variables for the home directory before falling back to the
|
||||
* operating system response.
|
||||
*
|
||||
* Throws a [`SystemError`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`.
|
||||
* Throws a [`SystemError`](https://nodejs.org/docs/latest-v24.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`.
|
||||
* @since v6.0.0
|
||||
*/
|
||||
function userInfo(options: { encoding: "buffer" }): UserInfo<Buffer>;
|
||||
function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;
|
||||
function userInfo(options?: UserInfoOptionsWithStringEncoding): UserInfo<string>;
|
||||
function userInfo(options: UserInfoOptionsWithBufferEncoding): UserInfo<NonSharedBuffer>;
|
||||
function userInfo(options: UserInfoOptions): UserInfo<string | NonSharedBuffer>;
|
||||
type SignalConstants = {
|
||||
[key in NodeJS.Signals]: number;
|
||||
};
|
||||
@@ -417,13 +428,13 @@ declare module "os" {
|
||||
const EOL: string;
|
||||
/**
|
||||
* Returns the operating system CPU architecture for which the Node.js binary was
|
||||
* compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`,
|
||||
* and `'x64'`.
|
||||
* compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`,
|
||||
* `'mips'`, `'mipsel'`, `'ppc64'`, `'riscv64'`, `'s390x'`, and `'x64'`.
|
||||
*
|
||||
* The return value is equivalent to [process.arch](https://nodejs.org/docs/latest-v20.x/api/process.html#processarch).
|
||||
* The return value is equivalent to [process.arch](https://nodejs.org/docs/latest-v24.x/api/process.html#processarch).
|
||||
* @since v0.5.0
|
||||
*/
|
||||
function arch(): string;
|
||||
function arch(): NodeJS.Architecture;
|
||||
/**
|
||||
* Returns a string identifying the kernel version.
|
||||
*
|
||||
@@ -445,7 +456,8 @@ declare module "os" {
|
||||
*/
|
||||
function platform(): NodeJS.Platform;
|
||||
/**
|
||||
* Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`, `mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`.
|
||||
* Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`,
|
||||
* `mips`, `mips64`, `ppc64`, `ppc64le`, `s390x`, `i386`, `i686`, `x86_64`.
|
||||
*
|
||||
* On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
|
||||
* available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
|
||||
|
||||
116
backend/node_modules/@types/node/package.json
generated
vendored
116
backend/node_modules/@types/node/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@types/node",
|
||||
"version": "20.14.12",
|
||||
"version": "24.10.0",
|
||||
"description": "TypeScript definitions for node",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
||||
"license": "MIT",
|
||||
@@ -15,11 +15,6 @@
|
||||
"githubUsername": "jkomyno",
|
||||
"url": "https://github.com/jkomyno"
|
||||
},
|
||||
{
|
||||
"name": "Alvis HT Tang",
|
||||
"githubUsername": "alvis",
|
||||
"url": "https://github.com/alvis"
|
||||
},
|
||||
{
|
||||
"name": "Andrew Makarov",
|
||||
"githubUsername": "r3nya",
|
||||
@@ -30,56 +25,11 @@
|
||||
"githubUsername": "btoueg",
|
||||
"url": "https://github.com/btoueg"
|
||||
},
|
||||
{
|
||||
"name": "Chigozirim C.",
|
||||
"githubUsername": "smac89",
|
||||
"url": "https://github.com/smac89"
|
||||
},
|
||||
{
|
||||
"name": "David Junger",
|
||||
"githubUsername": "touffy",
|
||||
"url": "https://github.com/touffy"
|
||||
},
|
||||
{
|
||||
"name": "Deividas Bakanas",
|
||||
"githubUsername": "DeividasBakanas",
|
||||
"url": "https://github.com/DeividasBakanas"
|
||||
},
|
||||
{
|
||||
"name": "Eugene Y. Q. Shen",
|
||||
"githubUsername": "eyqs",
|
||||
"url": "https://github.com/eyqs"
|
||||
},
|
||||
{
|
||||
"name": "Hannes Magnusson",
|
||||
"githubUsername": "Hannes-Magnusson-CK",
|
||||
"url": "https://github.com/Hannes-Magnusson-CK"
|
||||
},
|
||||
{
|
||||
"name": "Huw",
|
||||
"githubUsername": "hoo29",
|
||||
"url": "https://github.com/hoo29"
|
||||
},
|
||||
{
|
||||
"name": "Kelvin Jin",
|
||||
"githubUsername": "kjin",
|
||||
"url": "https://github.com/kjin"
|
||||
},
|
||||
{
|
||||
"name": "Klaus Meinhardt",
|
||||
"githubUsername": "ajafff",
|
||||
"url": "https://github.com/ajafff"
|
||||
},
|
||||
{
|
||||
"name": "Lishude",
|
||||
"githubUsername": "islishude",
|
||||
"url": "https://github.com/islishude"
|
||||
},
|
||||
{
|
||||
"name": "Mariusz Wiktorczyk",
|
||||
"githubUsername": "mwiktorczyk",
|
||||
"url": "https://github.com/mwiktorczyk"
|
||||
},
|
||||
{
|
||||
"name": "Mohsen Azimi",
|
||||
"githubUsername": "mohsen1",
|
||||
@@ -90,46 +40,16 @@
|
||||
"githubUsername": "galkin",
|
||||
"url": "https://github.com/galkin"
|
||||
},
|
||||
{
|
||||
"name": "Parambir Singh",
|
||||
"githubUsername": "parambirs",
|
||||
"url": "https://github.com/parambirs"
|
||||
},
|
||||
{
|
||||
"name": "Sebastian Silbermann",
|
||||
"githubUsername": "eps1lon",
|
||||
"url": "https://github.com/eps1lon"
|
||||
},
|
||||
{
|
||||
"name": "Thomas den Hollander",
|
||||
"githubUsername": "ThomasdenH",
|
||||
"url": "https://github.com/ThomasdenH"
|
||||
},
|
||||
{
|
||||
"name": "Wilco Bakker",
|
||||
"githubUsername": "WilcoBakker",
|
||||
"url": "https://github.com/WilcoBakker"
|
||||
},
|
||||
{
|
||||
"name": "wwwy3y3",
|
||||
"githubUsername": "wwwy3y3",
|
||||
"url": "https://github.com/wwwy3y3"
|
||||
},
|
||||
{
|
||||
"name": "Samuel Ainsworth",
|
||||
"githubUsername": "samuela",
|
||||
"url": "https://github.com/samuela"
|
||||
},
|
||||
{
|
||||
"name": "Kyle Uehlein",
|
||||
"githubUsername": "kuehlein",
|
||||
"url": "https://github.com/kuehlein"
|
||||
},
|
||||
{
|
||||
"name": "Thanik Bhongbhibhat",
|
||||
"githubUsername": "bhongy",
|
||||
"url": "https://github.com/bhongy"
|
||||
},
|
||||
{
|
||||
"name": "Marcin Kopacz",
|
||||
"githubUsername": "chyzwar",
|
||||
@@ -170,11 +90,6 @@
|
||||
"githubUsername": "victorperin",
|
||||
"url": "https://github.com/victorperin"
|
||||
},
|
||||
{
|
||||
"name": "Yongsheng Zhang",
|
||||
"githubUsername": "ZYSzys",
|
||||
"url": "https://github.com/ZYSzys"
|
||||
},
|
||||
{
|
||||
"name": "NodeJS Contributors",
|
||||
"githubUsername": "NodeJS",
|
||||
@@ -199,10 +114,32 @@
|
||||
"name": "Dmitry Semigradsky",
|
||||
"githubUsername": "Semigradsky",
|
||||
"url": "https://github.com/Semigradsky"
|
||||
},
|
||||
{
|
||||
"name": "René",
|
||||
"githubUsername": "Renegade334",
|
||||
"url": "https://github.com/Renegade334"
|
||||
},
|
||||
{
|
||||
"name": "Yagiz Nizipli",
|
||||
"githubUsername": "anonrig",
|
||||
"url": "https://github.com/anonrig"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"typesVersions": {
|
||||
"<=5.6": {
|
||||
"*": [
|
||||
"ts5.6/*"
|
||||
]
|
||||
},
|
||||
"<=5.7": {
|
||||
"*": [
|
||||
"ts5.7/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
@@ -210,8 +147,9 @@
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"undici-types": "~5.26.4"
|
||||
"undici-types": "~7.16.0"
|
||||
},
|
||||
"typesPublisherContentHash": "9e6a411f225bdb4e807bf8a25271d2fc7c8aa163691598117f118732284e76e0",
|
||||
"typeScriptVersion": "4.8"
|
||||
"peerDependencies": {},
|
||||
"typesPublisherContentHash": "520eb7d36290a7656940213fbf34026408b9af9ff538455bf669b4ea7a21d5bf",
|
||||
"typeScriptVersion": "5.2"
|
||||
}
|
||||
13
backend/node_modules/@types/node/path.d.ts
generated
vendored
13
backend/node_modules/@types/node/path.d.ts
generated
vendored
@@ -11,9 +11,9 @@ declare module "path/win32" {
|
||||
* paths. It can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const path = require('node:path');
|
||||
* import path from 'node:path';
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/path.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/path.js)
|
||||
*/
|
||||
declare module "path" {
|
||||
namespace path {
|
||||
@@ -94,6 +94,15 @@ declare module "path" {
|
||||
* @throws {TypeError} if any of the arguments is not a string.
|
||||
*/
|
||||
resolve(...paths: string[]): string;
|
||||
/**
|
||||
* The `path.matchesGlob()` method determines if `path` matches the `pattern`.
|
||||
* @param path The path to glob-match against.
|
||||
* @param pattern The glob to check the path against.
|
||||
* @returns Whether or not the `path` matched the `pattern`.
|
||||
* @throws {TypeError} if `path` or `pattern` are not strings.
|
||||
* @since v22.5.0
|
||||
*/
|
||||
matchesGlob(path: string, pattern: string): boolean;
|
||||
/**
|
||||
* Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
|
||||
*
|
||||
|
||||
153
backend/node_modules/@types/node/perf_hooks.d.ts
generated
vendored
153
backend/node_modules/@types/node/perf_hooks.d.ts
generated
vendored
@@ -10,7 +10,7 @@
|
||||
* * [Resource Timing](https://www.w3.org/TR/resource-timing-2/)
|
||||
*
|
||||
* ```js
|
||||
* const { PerformanceObserver, performance } = require('node:perf_hooks');
|
||||
* import { PerformanceObserver, performance } from 'node:perf_hooks';
|
||||
*
|
||||
* const obs = new PerformanceObserver((items) => {
|
||||
* console.log(items.getEntries()[0].duration);
|
||||
@@ -27,24 +27,34 @@
|
||||
* performance.measure('A to B', 'A', 'B');
|
||||
* });
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/perf_hooks.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/perf_hooks.js)
|
||||
*/
|
||||
declare module "perf_hooks" {
|
||||
import { AsyncResource } from "node:async_hooks";
|
||||
type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns" | "net";
|
||||
type EntryType =
|
||||
| "dns" // Node.js only
|
||||
| "function" // Node.js only
|
||||
| "gc" // Node.js only
|
||||
| "http2" // Node.js only
|
||||
| "http" // Node.js only
|
||||
| "mark" // available on the Web
|
||||
| "measure" // available on the Web
|
||||
| "net" // Node.js only
|
||||
| "node" // Node.js only
|
||||
| "resource"; // available on the Web
|
||||
interface NodeGCPerformanceDetail {
|
||||
/**
|
||||
* When `performanceEntry.entryType` is equal to 'gc', the `performance.kind` property identifies
|
||||
* the type of garbage collection operation that occurred.
|
||||
* See perf_hooks.constants for valid values.
|
||||
*/
|
||||
readonly kind?: number | undefined;
|
||||
readonly kind: number;
|
||||
/**
|
||||
* When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
|
||||
* property contains additional information about garbage collection operation.
|
||||
* See perf_hooks.constants for valid values.
|
||||
*/
|
||||
readonly flags?: number | undefined;
|
||||
readonly flags: number;
|
||||
}
|
||||
/**
|
||||
* The constructor of this class is not exposed to users directly.
|
||||
@@ -82,11 +92,6 @@ declare module "perf_hooks" {
|
||||
* @since v8.5.0
|
||||
*/
|
||||
readonly entryType: EntryType;
|
||||
/**
|
||||
* Additional detail specific to the `entryType`.
|
||||
* @since v16.0.0
|
||||
*/
|
||||
readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
|
||||
toJSON(): any;
|
||||
}
|
||||
/**
|
||||
@@ -94,6 +99,7 @@ declare module "perf_hooks" {
|
||||
* @since v18.2.0, v16.17.0
|
||||
*/
|
||||
class PerformanceMark extends PerformanceEntry {
|
||||
readonly detail: any;
|
||||
readonly duration: 0;
|
||||
readonly entryType: "mark";
|
||||
}
|
||||
@@ -104,8 +110,24 @@ declare module "perf_hooks" {
|
||||
* @since v18.2.0, v16.17.0
|
||||
*/
|
||||
class PerformanceMeasure extends PerformanceEntry {
|
||||
readonly detail: any;
|
||||
readonly entryType: "measure";
|
||||
}
|
||||
interface UVMetrics {
|
||||
/**
|
||||
* Number of event loop iterations.
|
||||
*/
|
||||
readonly loopCount: number;
|
||||
/**
|
||||
* Number of events that have been processed by the event handler.
|
||||
*/
|
||||
readonly events: number;
|
||||
/**
|
||||
* Number of events that were waiting to be processed when the event provider was called.
|
||||
*/
|
||||
readonly eventsWaiting: number;
|
||||
}
|
||||
// TODO: PerformanceNodeEntry is missing
|
||||
/**
|
||||
* _This property is an extension by Node.js. It is not available in Web browsers._
|
||||
*
|
||||
@@ -114,6 +136,7 @@ declare module "perf_hooks" {
|
||||
* @since v8.5.0
|
||||
*/
|
||||
class PerformanceNodeTiming extends PerformanceEntry {
|
||||
readonly entryType: "node";
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which the Node.js process
|
||||
* completed bootstrapping. If bootstrapping has not yet finished, the property
|
||||
@@ -155,6 +178,16 @@ declare module "perf_hooks" {
|
||||
* @since v8.5.0
|
||||
*/
|
||||
readonly nodeStart: number;
|
||||
/**
|
||||
* This is a wrapper to the `uv_metrics_info` function.
|
||||
* It returns the current set of event loop metrics.
|
||||
*
|
||||
* It is recommended to use this property inside a function whose execution was
|
||||
* scheduled using `setImmediate` to avoid collecting metrics before finishing all
|
||||
* operations scheduled during the current loop iteration.
|
||||
* @since v22.8.0, v20.18.0
|
||||
*/
|
||||
readonly uvMetricsInfo: UVMetrics;
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which the V8 platform was
|
||||
* initialized.
|
||||
@@ -190,7 +223,7 @@ declare module "perf_hooks" {
|
||||
/**
|
||||
* Additional optional detail to include with the mark.
|
||||
*/
|
||||
detail?: unknown | undefined;
|
||||
detail?: unknown;
|
||||
/**
|
||||
* Duration between start and end times.
|
||||
*/
|
||||
@@ -270,6 +303,30 @@ declare module "perf_hooks" {
|
||||
* @param name
|
||||
*/
|
||||
mark(name: string, options?: MarkOptions): PerformanceMark;
|
||||
/**
|
||||
* Creates a new `PerformanceResourceTiming` entry in the Resource Timeline.
|
||||
* A `PerformanceResourceTiming` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'resource'`.
|
||||
* Performance resources are used to mark moments in the Resource Timeline.
|
||||
* @param timingInfo [Fetch Timing Info](https://fetch.spec.whatwg.org/#fetch-timing-info)
|
||||
* @param requestedUrl The resource url
|
||||
* @param initiatorType The initiator name, e.g: 'fetch'
|
||||
* @param global
|
||||
* @param cacheMode The cache mode must be an empty string ('') or 'local'
|
||||
* @param bodyInfo [Fetch Response Body Info](https://fetch.spec.whatwg.org/#response-body-info)
|
||||
* @param responseStatus The response's status code
|
||||
* @param deliveryType The delivery type. Default: ''.
|
||||
* @since v18.2.0, v16.17.0
|
||||
*/
|
||||
markResourceTiming(
|
||||
timingInfo: object,
|
||||
requestedUrl: string,
|
||||
initiatorType: string,
|
||||
global: object,
|
||||
cacheMode: "" | "local",
|
||||
bodyInfo: object,
|
||||
responseStatus: number,
|
||||
deliveryType?: string,
|
||||
): PerformanceResourceTiming;
|
||||
/**
|
||||
* Creates a new PerformanceMeasure entry in the Performance Timeline.
|
||||
* A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
|
||||
@@ -320,10 +377,10 @@ declare module "perf_hooks" {
|
||||
* A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed.
|
||||
*
|
||||
* ```js
|
||||
* const {
|
||||
* import {
|
||||
* performance,
|
||||
* PerformanceObserver,
|
||||
* } = require('node:perf_hooks');
|
||||
* } from 'node:perf_hooks';
|
||||
*
|
||||
* function someFunction() {
|
||||
* console.log('hello world');
|
||||
@@ -362,10 +419,10 @@ declare module "perf_hooks" {
|
||||
* with respect to `performanceEntry.startTime`.
|
||||
*
|
||||
* ```js
|
||||
* const {
|
||||
* import {
|
||||
* performance,
|
||||
* PerformanceObserver,
|
||||
* } = require('node:perf_hooks');
|
||||
* } from 'node:perf_hooks';
|
||||
*
|
||||
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
||||
* console.log(perfObserverList.getEntries());
|
||||
@@ -405,10 +462,10 @@ declare module "perf_hooks" {
|
||||
* equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`.
|
||||
*
|
||||
* ```js
|
||||
* const {
|
||||
* import {
|
||||
* performance,
|
||||
* PerformanceObserver,
|
||||
* } = require('node:perf_hooks');
|
||||
* } from 'node:perf_hooks';
|
||||
*
|
||||
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
||||
* console.log(perfObserverList.getEntriesByName('meow'));
|
||||
@@ -456,10 +513,10 @@ declare module "perf_hooks" {
|
||||
* with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`.
|
||||
*
|
||||
* ```js
|
||||
* const {
|
||||
* import {
|
||||
* performance,
|
||||
* PerformanceObserver,
|
||||
* } = require('node:perf_hooks');
|
||||
* } from 'node:perf_hooks';
|
||||
*
|
||||
* const obs = new PerformanceObserver((perfObserverList, observer) => {
|
||||
* console.log(perfObserverList.getEntriesByType('mark'));
|
||||
@@ -509,10 +566,10 @@ declare module "perf_hooks" {
|
||||
* Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes` or `options.type`:
|
||||
*
|
||||
* ```js
|
||||
* const {
|
||||
* import {
|
||||
* performance,
|
||||
* PerformanceObserver,
|
||||
* } = require('node:perf_hooks');
|
||||
* } from 'node:perf_hooks';
|
||||
*
|
||||
* const obs = new PerformanceObserver((list, observer) => {
|
||||
* // Called once asynchronously. `list` contains three items.
|
||||
@@ -535,6 +592,11 @@ declare module "perf_hooks" {
|
||||
buffered?: boolean | undefined;
|
||||
},
|
||||
): void;
|
||||
/**
|
||||
* @since v16.0.0
|
||||
* @returns Current list of entries stored in the performance observer, emptying it out.
|
||||
*/
|
||||
takeRecords(): PerformanceEntry[];
|
||||
}
|
||||
/**
|
||||
* Provides detailed network timing data regarding the loading of an application's resources.
|
||||
@@ -543,6 +605,7 @@ declare module "perf_hooks" {
|
||||
* @since v18.2.0, v16.17.0
|
||||
*/
|
||||
class PerformanceResourceTiming extends PerformanceEntry {
|
||||
readonly entryType: "resource";
|
||||
protected constructor();
|
||||
/**
|
||||
* The high resolution millisecond timestamp at immediately before dispatching the `fetch`
|
||||
@@ -748,6 +811,20 @@ declare module "perf_hooks" {
|
||||
* @since v11.10.0
|
||||
*/
|
||||
disable(): boolean;
|
||||
/**
|
||||
* Disables the update interval timer when the histogram is disposed.
|
||||
*
|
||||
* ```js
|
||||
* const { monitorEventLoopDelay } = require('node:perf_hooks');
|
||||
* {
|
||||
* using hist = monitorEventLoopDelay({ resolution: 20 });
|
||||
* hist.enable();
|
||||
* // The histogram will be disabled when the block is exited.
|
||||
* }
|
||||
* ```
|
||||
* @since v24.2.0
|
||||
*/
|
||||
[Symbol.dispose](): void;
|
||||
}
|
||||
interface RecordableHistogram extends Histogram {
|
||||
/**
|
||||
@@ -780,7 +857,7 @@ declare module "perf_hooks" {
|
||||
* detect.
|
||||
*
|
||||
* ```js
|
||||
* const { monitorEventLoopDelay } = require('node:perf_hooks');
|
||||
* import { monitorEventLoopDelay } from 'node:perf_hooks';
|
||||
* const h = monitorEventLoopDelay({ resolution: 20 });
|
||||
* h.enable();
|
||||
* // Do something.
|
||||
@@ -801,12 +878,12 @@ declare module "perf_hooks" {
|
||||
* The minimum recordable value. Must be an integer value greater than 0.
|
||||
* @default 1
|
||||
*/
|
||||
min?: number | bigint | undefined;
|
||||
lowest?: number | bigint | undefined;
|
||||
/**
|
||||
* The maximum recordable value. Must be an integer value greater than min.
|
||||
* @default Number.MAX_SAFE_INTEGER
|
||||
*/
|
||||
max?: number | bigint | undefined;
|
||||
highest?: number | bigint | undefined;
|
||||
/**
|
||||
* The number of accuracy digits. Must be a number between 1 and 5.
|
||||
* @default 3
|
||||
@@ -829,8 +906,8 @@ declare module "perf_hooks" {
|
||||
} from "perf_hooks";
|
||||
global {
|
||||
/**
|
||||
* `PerformanceEntry` is a global reference for `require('node:perf_hooks').PerformanceEntry`
|
||||
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceentry
|
||||
* `PerformanceEntry` is a global reference for `import { PerformanceEntry } from 'node:perf_hooks'`
|
||||
* @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceentry
|
||||
* @since v19.0.0
|
||||
*/
|
||||
var PerformanceEntry: typeof globalThis extends {
|
||||
@@ -839,8 +916,8 @@ declare module "perf_hooks" {
|
||||
} ? T
|
||||
: typeof _PerformanceEntry;
|
||||
/**
|
||||
* `PerformanceMark` is a global reference for `require('node:perf_hooks').PerformanceMark`
|
||||
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performancemark
|
||||
* `PerformanceMark` is a global reference for `import { PerformanceMark } from 'node:perf_hooks'`
|
||||
* @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performancemark
|
||||
* @since v19.0.0
|
||||
*/
|
||||
var PerformanceMark: typeof globalThis extends {
|
||||
@@ -849,8 +926,8 @@ declare module "perf_hooks" {
|
||||
} ? T
|
||||
: typeof _PerformanceMark;
|
||||
/**
|
||||
* `PerformanceMeasure` is a global reference for `require('node:perf_hooks').PerformanceMeasure`
|
||||
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performancemeasure
|
||||
* `PerformanceMeasure` is a global reference for `import { PerformanceMeasure } from 'node:perf_hooks'`
|
||||
* @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performancemeasure
|
||||
* @since v19.0.0
|
||||
*/
|
||||
var PerformanceMeasure: typeof globalThis extends {
|
||||
@@ -859,8 +936,8 @@ declare module "perf_hooks" {
|
||||
} ? T
|
||||
: typeof _PerformanceMeasure;
|
||||
/**
|
||||
* `PerformanceObserver` is a global reference for `require('node:perf_hooks').PerformanceObserver`
|
||||
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceobserver
|
||||
* `PerformanceObserver` is a global reference for `import { PerformanceObserver } from 'node:perf_hooks'`
|
||||
* @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceobserver
|
||||
* @since v19.0.0
|
||||
*/
|
||||
var PerformanceObserver: typeof globalThis extends {
|
||||
@@ -869,8 +946,8 @@ declare module "perf_hooks" {
|
||||
} ? T
|
||||
: typeof _PerformanceObserver;
|
||||
/**
|
||||
* `PerformanceObserverEntryList` is a global reference for `require('node:perf_hooks').PerformanceObserverEntryList`
|
||||
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceobserverentrylist
|
||||
* `PerformanceObserverEntryList` is a global reference for `import { PerformanceObserverEntryList } from 'node:perf_hooks'`
|
||||
* @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceobserverentrylist
|
||||
* @since v19.0.0
|
||||
*/
|
||||
var PerformanceObserverEntryList: typeof globalThis extends {
|
||||
@@ -879,8 +956,8 @@ declare module "perf_hooks" {
|
||||
} ? T
|
||||
: typeof _PerformanceObserverEntryList;
|
||||
/**
|
||||
* `PerformanceResourceTiming` is a global reference for `require('node:perf_hooks').PerformanceResourceTiming`
|
||||
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceresourcetiming
|
||||
* `PerformanceResourceTiming` is a global reference for `import { PerformanceResourceTiming } from 'node:perf_hooks'`
|
||||
* @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceresourcetiming
|
||||
* @since v19.0.0
|
||||
*/
|
||||
var PerformanceResourceTiming: typeof globalThis extends {
|
||||
@@ -889,8 +966,8 @@ declare module "perf_hooks" {
|
||||
} ? T
|
||||
: typeof _PerformanceResourceTiming;
|
||||
/**
|
||||
* `performance` is a global reference for `require('node:perf_hooks').performance`
|
||||
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performance
|
||||
* `performance` is a global reference for `import { performance } from 'node:perf_hooks'`
|
||||
* @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performance
|
||||
* @since v16.0.0
|
||||
*/
|
||||
var performance: typeof globalThis extends {
|
||||
|
||||
428
backend/node_modules/@types/node/process.d.ts
generated
vendored
428
backend/node_modules/@types/node/process.d.ts
generated
vendored
@@ -1,8 +1,123 @@
|
||||
declare module "process" {
|
||||
import * as net from "node:net";
|
||||
import * as os from "node:os";
|
||||
import { Control, MessageOptions, SendHandle } from "node:child_process";
|
||||
import { PathLike } from "node:fs";
|
||||
import * as tty from "node:tty";
|
||||
import { Worker } from "node:worker_threads";
|
||||
|
||||
interface BuiltInModule {
|
||||
"assert": typeof import("assert");
|
||||
"node:assert": typeof import("node:assert");
|
||||
"assert/strict": typeof import("assert/strict");
|
||||
"node:assert/strict": typeof import("node:assert/strict");
|
||||
"async_hooks": typeof import("async_hooks");
|
||||
"node:async_hooks": typeof import("node:async_hooks");
|
||||
"buffer": typeof import("buffer");
|
||||
"node:buffer": typeof import("node:buffer");
|
||||
"child_process": typeof import("child_process");
|
||||
"node:child_process": typeof import("node:child_process");
|
||||
"cluster": typeof import("cluster");
|
||||
"node:cluster": typeof import("node:cluster");
|
||||
"console": typeof import("console");
|
||||
"node:console": typeof import("node:console");
|
||||
"constants": typeof import("constants");
|
||||
"node:constants": typeof import("node:constants");
|
||||
"crypto": typeof import("crypto");
|
||||
"node:crypto": typeof import("node:crypto");
|
||||
"dgram": typeof import("dgram");
|
||||
"node:dgram": typeof import("node:dgram");
|
||||
"diagnostics_channel": typeof import("diagnostics_channel");
|
||||
"node:diagnostics_channel": typeof import("node:diagnostics_channel");
|
||||
"dns": typeof import("dns");
|
||||
"node:dns": typeof import("node:dns");
|
||||
"dns/promises": typeof import("dns/promises");
|
||||
"node:dns/promises": typeof import("node:dns/promises");
|
||||
"domain": typeof import("domain");
|
||||
"node:domain": typeof import("node:domain");
|
||||
"events": typeof import("events");
|
||||
"node:events": typeof import("node:events");
|
||||
"fs": typeof import("fs");
|
||||
"node:fs": typeof import("node:fs");
|
||||
"fs/promises": typeof import("fs/promises");
|
||||
"node:fs/promises": typeof import("node:fs/promises");
|
||||
"http": typeof import("http");
|
||||
"node:http": typeof import("node:http");
|
||||
"http2": typeof import("http2");
|
||||
"node:http2": typeof import("node:http2");
|
||||
"https": typeof import("https");
|
||||
"node:https": typeof import("node:https");
|
||||
"inspector": typeof import("inspector");
|
||||
"node:inspector": typeof import("node:inspector");
|
||||
"inspector/promises": typeof import("inspector/promises");
|
||||
"node:inspector/promises": typeof import("node:inspector/promises");
|
||||
"module": typeof import("module");
|
||||
"node:module": typeof import("node:module");
|
||||
"net": typeof import("net");
|
||||
"node:net": typeof import("node:net");
|
||||
"os": typeof import("os");
|
||||
"node:os": typeof import("node:os");
|
||||
"path": typeof import("path");
|
||||
"node:path": typeof import("node:path");
|
||||
"path/posix": typeof import("path/posix");
|
||||
"node:path/posix": typeof import("node:path/posix");
|
||||
"path/win32": typeof import("path/win32");
|
||||
"node:path/win32": typeof import("node:path/win32");
|
||||
"perf_hooks": typeof import("perf_hooks");
|
||||
"node:perf_hooks": typeof import("node:perf_hooks");
|
||||
"process": typeof import("process");
|
||||
"node:process": typeof import("node:process");
|
||||
"punycode": typeof import("punycode");
|
||||
"node:punycode": typeof import("node:punycode");
|
||||
"querystring": typeof import("querystring");
|
||||
"node:querystring": typeof import("node:querystring");
|
||||
"readline": typeof import("readline");
|
||||
"node:readline": typeof import("node:readline");
|
||||
"readline/promises": typeof import("readline/promises");
|
||||
"node:readline/promises": typeof import("node:readline/promises");
|
||||
"repl": typeof import("repl");
|
||||
"node:repl": typeof import("node:repl");
|
||||
"node:sea": typeof import("node:sea");
|
||||
"node:sqlite": typeof import("node:sqlite");
|
||||
"stream": typeof import("stream");
|
||||
"node:stream": typeof import("node:stream");
|
||||
"stream/consumers": typeof import("stream/consumers");
|
||||
"node:stream/consumers": typeof import("node:stream/consumers");
|
||||
"stream/promises": typeof import("stream/promises");
|
||||
"node:stream/promises": typeof import("node:stream/promises");
|
||||
"stream/web": typeof import("stream/web");
|
||||
"node:stream/web": typeof import("node:stream/web");
|
||||
"string_decoder": typeof import("string_decoder");
|
||||
"node:string_decoder": typeof import("node:string_decoder");
|
||||
"node:test": typeof import("node:test");
|
||||
"node:test/reporters": typeof import("node:test/reporters");
|
||||
"timers": typeof import("timers");
|
||||
"node:timers": typeof import("node:timers");
|
||||
"timers/promises": typeof import("timers/promises");
|
||||
"node:timers/promises": typeof import("node:timers/promises");
|
||||
"tls": typeof import("tls");
|
||||
"node:tls": typeof import("node:tls");
|
||||
"trace_events": typeof import("trace_events");
|
||||
"node:trace_events": typeof import("node:trace_events");
|
||||
"tty": typeof import("tty");
|
||||
"node:tty": typeof import("node:tty");
|
||||
"url": typeof import("url");
|
||||
"node:url": typeof import("node:url");
|
||||
"util": typeof import("util");
|
||||
"node:util": typeof import("node:util");
|
||||
"sys": typeof import("util");
|
||||
"node:sys": typeof import("node:util");
|
||||
"util/types": typeof import("util/types");
|
||||
"node:util/types": typeof import("node:util/types");
|
||||
"v8": typeof import("v8");
|
||||
"node:v8": typeof import("node:v8");
|
||||
"vm": typeof import("vm");
|
||||
"node:vm": typeof import("node:vm");
|
||||
"wasi": typeof import("wasi");
|
||||
"node:wasi": typeof import("node:wasi");
|
||||
"worker_threads": typeof import("worker_threads");
|
||||
"node:worker_threads": typeof import("node:worker_threads");
|
||||
"zlib": typeof import("zlib");
|
||||
"node:zlib": typeof import("node:zlib");
|
||||
}
|
||||
global {
|
||||
var process: NodeJS.Process;
|
||||
namespace NodeJS {
|
||||
@@ -55,6 +170,84 @@ declare module "process" {
|
||||
libUrl?: string | undefined;
|
||||
lts?: string | undefined;
|
||||
}
|
||||
interface ProcessFeatures {
|
||||
/**
|
||||
* A boolean value that is `true` if the current Node.js build is caching builtin modules.
|
||||
* @since v12.0.0
|
||||
*/
|
||||
readonly cached_builtins: boolean;
|
||||
/**
|
||||
* A boolean value that is `true` if the current Node.js build is a debug build.
|
||||
* @since v0.5.5
|
||||
*/
|
||||
readonly debug: boolean;
|
||||
/**
|
||||
* A boolean value that is `true` if the current Node.js build includes the inspector.
|
||||
* @since v11.10.0
|
||||
*/
|
||||
readonly inspector: boolean;
|
||||
/**
|
||||
* A boolean value that is `true` if the current Node.js build includes support for IPv6.
|
||||
*
|
||||
* Since all Node.js builds have IPv6 support, this value is always `true`.
|
||||
* @since v0.5.3
|
||||
* @deprecated This property is always true, and any checks based on it are redundant.
|
||||
*/
|
||||
readonly ipv6: boolean;
|
||||
/**
|
||||
* A boolean value that is `true` if the current Node.js build supports
|
||||
* [loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-v24.x/api/modules.md#loading-ecmascript-modules-using-require).
|
||||
* @since v22.10.0
|
||||
*/
|
||||
readonly require_module: boolean;
|
||||
/**
|
||||
* A boolean value that is `true` if the current Node.js build includes support for TLS.
|
||||
* @since v0.5.3
|
||||
*/
|
||||
readonly tls: boolean;
|
||||
/**
|
||||
* A boolean value that is `true` if the current Node.js build includes support for ALPN in TLS.
|
||||
*
|
||||
* In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional ALPN support.
|
||||
* This value is therefore identical to that of `process.features.tls`.
|
||||
* @since v4.8.0
|
||||
* @deprecated Use `process.features.tls` instead.
|
||||
*/
|
||||
readonly tls_alpn: boolean;
|
||||
/**
|
||||
* A boolean value that is `true` if the current Node.js build includes support for OCSP in TLS.
|
||||
*
|
||||
* In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional OCSP support.
|
||||
* This value is therefore identical to that of `process.features.tls`.
|
||||
* @since v0.11.13
|
||||
* @deprecated Use `process.features.tls` instead.
|
||||
*/
|
||||
readonly tls_ocsp: boolean;
|
||||
/**
|
||||
* A boolean value that is `true` if the current Node.js build includes support for SNI in TLS.
|
||||
*
|
||||
* In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional SNI support.
|
||||
* This value is therefore identical to that of `process.features.tls`.
|
||||
* @since v0.5.3
|
||||
* @deprecated Use `process.features.tls` instead.
|
||||
*/
|
||||
readonly tls_sni: boolean;
|
||||
/**
|
||||
* A value that is `"strip"` by default,
|
||||
* `"transform"` if Node.js is run with `--experimental-transform-types`, and `false` if
|
||||
* Node.js is run with `--no-experimental-strip-types`.
|
||||
* @since v22.10.0
|
||||
*/
|
||||
readonly typescript: "strip" | "transform" | false;
|
||||
/**
|
||||
* A boolean value that is `true` if the current Node.js build includes support for libuv.
|
||||
*
|
||||
* Since it's not possible to build Node.js without libuv, this value is always `true`.
|
||||
* @since v0.5.3
|
||||
* @deprecated This property is always true, and any checks based on it are redundant.
|
||||
*/
|
||||
readonly uv: boolean;
|
||||
}
|
||||
interface ProcessVersions extends Dict<string> {
|
||||
http_parser: string;
|
||||
node: string;
|
||||
@@ -84,10 +277,8 @@ declare module "process" {
|
||||
| "loong64"
|
||||
| "mips"
|
||||
| "mipsel"
|
||||
| "ppc"
|
||||
| "ppc64"
|
||||
| "riscv64"
|
||||
| "s390"
|
||||
| "s390x"
|
||||
| "x64";
|
||||
type Signals =
|
||||
@@ -141,7 +332,7 @@ declare module "process" {
|
||||
*/
|
||||
type UnhandledRejectionListener = (reason: unknown, promise: Promise<unknown>) => void;
|
||||
type WarningListener = (warning: Error) => void;
|
||||
type MessageListener = (message: unknown, sendHandle: unknown) => void;
|
||||
type MessageListener = (message: unknown, sendHandle: SendHandle) => void;
|
||||
type SignalsListener = (signal: Signals) => void;
|
||||
type MultipleResolveListener = (
|
||||
type: MultipleResolveType,
|
||||
@@ -157,14 +348,46 @@ declare module "process" {
|
||||
/**
|
||||
* Can be used to change the default timezone at runtime
|
||||
*/
|
||||
TZ?: string;
|
||||
TZ?: string | undefined;
|
||||
}
|
||||
interface HRTime {
|
||||
/**
|
||||
* This is the legacy version of {@link process.hrtime.bigint()}
|
||||
* before bigint was introduced in JavaScript.
|
||||
*
|
||||
* The `process.hrtime()` method returns the current high-resolution real time in a `[seconds, nanoseconds]` tuple `Array`,
|
||||
* where `nanoseconds` is the remaining part of the real time that can't be represented in second precision.
|
||||
*
|
||||
* `time` is an optional parameter that must be the result of a previous `process.hrtime()` call to diff with the current time.
|
||||
* If the parameter passed in is not a tuple `Array`, a TypeError will be thrown.
|
||||
* Passing in a user-defined array instead of the result of a previous call to `process.hrtime()` will lead to undefined behavior.
|
||||
*
|
||||
* These times are relative to an arbitrary time in the past,
|
||||
* and not related to the time of day and therefore not subject to clock drift.
|
||||
* The primary use is for measuring performance between intervals:
|
||||
* ```js
|
||||
* const { hrtime } = require('node:process');
|
||||
* const NS_PER_SEC = 1e9;
|
||||
* const time = hrtime();
|
||||
* // [ 1800216, 25 ]
|
||||
*
|
||||
* setTimeout(() => {
|
||||
* const diff = hrtime(time);
|
||||
* // [ 1, 552 ]
|
||||
*
|
||||
* console.log(`Benchmark took ${diff[0] * NS_PER_SEC + diff[1]} nanoseconds`);
|
||||
* // Benchmark took 1000000552 nanoseconds
|
||||
* }, 1000);
|
||||
* ```
|
||||
* @since 0.7.6
|
||||
* @legacy Use {@link process.hrtime.bigint()} instead.
|
||||
* @param time The result of a previous call to `process.hrtime()`
|
||||
*/
|
||||
(time?: [number, number]): [number, number];
|
||||
/**
|
||||
* The `bigint` version of the `{@link hrtime()}` method returning the current high-resolution real time in nanoseconds as a `bigint`.
|
||||
* The `bigint` version of the {@link process.hrtime()} method returning the current high-resolution real time in nanoseconds as a `bigint`.
|
||||
*
|
||||
* Unlike `{@link hrtime()}`, it does not support an additional time argument since the difference can just be computed directly by subtraction of the two `bigint`s.
|
||||
* Unlike {@link process.hrtime()}, it does not support an additional time argument since the difference can just be computed directly by subtraction of the two `bigint`s.
|
||||
* ```js
|
||||
* import { hrtime } from 'node:process';
|
||||
*
|
||||
@@ -179,6 +402,7 @@ declare module "process" {
|
||||
* // Benchmark took 1154389282 nanoseconds
|
||||
* }, 1000);
|
||||
* ```
|
||||
* @since v10.7.0
|
||||
*/
|
||||
bigint(): bigint;
|
||||
}
|
||||
@@ -209,24 +433,28 @@ declare module "process" {
|
||||
has(scope: string, reference?: string): boolean;
|
||||
}
|
||||
interface ProcessReport {
|
||||
/**
|
||||
* Write reports in a compact format, single-line JSON, more easily consumable by log processing systems
|
||||
* than the default multi-line format designed for human consumption.
|
||||
* @since v13.12.0, v12.17.0
|
||||
*/
|
||||
compact: boolean;
|
||||
/**
|
||||
* Directory where the report is written.
|
||||
* The default value is the empty string, indicating that reports are written to the current
|
||||
* working directory of the Node.js process.
|
||||
* @default '' indicating that reports are written to the current
|
||||
*/
|
||||
directory: string;
|
||||
/**
|
||||
* Filename where the report is written.
|
||||
* The default value is the empty string.
|
||||
* @default '' the output filename will be comprised of a timestamp,
|
||||
* PID, and sequence number.
|
||||
* Filename where the report is written. If set to the empty string, the output filename will be comprised
|
||||
* of a timestamp, PID, and sequence number. The default value is the empty string.
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* Returns a JSON-formatted diagnostic report for the running process.
|
||||
* The report's JavaScript stack trace is taken from err, if present.
|
||||
* Returns a JavaScript Object representation of a diagnostic report for the running process.
|
||||
* The report's JavaScript stack trace is taken from `err`, if present.
|
||||
*/
|
||||
getReport(err?: Error): string;
|
||||
getReport(err?: Error): object;
|
||||
/**
|
||||
* If true, a diagnostic report is generated on fatal errors,
|
||||
* such as out of memory errors or failed C++ assertions.
|
||||
@@ -252,18 +480,19 @@ declare module "process" {
|
||||
/**
|
||||
* Writes a diagnostic report to a file. If filename is not provided, the default filename
|
||||
* includes the date, time, PID, and a sequence number.
|
||||
* The report's JavaScript stack trace is taken from err, if present.
|
||||
* The report's JavaScript stack trace is taken from `err`, if present.
|
||||
*
|
||||
* If the value of filename is set to `'stdout'` or `'stderr'`, the report is written
|
||||
* to the stdout or stderr of the process respectively.
|
||||
* @param fileName Name of the file where the report is written.
|
||||
* This should be a relative path, that will be appended to the directory specified in
|
||||
* `process.report.directory`, or the current working directory of the Node.js process,
|
||||
* if unspecified.
|
||||
* @param error A custom error used for reporting the JavaScript stack.
|
||||
* @param err A custom error used for reporting the JavaScript stack.
|
||||
* @return Filename of the generated report.
|
||||
*/
|
||||
writeReport(fileName?: string): string;
|
||||
writeReport(error?: Error): string;
|
||||
writeReport(fileName?: string, err?: Error): string;
|
||||
writeReport(err?: Error): string;
|
||||
}
|
||||
interface ResourceUsage {
|
||||
fsRead: number;
|
||||
@@ -520,7 +749,7 @@ declare module "process" {
|
||||
* should not be used directly, except in special cases. In other words, `require()` should be preferred over `process.dlopen()`
|
||||
* unless there are specific reasons such as custom dlopen flags or loading from ES modules.
|
||||
*
|
||||
* The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v20.x/api/os.html#dlopen-constants)`
|
||||
* The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v24.x/api/os.html#dlopen-constants)`
|
||||
* documentation for details.
|
||||
*
|
||||
* An important requirement when calling `process.dlopen()` is that the `module` instance must be passed. Functions exported by the C++ Addon
|
||||
@@ -763,7 +992,7 @@ declare module "process" {
|
||||
* @since v0.1.13
|
||||
* @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed.
|
||||
*/
|
||||
exit(code?: number | string | null | undefined): never;
|
||||
exit(code?: number | string | null): never;
|
||||
/**
|
||||
* A number which will be the process exit code, when the process either
|
||||
* exits gracefully, or is exited via {@link exit} without specifying
|
||||
@@ -774,7 +1003,41 @@ declare module "process" {
|
||||
* @default undefined
|
||||
* @since v0.11.8
|
||||
*/
|
||||
exitCode?: number | string | number | undefined;
|
||||
exitCode: number | string | null | undefined;
|
||||
finalization: {
|
||||
/**
|
||||
* This function registers a callback to be called when the process emits the `exit` event if the `ref` object was not garbage collected.
|
||||
* If the object `ref` was garbage collected before the `exit` event is emitted, the callback will be removed from the finalization registry, and it will not be called on process exit.
|
||||
*
|
||||
* Inside the callback you can release the resources allocated by the `ref` object.
|
||||
* Be aware that all limitations applied to the `beforeExit` event are also applied to the callback function,
|
||||
* this means that there is a possibility that the callback will not be called under special circumstances.
|
||||
*
|
||||
* The idea of this function is to help you free up resources when the starts process exiting, but also let the object be garbage collected if it is no longer being used.
|
||||
* @param ref The reference to the resource that is being tracked.
|
||||
* @param callback The callback function to be called when the resource is finalized.
|
||||
* @since v22.5.0
|
||||
* @experimental
|
||||
*/
|
||||
register<T extends object>(ref: T, callback: (ref: T, event: "exit") => void): void;
|
||||
/**
|
||||
* This function behaves exactly like the `register`, except that the callback will be called when the process emits the `beforeExit` event if `ref` object was not garbage collected.
|
||||
*
|
||||
* Be aware that all limitations applied to the `beforeExit` event are also applied to the callback function, this means that there is a possibility that the callback will not be called under special circumstances.
|
||||
* @param ref The reference to the resource that is being tracked.
|
||||
* @param callback The callback function to be called when the resource is finalized.
|
||||
* @since v22.5.0
|
||||
* @experimental
|
||||
*/
|
||||
registerBeforeExit<T extends object>(ref: T, callback: (ref: T, event: "beforeExit") => void): void;
|
||||
/**
|
||||
* This function remove the register of the object from the finalization registry, so the callback will not be called anymore.
|
||||
* @param ref The reference to the resource that was registered previously.
|
||||
* @since v22.5.0
|
||||
* @experimental
|
||||
*/
|
||||
unregister(ref: object): void;
|
||||
};
|
||||
/**
|
||||
* The `process.getActiveResourcesInfo()` method returns an array of strings containing
|
||||
* the types of the active resources that are currently keeping the event loop alive.
|
||||
@@ -793,6 +1056,12 @@ declare module "process" {
|
||||
* @since v17.3.0, v16.14.0
|
||||
*/
|
||||
getActiveResourcesInfo(): string[];
|
||||
/**
|
||||
* Provides a way to load built-in modules in a globally available function.
|
||||
* @param id ID of the built-in module being requested.
|
||||
*/
|
||||
getBuiltinModule<ID extends keyof BuiltInModule>(id: ID): BuiltInModule[ID];
|
||||
getBuiltinModule(id: string): object | undefined;
|
||||
/**
|
||||
* The `process.getgid()` method returns the numerical group identity of the
|
||||
* process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).)
|
||||
@@ -1198,7 +1467,7 @@ declare module "process" {
|
||||
* @since v20.12.0
|
||||
* @param path The path to the .env file
|
||||
*/
|
||||
loadEnvFile(path?: string | URL | Buffer): void;
|
||||
loadEnvFile(path?: PathLike): void;
|
||||
/**
|
||||
* The `process.pid` property returns the PID of the process.
|
||||
*
|
||||
@@ -1222,6 +1491,18 @@ declare module "process" {
|
||||
* @since v9.2.0, v8.10.0, v6.13.0
|
||||
*/
|
||||
readonly ppid: number;
|
||||
/**
|
||||
* The `process.threadCpuUsage()` method returns the user and system CPU time usage of
|
||||
* the current worker thread, in an object with properties `user` and `system`, whose
|
||||
* values are microsecond values (millionth of a second).
|
||||
*
|
||||
* The result of a previous call to `process.threadCpuUsage()` can be passed as the
|
||||
* argument to the function, to get a diff reading.
|
||||
* @since v23.9.0
|
||||
* @param previousValue A previous return value from calling
|
||||
* `process.threadCpuUsage()`
|
||||
*/
|
||||
threadCpuUsage(previousValue?: CpuUsage): CpuUsage;
|
||||
/**
|
||||
* The `process.title` property returns the current process title (i.e. returns
|
||||
* the current value of `ps`). Assigning a new value to `process.title` modifies
|
||||
@@ -1242,7 +1523,8 @@ declare module "process" {
|
||||
title: string;
|
||||
/**
|
||||
* The operating system CPU architecture for which the Node.js binary was compiled.
|
||||
* Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`.
|
||||
* Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`,
|
||||
* `'mipsel'`, `'ppc64'`, `'riscv64'`, `'s390x'`, and `'x64'`.
|
||||
*
|
||||
* ```js
|
||||
* import { arch } from 'node:process';
|
||||
@@ -1288,7 +1570,7 @@ declare module "process" {
|
||||
* @since v0.1.17
|
||||
* @deprecated Since v14.0.0 - Use `main` instead.
|
||||
*/
|
||||
mainModule?: Module | undefined;
|
||||
mainModule?: Module;
|
||||
memoryUsage: MemoryUsageFn;
|
||||
/**
|
||||
* Gets the amount of memory available to the process (in bytes) based on
|
||||
@@ -1298,13 +1580,11 @@ declare module "process" {
|
||||
* See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more
|
||||
* information.
|
||||
* @since v19.6.0, v18.15.0
|
||||
* @experimental
|
||||
*/
|
||||
constrainedMemory(): number;
|
||||
/**
|
||||
* Gets the amount of free memory that is still available to the process (in bytes).
|
||||
* See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v20.x/api/process.html#processavailablememory) for more information.
|
||||
* @experimental
|
||||
* See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v24.x/api/process.html#processavailablememory) for more information.
|
||||
* @since v20.13.0
|
||||
*/
|
||||
availableMemory(): number;
|
||||
@@ -1425,7 +1705,7 @@ declare module "process" {
|
||||
*/
|
||||
nextTick(callback: Function, ...args: any[]): void;
|
||||
/**
|
||||
* This API is available through the [--experimental-permission](https://nodejs.org/api/cli.html#--experimental-permission) flag.
|
||||
* This API is available through the [--permission](https://nodejs.org/api/cli.html#--permission) flag.
|
||||
*
|
||||
* `process.permission` is an object whose methods are used to manage permissions for the current process.
|
||||
* Additional documentation is available in the [Permission Model](https://nodejs.org/api/permissions.html#permission-model).
|
||||
@@ -1454,16 +1734,7 @@ declare module "process" {
|
||||
* @since v3.0.0
|
||||
*/
|
||||
readonly release: ProcessRelease;
|
||||
features: {
|
||||
inspector: boolean;
|
||||
debug: boolean;
|
||||
uv: boolean;
|
||||
ipv6: boolean;
|
||||
tls_alpn: boolean;
|
||||
tls_sni: boolean;
|
||||
tls_ocsp: boolean;
|
||||
tls: boolean;
|
||||
};
|
||||
readonly features: ProcessFeatures;
|
||||
/**
|
||||
* `process.umask()` returns the Node.js process's file mode creation mask. Child
|
||||
* processes inherit the mask from the parent process.
|
||||
@@ -1491,18 +1762,7 @@ declare module "process" {
|
||||
* If no IPC channel exists, this property is undefined.
|
||||
* @since v7.1.0
|
||||
*/
|
||||
channel?: {
|
||||
/**
|
||||
* This method makes the IPC channel keep the event loop of the process running if .unref() has been called before.
|
||||
* @since v7.1.0
|
||||
*/
|
||||
ref(): void;
|
||||
/**
|
||||
* This method makes the IPC channel not keep the event loop of the process running, and lets it finish even while the channel is open.
|
||||
* @since v7.1.0
|
||||
*/
|
||||
unref(): void;
|
||||
};
|
||||
channel?: Control;
|
||||
/**
|
||||
* If Node.js is spawned with an IPC channel, the `process.send()` method can be
|
||||
* used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object.
|
||||
@@ -1516,10 +1776,8 @@ declare module "process" {
|
||||
*/
|
||||
send?(
|
||||
message: any,
|
||||
sendHandle?: any,
|
||||
options?: {
|
||||
keepOpen?: boolean | undefined;
|
||||
},
|
||||
sendHandle?: SendHandle,
|
||||
options?: MessageOptions,
|
||||
callback?: (error: Error | null) => void,
|
||||
): boolean;
|
||||
/**
|
||||
@@ -1585,11 +1843,11 @@ declare module "process" {
|
||||
*/
|
||||
allowedNodeEnvironmentFlags: ReadonlySet<string>;
|
||||
/**
|
||||
* `process.report` is an object whose methods are used to generate diagnostic
|
||||
* reports for the current process. Additional documentation is available in the `report documentation`.
|
||||
* `process.report` is an object whose methods are used to generate diagnostic reports for the current process.
|
||||
* Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v24.x/api/report.html).
|
||||
* @since v11.8.0
|
||||
*/
|
||||
report?: ProcessReport | undefined;
|
||||
report: ProcessReport;
|
||||
/**
|
||||
* ```js
|
||||
* import { resourceUsage } from 'node:process';
|
||||
@@ -1651,6 +1909,56 @@ declare module "process" {
|
||||
* @since v0.8.0
|
||||
*/
|
||||
traceDeprecation: boolean;
|
||||
/**
|
||||
* An object is "refable" if it implements the Node.js "Refable protocol".
|
||||
* Specifically, this means that the object implements the `Symbol.for('nodejs.ref')`
|
||||
* and `Symbol.for('nodejs.unref')` methods. "Ref'd" objects will keep the Node.js
|
||||
* event loop alive, while "unref'd" objects will not. Historically, this was
|
||||
* implemented by using `ref()` and `unref()` methods directly on the objects.
|
||||
* This pattern, however, is being deprecated in favor of the "Refable protocol"
|
||||
* in order to better support Web Platform API types whose APIs cannot be modified
|
||||
* to add `ref()` and `unref()` methods but still need to support that behavior.
|
||||
* @since v22.14.0
|
||||
* @experimental
|
||||
* @param maybeRefable An object that may be "refable".
|
||||
*/
|
||||
ref(maybeRefable: any): void;
|
||||
/**
|
||||
* An object is "unrefable" if it implements the Node.js "Refable protocol".
|
||||
* Specifically, this means that the object implements the `Symbol.for('nodejs.ref')`
|
||||
* and `Symbol.for('nodejs.unref')` methods. "Ref'd" objects will keep the Node.js
|
||||
* event loop alive, while "unref'd" objects will not. Historically, this was
|
||||
* implemented by using `ref()` and `unref()` methods directly on the objects.
|
||||
* This pattern, however, is being deprecated in favor of the "Refable protocol"
|
||||
* in order to better support Web Platform API types whose APIs cannot be modified
|
||||
* to add `ref()` and `unref()` methods but still need to support that behavior.
|
||||
* @since v22.14.0
|
||||
* @experimental
|
||||
* @param maybeRefable An object that may be "unref'd".
|
||||
*/
|
||||
unref(maybeRefable: any): void;
|
||||
/**
|
||||
* Replaces the current process with a new process.
|
||||
*
|
||||
* This is achieved by using the `execve` POSIX function and therefore no memory or other
|
||||
* resources from the current process are preserved, except for the standard input,
|
||||
* standard output and standard error file descriptor.
|
||||
*
|
||||
* All other resources are discarded by the system when the processes are swapped, without triggering
|
||||
* any exit or close events and without running any cleanup handler.
|
||||
*
|
||||
* This function will never return, unless an error occurred.
|
||||
*
|
||||
* This function is not available on Windows or IBM i.
|
||||
* @since v22.15.0
|
||||
* @experimental
|
||||
* @param file The name or path of the executable file to run.
|
||||
* @param args List of string arguments. No argument can contain a null-byte (`\u0000`).
|
||||
* @param env Environment key-value pairs.
|
||||
* No key or value can contain a null-byte (`\u0000`).
|
||||
* **Default:** `process.env`.
|
||||
*/
|
||||
execve?(file: string, args?: readonly string[], env?: ProcessEnv): never;
|
||||
/* EventEmitter */
|
||||
addListener(event: "beforeExit", listener: BeforeExitListener): this;
|
||||
addListener(event: "disconnect", listener: DisconnectListener): this;
|
||||
@@ -1672,7 +1980,7 @@ declare module "process" {
|
||||
emit(event: "uncaughtExceptionMonitor", error: Error): boolean;
|
||||
emit(event: "unhandledRejection", reason: unknown, promise: Promise<unknown>): boolean;
|
||||
emit(event: "warning", warning: Error): boolean;
|
||||
emit(event: "message", message: unknown, sendHandle: unknown): this;
|
||||
emit(event: "message", message: unknown, sendHandle: SendHandle): this;
|
||||
emit(event: Signals, signal?: Signals): boolean;
|
||||
emit(
|
||||
event: "multipleResolves",
|
||||
|
||||
4
backend/node_modules/@types/node/punycode.d.ts
generated
vendored
4
backend/node_modules/@types/node/punycode.d.ts
generated
vendored
@@ -8,7 +8,7 @@
|
||||
* can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const punycode = require('punycode');
|
||||
* import punycode from 'node:punycode';
|
||||
* ```
|
||||
*
|
||||
* [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is
|
||||
@@ -24,7 +24,7 @@
|
||||
* made available to developers as a convenience. Fixes or other modifications to
|
||||
* the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project.
|
||||
* @deprecated Since v7.0.0 - Deprecated
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/punycode.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/punycode.js)
|
||||
*/
|
||||
declare module "punycode" {
|
||||
/**
|
||||
|
||||
9
backend/node_modules/@types/node/querystring.d.ts
generated
vendored
9
backend/node_modules/@types/node/querystring.d.ts
generated
vendored
@@ -3,13 +3,13 @@
|
||||
* query strings. It can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const querystring = require('node:querystring');
|
||||
* import querystring from 'node:querystring';
|
||||
* ```
|
||||
*
|
||||
* `querystring` is more performant than `URLSearchParams` but is not a
|
||||
* standardized API. Use `URLSearchParams` when performance is not critical or
|
||||
* when compatibility with browser code is desirable.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/querystring.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/querystring.js)
|
||||
*/
|
||||
declare module "querystring" {
|
||||
interface StringifyOptions {
|
||||
@@ -37,9 +37,8 @@ declare module "querystring" {
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| readonly string[]
|
||||
| readonly number[]
|
||||
| readonly boolean[]
|
||||
| bigint
|
||||
| ReadonlyArray<string | number | boolean | bigint>
|
||||
| null
|
||||
>
|
||||
{}
|
||||
|
||||
114
backend/node_modules/@types/node/readline.d.ts
generated
vendored
114
backend/node_modules/@types/node/readline.d.ts
generated
vendored
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-v20.x/api/stream.html#readable-streams) stream
|
||||
* (such as [`process.stdin`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdin)) one line at a time.
|
||||
* The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-v24.x/api/stream.html#readable-streams) stream
|
||||
* (such as [`process.stdin`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdin)) one line at a time.
|
||||
*
|
||||
* To use the promise-based APIs:
|
||||
*
|
||||
@@ -31,7 +31,7 @@
|
||||
*
|
||||
* Once this code is invoked, the Node.js application will not terminate until the `readline.Interface` is closed because the interface waits for data to be
|
||||
* received on the `input` stream.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/readline.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/readline.js)
|
||||
*/
|
||||
declare module "readline" {
|
||||
import { Abortable, EventEmitter } from "node:events";
|
||||
@@ -46,12 +46,12 @@ declare module "readline" {
|
||||
}
|
||||
/**
|
||||
* Instances of the `readline.Interface` class are constructed using the `readline.createInterface()` method. Every instance is associated with a
|
||||
* single `input` [Readable](https://nodejs.org/docs/latest-v20.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v20.x/api/stream.html#writable-streams) stream.
|
||||
* single `input` [Readable](https://nodejs.org/docs/latest-v24.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v24.x/api/stream.html#writable-streams) stream.
|
||||
* The `output` stream is used to print prompts for user input that arrives on,
|
||||
* and is read from, the `input` stream.
|
||||
* @since v0.1.104
|
||||
*/
|
||||
export class Interface extends EventEmitter {
|
||||
export class Interface extends EventEmitter implements Disposable {
|
||||
readonly terminal: boolean;
|
||||
/**
|
||||
* The current input data being processed by node.
|
||||
@@ -100,7 +100,7 @@ declare module "readline" {
|
||||
* > Instances of the `readline.Interface` class are constructed using the
|
||||
* > `readline.createInterface()` method.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#class-interfaceconstructor
|
||||
* @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor
|
||||
*/
|
||||
protected constructor(
|
||||
input: NodeJS.ReadableStream,
|
||||
@@ -114,7 +114,7 @@ declare module "readline" {
|
||||
* > Instances of the `readline.Interface` class are constructed using the
|
||||
* > `readline.createInterface()` method.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#class-interfaceconstructor
|
||||
* @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor
|
||||
*/
|
||||
protected constructor(options: ReadLineOptions);
|
||||
/**
|
||||
@@ -208,6 +208,11 @@ declare module "readline" {
|
||||
* @since v0.1.98
|
||||
*/
|
||||
close(): void;
|
||||
/**
|
||||
* Alias for `rl.close()`.
|
||||
* @since v22.15.0
|
||||
*/
|
||||
[Symbol.dispose](): void;
|
||||
/**
|
||||
* The `rl.write()` method will write either `data` or a key sequence identified
|
||||
* by `key` to the `output`. The `key` argument is supported only if `output` is
|
||||
@@ -304,7 +309,7 @@ declare module "readline" {
|
||||
prependOnceListener(event: "SIGINT", listener: () => void): this;
|
||||
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
|
||||
prependOnceListener(event: "history", listener: (history: string[]) => void): this;
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<string>;
|
||||
[Symbol.asyncIterator](): NodeJS.AsyncIterator<string>;
|
||||
}
|
||||
export type ReadLine = Interface; // type forwarded for backwards compatibility
|
||||
export type Completer = (line: string) => CompleterResult;
|
||||
@@ -314,35 +319,84 @@ declare module "readline" {
|
||||
) => void;
|
||||
export type CompleterResult = [string[], string];
|
||||
export interface ReadLineOptions {
|
||||
/**
|
||||
* The [`Readable`](https://nodejs.org/docs/latest-v24.x/api/stream.html#readable-streams) stream to listen to
|
||||
*/
|
||||
input: NodeJS.ReadableStream;
|
||||
/**
|
||||
* The [`Writable`](https://nodejs.org/docs/latest-v24.x/api/stream.html#writable-streams) stream to write readline data to.
|
||||
*/
|
||||
output?: NodeJS.WritableStream | undefined;
|
||||
/**
|
||||
* An optional function used for Tab autocompletion.
|
||||
*/
|
||||
completer?: Completer | AsyncCompleter | undefined;
|
||||
/**
|
||||
* `true` if the `input` and `output` streams should be treated like a TTY,
|
||||
* and have ANSI/VT100 escape codes written to it.
|
||||
* Default: checking `isTTY` on the `output` stream upon instantiation.
|
||||
*/
|
||||
terminal?: boolean | undefined;
|
||||
/**
|
||||
* Initial list of history lines. This option makes sense
|
||||
* only if `terminal` is set to `true` by the user or by an internal `output`
|
||||
* check, otherwise the history caching mechanism is not initialized at all.
|
||||
* Initial list of history lines.
|
||||
* This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check,
|
||||
* otherwise the history caching mechanism is not initialized at all.
|
||||
* @default []
|
||||
*/
|
||||
history?: string[] | undefined;
|
||||
historySize?: number | undefined;
|
||||
prompt?: string | undefined;
|
||||
crlfDelay?: number | undefined;
|
||||
/**
|
||||
* If `true`, when a new input line added
|
||||
* to the history list duplicates an older one, this removes the older line
|
||||
* from the list.
|
||||
* Maximum number of history lines retained.
|
||||
* To disable the history set this value to `0`.
|
||||
* This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check,
|
||||
* otherwise the history caching mechanism is not initialized at all.
|
||||
* @default 30
|
||||
*/
|
||||
historySize?: number | undefined;
|
||||
/**
|
||||
* If `true`, when a new input line added to the history list duplicates an older one,
|
||||
* this removes the older line from the list.
|
||||
* @default false
|
||||
*/
|
||||
removeHistoryDuplicates?: boolean | undefined;
|
||||
/**
|
||||
* The prompt string to use.
|
||||
* @default "> "
|
||||
*/
|
||||
prompt?: string | undefined;
|
||||
/**
|
||||
* If the delay between `\r` and `\n` exceeds `crlfDelay` milliseconds,
|
||||
* both `\r` and `\n` will be treated as separate end-of-line input.
|
||||
* `crlfDelay` will be coerced to a number no less than `100`.
|
||||
* It can be set to `Infinity`, in which case
|
||||
* `\r` followed by `\n` will always be considered a single newline
|
||||
* (which may be reasonable for [reading files](https://nodejs.org/docs/latest-v24.x/api/readline.html#example-read-file-stream-line-by-line) with `\r\n` line delimiter).
|
||||
* @default 100
|
||||
*/
|
||||
crlfDelay?: number | undefined;
|
||||
/**
|
||||
* The duration `readline` will wait for a character
|
||||
* (when reading an ambiguous key sequence in milliseconds
|
||||
* one that can both form a complete key sequence using the input read so far
|
||||
* and can take additional input to complete a longer key sequence).
|
||||
* @default 500
|
||||
*/
|
||||
escapeCodeTimeout?: number | undefined;
|
||||
/**
|
||||
* The number of spaces a tab is equal to (minimum 1).
|
||||
* @default 8
|
||||
*/
|
||||
tabSize?: number | undefined;
|
||||
/**
|
||||
* Allows closing the interface using an AbortSignal.
|
||||
* Aborting the signal will internally call `close` on the interface.
|
||||
*/
|
||||
signal?: AbortSignal | undefined;
|
||||
}
|
||||
/**
|
||||
* The `readline.createInterface()` method creates a new `readline.Interface` instance.
|
||||
*
|
||||
* ```js
|
||||
* const readline = require('node:readline');
|
||||
* import readline from 'node:readline';
|
||||
* const rl = readline.createInterface({
|
||||
* input: process.stdin,
|
||||
* output: process.stdout,
|
||||
@@ -398,7 +452,7 @@ declare module "readline" {
|
||||
* implement a small command-line interface:
|
||||
*
|
||||
* ```js
|
||||
* const readline = require('node:readline');
|
||||
* import readline from 'node:readline';
|
||||
* const rl = readline.createInterface({
|
||||
* input: process.stdin,
|
||||
* output: process.stdout,
|
||||
@@ -430,8 +484,8 @@ declare module "readline" {
|
||||
* well as a `for await...of` loop:
|
||||
*
|
||||
* ```js
|
||||
* const fs = require('node:fs');
|
||||
* const readline = require('node:readline');
|
||||
* import fs from 'node:fs';
|
||||
* import readline from 'node:readline';
|
||||
*
|
||||
* async function processLineByLine() {
|
||||
* const fileStream = fs.createReadStream('input.txt');
|
||||
@@ -455,8 +509,8 @@ declare module "readline" {
|
||||
* Alternatively, one could use the `'line'` event:
|
||||
*
|
||||
* ```js
|
||||
* const fs = require('node:fs');
|
||||
* const readline = require('node:readline');
|
||||
* import fs from 'node:fs';
|
||||
* import readline from 'node:readline';
|
||||
*
|
||||
* const rl = readline.createInterface({
|
||||
* input: fs.createReadStream('sample.txt'),
|
||||
@@ -471,9 +525,9 @@ declare module "readline" {
|
||||
* Currently, `for await...of` loop can be a bit slower. If `async` / `await` flow and speed are both essential, a mixed approach can be applied:
|
||||
*
|
||||
* ```js
|
||||
* const { once } = require('node:events');
|
||||
* const { createReadStream } = require('node:fs');
|
||||
* const { createInterface } = require('node:readline');
|
||||
* import { once } from 'node:events';
|
||||
* import { createReadStream } from 'node:fs';
|
||||
* import { createInterface } from 'node:readline';
|
||||
*
|
||||
* (async function processLineByLine() {
|
||||
* try {
|
||||
@@ -503,7 +557,7 @@ declare module "readline" {
|
||||
cols: number;
|
||||
}
|
||||
/**
|
||||
* The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v20.x/api/tty.html) stream
|
||||
* The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) stream
|
||||
* in a specified direction identified by `dir`.
|
||||
* @since v0.7.7
|
||||
* @param callback Invoked once the operation completes.
|
||||
@@ -511,7 +565,7 @@ declare module "readline" {
|
||||
*/
|
||||
export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
|
||||
/**
|
||||
* The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v20.x/api/tty.html) stream from
|
||||
* The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) stream from
|
||||
* the current position of the cursor down.
|
||||
* @since v0.7.7
|
||||
* @param callback Invoked once the operation completes.
|
||||
@@ -520,7 +574,7 @@ declare module "readline" {
|
||||
export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
|
||||
/**
|
||||
* The `readline.cursorTo()` method moves cursor to the specified position in a
|
||||
* given [TTY](https://nodejs.org/docs/latest-v20.x/api/tty.html) `stream`.
|
||||
* given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) `stream`.
|
||||
* @since v0.7.7
|
||||
* @param callback Invoked once the operation completes.
|
||||
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
||||
@@ -528,7 +582,7 @@ declare module "readline" {
|
||||
export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
|
||||
/**
|
||||
* The `readline.moveCursor()` method moves the cursor _relative_ to its current
|
||||
* position in a given [TTY](https://nodejs.org/docs/latest-v20.x/api/tty.html) `stream`.
|
||||
* position in a given [TTY](https://nodejs.org/docs/latest-v24.x/api/tty.html) `stream`.
|
||||
* @since v0.7.7
|
||||
* @param callback Invoked once the operation completes.
|
||||
* @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
||||
|
||||
21
backend/node_modules/@types/node/readline/promises.d.ts
generated
vendored
21
backend/node_modules/@types/node/readline/promises.d.ts
generated
vendored
@@ -1,10 +1,14 @@
|
||||
/**
|
||||
* @since v17.0.0
|
||||
* @experimental
|
||||
*/
|
||||
declare module "readline/promises" {
|
||||
import { AsyncCompleter, Completer, Direction, Interface as _Interface, ReadLineOptions } from "node:readline";
|
||||
import { Abortable } from "node:events";
|
||||
import {
|
||||
CompleterResult,
|
||||
Direction,
|
||||
Interface as _Interface,
|
||||
ReadLineOptions as _ReadLineOptions,
|
||||
} from "node:readline";
|
||||
/**
|
||||
* Instances of the `readlinePromises.Interface` class are constructed using the `readlinePromises.createInterface()` method. Every instance is associated with a
|
||||
* single `input` `Readable` stream and a single `output` `Writable` stream.
|
||||
@@ -60,7 +64,7 @@ declare module "readline/promises" {
|
||||
constructor(
|
||||
stream: NodeJS.WritableStream,
|
||||
options?: {
|
||||
autoCommit?: boolean;
|
||||
autoCommit?: boolean | undefined;
|
||||
},
|
||||
);
|
||||
/**
|
||||
@@ -111,11 +115,18 @@ declare module "readline/promises" {
|
||||
*/
|
||||
rollback(): this;
|
||||
}
|
||||
type Completer = (line: string) => CompleterResult | Promise<CompleterResult>;
|
||||
interface ReadLineOptions extends Omit<_ReadLineOptions, "completer"> {
|
||||
/**
|
||||
* An optional function used for Tab autocompletion.
|
||||
*/
|
||||
completer?: Completer | undefined;
|
||||
}
|
||||
/**
|
||||
* The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance.
|
||||
*
|
||||
* ```js
|
||||
* const readlinePromises = require('node:readline/promises');
|
||||
* import readlinePromises from 'node:readline/promises';
|
||||
* const rl = readlinePromises.createInterface({
|
||||
* input: process.stdin,
|
||||
* output: process.stdout,
|
||||
@@ -140,7 +151,7 @@ declare module "readline/promises" {
|
||||
function createInterface(
|
||||
input: NodeJS.ReadableStream,
|
||||
output?: NodeJS.WritableStream,
|
||||
completer?: Completer | AsyncCompleter,
|
||||
completer?: Completer,
|
||||
terminal?: boolean,
|
||||
): Interface;
|
||||
function createInterface(options: ReadLineOptions): Interface;
|
||||
|
||||
50
backend/node_modules/@types/node/repl.d.ts
generated
vendored
50
backend/node_modules/@types/node/repl.d.ts
generated
vendored
@@ -4,9 +4,9 @@
|
||||
* applications. It can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const repl = require('node:repl');
|
||||
* import repl from 'node:repl';
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/repl.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/repl.js)
|
||||
*/
|
||||
declare module "repl" {
|
||||
import { AsyncCompleter, Completer, Interface } from "node:readline";
|
||||
@@ -37,12 +37,10 @@ declare module "repl" {
|
||||
terminal?: boolean | undefined;
|
||||
/**
|
||||
* The function to be used when evaluating each given line of input.
|
||||
* Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can
|
||||
* **Default:** an async wrapper for the JavaScript `eval()` function. An `eval` function can
|
||||
* error with `repl.Recoverable` to indicate the input was incomplete and prompt for
|
||||
* additional lines.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_default_evaluation
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_custom_evaluation_functions
|
||||
* additional lines. See the [custom evaluation functions](https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#custom-evaluation-functions)
|
||||
* section for more details.
|
||||
*/
|
||||
eval?: REPLEval | undefined;
|
||||
/**
|
||||
@@ -74,13 +72,13 @@ declare module "repl" {
|
||||
* The function to invoke to format the output of each command before writing to `output`.
|
||||
* @default a wrapper for `util.inspect`
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_customizing_repl_output
|
||||
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_customizing_repl_output
|
||||
*/
|
||||
writer?: REPLWriter | undefined;
|
||||
/**
|
||||
* An optional function used for custom Tab auto completion.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#readline_use_of_the_completer_function
|
||||
* @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#readline_use_of_the_completer_function
|
||||
*/
|
||||
completer?: Completer | AsyncCompleter | undefined;
|
||||
/**
|
||||
@@ -125,12 +123,18 @@ declare module "repl" {
|
||||
*/
|
||||
action: REPLCommandAction;
|
||||
}
|
||||
interface REPLServerSetupHistoryOptions {
|
||||
filePath?: string | undefined;
|
||||
size?: number | undefined;
|
||||
removeHistoryDuplicates?: boolean | undefined;
|
||||
onHistoryFileLoaded?: ((err: Error | null, repl: REPLServer) => void) | undefined;
|
||||
}
|
||||
/**
|
||||
* Instances of `repl.REPLServer` are created using the {@link start} method
|
||||
* or directly using the JavaScript `new` keyword.
|
||||
*
|
||||
* ```js
|
||||
* const repl = require('node:repl');
|
||||
* import repl from 'node:repl';
|
||||
*
|
||||
* const options = { useColors: true };
|
||||
*
|
||||
@@ -168,33 +172,33 @@ declare module "repl" {
|
||||
/**
|
||||
* A value indicating whether the REPL is currently in "editor mode".
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_commands_and_special_keys
|
||||
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_commands_and_special_keys
|
||||
*/
|
||||
readonly editorMode: boolean;
|
||||
/**
|
||||
* A value indicating whether the `_` variable has been assigned.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
*/
|
||||
readonly underscoreAssigned: boolean;
|
||||
/**
|
||||
* The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL).
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
*/
|
||||
readonly last: any;
|
||||
/**
|
||||
* A value indicating whether the `_error` variable has been assigned.
|
||||
*
|
||||
* @since v9.8.0
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
*/
|
||||
readonly underscoreErrAssigned: boolean;
|
||||
/**
|
||||
* The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL).
|
||||
*
|
||||
* @since v9.8.0
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
||||
*/
|
||||
readonly lastError: any;
|
||||
/**
|
||||
@@ -246,7 +250,7 @@ declare module "repl" {
|
||||
*
|
||||
* `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_class_replserver
|
||||
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_class_replserver
|
||||
*/
|
||||
private constructor();
|
||||
/**
|
||||
@@ -257,7 +261,7 @@ declare module "repl" {
|
||||
* The following example shows two new commands added to the REPL instance:
|
||||
*
|
||||
* ```js
|
||||
* const repl = require('node:repl');
|
||||
* import repl from 'node:repl';
|
||||
*
|
||||
* const replServer = repl.start({ prompt: '> ' });
|
||||
* replServer.defineCommand('sayhello', {
|
||||
@@ -291,7 +295,7 @@ declare module "repl" {
|
||||
* The `replServer.displayPrompt()` method readies the REPL instance for input
|
||||
* from the user, printing the configured `prompt` to a new line in the `output` and resuming the `input` to accept new input.
|
||||
*
|
||||
* When multi-line input is being entered, an ellipsis is printed rather than the
|
||||
* When multi-line input is being entered, a pipe `'|'` is printed rather than the
|
||||
* 'prompt'.
|
||||
*
|
||||
* When `preserveCursor` is `true`, the cursor placement will not be reset to `0`.
|
||||
@@ -318,7 +322,11 @@ declare module "repl" {
|
||||
* @param historyPath the path to the history file
|
||||
* @param callback called when history writes are ready or upon error
|
||||
*/
|
||||
setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void;
|
||||
setupHistory(historyPath: string, callback: (err: Error | null, repl: this) => void): void;
|
||||
setupHistory(
|
||||
historyConfig?: REPLServerSetupHistoryOptions,
|
||||
callback?: (err: Error | null, repl: this) => void,
|
||||
): void;
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. close - inherited from `readline.Interface`
|
||||
@@ -407,7 +415,7 @@ declare module "repl" {
|
||||
* If `options` is a string, then it specifies the input prompt:
|
||||
*
|
||||
* ```js
|
||||
* const repl = require('node:repl');
|
||||
* import repl from 'node:repl';
|
||||
*
|
||||
* // a Unix style prompt
|
||||
* repl.start('$ ');
|
||||
@@ -418,7 +426,7 @@ declare module "repl" {
|
||||
/**
|
||||
* Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
|
||||
*
|
||||
* @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_recoverable_errors
|
||||
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_recoverable_errors
|
||||
*/
|
||||
class Recoverable extends SyntaxError {
|
||||
err: Error;
|
||||
|
||||
13
backend/node_modules/@types/node/sea.d.ts
generated
vendored
13
backend/node_modules/@types/node/sea.d.ts
generated
vendored
@@ -111,7 +111,7 @@
|
||||
* ```
|
||||
* @since v19.7.0, v18.16.0
|
||||
* @experimental
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.12.0/src/node_sea.cc)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/src/node_sea.cc)
|
||||
*/
|
||||
declare module "node:sea" {
|
||||
type AssetKey = string;
|
||||
@@ -149,5 +149,14 @@ declare module "node:sea" {
|
||||
* writes to the returned array buffer is likely to result in a crash.
|
||||
* @since v20.12.0
|
||||
*/
|
||||
function getRawAsset(key: AssetKey): string | ArrayBuffer;
|
||||
function getRawAsset(key: AssetKey): ArrayBuffer;
|
||||
/**
|
||||
* This method can be used to retrieve an array of all the keys of assets
|
||||
* embedded into the single-executable application.
|
||||
* An error is thrown when not running inside a single-executable application.
|
||||
* @since v24.8.0
|
||||
* @returns An array containing all the keys of the assets
|
||||
* embedded in the executable. If no assets are embedded, returns an empty array.
|
||||
*/
|
||||
function getAssetKeys(): string[];
|
||||
}
|
||||
|
||||
2038
backend/node_modules/@types/node/stream.d.ts
generated
vendored
2038
backend/node_modules/@types/node/stream.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
40
backend/node_modules/@types/node/stream/consumers.d.ts
generated
vendored
40
backend/node_modules/@types/node/stream/consumers.d.ts
generated
vendored
@@ -1,11 +1,37 @@
|
||||
/**
|
||||
* The utility consumer functions provide common options for consuming
|
||||
* streams.
|
||||
* @since v16.7.0
|
||||
*/
|
||||
declare module "stream/consumers" {
|
||||
import { Blob as NodeBlob } from "node:buffer";
|
||||
import { Readable } from "node:stream";
|
||||
function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<Buffer>;
|
||||
function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<string>;
|
||||
function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<ArrayBuffer>;
|
||||
function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<NodeBlob>;
|
||||
function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<unknown>;
|
||||
import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer";
|
||||
import { ReadableStream as WebReadableStream } from "node:stream/web";
|
||||
/**
|
||||
* @since v16.7.0
|
||||
* @returns Fulfills with an `ArrayBuffer` containing the full contents of the stream.
|
||||
*/
|
||||
function arrayBuffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* @since v16.7.0
|
||||
* @returns Fulfills with a `Blob` containing the full contents of the stream.
|
||||
*/
|
||||
function blob(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<NodeBlob>;
|
||||
/**
|
||||
* @since v16.7.0
|
||||
* @returns Fulfills with a `Buffer` containing the full contents of the stream.
|
||||
*/
|
||||
function buffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<NonSharedBuffer>;
|
||||
/**
|
||||
* @since v16.7.0
|
||||
* @returns Fulfills with the contents of the stream parsed as a
|
||||
* UTF-8 encoded string that is then passed through `JSON.parse()`.
|
||||
*/
|
||||
function json(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<unknown>;
|
||||
/**
|
||||
* @since v16.7.0
|
||||
* @returns Fulfills with the contents of the stream parsed as a UTF-8 encoded string.
|
||||
*/
|
||||
function text(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<string>;
|
||||
}
|
||||
declare module "node:stream/consumers" {
|
||||
export * from "stream/consumers";
|
||||
|
||||
9
backend/node_modules/@types/node/stream/promises.d.ts
generated
vendored
9
backend/node_modules/@types/node/stream/promises.d.ts
generated
vendored
@@ -1,12 +1,19 @@
|
||||
declare module "stream/promises" {
|
||||
import {
|
||||
FinishedOptions,
|
||||
FinishedOptions as _FinishedOptions,
|
||||
PipelineDestination,
|
||||
PipelineOptions,
|
||||
PipelinePromise,
|
||||
PipelineSource,
|
||||
PipelineTransform,
|
||||
} from "node:stream";
|
||||
interface FinishedOptions extends _FinishedOptions {
|
||||
/**
|
||||
* If true, removes the listeners registered by this function before the promise is fulfilled.
|
||||
* @default false
|
||||
*/
|
||||
cleanup?: boolean | undefined;
|
||||
}
|
||||
function finished(
|
||||
stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
|
||||
options?: FinishedOptions,
|
||||
|
||||
276
backend/node_modules/@types/node/stream/web.d.ts
generated
vendored
276
backend/node_modules/@types/node/stream/web.d.ts
generated
vendored
@@ -1,3 +1,36 @@
|
||||
type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").ByteLengthQueuingStrategy;
|
||||
type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").CountQueuingStrategy;
|
||||
type _QueuingStrategy<T = any> = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").QueuingStrategy<T>;
|
||||
type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").ReadableByteStreamController;
|
||||
type _ReadableStream<R = any> = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").ReadableStream<R>;
|
||||
type _ReadableStreamBYOBReader = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").ReadableStreamBYOBReader;
|
||||
type _ReadableStreamBYOBRequest = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").ReadableStreamBYOBRequest;
|
||||
type _ReadableStreamDefaultController<R = any> = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").ReadableStreamDefaultController<R>;
|
||||
type _ReadableStreamDefaultReader<R = any> = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").ReadableStreamDefaultReader<R>;
|
||||
type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").TextDecoderStream;
|
||||
type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").TextEncoderStream;
|
||||
type _TransformStream<I = any, O = any> = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").TransformStream<I, O>;
|
||||
type _TransformStreamDefaultController<O = any> = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").TransformStreamDefaultController<O>;
|
||||
type _WritableStream<W = any> = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").WritableStream<W>;
|
||||
type _WritableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").WritableStreamDefaultController;
|
||||
type _WritableStreamDefaultWriter<W = any> = typeof globalThis extends { onmessage: any } ? {}
|
||||
: import("stream/web").WritableStreamDefaultWriter<W>;
|
||||
|
||||
declare module "stream/web" {
|
||||
// stub module, pending copy&paste from .d.ts or manual impl
|
||||
// copy from lib.dom.d.ts
|
||||
@@ -62,21 +95,10 @@ declare module "stream/web" {
|
||||
signal?: AbortSignal;
|
||||
}
|
||||
interface ReadableStreamGenericReader {
|
||||
readonly closed: Promise<undefined>;
|
||||
readonly closed: Promise<void>;
|
||||
cancel(reason?: any): Promise<void>;
|
||||
}
|
||||
interface ReadableStreamDefaultReadValueResult<T> {
|
||||
done: false;
|
||||
value: T;
|
||||
}
|
||||
interface ReadableStreamDefaultReadDoneResult {
|
||||
done: true;
|
||||
value?: undefined;
|
||||
}
|
||||
type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
|
||||
type ReadableStreamDefaultReadResult<T> =
|
||||
| ReadableStreamDefaultReadValueResult<T>
|
||||
| ReadableStreamDefaultReadDoneResult;
|
||||
interface ReadableStreamReadValueResult<T> {
|
||||
done: false;
|
||||
value: T;
|
||||
@@ -119,6 +141,9 @@ declare module "stream/web" {
|
||||
interface TransformerTransformCallback<I, O> {
|
||||
(chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
|
||||
}
|
||||
interface TransformerCancelCallback {
|
||||
(reason: any): void | PromiseLike<void>;
|
||||
}
|
||||
interface UnderlyingByteSource {
|
||||
autoAllocateChunkSize?: number;
|
||||
cancel?: ReadableStreamErrorCallback;
|
||||
@@ -142,17 +167,21 @@ declare module "stream/web" {
|
||||
interface ReadableStreamErrorCallback {
|
||||
(reason: any): void | PromiseLike<void>;
|
||||
}
|
||||
interface ReadableStreamAsyncIterator<T> extends NodeJS.AsyncIterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
|
||||
}
|
||||
/** This Streams API interface represents a readable stream of byte data. */
|
||||
interface ReadableStream<R = any> {
|
||||
readonly locked: boolean;
|
||||
cancel(reason?: any): Promise<void>;
|
||||
getReader(): ReadableStreamDefaultReader<R>;
|
||||
getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
|
||||
getReader(): ReadableStreamDefaultReader<R>;
|
||||
getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<R>;
|
||||
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
||||
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
||||
tee(): [ReadableStream<R>, ReadableStream<R>];
|
||||
values(options?: { preventCancel?: boolean }): AsyncIterableIterator<R>;
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<R>;
|
||||
values(options?: { preventCancel?: boolean }): ReadableStreamAsyncIterator<R>;
|
||||
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<R>;
|
||||
}
|
||||
const ReadableStream: {
|
||||
prototype: ReadableStream;
|
||||
@@ -160,20 +189,53 @@ declare module "stream/web" {
|
||||
new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
|
||||
new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
|
||||
};
|
||||
type ReadableStreamReaderMode = "byob";
|
||||
interface ReadableStreamGetReaderOptions {
|
||||
/**
|
||||
* Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
|
||||
*
|
||||
* This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.
|
||||
*/
|
||||
mode?: ReadableStreamReaderMode;
|
||||
}
|
||||
type ReadableStreamReader<T> = ReadableStreamDefaultReader<T> | ReadableStreamBYOBReader;
|
||||
interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
|
||||
read(): Promise<ReadableStreamDefaultReadResult<R>>;
|
||||
read(): Promise<ReadableStreamReadResult<R>>;
|
||||
releaseLock(): void;
|
||||
}
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
|
||||
interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
|
||||
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
|
||||
read<T extends ArrayBufferView>(
|
||||
view: T,
|
||||
options?: {
|
||||
min?: number;
|
||||
},
|
||||
): Promise<ReadableStreamReadResult<T>>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
|
||||
releaseLock(): void;
|
||||
}
|
||||
const ReadableStreamDefaultReader: {
|
||||
prototype: ReadableStreamDefaultReader;
|
||||
new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
|
||||
};
|
||||
const ReadableStreamBYOBReader: any;
|
||||
const ReadableStreamBYOBRequest: any;
|
||||
const ReadableStreamBYOBReader: {
|
||||
prototype: ReadableStreamBYOBReader;
|
||||
new(stream: ReadableStream): ReadableStreamBYOBReader;
|
||||
};
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
|
||||
interface ReadableStreamBYOBRequest {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
|
||||
readonly view: ArrayBufferView | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
|
||||
respond(bytesWritten: number): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
|
||||
respondWithNewView(view: ArrayBufferView): void;
|
||||
}
|
||||
const ReadableStreamBYOBRequest: {
|
||||
prototype: ReadableStreamBYOBRequest;
|
||||
new(): ReadableStreamBYOBRequest;
|
||||
};
|
||||
interface ReadableByteStreamController {
|
||||
readonly byobRequest: undefined;
|
||||
readonly desiredSize: number | null;
|
||||
@@ -200,6 +262,7 @@ declare module "stream/web" {
|
||||
readableType?: undefined;
|
||||
start?: TransformerStartCallback<O>;
|
||||
transform?: TransformerTransformCallback<I, O>;
|
||||
cancel?: TransformerCancelCallback;
|
||||
writableType?: undefined;
|
||||
}
|
||||
interface TransformStream<I = any, O = any> {
|
||||
@@ -246,9 +309,9 @@ declare module "stream/web" {
|
||||
* sink.
|
||||
*/
|
||||
interface WritableStreamDefaultWriter<W = any> {
|
||||
readonly closed: Promise<undefined>;
|
||||
readonly closed: Promise<void>;
|
||||
readonly desiredSize: number | null;
|
||||
readonly ready: Promise<undefined>;
|
||||
readonly ready: Promise<void>;
|
||||
abort(reason?: any): Promise<void>;
|
||||
close(): Promise<void>;
|
||||
releaseLock(): void;
|
||||
@@ -345,22 +408,165 @@ declare module "stream/web" {
|
||||
prototype: TextDecoderStream;
|
||||
new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream;
|
||||
};
|
||||
interface CompressionStream<R = any, W = any> {
|
||||
readonly readable: ReadableStream<R>;
|
||||
readonly writable: WritableStream<W>;
|
||||
type CompressionFormat = "brotli" | "deflate" | "deflate-raw" | "gzip";
|
||||
class CompressionStream {
|
||||
constructor(format: CompressionFormat);
|
||||
readonly readable: ReadableStream;
|
||||
readonly writable: WritableStream;
|
||||
}
|
||||
const CompressionStream: {
|
||||
prototype: CompressionStream;
|
||||
new<R = any, W = any>(format: "deflate" | "deflate-raw" | "gzip"): CompressionStream<R, W>;
|
||||
};
|
||||
interface DecompressionStream<R = any, W = any> {
|
||||
readonly readable: ReadableStream<R>;
|
||||
readonly writable: WritableStream<W>;
|
||||
class DecompressionStream {
|
||||
constructor(format: CompressionFormat);
|
||||
readonly readable: ReadableStream;
|
||||
readonly writable: WritableStream;
|
||||
}
|
||||
|
||||
global {
|
||||
interface ByteLengthQueuingStrategy extends _ByteLengthQueuingStrategy {}
|
||||
/**
|
||||
* `ByteLengthQueuingStrategy` class is a global reference for `import { ByteLengthQueuingStrategy } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-bytelengthqueuingstrategy
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var ByteLengthQueuingStrategy: typeof globalThis extends { onmessage: any; ByteLengthQueuingStrategy: infer T }
|
||||
? T
|
||||
: typeof import("stream/web").ByteLengthQueuingStrategy;
|
||||
|
||||
interface CountQueuingStrategy extends _CountQueuingStrategy {}
|
||||
/**
|
||||
* `CountQueuingStrategy` class is a global reference for `import { CountQueuingStrategy } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-countqueuingstrategy
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var CountQueuingStrategy: typeof globalThis extends { onmessage: any; CountQueuingStrategy: infer T } ? T
|
||||
: typeof import("stream/web").CountQueuingStrategy;
|
||||
|
||||
interface QueuingStrategy<T = any> extends _QueuingStrategy<T> {}
|
||||
|
||||
interface ReadableByteStreamController extends _ReadableByteStreamController {}
|
||||
/**
|
||||
* `ReadableByteStreamController` class is a global reference for `import { ReadableByteStreamController } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-readablebytestreamcontroller
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var ReadableByteStreamController: typeof globalThis extends
|
||||
{ onmessage: any; ReadableByteStreamController: infer T } ? T
|
||||
: typeof import("stream/web").ReadableByteStreamController;
|
||||
|
||||
interface ReadableStream<R = any> extends _ReadableStream<R> {}
|
||||
/**
|
||||
* `ReadableStream` class is a global reference for `import { ReadableStream } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-readablestream
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var ReadableStream: typeof globalThis extends { onmessage: any; ReadableStream: infer T } ? T
|
||||
: typeof import("stream/web").ReadableStream;
|
||||
|
||||
interface ReadableStreamBYOBReader extends _ReadableStreamBYOBReader {}
|
||||
/**
|
||||
* `ReadableStreamBYOBReader` class is a global reference for `import { ReadableStreamBYOBReader } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-readablestreambyobreader
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T }
|
||||
? T
|
||||
: typeof import("stream/web").ReadableStreamBYOBReader;
|
||||
|
||||
interface ReadableStreamBYOBRequest extends _ReadableStreamBYOBRequest {}
|
||||
/**
|
||||
* `ReadableStreamBYOBRequest` class is a global reference for `import { ReadableStreamBYOBRequest } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-readablestreambyobrequest
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T }
|
||||
? T
|
||||
: typeof import("stream/web").ReadableStreamBYOBRequest;
|
||||
|
||||
interface ReadableStreamDefaultController<R = any> extends _ReadableStreamDefaultController<R> {}
|
||||
/**
|
||||
* `ReadableStreamDefaultController` class is a global reference for `import { ReadableStreamDefaultController } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-readablestreamdefaultcontroller
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var ReadableStreamDefaultController: typeof globalThis extends
|
||||
{ onmessage: any; ReadableStreamDefaultController: infer T } ? T
|
||||
: typeof import("stream/web").ReadableStreamDefaultController;
|
||||
|
||||
interface ReadableStreamDefaultReader<R = any> extends _ReadableStreamDefaultReader<R> {}
|
||||
/**
|
||||
* `ReadableStreamDefaultReader` class is a global reference for `import { ReadableStreamDefaultReader } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-readablestreamdefaultreader
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var ReadableStreamDefaultReader: typeof globalThis extends
|
||||
{ onmessage: any; ReadableStreamDefaultReader: infer T } ? T
|
||||
: typeof import("stream/web").ReadableStreamDefaultReader;
|
||||
|
||||
interface TextDecoderStream extends _TextDecoderStream {}
|
||||
/**
|
||||
* `TextDecoderStream` class is a global reference for `import { TextDecoderStream } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-textdecoderstream
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T
|
||||
: typeof import("stream/web").TextDecoderStream;
|
||||
|
||||
interface TextEncoderStream extends _TextEncoderStream {}
|
||||
/**
|
||||
* `TextEncoderStream` class is a global reference for `import { TextEncoderStream } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-textencoderstream
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var TextEncoderStream: typeof globalThis extends { onmessage: any; TextEncoderStream: infer T } ? T
|
||||
: typeof import("stream/web").TextEncoderStream;
|
||||
|
||||
interface TransformStream<I = any, O = any> extends _TransformStream<I, O> {}
|
||||
/**
|
||||
* `TransformStream` class is a global reference for `import { TransformStream } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-transformstream
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var TransformStream: typeof globalThis extends { onmessage: any; TransformStream: infer T } ? T
|
||||
: typeof import("stream/web").TransformStream;
|
||||
|
||||
interface TransformStreamDefaultController<O = any> extends _TransformStreamDefaultController<O> {}
|
||||
/**
|
||||
* `TransformStreamDefaultController` class is a global reference for `import { TransformStreamDefaultController } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-transformstreamdefaultcontroller
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var TransformStreamDefaultController: typeof globalThis extends
|
||||
{ onmessage: any; TransformStreamDefaultController: infer T } ? T
|
||||
: typeof import("stream/web").TransformStreamDefaultController;
|
||||
|
||||
interface WritableStream<W = any> extends _WritableStream<W> {}
|
||||
/**
|
||||
* `WritableStream` class is a global reference for `import { WritableStream } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-writablestream
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var WritableStream: typeof globalThis extends { onmessage: any; WritableStream: infer T } ? T
|
||||
: typeof import("stream/web").WritableStream;
|
||||
|
||||
interface WritableStreamDefaultController extends _WritableStreamDefaultController {}
|
||||
/**
|
||||
* `WritableStreamDefaultController` class is a global reference for `import { WritableStreamDefaultController } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-writablestreamdefaultcontroller
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var WritableStreamDefaultController: typeof globalThis extends
|
||||
{ onmessage: any; WritableStreamDefaultController: infer T } ? T
|
||||
: typeof import("stream/web").WritableStreamDefaultController;
|
||||
|
||||
interface WritableStreamDefaultWriter<W = any> extends _WritableStreamDefaultWriter<W> {}
|
||||
/**
|
||||
* `WritableStreamDefaultWriter` class is a global reference for `import { WritableStreamDefaultWriter } from 'node:stream/web'`.
|
||||
* https://nodejs.org/api/globals.html#class-writablestreamdefaultwriter
|
||||
* @since v18.0.0
|
||||
*/
|
||||
var WritableStreamDefaultWriter: typeof globalThis extends
|
||||
{ onmessage: any; WritableStreamDefaultWriter: infer T } ? T
|
||||
: typeof import("stream/web").WritableStreamDefaultWriter;
|
||||
}
|
||||
const DecompressionStream: {
|
||||
prototype: DecompressionStream;
|
||||
new<R = any, W = any>(format: "deflate" | "deflate-raw" | "gzip"): DecompressionStream<R, W>;
|
||||
};
|
||||
}
|
||||
declare module "node:stream/web" {
|
||||
export * from "stream/web";
|
||||
|
||||
12
backend/node_modules/@types/node/string_decoder.d.ts
generated
vendored
12
backend/node_modules/@types/node/string_decoder.d.ts
generated
vendored
@@ -4,13 +4,13 @@
|
||||
* characters. It can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const { StringDecoder } = require('node:string_decoder');
|
||||
* import { StringDecoder } from 'node:string_decoder';
|
||||
* ```
|
||||
*
|
||||
* The following example shows the basic use of the `StringDecoder` class.
|
||||
*
|
||||
* ```js
|
||||
* const { StringDecoder } = require('node:string_decoder');
|
||||
* import { StringDecoder } from 'node:string_decoder';
|
||||
* const decoder = new StringDecoder('utf8');
|
||||
*
|
||||
* const cent = Buffer.from([0xC2, 0xA2]);
|
||||
@@ -29,14 +29,14 @@
|
||||
* symbol (`€`) are written over three separate operations:
|
||||
*
|
||||
* ```js
|
||||
* const { StringDecoder } = require('node:string_decoder');
|
||||
* import { StringDecoder } from 'node:string_decoder';
|
||||
* const decoder = new StringDecoder('utf8');
|
||||
*
|
||||
* decoder.write(Buffer.from([0xE2]));
|
||||
* decoder.write(Buffer.from([0x82]));
|
||||
* console.log(decoder.end(Buffer.from([0xAC]))); // Prints: €
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/string_decoder.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/string_decoder.js)
|
||||
*/
|
||||
declare module "string_decoder" {
|
||||
class StringDecoder {
|
||||
@@ -48,7 +48,7 @@ declare module "string_decoder" {
|
||||
* @since v0.1.99
|
||||
* @param buffer The bytes to decode.
|
||||
*/
|
||||
write(buffer: string | Buffer | NodeJS.ArrayBufferView): string;
|
||||
write(buffer: string | NodeJS.ArrayBufferView): string;
|
||||
/**
|
||||
* Returns any remaining input stored in the internal buffer as a string. Bytes
|
||||
* representing incomplete UTF-8 and UTF-16 characters will be replaced with
|
||||
@@ -59,7 +59,7 @@ declare module "string_decoder" {
|
||||
* @since v0.9.3
|
||||
* @param buffer The bytes to decode.
|
||||
*/
|
||||
end(buffer?: string | Buffer | NodeJS.ArrayBufferView): string;
|
||||
end(buffer?: string | NodeJS.ArrayBufferView): string;
|
||||
}
|
||||
}
|
||||
declare module "node:string_decoder" {
|
||||
|
||||
3558
backend/node_modules/@types/node/test.d.ts
generated
vendored
3558
backend/node_modules/@types/node/test.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
303
backend/node_modules/@types/node/timers.d.ts
generated
vendored
303
backend/node_modules/@types/node/timers.d.ts
generated
vendored
@@ -1,21 +1,17 @@
|
||||
/**
|
||||
* The `timer` module exposes a global API for scheduling functions to
|
||||
* be called at some future period of time. Because the timer functions are
|
||||
* globals, there is no need to call `require('node:timers')` to use the API.
|
||||
* globals, there is no need to import `node:timers` to use the API.
|
||||
*
|
||||
* The timer functions within Node.js implement a similar API as the timers API
|
||||
* provided by Web Browsers but use a different internal implementation that is
|
||||
* built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/timers.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/timers.js)
|
||||
*/
|
||||
declare module "timers" {
|
||||
import { Abortable } from "node:events";
|
||||
import {
|
||||
setImmediate as setImmediatePromise,
|
||||
setInterval as setIntervalPromise,
|
||||
setTimeout as setTimeoutPromise,
|
||||
} from "node:timers/promises";
|
||||
interface TimerOptions extends Abortable {
|
||||
import * as promises from "node:timers/promises";
|
||||
export interface TimerOptions extends Abortable {
|
||||
/**
|
||||
* Set to `false` to indicate that the scheduled `Timeout`
|
||||
* should not require the Node.js event loop to remain active.
|
||||
@@ -23,38 +19,33 @@ declare module "timers" {
|
||||
*/
|
||||
ref?: boolean | undefined;
|
||||
}
|
||||
let setTimeout: typeof global.setTimeout;
|
||||
let clearTimeout: typeof global.clearTimeout;
|
||||
let setInterval: typeof global.setInterval;
|
||||
let clearInterval: typeof global.clearInterval;
|
||||
let setImmediate: typeof global.setImmediate;
|
||||
let clearImmediate: typeof global.clearImmediate;
|
||||
global {
|
||||
namespace NodeJS {
|
||||
// compatibility with older typings
|
||||
interface Timer extends RefCounted {
|
||||
hasRef(): boolean;
|
||||
refresh(): this;
|
||||
[Symbol.toPrimitive](): number;
|
||||
}
|
||||
/**
|
||||
* This object is created internally and is returned from `setImmediate()`. It
|
||||
* can be passed to `clearImmediate()` in order to cancel the scheduled
|
||||
* actions.
|
||||
*
|
||||
* By default, when an immediate is scheduled, the Node.js event loop will continue
|
||||
* running as long as the immediate is active. The `Immediate` object returned by `setImmediate()` exports both `immediate.ref()` and `immediate.unref()` functions that can be used to
|
||||
* control this default behavior.
|
||||
* running as long as the immediate is active. The `Immediate` object returned by
|
||||
* `setImmediate()` exports both `immediate.ref()` and `immediate.unref()`
|
||||
* functions that can be used to control this default behavior.
|
||||
*/
|
||||
class Immediate implements RefCounted {
|
||||
interface Immediate extends RefCounted, Disposable {
|
||||
/**
|
||||
* When called, requests that the Node.js event loop _not_ exit so long as the `Immediate` is active. Calling `immediate.ref()` multiple times will have no
|
||||
* If true, the `Immediate` object will keep the Node.js event loop active.
|
||||
* @since v11.0.0
|
||||
*/
|
||||
hasRef(): boolean;
|
||||
/**
|
||||
* When called, requests that the Node.js event loop _not_ exit so long as the
|
||||
* `Immediate` is active. Calling `immediate.ref()` multiple times will have no
|
||||
* effect.
|
||||
*
|
||||
* By default, all `Immediate` objects are "ref'ed", making it normally unnecessary
|
||||
* to call `immediate.ref()` unless `immediate.unref()` had been called previously.
|
||||
* @since v9.7.0
|
||||
* @return a reference to `immediate`
|
||||
* @returns a reference to `immediate`
|
||||
*/
|
||||
ref(): this;
|
||||
/**
|
||||
@@ -63,53 +54,58 @@ declare module "timers" {
|
||||
* running, the process may exit before the `Immediate` object's callback is
|
||||
* invoked. Calling `immediate.unref()` multiple times will have no effect.
|
||||
* @since v9.7.0
|
||||
* @return a reference to `immediate`
|
||||
* @returns a reference to `immediate`
|
||||
*/
|
||||
unref(): this;
|
||||
/**
|
||||
* If true, the `Immediate` object will keep the Node.js event loop active.
|
||||
* @since v11.0.0
|
||||
*/
|
||||
hasRef(): boolean;
|
||||
_onImmediate: Function; // to distinguish it from the Timeout class
|
||||
/**
|
||||
* Cancels the immediate. This is similar to calling `clearImmediate()`.
|
||||
* @since v20.5.0
|
||||
* @since v20.5.0, v18.18.0
|
||||
*/
|
||||
[Symbol.dispose](): void;
|
||||
_onImmediate(...args: any[]): void;
|
||||
}
|
||||
// Legacy interface used in Node.js v9 and prior
|
||||
// TODO: remove in a future major version bump
|
||||
/** @deprecated Use `NodeJS.Timeout` instead. */
|
||||
interface Timer extends RefCounted {
|
||||
hasRef(): boolean;
|
||||
refresh(): this;
|
||||
[Symbol.toPrimitive](): number;
|
||||
}
|
||||
/**
|
||||
* This object is created internally and is returned from `setTimeout()` and `setInterval()`. It can be passed to either `clearTimeout()` or `clearInterval()` in order to cancel the
|
||||
* scheduled actions.
|
||||
* This object is created internally and is returned from `setTimeout()` and
|
||||
* `setInterval()`. It can be passed to either `clearTimeout()` or
|
||||
* `clearInterval()` in order to cancel the scheduled actions.
|
||||
*
|
||||
* By default, when a timer is scheduled using either `setTimeout()` or `setInterval()`, the Node.js event loop will continue running as long as the
|
||||
* By default, when a timer is scheduled using either `setTimeout()` or
|
||||
* `setInterval()`, the Node.js event loop will continue running as long as the
|
||||
* timer is active. Each of the `Timeout` objects returned by these functions
|
||||
* export both `timeout.ref()` and `timeout.unref()` functions that can be used to
|
||||
* control this default behavior.
|
||||
*/
|
||||
class Timeout implements Timer {
|
||||
interface Timeout extends RefCounted, Disposable, Timer {
|
||||
/**
|
||||
* When called, requests that the Node.js event loop _not_ exit so long as the`Timeout` is active. Calling `timeout.ref()` multiple times will have no effect.
|
||||
*
|
||||
* By default, all `Timeout` objects are "ref'ed", making it normally unnecessary
|
||||
* to call `timeout.ref()` unless `timeout.unref()` had been called previously.
|
||||
* Cancels the timeout.
|
||||
* @since v0.9.1
|
||||
* @return a reference to `timeout`
|
||||
* @legacy Use `clearTimeout()` instead.
|
||||
* @returns a reference to `timeout`
|
||||
*/
|
||||
ref(): this;
|
||||
/**
|
||||
* When called, the active `Timeout` object will not require the Node.js event loop
|
||||
* to remain active. If there is no other activity keeping the event loop running,
|
||||
* the process may exit before the `Timeout` object's callback is invoked. Calling `timeout.unref()` multiple times will have no effect.
|
||||
* @since v0.9.1
|
||||
* @return a reference to `timeout`
|
||||
*/
|
||||
unref(): this;
|
||||
close(): this;
|
||||
/**
|
||||
* If true, the `Timeout` object will keep the Node.js event loop active.
|
||||
* @since v11.0.0
|
||||
*/
|
||||
hasRef(): boolean;
|
||||
/**
|
||||
* When called, requests that the Node.js event loop _not_ exit so long as the
|
||||
* `Timeout` is active. Calling `timeout.ref()` multiple times will have no effect.
|
||||
*
|
||||
* By default, all `Timeout` objects are "ref'ed", making it normally unnecessary
|
||||
* to call `timeout.ref()` unless `timeout.unref()` had been called previously.
|
||||
* @since v0.9.1
|
||||
* @returns a reference to `timeout`
|
||||
*/
|
||||
ref(): this;
|
||||
/**
|
||||
* Sets the timer's start time to the current time, and reschedules the timer to
|
||||
* call its callback at the previously specified duration adjusted to the current
|
||||
@@ -119,85 +115,36 @@ declare module "timers" {
|
||||
* Using this on a timer that has already called its callback will reactivate the
|
||||
* timer.
|
||||
* @since v10.2.0
|
||||
* @return a reference to `timeout`
|
||||
* @returns a reference to `timeout`
|
||||
*/
|
||||
refresh(): this;
|
||||
/**
|
||||
* When called, the active `Timeout` object will not require the Node.js event loop
|
||||
* to remain active. If there is no other activity keeping the event loop running,
|
||||
* the process may exit before the `Timeout` object's callback is invoked. Calling
|
||||
* `timeout.unref()` multiple times will have no effect.
|
||||
* @since v0.9.1
|
||||
* @returns a reference to `timeout`
|
||||
*/
|
||||
unref(): this;
|
||||
/**
|
||||
* Coerce a `Timeout` to a primitive. The primitive can be used to
|
||||
* clear the `Timeout`. The primitive can only be used in the
|
||||
* same thread where the timeout was created. Therefore, to use it
|
||||
* across `worker_threads` it must first be passed to the correct
|
||||
* thread. This allows enhanced compatibility with browser
|
||||
* `setTimeout()` and `setInterval()` implementations.
|
||||
* @since v14.9.0, v12.19.0
|
||||
*/
|
||||
[Symbol.toPrimitive](): number;
|
||||
/**
|
||||
* Cancels the timeout.
|
||||
* @since v20.5.0
|
||||
* @since v20.5.0, v18.18.0
|
||||
*/
|
||||
[Symbol.dispose](): void;
|
||||
_onTimeout(...args: any[]): void;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Schedules execution of a one-time `callback` after `delay` milliseconds.
|
||||
*
|
||||
* The `callback` will likely not be invoked in precisely `delay` milliseconds.
|
||||
* Node.js makes no guarantees about the exact timing of when callbacks will fire,
|
||||
* nor of their ordering. The callback will be called as close as possible to the
|
||||
* time specified.
|
||||
*
|
||||
* When `delay` is larger than `2147483647` or less than `1`, the `delay` will be set to `1`. Non-integer delays are truncated to an integer.
|
||||
*
|
||||
* If `callback` is not a function, a `TypeError` will be thrown.
|
||||
*
|
||||
* This method has a custom variant for promises that is available using `timersPromises.setTimeout()`.
|
||||
* @since v0.0.1
|
||||
* @param callback The function to call when the timer elapses.
|
||||
* @param [delay=1] The number of milliseconds to wait before calling the `callback`.
|
||||
* @param args Optional arguments to pass when the `callback` is called.
|
||||
* @return for use with {@link clearTimeout}
|
||||
*/
|
||||
function setTimeout<TArgs extends any[]>(
|
||||
callback: (...args: TArgs) => void,
|
||||
ms?: number,
|
||||
...args: TArgs
|
||||
): NodeJS.Timeout;
|
||||
// util.promisify no rest args compability
|
||||
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
||||
function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout;
|
||||
namespace setTimeout {
|
||||
const __promisify__: typeof setTimeoutPromise;
|
||||
}
|
||||
/**
|
||||
* Cancels a `Timeout` object created by `setTimeout()`.
|
||||
* @since v0.0.1
|
||||
* @param timeout A `Timeout` object as returned by {@link setTimeout} or the `primitive` of the `Timeout` object as a string or a number.
|
||||
*/
|
||||
function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void;
|
||||
/**
|
||||
* Schedules repeated execution of `callback` every `delay` milliseconds.
|
||||
*
|
||||
* When `delay` is larger than `2147483647` or less than `1`, the `delay` will be
|
||||
* set to `1`. Non-integer delays are truncated to an integer.
|
||||
*
|
||||
* If `callback` is not a function, a `TypeError` will be thrown.
|
||||
*
|
||||
* This method has a custom variant for promises that is available using `timersPromises.setInterval()`.
|
||||
* @since v0.0.1
|
||||
* @param callback The function to call when the timer elapses.
|
||||
* @param [delay=1] The number of milliseconds to wait before calling the `callback`.
|
||||
* @param args Optional arguments to pass when the `callback` is called.
|
||||
* @return for use with {@link clearInterval}
|
||||
*/
|
||||
function setInterval<TArgs extends any[]>(
|
||||
callback: (...args: TArgs) => void,
|
||||
ms?: number,
|
||||
...args: TArgs
|
||||
): NodeJS.Timeout;
|
||||
// util.promisify no rest args compability
|
||||
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
||||
function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timeout;
|
||||
namespace setInterval {
|
||||
const __promisify__: typeof setIntervalPromise;
|
||||
}
|
||||
/**
|
||||
* Cancels a `Timeout` object created by `setInterval()`.
|
||||
* @since v0.0.1
|
||||
* @param timeout A `Timeout` object as returned by {@link setInterval} or the `primitive` of the `Timeout` object as a string or a number.
|
||||
*/
|
||||
function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void;
|
||||
/**
|
||||
* Schedules the "immediate" execution of the `callback` after I/O events'
|
||||
* callbacks.
|
||||
@@ -210,30 +157,128 @@ declare module "timers" {
|
||||
*
|
||||
* If `callback` is not a function, a `TypeError` will be thrown.
|
||||
*
|
||||
* This method has a custom variant for promises that is available using `timersPromises.setImmediate()`.
|
||||
* This method has a custom variant for promises that is available using
|
||||
* `timersPromises.setImmediate()`.
|
||||
* @since v0.9.1
|
||||
* @param callback The function to call at the end of this turn of the Node.js `Event Loop`
|
||||
* @param callback The function to call at the end of this turn of
|
||||
* the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout)
|
||||
* @param args Optional arguments to pass when the `callback` is called.
|
||||
* @return for use with {@link clearImmediate}
|
||||
* @returns for use with `clearImmediate()`
|
||||
*/
|
||||
function setImmediate<TArgs extends any[]>(
|
||||
callback: (...args: TArgs) => void,
|
||||
...args: TArgs
|
||||
): NodeJS.Immediate;
|
||||
// util.promisify no rest args compability
|
||||
// Allow a single void-accepting argument to be optional in arguments lists.
|
||||
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
|
||||
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
||||
function setImmediate(callback: (args: void) => void): NodeJS.Immediate;
|
||||
function setImmediate(callback: (_: void) => void): NodeJS.Immediate;
|
||||
namespace setImmediate {
|
||||
const __promisify__: typeof setImmediatePromise;
|
||||
import __promisify__ = promises.setImmediate;
|
||||
export { __promisify__ };
|
||||
}
|
||||
/**
|
||||
* Schedules repeated execution of `callback` every `delay` milliseconds.
|
||||
*
|
||||
* When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
|
||||
* will be set to `1`. Non-integer delays are truncated to an integer.
|
||||
*
|
||||
* If `callback` is not a function, a `TypeError` will be thrown.
|
||||
*
|
||||
* This method has a custom variant for promises that is available using
|
||||
* `timersPromises.setInterval()`.
|
||||
* @since v0.0.1
|
||||
* @param callback The function to call when the timer elapses.
|
||||
* @param delay The number of milliseconds to wait before calling the
|
||||
* `callback`. **Default:** `1`.
|
||||
* @param args Optional arguments to pass when the `callback` is called.
|
||||
* @returns for use with `clearInterval()`
|
||||
*/
|
||||
function setInterval<TArgs extends any[]>(
|
||||
callback: (...args: TArgs) => void,
|
||||
delay?: number,
|
||||
...args: TArgs
|
||||
): NodeJS.Timeout;
|
||||
// Allow a single void-accepting argument to be optional in arguments lists.
|
||||
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
|
||||
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
||||
function setInterval(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
|
||||
/**
|
||||
* Schedules execution of a one-time `callback` after `delay` milliseconds.
|
||||
*
|
||||
* The `callback` will likely not be invoked in precisely `delay` milliseconds.
|
||||
* Node.js makes no guarantees about the exact timing of when callbacks will fire,
|
||||
* nor of their ordering. The callback will be called as close as possible to the
|
||||
* time specified.
|
||||
*
|
||||
* When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
|
||||
* will be set to `1`. Non-integer delays are truncated to an integer.
|
||||
*
|
||||
* If `callback` is not a function, a `TypeError` will be thrown.
|
||||
*
|
||||
* This method has a custom variant for promises that is available using
|
||||
* `timersPromises.setTimeout()`.
|
||||
* @since v0.0.1
|
||||
* @param callback The function to call when the timer elapses.
|
||||
* @param delay The number of milliseconds to wait before calling the
|
||||
* `callback`. **Default:** `1`.
|
||||
* @param args Optional arguments to pass when the `callback` is called.
|
||||
* @returns for use with `clearTimeout()`
|
||||
*/
|
||||
function setTimeout<TArgs extends any[]>(
|
||||
callback: (...args: TArgs) => void,
|
||||
delay?: number,
|
||||
...args: TArgs
|
||||
): NodeJS.Timeout;
|
||||
// Allow a single void-accepting argument to be optional in arguments lists.
|
||||
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
|
||||
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
||||
function setTimeout(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
|
||||
namespace setTimeout {
|
||||
import __promisify__ = promises.setTimeout;
|
||||
export { __promisify__ };
|
||||
}
|
||||
/**
|
||||
* Cancels an `Immediate` object created by `setImmediate()`.
|
||||
* @since v0.9.1
|
||||
* @param immediate An `Immediate` object as returned by {@link setImmediate}.
|
||||
* @param immediate An `Immediate` object as returned by `setImmediate()`.
|
||||
*/
|
||||
function clearImmediate(immediate: NodeJS.Immediate | undefined): void;
|
||||
/**
|
||||
* Cancels a `Timeout` object created by `setInterval()`.
|
||||
* @since v0.0.1
|
||||
* @param timeout A `Timeout` object as returned by `setInterval()`
|
||||
* or the primitive of the `Timeout` object as a string or a number.
|
||||
*/
|
||||
function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void;
|
||||
/**
|
||||
* Cancels a `Timeout` object created by `setTimeout()`.
|
||||
* @since v0.0.1
|
||||
* @param timeout A `Timeout` object as returned by `setTimeout()`
|
||||
* or the primitive of the `Timeout` object as a string or a number.
|
||||
*/
|
||||
function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void;
|
||||
/**
|
||||
* The `queueMicrotask()` method queues a microtask to invoke `callback`. If
|
||||
* `callback` throws an exception, the `process` object `'uncaughtException'`
|
||||
* event will be emitted.
|
||||
*
|
||||
* The microtask queue is managed by V8 and may be used in a similar manner to
|
||||
* the `process.nextTick()` queue, which is managed by Node.js. The
|
||||
* `process.nextTick()` queue is always processed before the microtask queue
|
||||
* within each turn of the Node.js event loop.
|
||||
* @since v11.0.0
|
||||
* @param callback Function to be queued.
|
||||
*/
|
||||
function clearImmediate(immediateId: NodeJS.Immediate | undefined): void;
|
||||
function queueMicrotask(callback: () => void): void;
|
||||
}
|
||||
import clearImmediate = globalThis.clearImmediate;
|
||||
import clearInterval = globalThis.clearInterval;
|
||||
import clearTimeout = globalThis.clearTimeout;
|
||||
import setImmediate = globalThis.setImmediate;
|
||||
import setInterval = globalThis.setInterval;
|
||||
import setTimeout = globalThis.setTimeout;
|
||||
export { clearImmediate, clearInterval, clearTimeout, promises, setImmediate, setInterval, setTimeout };
|
||||
}
|
||||
declare module "node:timers" {
|
||||
export * from "timers";
|
||||
|
||||
45
backend/node_modules/@types/node/timers/promises.d.ts
generated
vendored
45
backend/node_modules/@types/node/timers/promises.d.ts
generated
vendored
@@ -1,15 +1,17 @@
|
||||
/**
|
||||
* The `timers/promises` API provides an alternative set of timer functions
|
||||
* that return `Promise` objects. The API is accessible via `require('node:timers/promises')`.
|
||||
* that return `Promise` objects. The API is accessible via
|
||||
* `require('node:timers/promises')`.
|
||||
*
|
||||
* ```js
|
||||
* import {
|
||||
* setTimeout,
|
||||
* setImmediate,
|
||||
* setInterval,
|
||||
* } from 'timers/promises';
|
||||
* } from 'node:timers/promises';
|
||||
* ```
|
||||
* @since v15.0.0
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/timers/promises.js)
|
||||
*/
|
||||
declare module "timers/promises" {
|
||||
import { TimerOptions } from "node:timers";
|
||||
@@ -17,14 +19,15 @@ declare module "timers/promises" {
|
||||
* ```js
|
||||
* import {
|
||||
* setTimeout,
|
||||
* } from 'timers/promises';
|
||||
* } from 'node:timers/promises';
|
||||
*
|
||||
* const res = await setTimeout(100, 'result');
|
||||
*
|
||||
* console.log(res); // Prints 'result'
|
||||
* ```
|
||||
* @since v15.0.0
|
||||
* @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
|
||||
* @param delay The number of milliseconds to wait before fulfilling the
|
||||
* promise. **Default:** `1`.
|
||||
* @param value A value with which the promise is fulfilled.
|
||||
*/
|
||||
function setTimeout<T = void>(delay?: number, value?: T, options?: TimerOptions): Promise<T>;
|
||||
@@ -32,7 +35,7 @@ declare module "timers/promises" {
|
||||
* ```js
|
||||
* import {
|
||||
* setImmediate,
|
||||
* } from 'timers/promises';
|
||||
* } from 'node:timers/promises';
|
||||
*
|
||||
* const res = await setImmediate('result');
|
||||
*
|
||||
@@ -50,7 +53,7 @@ declare module "timers/promises" {
|
||||
* ```js
|
||||
* import {
|
||||
* setInterval,
|
||||
* } from 'timers/promises';
|
||||
* } from 'node:timers/promises';
|
||||
*
|
||||
* const interval = 100;
|
||||
* for await (const startTime of setInterval(interval, Date.now())) {
|
||||
@@ -62,33 +65,41 @@ declare module "timers/promises" {
|
||||
* console.log(Date.now());
|
||||
* ```
|
||||
* @since v15.9.0
|
||||
* @param delay The number of milliseconds to wait between iterations.
|
||||
* **Default:** `1`.
|
||||
* @param value A value with which the iterator returns.
|
||||
*/
|
||||
function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
|
||||
function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): NodeJS.AsyncIterator<T>;
|
||||
interface Scheduler {
|
||||
/**
|
||||
* An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification being developed as a standard Web Platform API.
|
||||
* An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification
|
||||
* being developed as a standard Web Platform API.
|
||||
*
|
||||
* Calling `timersPromises.scheduler.wait(delay, options)` is roughly equivalent to calling `timersPromises.setTimeout(delay, undefined, options)` except that the `ref`
|
||||
* option is not supported.
|
||||
* Calling `timersPromises.scheduler.wait(delay, options)` is roughly equivalent
|
||||
* to calling `timersPromises.setTimeout(delay, undefined, options)` except that
|
||||
* the `ref` option is not supported.
|
||||
*
|
||||
* ```js
|
||||
* import { scheduler } from 'node:timers/promises';
|
||||
*
|
||||
* await scheduler.wait(1000); // Wait one second before continuing
|
||||
* ```
|
||||
* @since v16.14.0
|
||||
* @since v17.3.0, v16.14.0
|
||||
* @experimental
|
||||
* @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
|
||||
* @param delay The number of milliseconds to wait before resolving the
|
||||
* promise.
|
||||
*/
|
||||
wait: (delay?: number, options?: Pick<TimerOptions, "signal">) => Promise<void>;
|
||||
wait(delay: number, options?: { signal?: AbortSignal }): Promise<void>;
|
||||
/**
|
||||
* An experimental API defined by the [Scheduling APIs](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html#promise-execution-tracking) draft specification
|
||||
* An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification
|
||||
* being developed as a standard Web Platform API.
|
||||
* Calling `timersPromises.scheduler.yield()` is equivalent to calling `timersPromises.setImmediate()` with no arguments.
|
||||
* @since v16.14.0
|
||||
*
|
||||
* Calling `timersPromises.scheduler.yield()` is equivalent to calling
|
||||
* `timersPromises.setImmediate()` with no arguments.
|
||||
* @since v17.3.0, v16.14.0
|
||||
* @experimental
|
||||
*/
|
||||
yield: () => Promise<void>;
|
||||
yield(): Promise<void>;
|
||||
}
|
||||
const scheduler: Scheduler;
|
||||
}
|
||||
|
||||
292
backend/node_modules/@types/node/tls.d.ts
generated
vendored
292
backend/node_modules/@types/node/tls.d.ts
generated
vendored
@@ -4,11 +4,12 @@
|
||||
* The module can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const tls = require('node:tls');
|
||||
* import tls from 'node:tls';
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/tls.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/tls.js)
|
||||
*/
|
||||
declare module "tls" {
|
||||
import { NonSharedBuffer } from "node:buffer";
|
||||
import { X509Certificate } from "node:crypto";
|
||||
import * as net from "node:net";
|
||||
import * as stream from "stream";
|
||||
@@ -49,7 +50,7 @@ declare module "tls" {
|
||||
/**
|
||||
* The DER encoded X.509 certificate data.
|
||||
*/
|
||||
raw: Buffer;
|
||||
raw: NonSharedBuffer;
|
||||
/**
|
||||
* The certificate subject.
|
||||
*/
|
||||
@@ -115,7 +116,7 @@ declare module "tls" {
|
||||
/**
|
||||
* The public key.
|
||||
*/
|
||||
pubkey?: Buffer;
|
||||
pubkey?: NonSharedBuffer;
|
||||
/**
|
||||
* The ASN.1 name of the OID of the elliptic curve.
|
||||
* Well-known curves are identified by an OID.
|
||||
@@ -295,7 +296,7 @@ declare module "tls" {
|
||||
* @since v9.9.0
|
||||
* @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet.
|
||||
*/
|
||||
getFinished(): Buffer | undefined;
|
||||
getFinished(): NonSharedBuffer | undefined;
|
||||
/**
|
||||
* Returns an object representing the peer's certificate. If the peer does not
|
||||
* provide a certificate, an empty object will be returned. If the socket has been
|
||||
@@ -322,7 +323,7 @@ declare module "tls" {
|
||||
* @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so
|
||||
* far.
|
||||
*/
|
||||
getPeerFinished(): Buffer | undefined;
|
||||
getPeerFinished(): NonSharedBuffer | undefined;
|
||||
/**
|
||||
* Returns a string containing the negotiated SSL/TLS protocol version of the
|
||||
* current connection. The value `'unknown'` will be returned for connected
|
||||
@@ -352,7 +353,7 @@ declare module "tls" {
|
||||
* must use the `'session'` event (it also works for TLSv1.2 and below).
|
||||
* @since v0.11.4
|
||||
*/
|
||||
getSession(): Buffer | undefined;
|
||||
getSession(): NonSharedBuffer | undefined;
|
||||
/**
|
||||
* See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information.
|
||||
* @since v12.11.0
|
||||
@@ -367,7 +368,7 @@ declare module "tls" {
|
||||
* See `Session Resumption` for more information.
|
||||
* @since v0.11.4
|
||||
*/
|
||||
getTLSTicket(): Buffer | undefined;
|
||||
getTLSTicket(): NonSharedBuffer | undefined;
|
||||
/**
|
||||
* See `Session Resumption` for more information.
|
||||
* @since v0.5.6
|
||||
@@ -398,6 +399,14 @@ declare module "tls" {
|
||||
},
|
||||
callback: (err: Error | null) => void,
|
||||
): undefined | boolean;
|
||||
/**
|
||||
* The `tlsSocket.setKeyCert()` method sets the private key and certificate to use for the socket.
|
||||
* This is mainly useful if you wish to select a server certificate from a TLS server's `ALPNCallback`.
|
||||
* @since v22.5.0, v20.17.0
|
||||
* @param context An object containing at least `key` and `cert` properties from the {@link createSecureContext()} `options`,
|
||||
* or a TLS context object created with {@link createSecureContext()} itself.
|
||||
*/
|
||||
setKeyCert(context: SecureContextOptions | SecureContext): void;
|
||||
/**
|
||||
* The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size.
|
||||
* Returns `true` if setting the limit succeeded; `false` otherwise.
|
||||
@@ -470,37 +479,37 @@ declare module "tls" {
|
||||
* @param context Optionally provide a context.
|
||||
* @return requested bytes of the keying material
|
||||
*/
|
||||
exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer;
|
||||
exportKeyingMaterial(length: number, label: string, context: Buffer): NonSharedBuffer;
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
||||
addListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
||||
addListener(event: "secureConnect", listener: () => void): this;
|
||||
addListener(event: "session", listener: (session: Buffer) => void): this;
|
||||
addListener(event: "keylog", listener: (line: Buffer) => void): this;
|
||||
addListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
||||
addListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "OCSPResponse", response: Buffer): boolean;
|
||||
emit(event: "OCSPResponse", response: NonSharedBuffer): boolean;
|
||||
emit(event: "secureConnect"): boolean;
|
||||
emit(event: "session", session: Buffer): boolean;
|
||||
emit(event: "keylog", line: Buffer): boolean;
|
||||
emit(event: "session", session: NonSharedBuffer): boolean;
|
||||
emit(event: "keylog", line: NonSharedBuffer): boolean;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
||||
on(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
||||
on(event: "secureConnect", listener: () => void): this;
|
||||
on(event: "session", listener: (session: Buffer) => void): this;
|
||||
on(event: "keylog", listener: (line: Buffer) => void): this;
|
||||
on(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
||||
on(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
||||
once(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
||||
once(event: "secureConnect", listener: () => void): this;
|
||||
once(event: "session", listener: (session: Buffer) => void): this;
|
||||
once(event: "keylog", listener: (line: Buffer) => void): this;
|
||||
once(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
||||
once(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
||||
prependListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
||||
prependListener(event: "secureConnect", listener: () => void): this;
|
||||
prependListener(event: "session", listener: (session: Buffer) => void): this;
|
||||
prependListener(event: "keylog", listener: (line: Buffer) => void): this;
|
||||
prependListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
||||
prependListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
||||
prependOnceListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
||||
prependOnceListener(event: "secureConnect", listener: () => void): this;
|
||||
prependOnceListener(event: "session", listener: (session: Buffer) => void): this;
|
||||
prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this;
|
||||
prependOnceListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
||||
prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
||||
}
|
||||
interface CommonConnectionOptions {
|
||||
/**
|
||||
@@ -523,7 +532,7 @@ declare module "tls" {
|
||||
* An array of strings or a Buffer naming possible ALPN protocols.
|
||||
* (Protocols should be ordered by their priority.)
|
||||
*/
|
||||
ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined;
|
||||
ALPNProtocols?: readonly string[] | NodeJS.ArrayBufferView | undefined;
|
||||
/**
|
||||
* SNICallback(servername, cb) <Function> A function that will be
|
||||
* called if the client supports SNI TLS extension. Two arguments
|
||||
@@ -578,7 +587,7 @@ declare module "tls" {
|
||||
* requires explicitly specifying a cipher suite with the `ciphers` option.
|
||||
* More information can be found in the RFC 4279.
|
||||
*/
|
||||
pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null;
|
||||
pskCallback?: ((socket: TLSSocket, identity: string) => NodeJS.ArrayBufferView | null) | undefined;
|
||||
/**
|
||||
* hint to send to a client to help
|
||||
* with selecting the identity during TLS-PSK negotiation. Will be ignored
|
||||
@@ -588,7 +597,7 @@ declare module "tls" {
|
||||
pskIdentityHint?: string | undefined;
|
||||
}
|
||||
interface PSKCallbackNegotation {
|
||||
psk: DataView | NodeJS.TypedArray;
|
||||
psk: NodeJS.ArrayBufferView;
|
||||
identity: string;
|
||||
}
|
||||
interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
|
||||
@@ -619,7 +628,7 @@ declare module "tls" {
|
||||
* compatible with the selected cipher's digest.
|
||||
* `identity` must use UTF-8 encoding.
|
||||
*/
|
||||
pskCallback?(hint: string | null): PSKCallbackNegotation | null;
|
||||
pskCallback?: ((hint: string | null) => PSKCallbackNegotation | null) | undefined;
|
||||
}
|
||||
/**
|
||||
* Accepts encrypted connections using TLS or SSL.
|
||||
@@ -639,7 +648,7 @@ declare module "tls" {
|
||||
* @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created
|
||||
* with {@link createSecureContext} itself.
|
||||
*/
|
||||
addContext(hostname: string, context: SecureContextOptions): void;
|
||||
addContext(hostname: string, context: SecureContextOptions | SecureContext): void;
|
||||
/**
|
||||
* Returns the session ticket keys.
|
||||
*
|
||||
@@ -647,7 +656,7 @@ declare module "tls" {
|
||||
* @since v3.0.0
|
||||
* @return A 48-byte buffer containing the session ticket keys.
|
||||
*/
|
||||
getTicketKeys(): Buffer;
|
||||
getTicketKeys(): NonSharedBuffer;
|
||||
/**
|
||||
* The `server.setSecureContext()` method replaces the secure context of an
|
||||
* existing server. Existing connections to the server are not interrupted.
|
||||
@@ -679,122 +688,138 @@ declare module "tls" {
|
||||
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
||||
addListener(
|
||||
event: "newSession",
|
||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
|
||||
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
||||
): this;
|
||||
addListener(
|
||||
event: "OCSPRequest",
|
||||
listener: (
|
||||
certificate: Buffer,
|
||||
issuer: Buffer,
|
||||
callback: (err: Error | null, resp: Buffer) => void,
|
||||
certificate: NonSharedBuffer,
|
||||
issuer: NonSharedBuffer,
|
||||
callback: (err: Error | null, resp: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
addListener(
|
||||
event: "resumeSession",
|
||||
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
||||
listener: (
|
||||
sessionId: NonSharedBuffer,
|
||||
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
||||
addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
||||
addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
|
||||
emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
|
||||
emit(
|
||||
event: "newSession",
|
||||
sessionId: NonSharedBuffer,
|
||||
sessionData: NonSharedBuffer,
|
||||
callback: () => void,
|
||||
): boolean;
|
||||
emit(
|
||||
event: "OCSPRequest",
|
||||
certificate: Buffer,
|
||||
issuer: Buffer,
|
||||
callback: (err: Error | null, resp: Buffer) => void,
|
||||
certificate: NonSharedBuffer,
|
||||
issuer: NonSharedBuffer,
|
||||
callback: (err: Error | null, resp: Buffer | null) => void,
|
||||
): boolean;
|
||||
emit(
|
||||
event: "resumeSession",
|
||||
sessionId: Buffer,
|
||||
sessionId: NonSharedBuffer,
|
||||
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
||||
): boolean;
|
||||
emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
|
||||
emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean;
|
||||
emit(event: "keylog", line: NonSharedBuffer, tlsSocket: TLSSocket): boolean;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
||||
on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
|
||||
on(
|
||||
event: "newSession",
|
||||
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
||||
): this;
|
||||
on(
|
||||
event: "OCSPRequest",
|
||||
listener: (
|
||||
certificate: Buffer,
|
||||
issuer: Buffer,
|
||||
callback: (err: Error | null, resp: Buffer) => void,
|
||||
certificate: NonSharedBuffer,
|
||||
issuer: NonSharedBuffer,
|
||||
callback: (err: Error | null, resp: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
on(
|
||||
event: "resumeSession",
|
||||
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
||||
listener: (
|
||||
sessionId: NonSharedBuffer,
|
||||
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
||||
on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
||||
on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
||||
once(
|
||||
event: "newSession",
|
||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
|
||||
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
||||
): this;
|
||||
once(
|
||||
event: "OCSPRequest",
|
||||
listener: (
|
||||
certificate: Buffer,
|
||||
issuer: Buffer,
|
||||
callback: (err: Error | null, resp: Buffer) => void,
|
||||
certificate: NonSharedBuffer,
|
||||
issuer: NonSharedBuffer,
|
||||
callback: (err: Error | null, resp: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
once(
|
||||
event: "resumeSession",
|
||||
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
||||
listener: (
|
||||
sessionId: NonSharedBuffer,
|
||||
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
||||
once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
||||
once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
||||
prependListener(
|
||||
event: "newSession",
|
||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
|
||||
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
||||
): this;
|
||||
prependListener(
|
||||
event: "OCSPRequest",
|
||||
listener: (
|
||||
certificate: Buffer,
|
||||
issuer: Buffer,
|
||||
callback: (err: Error | null, resp: Buffer) => void,
|
||||
certificate: NonSharedBuffer,
|
||||
issuer: NonSharedBuffer,
|
||||
callback: (err: Error | null, resp: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
prependListener(
|
||||
event: "resumeSession",
|
||||
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
||||
listener: (
|
||||
sessionId: NonSharedBuffer,
|
||||
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
||||
prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
||||
prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
||||
prependOnceListener(
|
||||
event: "newSession",
|
||||
listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
|
||||
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
||||
): this;
|
||||
prependOnceListener(
|
||||
event: "OCSPRequest",
|
||||
listener: (
|
||||
certificate: Buffer,
|
||||
issuer: Buffer,
|
||||
callback: (err: Error | null, resp: Buffer) => void,
|
||||
certificate: NonSharedBuffer,
|
||||
issuer: NonSharedBuffer,
|
||||
callback: (err: Error | null, resp: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
prependOnceListener(
|
||||
event: "resumeSession",
|
||||
listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
|
||||
listener: (
|
||||
sessionId: NonSharedBuffer,
|
||||
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
||||
) => void,
|
||||
): this;
|
||||
prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
||||
prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
||||
}
|
||||
/**
|
||||
* @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
|
||||
*/
|
||||
interface SecurePair {
|
||||
encrypted: TLSSocket;
|
||||
cleartext: TLSSocket;
|
||||
prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
||||
}
|
||||
type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
|
||||
interface SecureContextOptions {
|
||||
@@ -809,6 +834,12 @@ declare module "tls" {
|
||||
* This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error.
|
||||
*/
|
||||
ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined;
|
||||
/**
|
||||
* Treat intermediate (non-self-signed)
|
||||
* certificates in the trust CA certificate list as trusted.
|
||||
* @since v22.9.0, v20.18.0
|
||||
*/
|
||||
allowPartialTrustChain?: boolean | undefined;
|
||||
/**
|
||||
* Optionally override the trusted CA certificates. Default is to trust
|
||||
* the well-known CAs curated by Mozilla. Mozilla's CAs are completely
|
||||
@@ -843,6 +874,7 @@ declare module "tls" {
|
||||
ciphers?: string | undefined;
|
||||
/**
|
||||
* Name of an OpenSSL engine which can provide the client certificate.
|
||||
* @deprecated
|
||||
*/
|
||||
clientCertEngine?: string | undefined;
|
||||
/**
|
||||
@@ -885,12 +917,14 @@ declare module "tls" {
|
||||
/**
|
||||
* Name of an OpenSSL engine to get private key from. Should be used
|
||||
* together with privateKeyIdentifier.
|
||||
* @deprecated
|
||||
*/
|
||||
privateKeyEngine?: string | undefined;
|
||||
/**
|
||||
* Identifier of a private key managed by an OpenSSL engine. Should be
|
||||
* used together with privateKeyEngine. Should not be set together with
|
||||
* key, because both options define a private key in different ways.
|
||||
* @deprecated
|
||||
*/
|
||||
privateKeyIdentifier?: string | undefined;
|
||||
/**
|
||||
@@ -1000,8 +1034,8 @@ declare module "tls" {
|
||||
* The following illustrates a simple echo server:
|
||||
*
|
||||
* ```js
|
||||
* const tls = require('node:tls');
|
||||
* const fs = require('node:fs');
|
||||
* import tls from 'node:tls';
|
||||
* import fs from 'node:fs';
|
||||
*
|
||||
* const options = {
|
||||
* key: fs.readFileSync('server-key.pem'),
|
||||
@@ -1046,8 +1080,8 @@ declare module "tls" {
|
||||
*
|
||||
* ```js
|
||||
* // Assumes an echo server that is listening on port 8000.
|
||||
* const tls = require('node:tls');
|
||||
* const fs = require('node:fs');
|
||||
* import tls from 'node:tls';
|
||||
* import fs from 'node:fs';
|
||||
*
|
||||
* const options = {
|
||||
* // Necessary only if the server requires client certificate authentication.
|
||||
@@ -1085,45 +1119,6 @@ declare module "tls" {
|
||||
secureConnectListener?: () => void,
|
||||
): TLSSocket;
|
||||
function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
|
||||
/**
|
||||
* Creates a new secure pair object with two streams, one of which reads and writes
|
||||
* the encrypted data and the other of which reads and writes the cleartext data.
|
||||
* Generally, the encrypted stream is piped to/from an incoming encrypted data
|
||||
* stream and the cleartext one is used as a replacement for the initial encrypted
|
||||
* stream.
|
||||
*
|
||||
* `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and `encrypted` stream properties.
|
||||
*
|
||||
* Using `cleartext` has the same API as {@link TLSSocket}.
|
||||
*
|
||||
* The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code:
|
||||
*
|
||||
* ```js
|
||||
* pair = tls.createSecurePair(// ... );
|
||||
* pair.encrypted.pipe(socket);
|
||||
* socket.pipe(pair.encrypted);
|
||||
* ```
|
||||
*
|
||||
* can be replaced by:
|
||||
*
|
||||
* ```js
|
||||
* secureSocket = tls.TLSSocket(socket, options);
|
||||
* ```
|
||||
*
|
||||
* where `secureSocket` has the same API as `pair.cleartext`.
|
||||
* @since v0.3.2
|
||||
* @deprecated Since v0.11.3 - Use {@link TLSSocket} instead.
|
||||
* @param context A secure context object as returned by `tls.createSecureContext()`
|
||||
* @param isServer `true` to specify that this TLS connection should be opened as a server.
|
||||
* @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`.
|
||||
* @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`.
|
||||
*/
|
||||
function createSecurePair(
|
||||
context?: SecureContext,
|
||||
isServer?: boolean,
|
||||
requestCert?: boolean,
|
||||
rejectUnauthorized?: boolean,
|
||||
): SecurePair;
|
||||
/**
|
||||
* `{@link createServer}` sets the default value of the `honorCipherOrder` option
|
||||
* to `true`, other APIs that create secure contexts leave it unset.
|
||||
@@ -1149,13 +1144,38 @@ declare module "tls" {
|
||||
* @since v0.11.13
|
||||
*/
|
||||
function createSecureContext(options?: SecureContextOptions): SecureContext;
|
||||
/**
|
||||
* Returns an array containing the CA certificates from various sources, depending on `type`:
|
||||
*
|
||||
* * `"default"`: return the CA certificates that will be used by the Node.js TLS clients by default.
|
||||
* * When `--use-bundled-ca` is enabled (default), or `--use-openssl-ca` is not enabled,
|
||||
* this would include CA certificates from the bundled Mozilla CA store.
|
||||
* * When `--use-system-ca` is enabled, this would also include certificates from the system's
|
||||
* trusted store.
|
||||
* * When `NODE_EXTRA_CA_CERTS` is used, this would also include certificates loaded from the specified
|
||||
* file.
|
||||
* * `"system"`: return the CA certificates that are loaded from the system's trusted store, according
|
||||
* to rules set by `--use-system-ca`. This can be used to get the certificates from the system
|
||||
* when `--use-system-ca` is not enabled.
|
||||
* * `"bundled"`: return the CA certificates from the bundled Mozilla CA store. This would be the same
|
||||
* as `tls.rootCertificates`.
|
||||
* * `"extra"`: return the CA certificates loaded from `NODE_EXTRA_CA_CERTS`. It's an empty array if
|
||||
* `NODE_EXTRA_CA_CERTS` is not set.
|
||||
* @since v22.15.0
|
||||
* @param type The type of CA certificates that will be returned. Valid values
|
||||
* are `"default"`, `"system"`, `"bundled"` and `"extra"`.
|
||||
* **Default:** `"default"`.
|
||||
* @returns An array of PEM-encoded certificates. The array may contain duplicates
|
||||
* if the same certificate is repeatedly stored in multiple sources.
|
||||
*/
|
||||
function getCACertificates(type?: "default" | "system" | "bundled" | "extra"): string[];
|
||||
/**
|
||||
* Returns an array with the names of the supported TLS ciphers. The names are
|
||||
* lower-case for historical reasons, but must be uppercased to be used in
|
||||
* the `ciphers` option of `{@link createSecureContext}`.
|
||||
*
|
||||
* Not all supported ciphers are enabled by default. See
|
||||
* [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v20.x/api/tls.html#modifying-the-default-tls-cipher-suite).
|
||||
* [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v24.x/api/tls.html#modifying-the-default-tls-cipher-suite).
|
||||
*
|
||||
* Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for
|
||||
* TLSv1.2 and below.
|
||||
@@ -1166,6 +1186,38 @@ declare module "tls" {
|
||||
* @since v0.10.2
|
||||
*/
|
||||
function getCiphers(): string[];
|
||||
/**
|
||||
* Sets the default CA certificates used by Node.js TLS clients. If the provided
|
||||
* certificates are parsed successfully, they will become the default CA
|
||||
* certificate list returned by {@link getCACertificates} and used
|
||||
* by subsequent TLS connections that don't specify their own CA certificates.
|
||||
* The certificates will be deduplicated before being set as the default.
|
||||
*
|
||||
* This function only affects the current Node.js thread. Previous
|
||||
* sessions cached by the HTTPS agent won't be affected by this change, so
|
||||
* this method should be called before any unwanted cachable TLS connections are
|
||||
* made.
|
||||
*
|
||||
* To use system CA certificates as the default:
|
||||
*
|
||||
* ```js
|
||||
* import tls from 'node:tls';
|
||||
* tls.setDefaultCACertificates(tls.getCACertificates('system'));
|
||||
* ```
|
||||
*
|
||||
* This function completely replaces the default CA certificate list. To add additional
|
||||
* certificates to the existing defaults, get the current certificates and append to them:
|
||||
*
|
||||
* ```js
|
||||
* import tls from 'node:tls';
|
||||
* const currentCerts = tls.getCACertificates('default');
|
||||
* const additionalCerts = ['-----BEGIN CERTIFICATE-----\n...'];
|
||||
* tls.setDefaultCACertificates([...currentCerts, ...additionalCerts]);
|
||||
* ```
|
||||
* @since v24.5.0
|
||||
* @param certs An array of CA certificates in PEM format.
|
||||
*/
|
||||
function setDefaultCACertificates(certs: ReadonlyArray<string | NodeJS.ArrayBufferView>): void;
|
||||
/**
|
||||
* The default curve name to use for ECDH key agreement in a tls server.
|
||||
* The default value is `'auto'`. See `{@link createSecureContext()}` for further
|
||||
|
||||
20
backend/node_modules/@types/node/trace_events.d.ts
generated
vendored
20
backend/node_modules/@types/node/trace_events.d.ts
generated
vendored
@@ -9,8 +9,8 @@
|
||||
* The available categories are:
|
||||
*
|
||||
* * `node`: An empty placeholder.
|
||||
* * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html) trace data.
|
||||
* The [`async_hooks`](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html) events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property.
|
||||
* * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html) trace data.
|
||||
* The [`async_hooks`](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html) events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property.
|
||||
* * `node.bootstrap`: Enables capture of Node.js bootstrap milestones.
|
||||
* * `node.console`: Enables capture of `console.time()` and `console.count()` output.
|
||||
* * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`.
|
||||
@@ -22,7 +22,7 @@
|
||||
* * `node.fs_dir.sync`: Enables capture of trace data for file system sync directory methods.
|
||||
* * `node.fs.async`: Enables capture of trace data for file system async methods.
|
||||
* * `node.fs_dir.async`: Enables capture of trace data for file system async directory methods.
|
||||
* * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v20.x/api/perf_hooks.html) measurements.
|
||||
* * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v24.x/api/perf_hooks.html) measurements.
|
||||
* * `node.perf.usertiming`: Enables capture of only Performance API User Timing
|
||||
* measures and marks.
|
||||
* * `node.perf.timerify`: Enables capture of only Performance API timerify
|
||||
@@ -30,7 +30,7 @@
|
||||
* * `node.promises.rejections`: Enables capture of trace data tracking the number
|
||||
* of unhandled Promise rejections and handled-after-rejections.
|
||||
* * `node.vm.script`: Enables capture of trace data for the `node:vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
|
||||
* * `v8`: The [V8](https://nodejs.org/docs/latest-v20.x/api/v8.html) events are GC, compiling, and execution related.
|
||||
* * `v8`: The [V8](https://nodejs.org/docs/latest-v24.x/api/v8.html) events are GC, compiling, and execution related.
|
||||
* * `node.http`: Enables capture of trace data for http request / response.
|
||||
*
|
||||
* By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
|
||||
@@ -53,7 +53,7 @@
|
||||
* Alternatively, trace events may be enabled using the `node:trace_events` module:
|
||||
*
|
||||
* ```js
|
||||
* const trace_events = require('node:trace_events');
|
||||
* import trace_events from 'node:trace_events';
|
||||
* const tracing = trace_events.createTracing({ categories: ['node.perf'] });
|
||||
* tracing.enable(); // Enable trace event capture for the 'node.perf' category
|
||||
*
|
||||
@@ -88,9 +88,9 @@
|
||||
* However the trace-event timestamps are expressed in microseconds,
|
||||
* unlike `process.hrtime()` which returns nanoseconds.
|
||||
*
|
||||
* The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html#class-worker) threads.
|
||||
* The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html#class-worker) threads.
|
||||
* @experimental
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/trace_events.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/trace_events.js)
|
||||
*/
|
||||
declare module "trace_events" {
|
||||
/**
|
||||
@@ -118,7 +118,7 @@ declare module "trace_events" {
|
||||
* will be disabled.
|
||||
*
|
||||
* ```js
|
||||
* const trace_events = require('node:trace_events');
|
||||
* import trace_events from 'node:trace_events';
|
||||
* const t1 = trace_events.createTracing({ categories: ['node', 'v8'] });
|
||||
* const t2 = trace_events.createTracing({ categories: ['node.perf', 'node'] });
|
||||
* t1.enable();
|
||||
@@ -159,7 +159,7 @@ declare module "trace_events" {
|
||||
* Creates and returns a `Tracing` object for the given set of `categories`.
|
||||
*
|
||||
* ```js
|
||||
* const trace_events = require('node:trace_events');
|
||||
* import trace_events from 'node:trace_events';
|
||||
* const categories = ['node.perf', 'node.async_hooks'];
|
||||
* const tracing = trace_events.createTracing({ categories });
|
||||
* tracing.enable();
|
||||
@@ -178,7 +178,7 @@ declare module "trace_events" {
|
||||
* Given the file `test.js` below, the command `node --trace-event-categories node.perf test.js` will print `'node.async_hooks,node.perf'` to the console.
|
||||
*
|
||||
* ```js
|
||||
* const trace_events = require('node:trace_events');
|
||||
* import trace_events from 'node:trace_events';
|
||||
* const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });
|
||||
* const t2 = trace_events.createTracing({ categories: ['node.perf'] });
|
||||
* const t3 = trace_events.createTracing({ categories: ['v8'] });
|
||||
|
||||
4
backend/node_modules/@types/node/tty.d.ts
generated
vendored
4
backend/node_modules/@types/node/tty.d.ts
generated
vendored
@@ -3,7 +3,7 @@
|
||||
* directly. However, it can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const tty = require('node:tty');
|
||||
* import tty from 'node:tty';
|
||||
* ```
|
||||
*
|
||||
* When Node.js detects that it is being run with a text terminal ("TTY")
|
||||
@@ -21,7 +21,7 @@
|
||||
*
|
||||
* In most cases, there should be little to no reason for an application to
|
||||
* manually create instances of the `tty.ReadStream` and `tty.WriteStream` classes.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/tty.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/tty.js)
|
||||
*/
|
||||
declare module "tty" {
|
||||
import * as net from "node:net";
|
||||
|
||||
183
backend/node_modules/@types/node/url.d.ts
generated
vendored
183
backend/node_modules/@types/node/url.d.ts
generated
vendored
@@ -5,10 +5,10 @@
|
||||
* ```js
|
||||
* import url from 'node:url';
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/url.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/url.js)
|
||||
*/
|
||||
declare module "url" {
|
||||
import { Blob as NodeBlob } from "node:buffer";
|
||||
import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer";
|
||||
import { ClientRequestArgs } from "node:http";
|
||||
import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring";
|
||||
// Input to `url.format`
|
||||
@@ -50,10 +50,18 @@ declare module "url" {
|
||||
/**
|
||||
* `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default.
|
||||
* @default undefined
|
||||
* @since v22.1.0
|
||||
*/
|
||||
windows?: boolean | undefined;
|
||||
}
|
||||
interface PathToFileUrlOptions {
|
||||
/**
|
||||
* `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default.
|
||||
* @default undefined
|
||||
* @since v22.1.0
|
||||
*/
|
||||
windows?: boolean | undefined;
|
||||
}
|
||||
interface PathToFileUrlOptions extends FileUrlToPathOptions {}
|
||||
/**
|
||||
* The `url.parse()` method takes a URL string, parses it, and returns a URL
|
||||
* object.
|
||||
@@ -63,20 +71,44 @@ declare module "url" {
|
||||
* A `URIError` is thrown if the `auth` property is present but cannot be decoded.
|
||||
*
|
||||
* `url.parse()` uses a lenient, non-standard algorithm for parsing URL
|
||||
* strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) and incorrect handling of usernames and passwords. Do not use with untrusted
|
||||
* input. CVEs are not issued for `url.parse()` vulnerabilities. Use the `WHATWG URL` API instead.
|
||||
* strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487)
|
||||
* and incorrect handling of usernames and passwords. Do not use with untrusted
|
||||
* input. CVEs are not issued for `url.parse()` vulnerabilities. Use the
|
||||
* [WHATWG URL](https://nodejs.org/docs/latest-v24.x/api/url.html#the-whatwg-url-api) API instead, for example:
|
||||
*
|
||||
* ```js
|
||||
* function getURL(req) {
|
||||
* const proto = req.headers['x-forwarded-proto'] || 'https';
|
||||
* const host = req.headers['x-forwarded-host'] || req.headers.host || 'example.com';
|
||||
* return new URL(req.url || '/', `${proto}://${host}`);
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* The example above assumes well-formed headers are forwarded from a reverse
|
||||
* proxy to your Node.js server. If you are not using a reverse proxy, you should
|
||||
* use the example below:
|
||||
*
|
||||
* ```js
|
||||
* function getURL(req) {
|
||||
* return new URL(req.url || '/', 'https://example.com');
|
||||
* }
|
||||
* ```
|
||||
* @since v0.1.25
|
||||
* @deprecated Use the WHATWG URL API instead.
|
||||
* @param urlString The URL string to parse.
|
||||
* @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property
|
||||
* on the returned URL object will be an unparsed, undecoded string.
|
||||
* @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the
|
||||
* result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
|
||||
* @param parseQueryString If `true`, the `query` property will always
|
||||
* be set to an object returned by the [`querystring`](https://nodejs.org/docs/latest-v24.x/api/querystring.html) module's `parse()`
|
||||
* method. If `false`, the `query` property on the returned URL object will be an
|
||||
* unparsed, undecoded string. **Default:** `false`.
|
||||
* @param slashesDenoteHost If `true`, the first token after the literal
|
||||
* string `//` and preceding the next `/` will be interpreted as the `host`.
|
||||
* For instance, given `//foo/bar`, the result would be
|
||||
* `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
|
||||
* **Default:** `false`.
|
||||
*/
|
||||
function parse(urlString: string): UrlWithStringQuery;
|
||||
function parse(
|
||||
urlString: string,
|
||||
parseQueryString: false | undefined,
|
||||
parseQueryString?: false,
|
||||
slashesDenoteHost?: boolean,
|
||||
): UrlWithStringQuery;
|
||||
function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
|
||||
@@ -85,7 +117,7 @@ declare module "url" {
|
||||
* The `url.format()` method returns a formatted URL string derived from `urlObject`.
|
||||
*
|
||||
* ```js
|
||||
* const url = require('node:url');
|
||||
* import url from 'node:url';
|
||||
* url.format({
|
||||
* protocol: 'https',
|
||||
* hostname: 'example.com',
|
||||
@@ -149,7 +181,7 @@ declare module "url" {
|
||||
* The `url.format()` method returns a formatted URL string derived from `urlObject`.
|
||||
*
|
||||
* ```js
|
||||
* const url = require('node:url');
|
||||
* import url from 'node:url';
|
||||
* url.format({
|
||||
* protocol: 'https',
|
||||
* hostname: 'example.com',
|
||||
@@ -214,7 +246,7 @@ declare module "url" {
|
||||
* manner similar to that of a web browser resolving an anchor tag.
|
||||
*
|
||||
* ```js
|
||||
* const url = require('node:url');
|
||||
* import url from 'node:url';
|
||||
* url.resolve('/one/two/three', 'four'); // '/one/two/four'
|
||||
* url.resolve('http://example.com/', '/one'); // 'http://example.com/one'
|
||||
* url.resolve('http://example.com/one', '/two'); // 'http://example.com/two'
|
||||
@@ -307,6 +339,17 @@ declare module "url" {
|
||||
* @return The fully-resolved platform-specific Node.js file path.
|
||||
*/
|
||||
function fileURLToPath(url: string | URL, options?: FileUrlToPathOptions): string;
|
||||
/**
|
||||
* Like `url.fileURLToPath(...)` except that instead of returning a string
|
||||
* representation of the path, a `Buffer` is returned. This conversion is
|
||||
* helpful when the input URL contains percent-encoded segments that are
|
||||
* not valid UTF-8 / Unicode sequences.
|
||||
* @since v24.3.0
|
||||
* @param url The file URL string or URL object to convert to a path.
|
||||
* @returns The fully-resolved platform-specific Node.js file path
|
||||
* as a `Buffer`.
|
||||
*/
|
||||
function fileURLToPathBuffer(url: string | URL, options?: FileUrlToPathOptions): NonSharedBuffer;
|
||||
/**
|
||||
* This function ensures that `path` is resolved absolutely, and that the URL
|
||||
* control characters are correctly encoded when converting into a File URL.
|
||||
@@ -392,10 +435,10 @@ declare module "url" {
|
||||
* Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later.
|
||||
*
|
||||
* ```js
|
||||
* const {
|
||||
* import {
|
||||
* Blob,
|
||||
* resolveObjectURL,
|
||||
* } = require('node:buffer');
|
||||
* } from 'node:buffer';
|
||||
*
|
||||
* const blob = new Blob(['hello']);
|
||||
* const id = URL.createObjectURL(blob);
|
||||
@@ -412,14 +455,12 @@ declare module "url" {
|
||||
* Threads, `Blob` objects registered within one Worker will not be available
|
||||
* to other workers or the main thread.
|
||||
* @since v16.7.0
|
||||
* @experimental
|
||||
*/
|
||||
static createObjectURL(blob: NodeBlob): string;
|
||||
/**
|
||||
* Removes the stored `Blob` identified by the given ID. Attempting to revoke a
|
||||
* ID that isn't registered will silently fail.
|
||||
* @since v16.7.0
|
||||
* @experimental
|
||||
* @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
|
||||
*/
|
||||
static revokeObjectURL(id: string): void;
|
||||
@@ -437,6 +478,18 @@ declare module "url" {
|
||||
* @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first.
|
||||
*/
|
||||
static canParse(input: string, base?: string): boolean;
|
||||
/**
|
||||
* Parses a string as a URL. If `base` is provided, it will be used as the base
|
||||
* URL for the purpose of resolving non-absolute `input` URLs. Returns `null`
|
||||
* if the parameters can't be resolved to a valid URL.
|
||||
* @since v22.1.0
|
||||
* @param input The absolute or relative input URL to parse. If `input`
|
||||
* is relative, then `base` is required. If `input` is absolute, the `base`
|
||||
* is ignored. If `input` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
|
||||
* @param base The base URL to resolve against if the `input` is not
|
||||
* absolute. If `base` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
|
||||
*/
|
||||
static parse(input: string, base?: string): URL | null;
|
||||
constructor(input: string | { toString: () => string }, base?: string | URL);
|
||||
/**
|
||||
* Gets and sets the fragment portion of the URL.
|
||||
@@ -740,6 +793,57 @@ declare module "url" {
|
||||
*/
|
||||
toJSON(): string;
|
||||
}
|
||||
interface URLPatternComponentResult {
|
||||
input: string;
|
||||
groups: Record<string, string | undefined>;
|
||||
}
|
||||
interface URLPatternInit {
|
||||
protocol?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
hostname?: string;
|
||||
port?: string;
|
||||
pathname?: string;
|
||||
search?: string;
|
||||
hash?: string;
|
||||
baseURL?: string;
|
||||
}
|
||||
interface URLPatternOptions {
|
||||
ignoreCase?: boolean;
|
||||
}
|
||||
interface URLPatternResult {
|
||||
inputs: (string | URLPatternInit)[];
|
||||
protocol: URLPatternComponentResult;
|
||||
username: URLPatternComponentResult;
|
||||
password: URLPatternComponentResult;
|
||||
hostname: URLPatternComponentResult;
|
||||
port: URLPatternComponentResult;
|
||||
pathname: URLPatternComponentResult;
|
||||
search: URLPatternComponentResult;
|
||||
hash: URLPatternComponentResult;
|
||||
}
|
||||
/**
|
||||
* @since v23.8.0
|
||||
* @experimental
|
||||
*/
|
||||
class URLPattern {
|
||||
constructor(input: string | URLPatternInit, baseURL: string, options?: URLPatternOptions);
|
||||
constructor(input?: string | URLPatternInit, options?: URLPatternOptions);
|
||||
exec(input?: string | URLPatternInit, baseURL?: string): URLPatternResult | null;
|
||||
readonly hasRegExpGroups: boolean;
|
||||
readonly hash: string;
|
||||
readonly hostname: string;
|
||||
readonly password: string;
|
||||
readonly pathname: string;
|
||||
readonly port: string;
|
||||
readonly protocol: string;
|
||||
readonly search: string;
|
||||
test(input?: string | URLPatternInit, baseURL?: string): boolean;
|
||||
readonly username: string;
|
||||
}
|
||||
interface URLSearchParamsIterator<T> extends NodeJS.Iterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): URLSearchParamsIterator<T>;
|
||||
}
|
||||
/**
|
||||
* The `URLSearchParams` API provides read and write access to the query of a `URL`. The `URLSearchParams` class can also be used standalone with one of the
|
||||
* four following constructors.
|
||||
@@ -808,9 +912,9 @@ declare module "url" {
|
||||
* Returns an ES6 `Iterator` over each of the name-value pairs in the query.
|
||||
* 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`.
|
||||
*
|
||||
* Alias for `urlSearchParams[@@iterator]()`.
|
||||
* Alias for `urlSearchParams[Symbol.iterator]()`.
|
||||
*/
|
||||
entries(): IterableIterator<[string, string]>;
|
||||
entries(): URLSearchParamsIterator<[string, string]>;
|
||||
/**
|
||||
* Iterates over each name-value pair in the query and invokes the given function.
|
||||
*
|
||||
@@ -864,7 +968,7 @@ declare module "url" {
|
||||
* // foo
|
||||
* ```
|
||||
*/
|
||||
keys(): IterableIterator<string>;
|
||||
keys(): URLSearchParamsIterator<string>;
|
||||
/**
|
||||
* Sets the value in the `URLSearchParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`,
|
||||
* set the first such pair's value to `value` and remove all others. If not,
|
||||
@@ -914,37 +1018,38 @@ declare module "url" {
|
||||
/**
|
||||
* Returns an ES6 `Iterator` over the values of each name-value pair.
|
||||
*/
|
||||
values(): IterableIterator<string>;
|
||||
[Symbol.iterator](): IterableIterator<[string, string]>;
|
||||
values(): URLSearchParamsIterator<string>;
|
||||
[Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
|
||||
}
|
||||
import { URL as _URL, URLSearchParams as _URLSearchParams } from "url";
|
||||
import {
|
||||
URL as _URL,
|
||||
URLPattern as _URLPattern,
|
||||
URLPatternInit as _URLPatternInit,
|
||||
URLPatternResult as _URLPatternResult,
|
||||
URLSearchParams as _URLSearchParams,
|
||||
} from "url";
|
||||
global {
|
||||
interface URLSearchParams extends _URLSearchParams {}
|
||||
interface URL extends _URL {}
|
||||
interface Global {
|
||||
URL: typeof _URL;
|
||||
URLSearchParams: typeof _URLSearchParams;
|
||||
}
|
||||
/**
|
||||
* `URL` class is a global reference for `require('url').URL`
|
||||
* https://nodejs.org/api/url.html#the-whatwg-url-api
|
||||
* @since v10.0.0
|
||||
*/
|
||||
var URL: typeof globalThis extends {
|
||||
onmessage: any;
|
||||
URL: infer T;
|
||||
} ? T
|
||||
: typeof _URL;
|
||||
/**
|
||||
* `URLSearchParams` class is a global reference for `require('url').URLSearchParams`
|
||||
* https://nodejs.org/api/url.html#class-urlsearchparams
|
||||
* @since v10.0.0
|
||||
*/
|
||||
interface URLSearchParams extends _URLSearchParams {}
|
||||
var URLSearchParams: typeof globalThis extends {
|
||||
onmessage: any;
|
||||
URLSearchParams: infer T;
|
||||
} ? T
|
||||
: typeof _URLSearchParams;
|
||||
interface URLPatternInit extends _URLPatternInit {}
|
||||
interface URLPatternResult extends _URLPatternResult {}
|
||||
interface URLPattern extends _URLPattern {}
|
||||
var URLPattern: typeof globalThis extends {
|
||||
onmessage: any;
|
||||
scheduler: any; // Must be a var introduced at the same time as URLPattern.
|
||||
URLPattern: infer T;
|
||||
} ? T
|
||||
: typeof _URLPattern;
|
||||
}
|
||||
}
|
||||
declare module "node:url" {
|
||||
|
||||
861
backend/node_modules/@types/node/util.d.ts
generated
vendored
861
backend/node_modules/@types/node/util.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
244
backend/node_modules/@types/node/v8.d.ts
generated
vendored
244
backend/node_modules/@types/node/v8.d.ts
generated
vendored
@@ -2,11 +2,12 @@
|
||||
* The `node:v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* const v8 = require('node:v8');
|
||||
* import v8 from 'node:v8';
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/v8.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/v8.js)
|
||||
*/
|
||||
declare module "v8" {
|
||||
import { NonSharedBuffer } from "node:buffer";
|
||||
import { Readable } from "node:stream";
|
||||
interface HeapSpaceInfo {
|
||||
space_name: string;
|
||||
@@ -43,12 +44,12 @@ declare module "v8" {
|
||||
* If true, expose internals in the heap snapshot.
|
||||
* @default false
|
||||
*/
|
||||
exposeInternals?: boolean;
|
||||
exposeInternals?: boolean | undefined;
|
||||
/**
|
||||
* If true, expose numeric values in artificial fields.
|
||||
* @default false
|
||||
*/
|
||||
exposeNumericValues?: boolean;
|
||||
exposeNumericValues?: boolean | undefined;
|
||||
}
|
||||
/**
|
||||
* Returns an integer representing a version tag derived from the V8 version,
|
||||
@@ -113,6 +114,87 @@ declare module "v8" {
|
||||
* @since v1.0.0
|
||||
*/
|
||||
function getHeapStatistics(): HeapInfo;
|
||||
/**
|
||||
* It returns an object with a structure similar to the
|
||||
* [`cppgc::HeapStatistics`](https://v8docs.nodesource.com/node-22.4/d7/d51/heap-statistics_8h_source.html)
|
||||
* object. See the [V8 documentation](https://v8docs.nodesource.com/node-22.4/df/d2f/structcppgc_1_1_heap_statistics.html)
|
||||
* for more information about the properties of the object.
|
||||
*
|
||||
* ```js
|
||||
* // Detailed
|
||||
* ({
|
||||
* committed_size_bytes: 131072,
|
||||
* resident_size_bytes: 131072,
|
||||
* used_size_bytes: 152,
|
||||
* space_statistics: [
|
||||
* {
|
||||
* name: 'NormalPageSpace0',
|
||||
* committed_size_bytes: 0,
|
||||
* resident_size_bytes: 0,
|
||||
* used_size_bytes: 0,
|
||||
* page_stats: [{}],
|
||||
* free_list_stats: {},
|
||||
* },
|
||||
* {
|
||||
* name: 'NormalPageSpace1',
|
||||
* committed_size_bytes: 131072,
|
||||
* resident_size_bytes: 131072,
|
||||
* used_size_bytes: 152,
|
||||
* page_stats: [{}],
|
||||
* free_list_stats: {},
|
||||
* },
|
||||
* {
|
||||
* name: 'NormalPageSpace2',
|
||||
* committed_size_bytes: 0,
|
||||
* resident_size_bytes: 0,
|
||||
* used_size_bytes: 0,
|
||||
* page_stats: [{}],
|
||||
* free_list_stats: {},
|
||||
* },
|
||||
* {
|
||||
* name: 'NormalPageSpace3',
|
||||
* committed_size_bytes: 0,
|
||||
* resident_size_bytes: 0,
|
||||
* used_size_bytes: 0,
|
||||
* page_stats: [{}],
|
||||
* free_list_stats: {},
|
||||
* },
|
||||
* {
|
||||
* name: 'LargePageSpace',
|
||||
* committed_size_bytes: 0,
|
||||
* resident_size_bytes: 0,
|
||||
* used_size_bytes: 0,
|
||||
* page_stats: [{}],
|
||||
* free_list_stats: {},
|
||||
* },
|
||||
* ],
|
||||
* type_names: [],
|
||||
* detail_level: 'detailed',
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* ```js
|
||||
* // Brief
|
||||
* ({
|
||||
* committed_size_bytes: 131072,
|
||||
* resident_size_bytes: 131072,
|
||||
* used_size_bytes: 128864,
|
||||
* space_statistics: [],
|
||||
* type_names: [],
|
||||
* detail_level: 'brief',
|
||||
* });
|
||||
* ```
|
||||
* @since v22.15.0
|
||||
* @param detailLevel **Default:** `'detailed'`. Specifies the level of detail in the returned statistics.
|
||||
* Accepted values are:
|
||||
* * `'brief'`: Brief statistics contain only the top-level
|
||||
* allocated and used
|
||||
* memory statistics for the entire heap.
|
||||
* * `'detailed'`: Detailed statistics also contain a break
|
||||
* down per space and page, as well as freelist statistics
|
||||
* and object type histograms.
|
||||
*/
|
||||
function getCppHeapStatistics(detailLevel?: "brief" | "detailed"): object;
|
||||
/**
|
||||
* Returns statistics about the V8 heap spaces, i.e. the segments which make up
|
||||
* the V8 heap. Neither the ordering of heap spaces, nor the availability of a
|
||||
@@ -176,7 +258,7 @@ declare module "v8" {
|
||||
*
|
||||
* ```js
|
||||
* // Print GC events to stdout for one minute.
|
||||
* const v8 = require('node:v8');
|
||||
* import v8 from 'node:v8';
|
||||
* v8.setFlagsFromString('--trace_gc');
|
||||
* setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3);
|
||||
* ```
|
||||
@@ -243,7 +325,7 @@ declare module "v8" {
|
||||
*
|
||||
* ```js
|
||||
* // Print heap snapshot to the console
|
||||
* const v8 = require('node:v8');
|
||||
* import v8 from 'node:v8';
|
||||
* const stream = v8.getHeapSnapshot();
|
||||
* stream.pipe(process.stdout);
|
||||
* ```
|
||||
@@ -268,12 +350,12 @@ declare module "v8" {
|
||||
* for a duration depending on the heap size.
|
||||
*
|
||||
* ```js
|
||||
* const { writeHeapSnapshot } = require('node:v8');
|
||||
* const {
|
||||
* import { writeHeapSnapshot } from 'node:v8';
|
||||
* import {
|
||||
* Worker,
|
||||
* isMainThread,
|
||||
* parentPort,
|
||||
* } = require('node:worker_threads');
|
||||
* } from 'node:worker_threads';
|
||||
*
|
||||
* if (isMainThread) {
|
||||
* const worker = new Worker(__filename);
|
||||
@@ -319,6 +401,71 @@ declare module "v8" {
|
||||
* @since v12.8.0
|
||||
*/
|
||||
function getHeapCodeStatistics(): HeapCodeStatistics;
|
||||
/**
|
||||
* @since v24.8.0
|
||||
*/
|
||||
interface CPUProfileHandle {
|
||||
/**
|
||||
* Stopping collecting the profile, then return a Promise that fulfills with an error or the
|
||||
* profile data.
|
||||
* @since v24.8.0
|
||||
*/
|
||||
stop(): Promise<string>;
|
||||
/**
|
||||
* Stopping collecting the profile and the profile will be discarded.
|
||||
* @since v24.8.0
|
||||
*/
|
||||
[Symbol.asyncDispose](): Promise<void>;
|
||||
}
|
||||
/**
|
||||
* @since v24.9.0
|
||||
*/
|
||||
interface HeapProfileHandle {
|
||||
/**
|
||||
* Stopping collecting the profile, then return a Promise that fulfills with an error or the
|
||||
* profile data.
|
||||
* @since v24.9.0
|
||||
*/
|
||||
stop(): Promise<string>;
|
||||
/**
|
||||
* Stopping collecting the profile and the profile will be discarded.
|
||||
* @since v24.9.0
|
||||
*/
|
||||
[Symbol.asyncDispose](): Promise<void>;
|
||||
}
|
||||
/**
|
||||
* V8 only supports `Latin-1/ISO-8859-1` and `UTF16` as the underlying representation of a string.
|
||||
* If the `content` uses `Latin-1/ISO-8859-1` as the underlying representation, this function will return true;
|
||||
* otherwise, it returns false.
|
||||
*
|
||||
* If this method returns false, that does not mean that the string contains some characters not in `Latin-1/ISO-8859-1`.
|
||||
* Sometimes a `Latin-1` string may also be represented as `UTF16`.
|
||||
*
|
||||
* ```js
|
||||
* const { isStringOneByteRepresentation } = require('node:v8');
|
||||
*
|
||||
* const Encoding = {
|
||||
* latin1: 1,
|
||||
* utf16le: 2,
|
||||
* };
|
||||
* const buffer = Buffer.alloc(100);
|
||||
* function writeString(input) {
|
||||
* if (isStringOneByteRepresentation(input)) {
|
||||
* buffer.writeUint8(Encoding.latin1);
|
||||
* buffer.writeUint32LE(input.length, 1);
|
||||
* buffer.write(input, 5, 'latin1');
|
||||
* } else {
|
||||
* buffer.writeUint8(Encoding.utf16le);
|
||||
* buffer.writeUint32LE(input.length * 2, 1);
|
||||
* buffer.write(input, 5, 'utf16le');
|
||||
* }
|
||||
* }
|
||||
* writeString('hello');
|
||||
* writeString('你好');
|
||||
* ```
|
||||
* @since v23.10.0, v22.15.0
|
||||
*/
|
||||
function isStringOneByteRepresentation(content: string): boolean;
|
||||
/**
|
||||
* @since v8.0.0
|
||||
*/
|
||||
@@ -339,7 +486,7 @@ declare module "v8" {
|
||||
* the buffer is released. Calling this method results in undefined behavior
|
||||
* if a previous write has failed.
|
||||
*/
|
||||
releaseBuffer(): Buffer;
|
||||
releaseBuffer(): NonSharedBuffer;
|
||||
/**
|
||||
* Marks an `ArrayBuffer` as having its contents transferred out of band.
|
||||
* Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`.
|
||||
@@ -367,7 +514,7 @@ declare module "v8" {
|
||||
* will require a way to compute the length of the buffer.
|
||||
* For use inside of a custom `serializer._writeHostObject()`.
|
||||
*/
|
||||
writeRawBytes(buffer: NodeJS.TypedArray): void;
|
||||
writeRawBytes(buffer: NodeJS.ArrayBufferView): void;
|
||||
}
|
||||
/**
|
||||
* A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only
|
||||
@@ -438,14 +585,14 @@ declare module "v8" {
|
||||
* larger than `buffer.constants.MAX_LENGTH`.
|
||||
* @since v8.0.0
|
||||
*/
|
||||
function serialize(value: any): Buffer;
|
||||
function serialize(value: any): NonSharedBuffer;
|
||||
/**
|
||||
* Uses a `DefaultDeserializer` with default options to read a JS value
|
||||
* from a buffer.
|
||||
* @since v8.0.0
|
||||
* @param buffer A buffer returned by {@link serialize}.
|
||||
*/
|
||||
function deserialize(buffer: NodeJS.TypedArray): any;
|
||||
function deserialize(buffer: NodeJS.ArrayBufferView): any;
|
||||
/**
|
||||
* The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple
|
||||
* times during the lifetime of the process. Each time the execution counter will
|
||||
@@ -466,8 +613,7 @@ declare module "v8" {
|
||||
function stopCoverage(): void;
|
||||
/**
|
||||
* The API is a no-op if `--heapsnapshot-near-heap-limit` is already set from the command line or the API is called more than once.
|
||||
* `limit` must be a positive integer. See [`--heapsnapshot-near-heap-limit`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information.
|
||||
* @experimental
|
||||
* `limit` must be a positive integer. See [`--heapsnapshot-near-heap-limit`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information.
|
||||
* @since v18.10.0, v16.18.0
|
||||
*/
|
||||
function setHeapSnapshotNearHeapLimit(limit: number): void;
|
||||
@@ -550,7 +696,7 @@ declare module "v8" {
|
||||
* Here's an example.
|
||||
*
|
||||
* ```js
|
||||
* const { GCProfiler } = require('v8');
|
||||
* import { GCProfiler } from 'node:v8';
|
||||
* const profiler = new GCProfiler();
|
||||
* profiler.start();
|
||||
* setTimeout(() => {
|
||||
@@ -693,33 +839,6 @@ declare module "v8" {
|
||||
*/
|
||||
const promiseHooks: PromiseHooks;
|
||||
type StartupSnapshotCallbackFn = (args: any) => any;
|
||||
interface StartupSnapshot {
|
||||
/**
|
||||
* Add a callback that will be called when the Node.js instance is about to get serialized into a snapshot and exit.
|
||||
* This can be used to release resources that should not or cannot be serialized or to convert user data into a form more suitable for serialization.
|
||||
* @since v18.6.0, v16.17.0
|
||||
*/
|
||||
addSerializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
|
||||
/**
|
||||
* Add a callback that will be called when the Node.js instance is deserialized from a snapshot.
|
||||
* The `callback` and the `data` (if provided) will be serialized into the snapshot, they can be used to re-initialize the state of the application or
|
||||
* to re-acquire resources that the application needs when the application is restarted from the snapshot.
|
||||
* @since v18.6.0, v16.17.0
|
||||
*/
|
||||
addDeserializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
|
||||
/**
|
||||
* This sets the entry point of the Node.js application when it is deserialized from a snapshot. This can be called only once in the snapshot building script.
|
||||
* If called, the deserialized application no longer needs an additional entry point script to start up and will simply invoke the callback along with the deserialized
|
||||
* data (if provided), otherwise an entry point script still needs to be provided to the deserialized application.
|
||||
* @since v18.6.0, v16.17.0
|
||||
*/
|
||||
setDeserializeMainFunction(callback: StartupSnapshotCallbackFn, data?: any): void;
|
||||
/**
|
||||
* Returns true if the Node.js instance is run to build a snapshot.
|
||||
* @since v18.6.0, v16.17.0
|
||||
*/
|
||||
isBuildingSnapshot(): boolean;
|
||||
}
|
||||
/**
|
||||
* The `v8.startupSnapshot` interface can be used to add serialization and deserialization hooks for custom startup snapshots.
|
||||
*
|
||||
@@ -736,12 +855,12 @@ declare module "v8" {
|
||||
* ```js
|
||||
* 'use strict';
|
||||
*
|
||||
* const fs = require('node:fs');
|
||||
* const zlib = require('node:zlib');
|
||||
* const path = require('node:path');
|
||||
* const assert = require('node:assert');
|
||||
* import fs from 'node:fs';
|
||||
* import zlib from 'node:zlib';
|
||||
* import path from 'node:path';
|
||||
* import assert from 'node:assert';
|
||||
*
|
||||
* const v8 = require('node:v8');
|
||||
* import v8 from 'node:v8';
|
||||
*
|
||||
* class BookShelf {
|
||||
* storage = new Map();
|
||||
@@ -798,10 +917,35 @@ declare module "v8" {
|
||||
*
|
||||
* Currently the application deserialized from a user-land snapshot cannot be snapshotted again, so these APIs are only available to applications that are not deserialized from a user-land snapshot.
|
||||
*
|
||||
* @experimental
|
||||
* @since v18.6.0, v16.17.0
|
||||
*/
|
||||
const startupSnapshot: StartupSnapshot;
|
||||
namespace startupSnapshot {
|
||||
/**
|
||||
* Add a callback that will be called when the Node.js instance is about to get serialized into a snapshot and exit.
|
||||
* This can be used to release resources that should not or cannot be serialized or to convert user data into a form more suitable for serialization.
|
||||
* @since v18.6.0, v16.17.0
|
||||
*/
|
||||
function addSerializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
|
||||
/**
|
||||
* Add a callback that will be called when the Node.js instance is deserialized from a snapshot.
|
||||
* The `callback` and the `data` (if provided) will be serialized into the snapshot, they can be used to re-initialize the state of the application or
|
||||
* to re-acquire resources that the application needs when the application is restarted from the snapshot.
|
||||
* @since v18.6.0, v16.17.0
|
||||
*/
|
||||
function addDeserializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
|
||||
/**
|
||||
* This sets the entry point of the Node.js application when it is deserialized from a snapshot. This can be called only once in the snapshot building script.
|
||||
* If called, the deserialized application no longer needs an additional entry point script to start up and will simply invoke the callback along with the deserialized
|
||||
* data (if provided), otherwise an entry point script still needs to be provided to the deserialized application.
|
||||
* @since v18.6.0, v16.17.0
|
||||
*/
|
||||
function setDeserializeMainFunction(callback: StartupSnapshotCallbackFn, data?: any): void;
|
||||
/**
|
||||
* Returns true if the Node.js instance is run to build a snapshot.
|
||||
* @since v18.6.0, v16.17.0
|
||||
*/
|
||||
function isBuildingSnapshot(): boolean;
|
||||
}
|
||||
}
|
||||
declare module "node:v8" {
|
||||
export * from "v8";
|
||||
|
||||
518
backend/node_modules/@types/node/vm.d.ts
generated
vendored
518
backend/node_modules/@types/node/vm.d.ts
generated
vendored
@@ -17,7 +17,7 @@
|
||||
* code are reflected in the context object.
|
||||
*
|
||||
* ```js
|
||||
* const vm = require('node:vm');
|
||||
* import vm from 'node:vm';
|
||||
*
|
||||
* const x = 1;
|
||||
*
|
||||
@@ -34,10 +34,11 @@
|
||||
*
|
||||
* console.log(x); // 1; y is not defined.
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/vm.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/vm.js)
|
||||
*/
|
||||
declare module "vm" {
|
||||
import { ImportAttributes } from "node:module";
|
||||
import { NonSharedBuffer } from "node:buffer";
|
||||
import { ImportAttributes, ImportPhase } from "node:module";
|
||||
interface Context extends NodeJS.Dict<any> {}
|
||||
interface BaseOptions {
|
||||
/**
|
||||
@@ -56,20 +57,27 @@ declare module "vm" {
|
||||
*/
|
||||
columnOffset?: number | undefined;
|
||||
}
|
||||
type DynamicModuleLoader<T> = (
|
||||
specifier: string,
|
||||
referrer: T,
|
||||
importAttributes: ImportAttributes,
|
||||
phase: ImportPhase,
|
||||
) => Module | Promise<Module>;
|
||||
interface ScriptOptions extends BaseOptions {
|
||||
/**
|
||||
* V8's code cache data for the supplied source.
|
||||
* Provides an optional data with V8's code cache data for the supplied source.
|
||||
*/
|
||||
cachedData?: Buffer | NodeJS.ArrayBufferView | undefined;
|
||||
cachedData?: NodeJS.ArrayBufferView | undefined;
|
||||
/** @deprecated in favor of `script.createCachedData()` */
|
||||
produceCachedData?: boolean | undefined;
|
||||
/**
|
||||
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
||||
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
||||
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v20.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
||||
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
||||
* @experimental
|
||||
*/
|
||||
importModuleDynamically?:
|
||||
| ((specifier: string, script: Script, importAttributes: ImportAttributes) => Module)
|
||||
| DynamicModuleLoader<Script>
|
||||
| typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
|
||||
| undefined;
|
||||
}
|
||||
@@ -92,41 +100,48 @@ declare module "vm" {
|
||||
*/
|
||||
breakOnSigint?: boolean | undefined;
|
||||
}
|
||||
interface RunningScriptInNewContextOptions extends RunningScriptOptions {
|
||||
interface RunningScriptInNewContextOptions
|
||||
extends RunningScriptOptions, Pick<CreateContextOptions, "microtaskMode">
|
||||
{
|
||||
/**
|
||||
* Human-readable name of the newly created context.
|
||||
*/
|
||||
contextName?: CreateContextOptions["name"];
|
||||
contextName?: CreateContextOptions["name"] | undefined;
|
||||
/**
|
||||
* Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL,
|
||||
* but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object.
|
||||
* Most notably, this string should omit the trailing slash, as that denotes a path.
|
||||
*/
|
||||
contextOrigin?: CreateContextOptions["origin"];
|
||||
contextCodeGeneration?: CreateContextOptions["codeGeneration"];
|
||||
/**
|
||||
* If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
|
||||
*/
|
||||
microtaskMode?: CreateContextOptions["microtaskMode"];
|
||||
contextOrigin?: CreateContextOptions["origin"] | undefined;
|
||||
contextCodeGeneration?: CreateContextOptions["codeGeneration"] | undefined;
|
||||
}
|
||||
interface RunningCodeOptions extends RunningScriptOptions {
|
||||
cachedData?: ScriptOptions["cachedData"];
|
||||
importModuleDynamically?: ScriptOptions["importModuleDynamically"];
|
||||
}
|
||||
interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions {
|
||||
cachedData?: ScriptOptions["cachedData"];
|
||||
importModuleDynamically?: ScriptOptions["importModuleDynamically"];
|
||||
}
|
||||
interface CompileFunctionOptions extends BaseOptions {
|
||||
interface RunningCodeOptions extends RunningScriptOptions, Pick<ScriptOptions, "cachedData"> {
|
||||
/**
|
||||
* Provides an optional data with V8's code cache data for the supplied source.
|
||||
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
||||
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
||||
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
||||
* @experimental
|
||||
*/
|
||||
cachedData?: Buffer | undefined;
|
||||
importModuleDynamically?:
|
||||
| DynamicModuleLoader<Script>
|
||||
| typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
|
||||
| undefined;
|
||||
}
|
||||
interface RunningCodeInNewContextOptions
|
||||
extends RunningScriptInNewContextOptions, Pick<ScriptOptions, "cachedData">
|
||||
{
|
||||
/**
|
||||
* Specifies whether to produce new cache data.
|
||||
* @default false
|
||||
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
||||
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
||||
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
||||
* @experimental
|
||||
*/
|
||||
produceCachedData?: boolean | undefined;
|
||||
importModuleDynamically?:
|
||||
| DynamicModuleLoader<Script>
|
||||
| typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
|
||||
| undefined;
|
||||
}
|
||||
interface CompileFunctionOptions extends BaseOptions, Pick<ScriptOptions, "cachedData" | "produceCachedData"> {
|
||||
/**
|
||||
* The sandbox/context in which the said function should be compiled in.
|
||||
*/
|
||||
@@ -135,6 +150,16 @@ declare module "vm" {
|
||||
* An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling
|
||||
*/
|
||||
contextExtensions?: Object[] | undefined;
|
||||
/**
|
||||
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
||||
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
||||
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
||||
* @experimental
|
||||
*/
|
||||
importModuleDynamically?:
|
||||
| DynamicModuleLoader<ReturnType<typeof compileFunction>>
|
||||
| typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
|
||||
| undefined;
|
||||
}
|
||||
interface CreateContextOptions {
|
||||
/**
|
||||
@@ -169,6 +194,16 @@ declare module "vm" {
|
||||
* If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
|
||||
*/
|
||||
microtaskMode?: "afterEvaluate" | undefined;
|
||||
/**
|
||||
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
||||
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
||||
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
||||
* @experimental
|
||||
*/
|
||||
importModuleDynamically?:
|
||||
| DynamicModuleLoader<Context>
|
||||
| typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
|
||||
| undefined;
|
||||
}
|
||||
type MeasureMemoryMode = "summary" | "detailed";
|
||||
interface MeasureMemoryOptions {
|
||||
@@ -203,7 +238,7 @@ declare module "vm" {
|
||||
* The globals are contained in the `context` object.
|
||||
*
|
||||
* ```js
|
||||
* const vm = require('node:vm');
|
||||
* import vm from 'node:vm';
|
||||
*
|
||||
* const context = {
|
||||
* animal: 'cat',
|
||||
@@ -230,9 +265,16 @@ declare module "vm" {
|
||||
*/
|
||||
runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any;
|
||||
/**
|
||||
* First contextifies the given `contextObject`, runs the compiled code contained
|
||||
* by the `vm.Script` object within the created context, and returns the result.
|
||||
* Running code does not have access to local scope.
|
||||
* This method is a shortcut to `script.runInContext(vm.createContext(options), options)`.
|
||||
* It does several things at once:
|
||||
*
|
||||
* 1. Creates a new context.
|
||||
* 2. If `contextObject` is an object, contextifies it with the new context.
|
||||
* If `contextObject` is undefined, creates a new object and contextifies it.
|
||||
* If `contextObject` is `vm.constants.DONT_CONTEXTIFY`, don't contextify anything.
|
||||
* 3. Runs the compiled code contained by the `vm.Script` object within the created context. The code
|
||||
* does not have access to the scope in which this method is called.
|
||||
* 4. Returns the result.
|
||||
*
|
||||
* The following example compiles code that sets a global variable, then executes
|
||||
* the code multiple times in different contexts. The globals are set on and
|
||||
@@ -250,12 +292,22 @@ declare module "vm" {
|
||||
*
|
||||
* console.log(contexts);
|
||||
* // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }]
|
||||
*
|
||||
* // This would throw if the context is created from a contextified object.
|
||||
* // vm.constants.DONT_CONTEXTIFY allows creating contexts with ordinary
|
||||
* // global objects that can be frozen.
|
||||
* const freezeScript = new vm.Script('Object.freeze(globalThis); globalThis;');
|
||||
* const frozenContext = freezeScript.runInNewContext(vm.constants.DONT_CONTEXTIFY);
|
||||
* ```
|
||||
* @since v0.3.1
|
||||
* @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
|
||||
* @param contextObject Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified.
|
||||
* If `undefined`, an empty contextified object will be created for backwards compatibility.
|
||||
* @return the result of the very last statement executed in the script.
|
||||
*/
|
||||
runInNewContext(contextObject?: Context, options?: RunningScriptInNewContextOptions): any;
|
||||
runInNewContext(
|
||||
contextObject?: Context | typeof constants.DONT_CONTEXTIFY,
|
||||
options?: RunningScriptInNewContextOptions,
|
||||
): any;
|
||||
/**
|
||||
* Runs the compiled code contained by the `vm.Script` within the context of the
|
||||
* current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object.
|
||||
@@ -264,7 +316,7 @@ declare module "vm" {
|
||||
* executes that code multiple times:
|
||||
*
|
||||
* ```js
|
||||
* const vm = require('node:vm');
|
||||
* import vm from 'node:vm';
|
||||
*
|
||||
* global.globalVar = 0;
|
||||
*
|
||||
@@ -316,17 +368,17 @@ declare module "vm" {
|
||||
* ```
|
||||
* @since v10.6.0
|
||||
*/
|
||||
createCachedData(): Buffer;
|
||||
createCachedData(): NonSharedBuffer;
|
||||
/** @deprecated in favor of `script.createCachedData()` */
|
||||
cachedDataProduced?: boolean | undefined;
|
||||
cachedDataProduced?: boolean;
|
||||
/**
|
||||
* When `cachedData` is supplied to create the `vm.Script`, this value will be set
|
||||
* to either `true` or `false` depending on acceptance of the data by V8.
|
||||
* Otherwise the value is `undefined`.
|
||||
* @since v5.7.0
|
||||
*/
|
||||
cachedDataRejected?: boolean | undefined;
|
||||
cachedData?: Buffer | undefined;
|
||||
cachedDataRejected?: boolean;
|
||||
cachedData?: NonSharedBuffer;
|
||||
/**
|
||||
* When the script is compiled from a source that contains a source map magic
|
||||
* comment, this property will be set to the URL of the source map.
|
||||
@@ -344,16 +396,16 @@ declare module "vm" {
|
||||
* ```
|
||||
* @since v19.1.0, v18.13.0
|
||||
*/
|
||||
sourceMapURL?: string | undefined;
|
||||
sourceMapURL: string | undefined;
|
||||
}
|
||||
/**
|
||||
* If given a `contextObject`, the `vm.createContext()` method will
|
||||
* [prepare that object](https://nodejs.org/docs/latest-v20.x/api/vm.html#what-does-it-mean-to-contextify-an-object)
|
||||
* and return a reference to it so that it can be used in `{@link runInContext}` or
|
||||
* [`script.runInContext()`](https://nodejs.org/docs/latest-v20.x/api/vm.html#scriptrunincontextcontextifiedobject-options). Inside such
|
||||
* scripts, the `contextObject` will be the global object, retaining all of its
|
||||
* existing properties but also having the built-in objects and functions any
|
||||
* standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global
|
||||
* If the given `contextObject` is an object, the `vm.createContext()` method will
|
||||
* [prepare that object](https://nodejs.org/docs/latest-v24.x/api/vm.html#what-does-it-mean-to-contextify-an-object)
|
||||
* and return a reference to it so that it can be used in calls to {@link runInContext} or
|
||||
* [`script.runInContext()`](https://nodejs.org/docs/latest-v24.x/api/vm.html#scriptrunincontextcontextifiedobject-options).
|
||||
* Inside such scripts, the global object will be wrapped by the `contextObject`, retaining all of its
|
||||
* existing properties but also having the built-in objects and functions any standard
|
||||
* [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global
|
||||
* variables will remain unchanged.
|
||||
*
|
||||
* ```js
|
||||
@@ -374,7 +426,12 @@ declare module "vm" {
|
||||
* ```
|
||||
*
|
||||
* If `contextObject` is omitted (or passed explicitly as `undefined`), a new,
|
||||
* empty `contextified` object will be returned.
|
||||
* empty contextified object will be returned.
|
||||
*
|
||||
* When the global object in the newly created context is contextified, it has some quirks
|
||||
* compared to ordinary global objects. For example, it cannot be frozen. To create a context
|
||||
* without the contextifying quirks, pass `vm.constants.DONT_CONTEXTIFY` as the `contextObject`
|
||||
* argument. See the documentation of `vm.constants.DONT_CONTEXTIFY` for details.
|
||||
*
|
||||
* The `vm.createContext()` method is primarily useful for creating a single
|
||||
* context that can be used to run multiple scripts. For instance, if emulating a
|
||||
@@ -385,11 +442,17 @@ declare module "vm" {
|
||||
* The provided `name` and `origin` of the context are made visible through the
|
||||
* Inspector API.
|
||||
* @since v0.3.1
|
||||
* @param contextObject Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified.
|
||||
* If `undefined`, an empty contextified object will be created for backwards compatibility.
|
||||
* @return contextified object.
|
||||
*/
|
||||
function createContext(sandbox?: Context, options?: CreateContextOptions): Context;
|
||||
function createContext(
|
||||
contextObject?: Context | typeof constants.DONT_CONTEXTIFY,
|
||||
options?: CreateContextOptions,
|
||||
): Context;
|
||||
/**
|
||||
* Returns `true` if the given `object` object has been `contextified` using {@link createContext}.
|
||||
* Returns `true` if the given `object` object has been contextified using {@link createContext},
|
||||
* or if it's the global object of a context created using `vm.constants.DONT_CONTEXTIFY`.
|
||||
* @since v0.11.7
|
||||
*/
|
||||
function isContext(sandbox: Context): boolean;
|
||||
@@ -404,7 +467,7 @@ declare module "vm" {
|
||||
* The following example compiles and executes different scripts using a single `contextified` object:
|
||||
*
|
||||
* ```js
|
||||
* const vm = require('node:vm');
|
||||
* import vm from 'node:vm';
|
||||
*
|
||||
* const contextObject = { globalVar: 1 };
|
||||
* vm.createContext(contextObject);
|
||||
@@ -422,13 +485,21 @@ declare module "vm" {
|
||||
*/
|
||||
function runInContext(code: string, contextifiedObject: Context, options?: RunningCodeOptions | string): any;
|
||||
/**
|
||||
* The `vm.runInNewContext()` first contextifies the given `contextObject` (or
|
||||
* creates a new `contextObject` if passed as `undefined`), compiles the `code`,
|
||||
* runs it within the created context, then returns the result. Running code
|
||||
* does not have access to the local scope.
|
||||
*
|
||||
* This method is a shortcut to
|
||||
* `(new vm.Script(code, options)).runInContext(vm.createContext(options), options)`.
|
||||
* If `options` is a string, then it specifies the filename.
|
||||
*
|
||||
* It does several things at once:
|
||||
*
|
||||
* 1. Creates a new context.
|
||||
* 2. If `contextObject` is an object, contextifies it with the new context.
|
||||
* If `contextObject` is undefined, creates a new object and contextifies it.
|
||||
* If `contextObject` is `vm.constants.DONT_CONTEXTIFY`, don't contextify anything.
|
||||
* 3. Compiles the code as a`vm.Script`
|
||||
* 4. Runs the compield code within the created context. The code does not have access to the scope in
|
||||
* which this method is called.
|
||||
* 5. Returns the result.
|
||||
*
|
||||
* The following example compiles and executes code that increments a global
|
||||
* variable and sets a new one. These globals are contained in the `contextObject`.
|
||||
*
|
||||
@@ -443,15 +514,21 @@ declare module "vm" {
|
||||
* vm.runInNewContext('count += 1; name = "kitty"', contextObject);
|
||||
* console.log(contextObject);
|
||||
* // Prints: { animal: 'cat', count: 3, name: 'kitty' }
|
||||
*
|
||||
* // This would throw if the context is created from a contextified object.
|
||||
* // vm.constants.DONT_CONTEXTIFY allows creating contexts with ordinary global objects that
|
||||
* // can be frozen.
|
||||
* const frozenContext = vm.runInNewContext('Object.freeze(globalThis); globalThis;', vm.constants.DONT_CONTEXTIFY);
|
||||
* ```
|
||||
* @since v0.3.1
|
||||
* @param code The JavaScript code to compile and run.
|
||||
* @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
|
||||
* @param contextObject Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified.
|
||||
* If `undefined`, an empty contextified object will be created for backwards compatibility.
|
||||
* @return the result of the very last statement executed in the script.
|
||||
*/
|
||||
function runInNewContext(
|
||||
code: string,
|
||||
contextObject?: Context,
|
||||
contextObject?: Context | typeof constants.DONT_CONTEXTIFY,
|
||||
options?: RunningCodeInNewContextOptions | string,
|
||||
): any;
|
||||
/**
|
||||
@@ -465,7 +542,7 @@ declare module "vm" {
|
||||
* the JavaScript [`eval()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) function to run the same code:
|
||||
*
|
||||
* ```js
|
||||
* const vm = require('node:vm');
|
||||
* import vm from 'node:vm';
|
||||
* let localVar = 'initial value';
|
||||
*
|
||||
* const vmResult = vm.runInThisContext('localVar = "vm";');
|
||||
@@ -487,16 +564,16 @@ declare module "vm" {
|
||||
* context. The code passed to this VM context will have its own isolated scope.
|
||||
*
|
||||
* In order to run a simple web server using the `node:http` module the code passed
|
||||
* to the context must either call `require('node:http')` on its own, or have a
|
||||
* to the context must either import `node:http` on its own, or have a
|
||||
* reference to the `node:http` module passed to it. For instance:
|
||||
*
|
||||
* ```js
|
||||
* 'use strict';
|
||||
* const vm = require('node:vm');
|
||||
* import vm from 'node:vm';
|
||||
*
|
||||
* const code = `
|
||||
* ((require) => {
|
||||
* const http = require('node:http');
|
||||
* const http = require('node:http');
|
||||
*
|
||||
* http.createServer((request, response) => {
|
||||
* response.writeHead(200, { 'Content-Type': 'text/plain' });
|
||||
@@ -529,11 +606,7 @@ declare module "vm" {
|
||||
code: string,
|
||||
params?: readonly string[],
|
||||
options?: CompileFunctionOptions,
|
||||
): Function & {
|
||||
cachedData?: Script["cachedData"] | undefined;
|
||||
cachedDataProduced?: Script["cachedDataProduced"] | undefined;
|
||||
cachedDataRejected?: Script["cachedDataRejected"] | undefined;
|
||||
};
|
||||
): Function & Pick<Script, "cachedData" | "cachedDataProduced" | "cachedDataRejected">;
|
||||
/**
|
||||
* Measure the memory known to V8 and used by all contexts known to the
|
||||
* current V8 isolate, or the main context.
|
||||
@@ -547,7 +620,7 @@ declare module "vm" {
|
||||
* the memory occupied by each heap space in the current V8 instance.
|
||||
*
|
||||
* ```js
|
||||
* const vm = require('node:vm');
|
||||
* import vm from 'node:vm';
|
||||
* // Measure the memory used by the main context.
|
||||
* vm.measureMemory({ mode: 'summary' })
|
||||
* // This is the same as vm.measureMemory()
|
||||
@@ -590,16 +663,11 @@ declare module "vm" {
|
||||
* @experimental
|
||||
*/
|
||||
function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
|
||||
interface ModuleEvaluateOptions {
|
||||
timeout?: RunningScriptOptions["timeout"] | undefined;
|
||||
breakOnSigint?: RunningScriptOptions["breakOnSigint"] | undefined;
|
||||
}
|
||||
interface ModuleEvaluateOptions extends Pick<RunningScriptOptions, "breakOnSigint" | "timeout"> {}
|
||||
type ModuleLinker = (
|
||||
specifier: string,
|
||||
referencingModule: Module,
|
||||
extra: {
|
||||
/** @deprecated Use `attributes` instead */
|
||||
assert: ImportAttributes;
|
||||
attributes: ImportAttributes;
|
||||
},
|
||||
) => Module | Promise<Module>;
|
||||
@@ -609,14 +677,12 @@ declare module "vm" {
|
||||
* flag enabled.
|
||||
*
|
||||
* The `vm.Module` class provides a low-level interface for using
|
||||
* ECMAScript modules in VM contexts. It is the counterpart of the `vm.Script` class that closely mirrors [Module Record](https://262.ecma-international.org/14.0/#sec-abstract-module-records) s as
|
||||
* defined in the ECMAScript
|
||||
* ECMAScript modules in VM contexts. It is the counterpart of the `vm.Script`
|
||||
* class that closely mirrors [Module Record](https://tc39.es/ecma262/#sec-abstract-module-records)s as defined in the ECMAScript
|
||||
* specification.
|
||||
*
|
||||
* Unlike `vm.Script` however, every `vm.Module` object is bound to a context from
|
||||
* its creation. Operations on `vm.Module` objects are intrinsically asynchronous,
|
||||
* in contrast with the synchronous nature of `vm.Script` objects. The use of
|
||||
* 'async' functions can help with manipulating `vm.Module` objects.
|
||||
* its creation.
|
||||
*
|
||||
* Using a `vm.Module` object requires three distinct steps: creation/parsing,
|
||||
* linking, and evaluation. These three steps are illustrated in the following
|
||||
@@ -644,7 +710,7 @@ declare module "vm" {
|
||||
* // Here, we attempt to obtain the default export from the module "foo", and
|
||||
* // put it into local binding "secret".
|
||||
*
|
||||
* const bar = new vm.SourceTextModule(`
|
||||
* const rootModule = new vm.SourceTextModule(`
|
||||
* import s from 'foo';
|
||||
* s;
|
||||
* print(s);
|
||||
@@ -654,39 +720,48 @@ declare module "vm" {
|
||||
* //
|
||||
* // "Link" the imported dependencies of this Module to it.
|
||||
* //
|
||||
* // The provided linking callback (the "linker") accepts two arguments: the
|
||||
* // parent module (`bar` in this case) and the string that is the specifier of
|
||||
* // the imported module. The callback is expected to return a Module that
|
||||
* // corresponds to the provided specifier, with certain requirements documented
|
||||
* // in `module.link()`.
|
||||
* //
|
||||
* // If linking has not started for the returned Module, the same linker
|
||||
* // callback will be called on the returned Module.
|
||||
* // Obtain the requested dependencies of a SourceTextModule by
|
||||
* // `sourceTextModule.moduleRequests` and resolve them.
|
||||
* //
|
||||
* // Even top-level Modules without dependencies must be explicitly linked. The
|
||||
* // callback provided would never be called, however.
|
||||
* // array passed to `sourceTextModule.linkRequests(modules)` can be
|
||||
* // empty, however.
|
||||
* //
|
||||
* // The link() method returns a Promise that will be resolved when all the
|
||||
* // Promises returned by the linker resolve.
|
||||
* //
|
||||
* // Note: This is a contrived example in that the linker function creates a new
|
||||
* // "foo" module every time it is called. In a full-fledged module system, a
|
||||
* // cache would probably be used to avoid duplicated modules.
|
||||
* // Note: This is a contrived example in that the resolveAndLinkDependencies
|
||||
* // creates a new "foo" module every time it is called. In a full-fledged
|
||||
* // module system, a cache would probably be used to avoid duplicated modules.
|
||||
*
|
||||
* async function linker(specifier, referencingModule) {
|
||||
* if (specifier === 'foo') {
|
||||
* return new vm.SourceTextModule(`
|
||||
* // The "secret" variable refers to the global variable we added to
|
||||
* // "contextifiedObject" when creating the context.
|
||||
* export default secret;
|
||||
* `, { context: referencingModule.context });
|
||||
* const moduleMap = new Map([
|
||||
* ['root', rootModule],
|
||||
* ]);
|
||||
*
|
||||
* // Using `contextifiedObject` instead of `referencingModule.context`
|
||||
* // here would work as well.
|
||||
* }
|
||||
* throw new Error(`Unable to resolve dependency: ${specifier}`);
|
||||
* function resolveAndLinkDependencies(module) {
|
||||
* const requestedModules = module.moduleRequests.map((request) => {
|
||||
* // In a full-fledged module system, the resolveAndLinkDependencies would
|
||||
* // resolve the module with the module cache key `[specifier, attributes]`.
|
||||
* // In this example, we just use the specifier as the key.
|
||||
* const specifier = request.specifier;
|
||||
*
|
||||
* let requestedModule = moduleMap.get(specifier);
|
||||
* if (requestedModule === undefined) {
|
||||
* requestedModule = new vm.SourceTextModule(`
|
||||
* // The "secret" variable refers to the global variable we added to
|
||||
* // "contextifiedObject" when creating the context.
|
||||
* export default secret;
|
||||
* `, { context: referencingModule.context });
|
||||
* moduleMap.set(specifier, linkedModule);
|
||||
* // Resolve the dependencies of the new module as well.
|
||||
* resolveAndLinkDependencies(requestedModule);
|
||||
* }
|
||||
*
|
||||
* return requestedModule;
|
||||
* });
|
||||
*
|
||||
* module.linkRequests(requestedModules);
|
||||
* }
|
||||
* await bar.link(linker);
|
||||
*
|
||||
* resolveAndLinkDependencies(rootModule);
|
||||
* rootModule.instantiate();
|
||||
*
|
||||
* // Step 3
|
||||
* //
|
||||
@@ -694,20 +769,12 @@ declare module "vm" {
|
||||
* // resolve after the module has finished evaluating.
|
||||
*
|
||||
* // Prints 42.
|
||||
* await bar.evaluate();
|
||||
* await rootModule.evaluate();
|
||||
* ```
|
||||
* @since v13.0.0, v12.16.0
|
||||
* @experimental
|
||||
*/
|
||||
class Module {
|
||||
/**
|
||||
* The specifiers of all dependencies of this module. The returned array is frozen
|
||||
* to disallow any changes to it.
|
||||
*
|
||||
* Corresponds to the `[[RequestedModules]]` field of [Cyclic Module Record](https://tc39.es/ecma262/#sec-cyclic-module-records) s in
|
||||
* the ECMAScript specification.
|
||||
*/
|
||||
dependencySpecifiers: readonly string[];
|
||||
/**
|
||||
* If the `module.status` is `'errored'`, this property contains the exception
|
||||
* thrown by the module during evaluation. If the status is anything else,
|
||||
@@ -772,6 +839,10 @@ declare module "vm" {
|
||||
* Link module dependencies. This method must be called before evaluation, and
|
||||
* can only be called once per module.
|
||||
*
|
||||
* Use `sourceTextModule.linkRequests(modules)` and
|
||||
* `sourceTextModule.instantiate()` to link modules either synchronously or
|
||||
* asynchronously.
|
||||
*
|
||||
* The function is expected to return a `Module` object or a `Promise` that
|
||||
* eventually resolves to a `Module` object. The returned `Module` must satisfy the
|
||||
* following two invariants:
|
||||
@@ -802,21 +873,43 @@ declare module "vm" {
|
||||
*/
|
||||
link(linker: ModuleLinker): Promise<void>;
|
||||
}
|
||||
interface SourceTextModuleOptions {
|
||||
interface SourceTextModuleOptions extends Pick<ScriptOptions, "cachedData" | "columnOffset" | "lineOffset"> {
|
||||
/**
|
||||
* String used in stack traces.
|
||||
* @default 'vm:module(i)' where i is a context-specific ascending index.
|
||||
*/
|
||||
identifier?: string | undefined;
|
||||
cachedData?: ScriptOptions["cachedData"] | undefined;
|
||||
context?: Context | undefined;
|
||||
lineOffset?: BaseOptions["lineOffset"] | undefined;
|
||||
columnOffset?: BaseOptions["columnOffset"] | undefined;
|
||||
/**
|
||||
* Called during evaluation of this module to initialize the `import.meta`.
|
||||
*/
|
||||
initializeImportMeta?: ((meta: ImportMeta, module: SourceTextModule) => void) | undefined;
|
||||
importModuleDynamically?: ScriptOptions["importModuleDynamically"] | undefined;
|
||||
/**
|
||||
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
||||
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
||||
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
||||
* @experimental
|
||||
*/
|
||||
importModuleDynamically?: DynamicModuleLoader<SourceTextModule> | undefined;
|
||||
}
|
||||
/**
|
||||
* A `ModuleRequest` represents the request to import a module with given import attributes and phase.
|
||||
* @since 24.4.0
|
||||
*/
|
||||
interface ModuleRequest {
|
||||
/**
|
||||
* The specifier of the requested module.
|
||||
*/
|
||||
specifier: string;
|
||||
/**
|
||||
* The `"with"` value passed to the `WithClause` in a `ImportDeclaration`, or an empty object if no value was
|
||||
* provided.
|
||||
*/
|
||||
attributes: ImportAttributes;
|
||||
/**
|
||||
* The phase of the requested module (`"source"` or `"evaluation"`).
|
||||
*/
|
||||
phase: ImportPhase;
|
||||
}
|
||||
/**
|
||||
* This feature is only available with the `--experimental-vm-modules` command
|
||||
@@ -830,9 +923,163 @@ declare module "vm" {
|
||||
class SourceTextModule extends Module {
|
||||
/**
|
||||
* Creates a new `SourceTextModule` instance.
|
||||
*
|
||||
* Properties assigned to the `import.meta` object that are objects may
|
||||
* allow the module to access information outside the specified `context`. Use
|
||||
* `vm.runInContext()` to create objects in a specific context.
|
||||
*
|
||||
* ```js
|
||||
* import vm from 'node:vm';
|
||||
*
|
||||
* const contextifiedObject = vm.createContext({ secret: 42 });
|
||||
*
|
||||
* const module = new vm.SourceTextModule(
|
||||
* 'Object.getPrototypeOf(import.meta.prop).secret = secret;',
|
||||
* {
|
||||
* initializeImportMeta(meta) {
|
||||
* // Note: this object is created in the top context. As such,
|
||||
* // Object.getPrototypeOf(import.meta.prop) points to the
|
||||
* // Object.prototype in the top context rather than that in
|
||||
* // the contextified object.
|
||||
* meta.prop = {};
|
||||
* },
|
||||
* });
|
||||
* // The module has an empty `moduleRequests` array.
|
||||
* module.linkRequests([]);
|
||||
* module.instantiate();
|
||||
* await module.evaluate();
|
||||
*
|
||||
* // Now, Object.prototype.secret will be equal to 42.
|
||||
* //
|
||||
* // To fix this problem, replace
|
||||
* // meta.prop = {};
|
||||
* // above with
|
||||
* // meta.prop = vm.runInContext('{}', contextifiedObject);
|
||||
* ```
|
||||
* @param code JavaScript Module code to parse
|
||||
*/
|
||||
constructor(code: string, options?: SourceTextModuleOptions);
|
||||
/**
|
||||
* @deprecated Use `sourceTextModule.moduleRequests` instead.
|
||||
*/
|
||||
readonly dependencySpecifiers: readonly string[];
|
||||
/**
|
||||
* Iterates over the dependency graph and returns `true` if any module in its
|
||||
* dependencies or this module itself contains top-level `await` expressions,
|
||||
* otherwise returns `false`.
|
||||
*
|
||||
* The search may be slow if the graph is big enough.
|
||||
*
|
||||
* This requires the module to be instantiated first. If the module is not
|
||||
* instantiated yet, an error will be thrown.
|
||||
* @since v24.9.0
|
||||
*/
|
||||
hasAsyncGraph(): boolean;
|
||||
/**
|
||||
* Returns whether the module itself contains any top-level `await` expressions.
|
||||
*
|
||||
* This corresponds to the field `[[HasTLA]]` in [Cyclic Module Record](https://tc39.es/ecma262/#sec-cyclic-module-records) in the
|
||||
* ECMAScript specification.
|
||||
* @since v24.9.0
|
||||
*/
|
||||
hasTopLevelAwait(): boolean;
|
||||
/**
|
||||
* Instantiate the module with the linked requested modules.
|
||||
*
|
||||
* This resolves the imported bindings of the module, including re-exported
|
||||
* binding names. When there are any bindings that cannot be resolved,
|
||||
* an error would be thrown synchronously.
|
||||
*
|
||||
* If the requested modules include cyclic dependencies, the
|
||||
* `sourceTextModule.linkRequests(modules)` method must be called on all
|
||||
* modules in the cycle before calling this method.
|
||||
* @since v24.8.0
|
||||
*/
|
||||
instantiate(): void;
|
||||
/**
|
||||
* Link module dependencies. This method must be called before evaluation, and
|
||||
* can only be called once per module.
|
||||
*
|
||||
* The order of the module instances in the `modules` array should correspond to the order of
|
||||
* `sourceTextModule.moduleRequests` being resolved. If two module requests have the same
|
||||
* specifier and import attributes, they must be resolved with the same module instance or an
|
||||
* `ERR_MODULE_LINK_MISMATCH` would be thrown. For example, when linking requests for this
|
||||
* module:
|
||||
*
|
||||
* ```js
|
||||
* import foo from 'foo';
|
||||
* import source Foo from 'foo';
|
||||
* ```
|
||||
*
|
||||
* The `modules` array must contain two references to the same instance, because the two
|
||||
* module requests are identical but in two phases.
|
||||
*
|
||||
* If the module has no dependencies, the `modules` array can be empty.
|
||||
*
|
||||
* Users can use `sourceTextModule.moduleRequests` to implement the host-defined
|
||||
* [HostLoadImportedModule](https://tc39.es/ecma262/#sec-HostLoadImportedModule) abstract operation in the ECMAScript specification,
|
||||
* and using `sourceTextModule.linkRequests()` to invoke specification defined
|
||||
* [FinishLoadingImportedModule](https://tc39.es/ecma262/#sec-FinishLoadingImportedModule), on the module with all dependencies in a batch.
|
||||
*
|
||||
* It's up to the creator of the `SourceTextModule` to determine if the resolution
|
||||
* of the dependencies is synchronous or asynchronous.
|
||||
*
|
||||
* After each module in the `modules` array is linked, call
|
||||
* `sourceTextModule.instantiate()`.
|
||||
* @since v24.8.0
|
||||
* @param modules Array of `vm.Module` objects that this module depends on.
|
||||
* The order of the modules in the array is the order of
|
||||
* `sourceTextModule.moduleRequests`.
|
||||
*/
|
||||
linkRequests(modules: readonly Module[]): void;
|
||||
/**
|
||||
* The requested import dependencies of this module. The returned array is frozen
|
||||
* to disallow any changes to it.
|
||||
*
|
||||
* For example, given a source text:
|
||||
*
|
||||
* ```js
|
||||
* import foo from 'foo';
|
||||
* import fooAlias from 'foo';
|
||||
* import bar from './bar.js';
|
||||
* import withAttrs from '../with-attrs.ts' with { arbitraryAttr: 'attr-val' };
|
||||
* import source Module from 'wasm-mod.wasm';
|
||||
* ```
|
||||
*
|
||||
* The value of the `sourceTextModule.moduleRequests` will be:
|
||||
*
|
||||
* ```js
|
||||
* [
|
||||
* {
|
||||
* specifier: 'foo',
|
||||
* attributes: {},
|
||||
* phase: 'evaluation',
|
||||
* },
|
||||
* {
|
||||
* specifier: 'foo',
|
||||
* attributes: {},
|
||||
* phase: 'evaluation',
|
||||
* },
|
||||
* {
|
||||
* specifier: './bar.js',
|
||||
* attributes: {},
|
||||
* phase: 'evaluation',
|
||||
* },
|
||||
* {
|
||||
* specifier: '../with-attrs.ts',
|
||||
* attributes: { arbitraryAttr: 'attr-val' },
|
||||
* phase: 'evaluation',
|
||||
* },
|
||||
* {
|
||||
* specifier: 'wasm-mod.wasm',
|
||||
* attributes: {},
|
||||
* phase: 'source',
|
||||
* },
|
||||
* ];
|
||||
* ```
|
||||
* @since v24.4.0
|
||||
*/
|
||||
readonly moduleRequests: readonly ModuleRequest[];
|
||||
}
|
||||
interface SyntheticModuleOptions {
|
||||
/**
|
||||
@@ -855,7 +1102,7 @@ declare module "vm" {
|
||||
* module graphs.
|
||||
*
|
||||
* ```js
|
||||
* const vm = require('node:vm');
|
||||
* import vm from 'node:vm';
|
||||
*
|
||||
* const source = '{ "a": 1 }';
|
||||
* const module = new vm.SyntheticModule(['default'], function() {
|
||||
@@ -880,9 +1127,7 @@ declare module "vm" {
|
||||
options?: SyntheticModuleOptions,
|
||||
);
|
||||
/**
|
||||
* This method is used after the module is linked to set the values of exports. If
|
||||
* it is called before the module is linked, an `ERR_VM_MODULE_STATUS` error
|
||||
* will be thrown.
|
||||
* This method sets the module export binding slots with the given value.
|
||||
*
|
||||
* ```js
|
||||
* import vm from 'node:vm';
|
||||
@@ -891,7 +1136,6 @@ declare module "vm" {
|
||||
* m.setExport('x', 1);
|
||||
* });
|
||||
*
|
||||
* await m.link(() => {});
|
||||
* await m.evaluate();
|
||||
*
|
||||
* assert.strictEqual(m.namespace.x, 1);
|
||||
@@ -904,19 +1148,31 @@ declare module "vm" {
|
||||
}
|
||||
/**
|
||||
* Returns an object containing commonly used constants for VM operations.
|
||||
* @since v20.12.0
|
||||
* @since v21.7.0, v20.12.0
|
||||
*/
|
||||
namespace constants {
|
||||
/**
|
||||
* Stability: 1.1 - Active development
|
||||
*
|
||||
* A constant that can be used as the `importModuleDynamically` option to `vm.Script`
|
||||
* and `vm.compileFunction()` so that Node.js uses the default ESM loader from the main
|
||||
* context to load the requested module.
|
||||
*
|
||||
* For detailed information, see [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v20.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
||||
* For detailed information, see [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v24.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
||||
* @since v21.7.0, v20.12.0
|
||||
*/
|
||||
const USE_MAIN_CONTEXT_DEFAULT_LOADER: number;
|
||||
/**
|
||||
* This constant, when used as the `contextObject` argument in vm APIs, instructs Node.js to create
|
||||
* a context without wrapping its global object with another object in a Node.js-specific manner.
|
||||
* As a result, the `globalThis` value inside the new context would behave more closely to an ordinary
|
||||
* one.
|
||||
*
|
||||
* When `vm.constants.DONT_CONTEXTIFY` is used as the `contextObject` argument to {@link createContext},
|
||||
* the returned object is a proxy-like object to the global object in the newly created context with
|
||||
* fewer Node.js-specific quirks. It is reference equal to the `globalThis` value in the new context,
|
||||
* can be modified from outside the context, and can be used to access built-ins in the new context directly.
|
||||
* @since v22.8.0
|
||||
*/
|
||||
const DONT_CONTEXTIFY: number;
|
||||
}
|
||||
}
|
||||
declare module "node:vm" {
|
||||
|
||||
27
backend/node_modules/@types/node/wasi.d.ts
generated
vendored
27
backend/node_modules/@types/node/wasi.d.ts
generated
vendored
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* ```js
|
||||
* import { readFile } from 'node:fs/promises';
|
||||
* import { WASI } from 'wasi';
|
||||
* import { WASI } from 'node:wasi';
|
||||
* import { argv, env } from 'node:process';
|
||||
*
|
||||
* const wasi = new WASI({
|
||||
@@ -67,7 +67,7 @@
|
||||
* wat2wasm demo.wat
|
||||
* ```
|
||||
* @experimental
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/wasi.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/wasi.js)
|
||||
*/
|
||||
declare module "wasi" {
|
||||
interface WASIOptions {
|
||||
@@ -77,7 +77,7 @@ declare module "wasi" {
|
||||
* WASI command itself.
|
||||
* @default []
|
||||
*/
|
||||
args?: string[] | undefined;
|
||||
args?: readonly string[] | undefined;
|
||||
/**
|
||||
* An object similar to `process.env` that the WebAssembly
|
||||
* application will see as its environment.
|
||||
@@ -121,6 +121,12 @@ declare module "wasi" {
|
||||
*/
|
||||
version: "unstable" | "preview1";
|
||||
}
|
||||
interface FinalizeBindingsOptions {
|
||||
/**
|
||||
* @default instance.exports.memory
|
||||
*/
|
||||
memory?: object | undefined;
|
||||
}
|
||||
/**
|
||||
* The `WASI` class provides the WASI system call API and additional convenience
|
||||
* methods for working with WASI-based applications. Each `WASI` instance
|
||||
@@ -167,6 +173,21 @@ declare module "wasi" {
|
||||
* @since v14.6.0, v12.19.0
|
||||
*/
|
||||
initialize(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
|
||||
/**
|
||||
* Set up WASI host bindings to `instance` without calling `initialize()`
|
||||
* or `start()`. This method is useful when the WASI module is instantiated in
|
||||
* child threads for sharing the memory across threads.
|
||||
*
|
||||
* `finalizeBindings()` requires that either `instance` exports a
|
||||
* [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named `memory` or user specify a
|
||||
* [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) object in `options.memory`. If the `memory` is invalid
|
||||
* an exception is thrown.
|
||||
*
|
||||
* `start()` and `initialize()` will call `finalizeBindings()` internally.
|
||||
* If `finalizeBindings()` is called more than once, an exception is thrown.
|
||||
* @since v24.4.0
|
||||
*/
|
||||
finalizeBindings(instance: object, options?: FinalizeBindingsOptions): void;
|
||||
/**
|
||||
* `wasiImport` is an object that implements the WASI system call API. This object
|
||||
* should be passed as the `wasi_snapshot_preview1` import during the instantiation
|
||||
|
||||
360
backend/node_modules/@types/node/worker_threads.d.ts
generated
vendored
360
backend/node_modules/@types/node/worker_threads.d.ts
generated
vendored
@@ -3,7 +3,7 @@
|
||||
* JavaScript in parallel. To access it:
|
||||
*
|
||||
* ```js
|
||||
* const worker = require('node:worker_threads');
|
||||
* import worker from 'node:worker_threads';
|
||||
* ```
|
||||
*
|
||||
* Workers (threads) are useful for performing CPU-intensive JavaScript operations.
|
||||
@@ -14,29 +14,32 @@
|
||||
* so by transferring `ArrayBuffer` instances or sharing `SharedArrayBuffer` instances.
|
||||
*
|
||||
* ```js
|
||||
* const {
|
||||
* Worker, isMainThread, parentPort, workerData,
|
||||
* } = require('node:worker_threads');
|
||||
* import {
|
||||
* Worker,
|
||||
* isMainThread,
|
||||
* parentPort,
|
||||
* workerData,
|
||||
* } from 'node:worker_threads';
|
||||
*
|
||||
* if (isMainThread) {
|
||||
* module.exports = function parseJSAsync(script) {
|
||||
* return new Promise((resolve, reject) => {
|
||||
* const worker = new Worker(__filename, {
|
||||
* workerData: script,
|
||||
* });
|
||||
* worker.on('message', resolve);
|
||||
* worker.on('error', reject);
|
||||
* worker.on('exit', (code) => {
|
||||
* if (code !== 0)
|
||||
* reject(new Error(`Worker stopped with exit code ${code}`));
|
||||
* });
|
||||
* });
|
||||
* };
|
||||
* } else {
|
||||
* const { parse } = require('some-js-parsing-library');
|
||||
* if (!isMainThread) {
|
||||
* const { parse } = await import('some-js-parsing-library');
|
||||
* const script = workerData;
|
||||
* parentPort.postMessage(parse(script));
|
||||
* }
|
||||
*
|
||||
* export default function parseJSAsync(script) {
|
||||
* return new Promise((resolve, reject) => {
|
||||
* const worker = new Worker(new URL(import.meta.url), {
|
||||
* workerData: script,
|
||||
* });
|
||||
* worker.on('message', resolve);
|
||||
* worker.on('error', reject);
|
||||
* worker.on('exit', (code) => {
|
||||
* if (code !== 0)
|
||||
* reject(new Error(`Worker stopped with exit code ${code}`));
|
||||
* });
|
||||
* });
|
||||
* };
|
||||
* ```
|
||||
*
|
||||
* The above example spawns a Worker thread for each `parseJSAsync()` call. In
|
||||
@@ -49,22 +52,25 @@
|
||||
*
|
||||
* Worker threads inherit non-process-specific options by default. Refer to `Worker constructor options` to know how to customize worker thread options,
|
||||
* specifically `argv` and `execArgv` options.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/worker_threads.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/worker_threads.js)
|
||||
*/
|
||||
declare module "worker_threads" {
|
||||
import { Blob } from "node:buffer";
|
||||
import { Context } from "node:vm";
|
||||
import { EventEmitter } from "node:events";
|
||||
import { EventEmitter, NodeEventTarget } from "node:events";
|
||||
import { EventLoopUtilityFunction } from "node:perf_hooks";
|
||||
import { FileHandle } from "node:fs/promises";
|
||||
import { Readable, Writable } from "node:stream";
|
||||
import { ReadableStream, TransformStream, WritableStream } from "node:stream/web";
|
||||
import { URL } from "node:url";
|
||||
import { X509Certificate } from "node:crypto";
|
||||
import { CPUProfileHandle, HeapInfo, HeapProfileHandle } from "node:v8";
|
||||
import { MessageEvent } from "undici-types";
|
||||
const isInternalThread: boolean;
|
||||
const isMainThread: boolean;
|
||||
const parentPort: null | MessagePort;
|
||||
const resourceLimits: ResourceLimits;
|
||||
const SHARE_ENV: unique symbol;
|
||||
const threadId: number;
|
||||
const threadName: string | null;
|
||||
const workerData: any;
|
||||
/**
|
||||
* Instances of the `worker.MessageChannel` class represent an asynchronous,
|
||||
@@ -72,7 +78,7 @@ declare module "worker_threads" {
|
||||
* The `MessageChannel` has no methods of its own. `new MessageChannel()` yields an object with `port1` and `port2` properties, which refer to linked `MessagePort` instances.
|
||||
*
|
||||
* ```js
|
||||
* const { MessageChannel } = require('node:worker_threads');
|
||||
* import { MessageChannel } from 'node:worker_threads';
|
||||
*
|
||||
* const { port1, port2 } = new MessageChannel();
|
||||
* port1.on('message', (message) => console.log('received', message));
|
||||
@@ -88,7 +94,17 @@ declare module "worker_threads" {
|
||||
interface WorkerPerformance {
|
||||
eventLoopUtilization: EventLoopUtilityFunction;
|
||||
}
|
||||
type TransferListItem = ArrayBuffer | MessagePort | FileHandle | X509Certificate | Blob;
|
||||
type Transferable =
|
||||
| ArrayBuffer
|
||||
| MessagePort
|
||||
| AbortSignal
|
||||
| FileHandle
|
||||
| ReadableStream
|
||||
| WritableStream
|
||||
| TransformStream;
|
||||
/** @deprecated Use `import { Transferable } from "node:worker_threads"` instead. */
|
||||
// TODO: remove in a future major @types/node version.
|
||||
type TransferListItem = Transferable;
|
||||
/**
|
||||
* Instances of the `worker.MessagePort` class represent one end of an
|
||||
* asynchronous, two-way communications channel. It can be used to transfer
|
||||
@@ -97,7 +113,7 @@ declare module "worker_threads" {
|
||||
* This implementation matches [browser `MessagePort`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort) s.
|
||||
* @since v10.5.0
|
||||
*/
|
||||
class MessagePort extends EventEmitter {
|
||||
class MessagePort implements EventTarget {
|
||||
/**
|
||||
* Disables further sending of messages on either side of the connection.
|
||||
* This method can be called when no further communication will happen over this `MessagePort`.
|
||||
@@ -121,7 +137,7 @@ declare module "worker_threads" {
|
||||
* * `value` may not contain native (C++-backed) objects other than:
|
||||
*
|
||||
* ```js
|
||||
* const { MessageChannel } = require('node:worker_threads');
|
||||
* import { MessageChannel } from 'node:worker_threads';
|
||||
* const { port1, port2 } = new MessageChannel();
|
||||
*
|
||||
* port1.on('message', (message) => console.log(message));
|
||||
@@ -143,7 +159,7 @@ declare module "worker_threads" {
|
||||
* `value` may still contain `ArrayBuffer` instances that are not in `transferList`; in that case, the underlying memory is copied rather than moved.
|
||||
*
|
||||
* ```js
|
||||
* const { MessageChannel } = require('node:worker_threads');
|
||||
* import { MessageChannel } from 'node:worker_threads';
|
||||
* const { port1, port2 } = new MessageChannel();
|
||||
*
|
||||
* port1.on('message', (message) => console.log(message));
|
||||
@@ -173,7 +189,12 @@ declare module "worker_threads" {
|
||||
* behind this API, see the `serialization API of the node:v8 module`.
|
||||
* @since v10.5.0
|
||||
*/
|
||||
postMessage(value: any, transferList?: readonly TransferListItem[]): void;
|
||||
postMessage(value: any, transferList?: readonly Transferable[]): void;
|
||||
/**
|
||||
* If true, the `MessagePort` object will keep the Node.js event loop active.
|
||||
* @since v18.1.0, v16.17.0
|
||||
*/
|
||||
hasRef(): boolean;
|
||||
/**
|
||||
* Opposite of `unref()`. Calling `ref()` on a previously `unref()`ed port does _not_ let the program exit if it's the only active handle left (the default
|
||||
* behavior). If the port is `ref()`ed, calling `ref()` again has no effect.
|
||||
@@ -205,42 +226,32 @@ declare module "worker_threads" {
|
||||
* @since v10.5.0
|
||||
*/
|
||||
start(): void;
|
||||
addListener(event: "close", listener: () => void): this;
|
||||
addListener(event: "close", listener: (ev: Event) => void): this;
|
||||
addListener(event: "message", listener: (value: any) => void): this;
|
||||
addListener(event: "messageerror", listener: (error: Error) => void): this;
|
||||
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
emit(event: "close"): boolean;
|
||||
addListener(event: string, listener: (arg: any) => void): this;
|
||||
emit(event: "close", ev: Event): boolean;
|
||||
emit(event: "message", value: any): boolean;
|
||||
emit(event: "messageerror", error: Error): boolean;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
on(event: "close", listener: () => void): this;
|
||||
emit(event: string, arg: any): boolean;
|
||||
off(event: "close", listener: (ev: Event) => void, options?: EventListenerOptions): this;
|
||||
off(event: "message", listener: (value: any) => void, options?: EventListenerOptions): this;
|
||||
off(event: "messageerror", listener: (error: Error) => void, options?: EventListenerOptions): this;
|
||||
off(event: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
|
||||
on(event: "close", listener: (ev: Event) => void): this;
|
||||
on(event: "message", listener: (value: any) => void): this;
|
||||
on(event: "messageerror", listener: (error: Error) => void): this;
|
||||
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
once(event: "close", listener: () => void): this;
|
||||
on(event: string, listener: (arg: any) => void): this;
|
||||
once(event: "close", listener: (ev: Event) => void): this;
|
||||
once(event: "message", listener: (value: any) => void): this;
|
||||
once(event: "messageerror", listener: (error: Error) => void): this;
|
||||
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "close", listener: () => void): this;
|
||||
prependListener(event: "message", listener: (value: any) => void): this;
|
||||
prependListener(event: "messageerror", listener: (error: Error) => void): this;
|
||||
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "close", listener: () => void): this;
|
||||
prependOnceListener(event: "message", listener: (value: any) => void): this;
|
||||
prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
|
||||
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
removeListener(event: "close", listener: () => void): this;
|
||||
removeListener(event: "message", listener: (value: any) => void): this;
|
||||
removeListener(event: "messageerror", listener: (error: Error) => void): this;
|
||||
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
off(event: "close", listener: () => void): this;
|
||||
off(event: "message", listener: (value: any) => void): this;
|
||||
off(event: "messageerror", listener: (error: Error) => void): this;
|
||||
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
addEventListener: EventTarget["addEventListener"];
|
||||
dispatchEvent: EventTarget["dispatchEvent"];
|
||||
removeEventListener: EventTarget["removeEventListener"];
|
||||
once(event: string, listener: (arg: any) => void): this;
|
||||
removeListener(event: "close", listener: (ev: Event) => void, options?: EventListenerOptions): this;
|
||||
removeListener(event: "message", listener: (value: any) => void, options?: EventListenerOptions): this;
|
||||
removeListener(event: "messageerror", listener: (error: Error) => void, options?: EventListenerOptions): this;
|
||||
removeListener(event: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
|
||||
}
|
||||
interface MessagePort extends NodeEventTarget {}
|
||||
interface WorkerOptions {
|
||||
/**
|
||||
* List of arguments which would be stringified and appended to
|
||||
@@ -260,14 +271,14 @@ declare module "worker_threads" {
|
||||
/**
|
||||
* Additional data to send in the first worker message.
|
||||
*/
|
||||
transferList?: TransferListItem[] | undefined;
|
||||
transferList?: Transferable[] | undefined;
|
||||
/**
|
||||
* @default true
|
||||
*/
|
||||
trackUnmanagedFds?: boolean | undefined;
|
||||
/**
|
||||
* An optional `name` to be appended to the worker title
|
||||
* for debuggin/identification purposes, making the final title as
|
||||
* for debugging/identification purposes, making the final title as
|
||||
* `[worker ${id}] ${name}`.
|
||||
*/
|
||||
name?: string | undefined;
|
||||
@@ -298,8 +309,8 @@ declare module "worker_threads" {
|
||||
* Notable differences inside a Worker environment are:
|
||||
*
|
||||
* * The `process.stdin`, `process.stdout`, and `process.stderr` streams may be redirected by the parent thread.
|
||||
* * The `require('node:worker_threads').isMainThread` property is set to `false`.
|
||||
* * The `require('node:worker_threads').parentPort` message port is available.
|
||||
* * The `import { isMainThread } from 'node:worker_threads'` variable is set to `false`.
|
||||
* * The `import { parentPort } from 'node:worker_threads'` message port is available.
|
||||
* * `process.exit()` does not stop the whole program, just the single thread,
|
||||
* and `process.abort()` is not available.
|
||||
* * `process.chdir()` and `process` methods that set group or user ids
|
||||
@@ -334,10 +345,10 @@ declare module "worker_threads" {
|
||||
* the thread barrier.
|
||||
*
|
||||
* ```js
|
||||
* const assert = require('node:assert');
|
||||
* const {
|
||||
* import assert from 'node:assert';
|
||||
* import {
|
||||
* Worker, MessageChannel, MessagePort, isMainThread, parentPort,
|
||||
* } = require('node:worker_threads');
|
||||
* } from 'node:worker_threads';
|
||||
* if (isMainThread) {
|
||||
* const worker = new Worker(__filename);
|
||||
* const subChannel = new MessageChannel();
|
||||
@@ -377,11 +388,17 @@ declare module "worker_threads" {
|
||||
readonly stderr: Readable;
|
||||
/**
|
||||
* An integer identifier for the referenced thread. Inside the worker thread,
|
||||
* it is available as `require('node:worker_threads').threadId`.
|
||||
* it is available as `import { threadId } from 'node:worker_threads'`.
|
||||
* This value is unique for each `Worker` instance inside a single process.
|
||||
* @since v10.5.0
|
||||
*/
|
||||
readonly threadId: number;
|
||||
/**
|
||||
* A string identifier for the referenced thread or null if the thread is not running.
|
||||
* Inside the worker thread, it is available as `require('node:worker_threads').threadName`.
|
||||
* @since v24.6.0
|
||||
*/
|
||||
readonly threadName: string | null;
|
||||
/**
|
||||
* Provides the set of JS engine resource constraints for this Worker thread.
|
||||
* If the `resourceLimits` option was passed to the `Worker` constructor,
|
||||
@@ -408,7 +425,7 @@ declare module "worker_threads" {
|
||||
* See `port.postMessage()` for more details.
|
||||
* @since v10.5.0
|
||||
*/
|
||||
postMessage(value: any, transferList?: readonly TransferListItem[]): void;
|
||||
postMessage(value: any, transferList?: readonly Transferable[]): void;
|
||||
/**
|
||||
* Opposite of `unref()`, calling `ref()` on a previously `unref()`ed worker does _not_ let the program exit if it's the only active handle left (the default
|
||||
* behavior). If the worker is `ref()`ed, calling `ref()` again has
|
||||
@@ -428,6 +445,13 @@ declare module "worker_threads" {
|
||||
* @since v10.5.0
|
||||
*/
|
||||
terminate(): Promise<number>;
|
||||
/**
|
||||
* This method returns a `Promise` that will resolve to an object identical to `process.threadCpuUsage()`,
|
||||
* or reject with an `ERR_WORKER_NOT_RUNNING` error if the worker is no longer running.
|
||||
* This methods allows the statistics to be observed from outside the actual thread.
|
||||
* @since v24.6.0
|
||||
*/
|
||||
cpuUsage(prev?: NodeJS.CpuUsage): Promise<NodeJS.CpuUsage>;
|
||||
/**
|
||||
* Returns a readable stream for a V8 snapshot of the current state of the Worker.
|
||||
* See `v8.getHeapSnapshot()` for more details.
|
||||
@@ -438,6 +462,100 @@ declare module "worker_threads" {
|
||||
* @return A promise for a Readable Stream containing a V8 heap snapshot
|
||||
*/
|
||||
getHeapSnapshot(): Promise<Readable>;
|
||||
/**
|
||||
* This method returns a `Promise` that will resolve to an object identical to `v8.getHeapStatistics()`,
|
||||
* or reject with an `ERR_WORKER_NOT_RUNNING` error if the worker is no longer running.
|
||||
* This methods allows the statistics to be observed from outside the actual thread.
|
||||
* @since v24.0.0
|
||||
*/
|
||||
getHeapStatistics(): Promise<HeapInfo>;
|
||||
/**
|
||||
* Starting a CPU profile then return a Promise that fulfills with an error
|
||||
* or an `CPUProfileHandle` object. This API supports `await using` syntax.
|
||||
*
|
||||
* ```js
|
||||
* const { Worker } = require('node:worker_threads');
|
||||
*
|
||||
* const worker = new Worker(`
|
||||
* const { parentPort } = require('worker_threads');
|
||||
* parentPort.on('message', () => {});
|
||||
* `, { eval: true });
|
||||
*
|
||||
* worker.on('online', async () => {
|
||||
* const handle = await worker.startCpuProfile();
|
||||
* const profile = await handle.stop();
|
||||
* console.log(profile);
|
||||
* worker.terminate();
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* `await using` example.
|
||||
*
|
||||
* ```js
|
||||
* const { Worker } = require('node:worker_threads');
|
||||
*
|
||||
* const w = new Worker(`
|
||||
* const { parentPort } = require('node:worker_threads');
|
||||
* parentPort.on('message', () => {});
|
||||
* `, { eval: true });
|
||||
*
|
||||
* w.on('online', async () => {
|
||||
* // Stop profile automatically when return and profile will be discarded
|
||||
* await using handle = await w.startCpuProfile();
|
||||
* });
|
||||
* ```
|
||||
* @since v24.8.0
|
||||
*/
|
||||
startCpuProfile(): Promise<CPUProfileHandle>;
|
||||
/**
|
||||
* Starting a Heap profile then return a Promise that fulfills with an error
|
||||
* or an `HeapProfileHandle` object. This API supports `await using` syntax.
|
||||
*
|
||||
* ```js
|
||||
* const { Worker } = require('node:worker_threads');
|
||||
*
|
||||
* const worker = new Worker(`
|
||||
* const { parentPort } = require('worker_threads');
|
||||
* parentPort.on('message', () => {});
|
||||
* `, { eval: true });
|
||||
*
|
||||
* worker.on('online', async () => {
|
||||
* const handle = await worker.startHeapProfile();
|
||||
* const profile = await handle.stop();
|
||||
* console.log(profile);
|
||||
* worker.terminate();
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* `await using` example.
|
||||
*
|
||||
* ```js
|
||||
* const { Worker } = require('node:worker_threads');
|
||||
*
|
||||
* const w = new Worker(`
|
||||
* const { parentPort } = require('node:worker_threads');
|
||||
* parentPort.on('message', () => {});
|
||||
* `, { eval: true });
|
||||
*
|
||||
* w.on('online', async () => {
|
||||
* // Stop profile automatically when return and profile will be discarded
|
||||
* await using handle = await w.startHeapProfile();
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
startHeapProfile(): Promise<HeapProfileHandle>;
|
||||
/**
|
||||
* Calls `worker.terminate()` when the dispose scope is exited.
|
||||
*
|
||||
* ```js
|
||||
* async function example() {
|
||||
* await using worker = new Worker('for (;;) {}', { eval: true });
|
||||
* // Worker is automatically terminate when the scope is exited.
|
||||
* }
|
||||
* ```
|
||||
* @since v24.2.0
|
||||
*/
|
||||
[Symbol.asyncDispose](): Promise<void>;
|
||||
addListener(event: "error", listener: (err: Error) => void): this;
|
||||
addListener(event: "exit", listener: (exitCode: number) => void): this;
|
||||
addListener(event: "message", listener: (value: any) => void): this;
|
||||
@@ -495,11 +613,11 @@ declare module "worker_threads" {
|
||||
* ```js
|
||||
* 'use strict';
|
||||
*
|
||||
* const {
|
||||
* import {
|
||||
* isMainThread,
|
||||
* BroadcastChannel,
|
||||
* Worker,
|
||||
* } = require('node:worker_threads');
|
||||
* } from 'node:worker_threads';
|
||||
*
|
||||
* const bc = new BroadcastChannel('hello');
|
||||
*
|
||||
@@ -518,18 +636,18 @@ declare module "worker_threads" {
|
||||
* ```
|
||||
* @since v15.4.0
|
||||
*/
|
||||
class BroadcastChannel {
|
||||
class BroadcastChannel extends EventTarget {
|
||||
readonly name: string;
|
||||
/**
|
||||
* Invoked with a single \`MessageEvent\` argument when a message is received.
|
||||
* @since v15.4.0
|
||||
*/
|
||||
onmessage: (message: unknown) => void;
|
||||
onmessage: (message: MessageEvent) => void;
|
||||
/**
|
||||
* Invoked with a received message cannot be deserialized.
|
||||
* @since v15.4.0
|
||||
*/
|
||||
onmessageerror: (message: unknown) => void;
|
||||
onmessageerror: (message: MessageEvent) => void;
|
||||
constructor(name: string);
|
||||
/**
|
||||
* Closes the `BroadcastChannel` connection.
|
||||
@@ -542,6 +660,35 @@ declare module "worker_threads" {
|
||||
*/
|
||||
postMessage(message: unknown): void;
|
||||
}
|
||||
interface Lock {
|
||||
readonly mode: LockMode;
|
||||
readonly name: string;
|
||||
}
|
||||
interface LockGrantedCallback<T> {
|
||||
(lock: Lock | null): T;
|
||||
}
|
||||
interface LockInfo {
|
||||
clientId: string;
|
||||
mode: LockMode;
|
||||
name: string;
|
||||
}
|
||||
interface LockManager {
|
||||
query(): Promise<LockManagerSnapshot>;
|
||||
request<T>(name: string, callback: LockGrantedCallback<T>): Promise<Awaited<T>>;
|
||||
request<T>(name: string, options: LockOptions, callback: LockGrantedCallback<T>): Promise<Awaited<T>>;
|
||||
}
|
||||
interface LockManagerSnapshot {
|
||||
held: LockInfo[];
|
||||
pending: LockInfo[];
|
||||
}
|
||||
type LockMode = "exclusive" | "shared";
|
||||
interface LockOptions {
|
||||
ifAvailable?: boolean;
|
||||
mode?: LockMode;
|
||||
signal?: AbortSignal;
|
||||
steal?: boolean;
|
||||
}
|
||||
var locks: LockManager;
|
||||
/**
|
||||
* Mark an object as not transferable. If `object` occurs in the transfer list of
|
||||
* a `port.postMessage()` call, it is ignored.
|
||||
@@ -553,7 +700,7 @@ declare module "worker_threads" {
|
||||
* This operation cannot be undone.
|
||||
*
|
||||
* ```js
|
||||
* const { MessageChannel, markAsUntransferable } = require('node:worker_threads');
|
||||
* import { MessageChannel, markAsUntransferable } from 'node:worker_threads';
|
||||
*
|
||||
* const pooledBuffer = new ArrayBuffer(8);
|
||||
* const typedArray1 = new Uint8Array(pooledBuffer);
|
||||
@@ -576,6 +723,39 @@ declare module "worker_threads" {
|
||||
* @since v14.5.0, v12.19.0
|
||||
*/
|
||||
function markAsUntransferable(object: object): void;
|
||||
/**
|
||||
* Check if an object is marked as not transferable with
|
||||
* {@link markAsUntransferable}.
|
||||
* @since v21.0.0
|
||||
*/
|
||||
function isMarkedAsUntransferable(object: object): boolean;
|
||||
/**
|
||||
* Mark an object as not cloneable. If `object` is used as `message` in
|
||||
* a `port.postMessage()` call, an error is thrown. This is a no-op if `object` is a
|
||||
* primitive value.
|
||||
*
|
||||
* This has no effect on `ArrayBuffer`, or any `Buffer` like objects.
|
||||
*
|
||||
* This operation cannot be undone.
|
||||
*
|
||||
* ```js
|
||||
* const { markAsUncloneable } = require('node:worker_threads');
|
||||
*
|
||||
* const anyObject = { foo: 'bar' };
|
||||
* markAsUncloneable(anyObject);
|
||||
* const { port1 } = new MessageChannel();
|
||||
* try {
|
||||
* // This will throw an error, because anyObject is not cloneable.
|
||||
* port1.postMessage(anyObject)
|
||||
* } catch (error) {
|
||||
* // error.name === 'DataCloneError'
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* There is no equivalent to this API in browsers.
|
||||
* @since v22.10.0
|
||||
*/
|
||||
function markAsUncloneable(object: object): void;
|
||||
/**
|
||||
* Transfer a `MessagePort` to a different `vm` Context. The original `port` object is rendered unusable, and the returned `MessagePort` instance
|
||||
* takes its place.
|
||||
@@ -598,7 +778,7 @@ declare module "worker_threads" {
|
||||
* that contains the message payload, corresponding to the oldest message in the `MessagePort`'s queue.
|
||||
*
|
||||
* ```js
|
||||
* const { MessageChannel, receiveMessageOnPort } = require('node:worker_threads');
|
||||
* import { MessageChannel, receiveMessageOnPort } from 'node:worker_threads';
|
||||
* const { port1, port2 } = new MessageChannel();
|
||||
* port1.postMessage({ hello: 'world' });
|
||||
*
|
||||
@@ -624,12 +804,12 @@ declare module "worker_threads" {
|
||||
* automatically.
|
||||
*
|
||||
* ```js
|
||||
* const {
|
||||
* import {
|
||||
* Worker,
|
||||
* isMainThread,
|
||||
* setEnvironmentData,
|
||||
* getEnvironmentData,
|
||||
* } = require('node:worker_threads');
|
||||
* } from 'node:worker_threads';
|
||||
*
|
||||
* if (isMainThread) {
|
||||
* setEnvironmentData('Hello', 'World!');
|
||||
@@ -649,7 +829,25 @@ declare module "worker_threads" {
|
||||
* @param value Any arbitrary, cloneable JavaScript value that will be cloned and passed automatically to all new `Worker` instances. If `value` is passed as `undefined`, any previously set value
|
||||
* for the `key` will be deleted.
|
||||
*/
|
||||
function setEnvironmentData(key: Serializable, value: Serializable): void;
|
||||
function setEnvironmentData(key: Serializable, value?: Serializable): void;
|
||||
/**
|
||||
* Sends a value to another worker, identified by its thread ID.
|
||||
* @param threadId The target thread ID. If the thread ID is invalid, a `ERR_WORKER_MESSAGING_FAILED` error will be thrown.
|
||||
* If the target thread ID is the current thread ID, a `ERR_WORKER_MESSAGING_SAME_THREAD` error will be thrown.
|
||||
* @param value The value to send.
|
||||
* @param transferList If one or more `MessagePort`-like objects are passed in value, a `transferList` is required for those items
|
||||
* or `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` is thrown. See `port.postMessage()` for more information.
|
||||
* @param timeout Time to wait for the message to be delivered in milliseconds. By default it's `undefined`, which means wait forever.
|
||||
* If the operation times out, a `ERR_WORKER_MESSAGING_TIMEOUT` error is thrown.
|
||||
* @since v22.5.0
|
||||
*/
|
||||
function postMessageToThread(threadId: number, value: any, timeout?: number): Promise<void>;
|
||||
function postMessageToThread(
|
||||
threadId: number,
|
||||
value: any,
|
||||
transferList: readonly Transferable[],
|
||||
timeout?: number,
|
||||
): Promise<void>;
|
||||
|
||||
import {
|
||||
BroadcastChannel as _BroadcastChannel,
|
||||
@@ -657,8 +855,12 @@ declare module "worker_threads" {
|
||||
MessagePort as _MessagePort,
|
||||
} from "worker_threads";
|
||||
global {
|
||||
function structuredClone<T>(
|
||||
value: T,
|
||||
options?: { transfer?: Transferable[] },
|
||||
): T;
|
||||
/**
|
||||
* `BroadcastChannel` class is a global reference for `require('worker_threads').BroadcastChannel`
|
||||
* `BroadcastChannel` class is a global reference for `import { BroadcastChannel } from 'worker_threads'`
|
||||
* https://nodejs.org/api/globals.html#broadcastchannel
|
||||
* @since v18.0.0
|
||||
*/
|
||||
@@ -668,7 +870,7 @@ declare module "worker_threads" {
|
||||
} ? T
|
||||
: typeof _BroadcastChannel;
|
||||
/**
|
||||
* `MessageChannel` class is a global reference for `require('worker_threads').MessageChannel`
|
||||
* `MessageChannel` class is a global reference for `import { MessageChannel } from 'worker_threads'`
|
||||
* https://nodejs.org/api/globals.html#messagechannel
|
||||
* @since v15.0.0
|
||||
*/
|
||||
@@ -678,7 +880,7 @@ declare module "worker_threads" {
|
||||
} ? T
|
||||
: typeof _MessageChannel;
|
||||
/**
|
||||
* `MessagePort` class is a global reference for `require('worker_threads').MessagePort`
|
||||
* `MessagePort` class is a global reference for `import { MessagePort } from 'worker_threads'`
|
||||
* https://nodejs.org/api/globals.html#messageport
|
||||
* @since v15.0.0
|
||||
*/
|
||||
|
||||
295
backend/node_modules/@types/node/zlib.d.ts
generated
vendored
295
backend/node_modules/@types/node/zlib.d.ts
generated
vendored
@@ -5,23 +5,23 @@
|
||||
* To access it:
|
||||
*
|
||||
* ```js
|
||||
* const zlib = require('node:zlib');
|
||||
* import zlib from 'node:zlib';
|
||||
* ```
|
||||
*
|
||||
* Compression and decompression are built around the Node.js
|
||||
* [Streams API](https://nodejs.org/docs/latest-v20.x/api/stream.html).
|
||||
* [Streams API](https://nodejs.org/docs/latest-v24.x/api/stream.html).
|
||||
*
|
||||
* Compressing or decompressing a stream (such as a file) can be accomplished by
|
||||
* piping the source stream through a `zlib` `Transform` stream into a destination
|
||||
* stream:
|
||||
*
|
||||
* ```js
|
||||
* const { createGzip } = require('node:zlib');
|
||||
* const { pipeline } = require('node:stream');
|
||||
* const {
|
||||
* import { createGzip } from 'node:zlib';
|
||||
* import { pipeline } from 'node:stream';
|
||||
* import {
|
||||
* createReadStream,
|
||||
* createWriteStream,
|
||||
* } = require('node:fs');
|
||||
* } from 'node:fs';
|
||||
*
|
||||
* const gzip = createGzip();
|
||||
* const source = createReadStream('input.txt');
|
||||
@@ -36,7 +36,7 @@
|
||||
*
|
||||
* // Or, Promisified
|
||||
*
|
||||
* const { promisify } = require('node:util');
|
||||
* import { promisify } from 'node:util';
|
||||
* const pipe = promisify(pipeline);
|
||||
*
|
||||
* async function do_gzip(input, output) {
|
||||
@@ -56,7 +56,7 @@
|
||||
* It is also possible to compress or decompress data in a single step:
|
||||
*
|
||||
* ```js
|
||||
* const { deflate, unzip } = require('node:zlib');
|
||||
* import { deflate, unzip } from 'node:zlib';
|
||||
*
|
||||
* const input = '.................................';
|
||||
* deflate(input, (err, buffer) => {
|
||||
@@ -78,7 +78,7 @@
|
||||
*
|
||||
* // Or, Promisified
|
||||
*
|
||||
* const { promisify } = require('node:util');
|
||||
* import { promisify } from 'node:util';
|
||||
* const do_unzip = promisify(unzip);
|
||||
*
|
||||
* do_unzip(buffer)
|
||||
@@ -89,9 +89,10 @@
|
||||
* });
|
||||
* ```
|
||||
* @since v0.5.8
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/zlib.js)
|
||||
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/zlib.js)
|
||||
*/
|
||||
declare module "zlib" {
|
||||
import { NonSharedBuffer } from "node:buffer";
|
||||
import * as stream from "node:stream";
|
||||
interface ZlibOptions {
|
||||
/**
|
||||
@@ -143,14 +144,51 @@ declare module "zlib" {
|
||||
}
|
||||
| undefined;
|
||||
/**
|
||||
* Limits output size when using [convenience methods](https://nodejs.org/docs/latest-v20.x/api/zlib.html#convenience-methods).
|
||||
* Limits output size when using [convenience methods](https://nodejs.org/docs/latest-v24.x/api/zlib.html#convenience-methods).
|
||||
* @default buffer.kMaxLength
|
||||
*/
|
||||
maxOutputLength?: number | undefined;
|
||||
/**
|
||||
* If `true`, returns an object with `buffer` and `engine`.
|
||||
*/
|
||||
info?: boolean | undefined;
|
||||
}
|
||||
interface ZstdOptions {
|
||||
/**
|
||||
* @default constants.ZSTD_e_continue
|
||||
*/
|
||||
flush?: number | undefined;
|
||||
/**
|
||||
* @default constants.ZSTD_e_end
|
||||
*/
|
||||
finishFlush?: number | undefined;
|
||||
/**
|
||||
* @default 16 * 1024
|
||||
*/
|
||||
chunkSize?: number | undefined;
|
||||
/**
|
||||
* Key-value object containing indexed
|
||||
* [Zstd parameters](https://nodejs.org/docs/latest-v24.x/api/zlib.html#zstd-constants).
|
||||
*/
|
||||
params?: { [key: number]: number | boolean } | undefined;
|
||||
/**
|
||||
* Limits output size when using
|
||||
* [convenience methods](https://nodejs.org/docs/latest-v24.x/api/zlib.html#convenience-methods).
|
||||
* @default buffer.kMaxLength
|
||||
*/
|
||||
maxOutputLength?: number | undefined;
|
||||
/**
|
||||
* If `true`, returns an object with `buffer` and `engine`.
|
||||
*/
|
||||
info?: boolean | undefined;
|
||||
/**
|
||||
* Optional dictionary used to improve compression efficiency when compressing or decompressing data that
|
||||
* shares common patterns with the dictionary.
|
||||
* @since v24.6.0
|
||||
*/
|
||||
dictionary?: NodeJS.ArrayBufferView | undefined;
|
||||
}
|
||||
interface Zlib {
|
||||
/** @deprecated Use bytesWritten instead. */
|
||||
readonly bytesRead: number;
|
||||
readonly bytesWritten: number;
|
||||
shell?: boolean | string | undefined;
|
||||
close(callback?: () => void): void;
|
||||
@@ -172,6 +210,25 @@ declare module "zlib" {
|
||||
interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams {}
|
||||
interface InflateRaw extends stream.Transform, Zlib, ZlibReset {}
|
||||
interface Unzip extends stream.Transform, Zlib {}
|
||||
/**
|
||||
* @since v22.15.0
|
||||
* @experimental
|
||||
*/
|
||||
interface ZstdCompress extends stream.Transform, Zlib {}
|
||||
/**
|
||||
* @since v22.15.0
|
||||
* @experimental
|
||||
*/
|
||||
interface ZstdDecompress extends stream.Transform, Zlib {}
|
||||
/**
|
||||
* Computes a 32-bit [Cyclic Redundancy Check](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) checksum of `data`.
|
||||
* If `value` is specified, it is used as the starting value of the checksum, otherwise, 0 is used as the starting value.
|
||||
* @param data When `data` is a string, it will be encoded as UTF-8 before being used for computation.
|
||||
* @param value An optional starting value. It must be a 32-bit unsigned integer. @default 0
|
||||
* @returns A 32-bit unsigned integer containing the checksum.
|
||||
* @since v22.2.0
|
||||
*/
|
||||
function crc32(data: string | NodeJS.ArrayBufferView, value?: number): number;
|
||||
/**
|
||||
* Creates and returns a new `BrotliCompress` object.
|
||||
* @since v11.7.0, v10.16.0
|
||||
@@ -224,125 +281,165 @@ declare module "zlib" {
|
||||
* @since v0.5.8
|
||||
*/
|
||||
function createUnzip(options?: ZlibOptions): Unzip;
|
||||
/**
|
||||
* Creates and returns a new `ZstdCompress` object.
|
||||
* @since v22.15.0
|
||||
*/
|
||||
function createZstdCompress(options?: ZstdOptions): ZstdCompress;
|
||||
/**
|
||||
* Creates and returns a new `ZstdDecompress` object.
|
||||
* @since v22.15.0
|
||||
*/
|
||||
function createZstdDecompress(options?: ZstdOptions): ZstdDecompress;
|
||||
type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView;
|
||||
type CompressCallback = (error: Error | null, result: Buffer) => void;
|
||||
type CompressCallback = (error: Error | null, result: NonSharedBuffer) => void;
|
||||
/**
|
||||
* @since v11.7.0, v10.16.0
|
||||
*/
|
||||
function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
|
||||
function brotliCompress(buf: InputType, callback: CompressCallback): void;
|
||||
namespace brotliCompress {
|
||||
function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
|
||||
function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<NonSharedBuffer>;
|
||||
}
|
||||
/**
|
||||
* Compress a chunk of data with `BrotliCompress`.
|
||||
* @since v11.7.0, v10.16.0
|
||||
*/
|
||||
function brotliCompressSync(buf: InputType, options?: BrotliOptions): Buffer;
|
||||
function brotliCompressSync(buf: InputType, options?: BrotliOptions): NonSharedBuffer;
|
||||
/**
|
||||
* @since v11.7.0, v10.16.0
|
||||
*/
|
||||
function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
|
||||
function brotliDecompress(buf: InputType, callback: CompressCallback): void;
|
||||
namespace brotliDecompress {
|
||||
function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
|
||||
function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<NonSharedBuffer>;
|
||||
}
|
||||
/**
|
||||
* Decompress a chunk of data with `BrotliDecompress`.
|
||||
* @since v11.7.0, v10.16.0
|
||||
*/
|
||||
function brotliDecompressSync(buf: InputType, options?: BrotliOptions): Buffer;
|
||||
function brotliDecompressSync(buf: InputType, options?: BrotliOptions): NonSharedBuffer;
|
||||
/**
|
||||
* @since v0.6.0
|
||||
*/
|
||||
function deflate(buf: InputType, callback: CompressCallback): void;
|
||||
function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace deflate {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
||||
}
|
||||
/**
|
||||
* Compress a chunk of data with `Deflate`.
|
||||
* @since v0.11.12
|
||||
*/
|
||||
function deflateSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
function deflateSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
||||
/**
|
||||
* @since v0.6.0
|
||||
*/
|
||||
function deflateRaw(buf: InputType, callback: CompressCallback): void;
|
||||
function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace deflateRaw {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
||||
}
|
||||
/**
|
||||
* Compress a chunk of data with `DeflateRaw`.
|
||||
* @since v0.11.12
|
||||
*/
|
||||
function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
function deflateRawSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
||||
/**
|
||||
* @since v0.6.0
|
||||
*/
|
||||
function gzip(buf: InputType, callback: CompressCallback): void;
|
||||
function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace gzip {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
||||
}
|
||||
/**
|
||||
* Compress a chunk of data with `Gzip`.
|
||||
* @since v0.11.12
|
||||
*/
|
||||
function gzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
function gzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
||||
/**
|
||||
* @since v0.6.0
|
||||
*/
|
||||
function gunzip(buf: InputType, callback: CompressCallback): void;
|
||||
function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace gunzip {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
||||
}
|
||||
/**
|
||||
* Decompress a chunk of data with `Gunzip`.
|
||||
* @since v0.11.12
|
||||
*/
|
||||
function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
function gunzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
||||
/**
|
||||
* @since v0.6.0
|
||||
*/
|
||||
function inflate(buf: InputType, callback: CompressCallback): void;
|
||||
function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace inflate {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
||||
}
|
||||
/**
|
||||
* Decompress a chunk of data with `Inflate`.
|
||||
* @since v0.11.12
|
||||
*/
|
||||
function inflateSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
function inflateSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
||||
/**
|
||||
* @since v0.6.0
|
||||
*/
|
||||
function inflateRaw(buf: InputType, callback: CompressCallback): void;
|
||||
function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace inflateRaw {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
||||
}
|
||||
/**
|
||||
* Decompress a chunk of data with `InflateRaw`.
|
||||
* @since v0.11.12
|
||||
*/
|
||||
function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
function inflateRawSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
||||
/**
|
||||
* @since v0.6.0
|
||||
*/
|
||||
function unzip(buf: InputType, callback: CompressCallback): void;
|
||||
function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace unzip {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
||||
}
|
||||
/**
|
||||
* Decompress a chunk of data with `Unzip`.
|
||||
* @since v0.11.12
|
||||
*/
|
||||
function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
function unzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
||||
/**
|
||||
* @since v22.15.0
|
||||
* @experimental
|
||||
*/
|
||||
function zstdCompress(buf: InputType, callback: CompressCallback): void;
|
||||
function zstdCompress(buf: InputType, options: ZstdOptions, callback: CompressCallback): void;
|
||||
namespace zstdCompress {
|
||||
function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<NonSharedBuffer>;
|
||||
}
|
||||
/**
|
||||
* Compress a chunk of data with `ZstdCompress`.
|
||||
* @since v22.15.0
|
||||
* @experimental
|
||||
*/
|
||||
function zstdCompressSync(buf: InputType, options?: ZstdOptions): NonSharedBuffer;
|
||||
/**
|
||||
* @since v22.15.0
|
||||
* @experimental
|
||||
*/
|
||||
function zstdDecompress(buf: InputType, callback: CompressCallback): void;
|
||||
function zstdDecompress(buf: InputType, options: ZstdOptions, callback: CompressCallback): void;
|
||||
namespace zstdDecompress {
|
||||
function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<NonSharedBuffer>;
|
||||
}
|
||||
/**
|
||||
* Decompress a chunk of data with `ZstdDecompress`.
|
||||
* @since v22.15.0
|
||||
* @experimental
|
||||
*/
|
||||
function zstdDecompressSync(buf: InputType, options?: ZstdOptions): NonSharedBuffer;
|
||||
namespace constants {
|
||||
const BROTLI_DECODE: number;
|
||||
const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number;
|
||||
@@ -414,50 +511,106 @@ declare module "zlib" {
|
||||
const INFLATE: number;
|
||||
const INFLATERAW: number;
|
||||
const UNZIP: number;
|
||||
// Allowed flush values.
|
||||
const Z_NO_FLUSH: number;
|
||||
const Z_PARTIAL_FLUSH: number;
|
||||
const Z_SYNC_FLUSH: number;
|
||||
const Z_FULL_FLUSH: number;
|
||||
const Z_FINISH: number;
|
||||
const Z_BLOCK: number;
|
||||
const Z_TREES: number;
|
||||
// Return codes for the compression/decompression functions.
|
||||
// Negative values are errors, positive values are used for special but normal events.
|
||||
const Z_OK: number;
|
||||
const Z_STREAM_END: number;
|
||||
const Z_NEED_DICT: number;
|
||||
const Z_ERRNO: number;
|
||||
const Z_STREAM_ERROR: number;
|
||||
const Z_DATA_ERROR: number;
|
||||
const Z_MEM_ERROR: number;
|
||||
const Z_BUF_ERROR: number;
|
||||
const Z_VERSION_ERROR: number;
|
||||
// Compression levels.
|
||||
const Z_NO_COMPRESSION: number;
|
||||
const Z_BEST_SPEED: number;
|
||||
const ZLIB_VERNUM: number;
|
||||
const ZSTD_CLEVEL_DEFAULT: number;
|
||||
const ZSTD_COMPRESS: number;
|
||||
const ZSTD_DECOMPRESS: number;
|
||||
const ZSTD_btlazy2: number;
|
||||
const ZSTD_btopt: number;
|
||||
const ZSTD_btultra: number;
|
||||
const ZSTD_btultra2: number;
|
||||
const ZSTD_c_chainLog: number;
|
||||
const ZSTD_c_checksumFlag: number;
|
||||
const ZSTD_c_compressionLevel: number;
|
||||
const ZSTD_c_contentSizeFlag: number;
|
||||
const ZSTD_c_dictIDFlag: number;
|
||||
const ZSTD_c_enableLongDistanceMatching: number;
|
||||
const ZSTD_c_hashLog: number;
|
||||
const ZSTD_c_jobSize: number;
|
||||
const ZSTD_c_ldmBucketSizeLog: number;
|
||||
const ZSTD_c_ldmHashLog: number;
|
||||
const ZSTD_c_ldmHashRateLog: number;
|
||||
const ZSTD_c_ldmMinMatch: number;
|
||||
const ZSTD_c_minMatch: number;
|
||||
const ZSTD_c_nbWorkers: number;
|
||||
const ZSTD_c_overlapLog: number;
|
||||
const ZSTD_c_searchLog: number;
|
||||
const ZSTD_c_strategy: number;
|
||||
const ZSTD_c_targetLength: number;
|
||||
const ZSTD_c_windowLog: number;
|
||||
const ZSTD_d_windowLogMax: number;
|
||||
const ZSTD_dfast: number;
|
||||
const ZSTD_e_continue: number;
|
||||
const ZSTD_e_end: number;
|
||||
const ZSTD_e_flush: number;
|
||||
const ZSTD_error_GENERIC: number;
|
||||
const ZSTD_error_checksum_wrong: number;
|
||||
const ZSTD_error_corruption_detected: number;
|
||||
const ZSTD_error_dictionaryCreation_failed: number;
|
||||
const ZSTD_error_dictionary_corrupted: number;
|
||||
const ZSTD_error_dictionary_wrong: number;
|
||||
const ZSTD_error_dstBuffer_null: number;
|
||||
const ZSTD_error_dstSize_tooSmall: number;
|
||||
const ZSTD_error_frameParameter_unsupported: number;
|
||||
const ZSTD_error_frameParameter_windowTooLarge: number;
|
||||
const ZSTD_error_init_missing: number;
|
||||
const ZSTD_error_literals_headerWrong: number;
|
||||
const ZSTD_error_maxSymbolValue_tooLarge: number;
|
||||
const ZSTD_error_maxSymbolValue_tooSmall: number;
|
||||
const ZSTD_error_memory_allocation: number;
|
||||
const ZSTD_error_noForwardProgress_destFull: number;
|
||||
const ZSTD_error_noForwardProgress_inputEmpty: number;
|
||||
const ZSTD_error_no_error: number;
|
||||
const ZSTD_error_parameter_combination_unsupported: number;
|
||||
const ZSTD_error_parameter_outOfBound: number;
|
||||
const ZSTD_error_parameter_unsupported: number;
|
||||
const ZSTD_error_prefix_unknown: number;
|
||||
const ZSTD_error_srcSize_wrong: number;
|
||||
const ZSTD_error_stabilityCondition_notRespected: number;
|
||||
const ZSTD_error_stage_wrong: number;
|
||||
const ZSTD_error_tableLog_tooLarge: number;
|
||||
const ZSTD_error_version_unsupported: number;
|
||||
const ZSTD_error_workSpace_tooSmall: number;
|
||||
const ZSTD_fast: number;
|
||||
const ZSTD_greedy: number;
|
||||
const ZSTD_lazy: number;
|
||||
const ZSTD_lazy2: number;
|
||||
const Z_BEST_COMPRESSION: number;
|
||||
const Z_BEST_SPEED: number;
|
||||
const Z_BLOCK: number;
|
||||
const Z_BUF_ERROR: number;
|
||||
const Z_DATA_ERROR: number;
|
||||
const Z_DEFAULT_CHUNK: number;
|
||||
const Z_DEFAULT_COMPRESSION: number;
|
||||
// Compression strategy.
|
||||
const Z_FILTERED: number;
|
||||
const Z_HUFFMAN_ONLY: number;
|
||||
const Z_RLE: number;
|
||||
const Z_FIXED: number;
|
||||
const Z_DEFAULT_LEVEL: number;
|
||||
const Z_DEFAULT_MEMLEVEL: number;
|
||||
const Z_DEFAULT_STRATEGY: number;
|
||||
const Z_DEFAULT_WINDOWBITS: number;
|
||||
|
||||
const Z_MIN_WINDOWBITS: number;
|
||||
const Z_MAX_WINDOWBITS: number;
|
||||
const Z_MIN_CHUNK: number;
|
||||
const Z_ERRNO: number;
|
||||
const Z_FILTERED: number;
|
||||
const Z_FINISH: number;
|
||||
const Z_FIXED: number;
|
||||
const Z_FULL_FLUSH: number;
|
||||
const Z_HUFFMAN_ONLY: number;
|
||||
const Z_MAX_CHUNK: number;
|
||||
const Z_DEFAULT_CHUNK: number;
|
||||
const Z_MIN_MEMLEVEL: number;
|
||||
const Z_MAX_MEMLEVEL: number;
|
||||
const Z_DEFAULT_MEMLEVEL: number;
|
||||
const Z_MIN_LEVEL: number;
|
||||
const Z_MAX_LEVEL: number;
|
||||
const Z_DEFAULT_LEVEL: number;
|
||||
const ZLIB_VERNUM: number;
|
||||
const Z_MAX_MEMLEVEL: number;
|
||||
const Z_MAX_WINDOWBITS: number;
|
||||
const Z_MEM_ERROR: number;
|
||||
const Z_MIN_CHUNK: number;
|
||||
const Z_MIN_LEVEL: number;
|
||||
const Z_MIN_MEMLEVEL: number;
|
||||
const Z_MIN_WINDOWBITS: number;
|
||||
const Z_NEED_DICT: number;
|
||||
const Z_NO_COMPRESSION: number;
|
||||
const Z_NO_FLUSH: number;
|
||||
const Z_OK: number;
|
||||
const Z_PARTIAL_FLUSH: number;
|
||||
const Z_RLE: number;
|
||||
const Z_STREAM_END: number;
|
||||
const Z_STREAM_ERROR: number;
|
||||
const Z_SYNC_FLUSH: number;
|
||||
const Z_VERSION_ERROR: number;
|
||||
}
|
||||
// Allowed flush values.
|
||||
/** @deprecated Use `constants.Z_NO_FLUSH` */
|
||||
@@ -472,8 +625,6 @@ declare module "zlib" {
|
||||
const Z_FINISH: number;
|
||||
/** @deprecated Use `constants.Z_BLOCK` */
|
||||
const Z_BLOCK: number;
|
||||
/** @deprecated Use `constants.Z_TREES` */
|
||||
const Z_TREES: number;
|
||||
// Return codes for the compression/decompression functions.
|
||||
// Negative values are errors, positive values are used for special but normal events.
|
||||
/** @deprecated Use `constants.Z_OK` */
|
||||
|
||||
23
backend/node_modules/undici-types/agent.d.ts
generated
vendored
23
backend/node_modules/undici-types/agent.d.ts
generated
vendored
@@ -1,31 +1,32 @@
|
||||
import { URL } from 'url'
|
||||
import Pool from './pool'
|
||||
import Dispatcher from "./dispatcher";
|
||||
import Dispatcher from './dispatcher'
|
||||
import TClientStats from './client-stats'
|
||||
import TPoolStats from './pool-stats'
|
||||
|
||||
export default Agent
|
||||
|
||||
declare class Agent extends Dispatcher{
|
||||
constructor(opts?: Agent.Options)
|
||||
declare class Agent extends Dispatcher {
|
||||
constructor (opts?: Agent.Options)
|
||||
/** `true` after `dispatcher.close()` has been called. */
|
||||
closed: boolean;
|
||||
closed: boolean
|
||||
/** `true` after `dispatcher.destroyed()` has been called or `dispatcher.close()` has been called and the dispatcher shutdown has completed. */
|
||||
destroyed: boolean;
|
||||
destroyed: boolean
|
||||
/** Dispatches a request. */
|
||||
dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
|
||||
dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
|
||||
/** Aggregate stats for a Agent by origin. */
|
||||
readonly stats: Record<string, TClientStats | TPoolStats>
|
||||
}
|
||||
|
||||
declare namespace Agent {
|
||||
export interface Options extends Pool.Options {
|
||||
/** Default: `(origin, opts) => new Pool(origin, opts)`. */
|
||||
factory?(origin: string | URL, opts: Object): Dispatcher;
|
||||
/** Integer. Default: `0` */
|
||||
maxRedirections?: number;
|
||||
|
||||
interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options["interceptors"]
|
||||
interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options['interceptors']
|
||||
maxOrigins?: number
|
||||
}
|
||||
|
||||
export interface DispatchOptions extends Dispatcher.DispatchOptions {
|
||||
/** Integer. */
|
||||
maxRedirections?: number;
|
||||
}
|
||||
}
|
||||
|
||||
66
backend/node_modules/undici-types/api.d.ts
generated
vendored
66
backend/node_modules/undici-types/api.d.ts
generated
vendored
@@ -2,42 +2,42 @@ import { URL, UrlObject } from 'url'
|
||||
import { Duplex } from 'stream'
|
||||
import Dispatcher from './dispatcher'
|
||||
|
||||
/** Performs an HTTP request. */
|
||||
declare function request<TOpaque = null> (
|
||||
url: string | URL | UrlObject,
|
||||
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions<TOpaque>, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
|
||||
): Promise<Dispatcher.ResponseData<TOpaque>>
|
||||
|
||||
/** A faster version of `request`. */
|
||||
declare function stream<TOpaque = null> (
|
||||
url: string | URL | UrlObject,
|
||||
options: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions<TOpaque>, 'origin' | 'path'>,
|
||||
factory: Dispatcher.StreamFactory<TOpaque>
|
||||
): Promise<Dispatcher.StreamData<TOpaque>>
|
||||
|
||||
/** For easy use with `stream.pipeline`. */
|
||||
declare function pipeline<TOpaque = null> (
|
||||
url: string | URL | UrlObject,
|
||||
options: { dispatcher?: Dispatcher } & Omit<Dispatcher.PipelineOptions<TOpaque>, 'origin' | 'path'>,
|
||||
handler: Dispatcher.PipelineHandler<TOpaque>
|
||||
): Duplex
|
||||
|
||||
/** Starts two-way communications with the requested resource. */
|
||||
declare function connect<TOpaque = null> (
|
||||
url: string | URL | UrlObject,
|
||||
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions<TOpaque>, 'origin' | 'path'>
|
||||
): Promise<Dispatcher.ConnectData<TOpaque>>
|
||||
|
||||
/** Upgrade to a different protocol. */
|
||||
declare function upgrade (
|
||||
url: string | URL | UrlObject,
|
||||
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.UpgradeOptions, 'origin' | 'path'>
|
||||
): Promise<Dispatcher.UpgradeData>
|
||||
|
||||
export {
|
||||
request,
|
||||
stream,
|
||||
pipeline,
|
||||
connect,
|
||||
upgrade,
|
||||
upgrade
|
||||
}
|
||||
|
||||
/** Performs an HTTP request. */
|
||||
declare function request(
|
||||
url: string | URL | UrlObject,
|
||||
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
|
||||
): Promise<Dispatcher.ResponseData>;
|
||||
|
||||
/** A faster version of `request`. */
|
||||
declare function stream(
|
||||
url: string | URL | UrlObject,
|
||||
options: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path'>,
|
||||
factory: Dispatcher.StreamFactory
|
||||
): Promise<Dispatcher.StreamData>;
|
||||
|
||||
/** For easy use with `stream.pipeline`. */
|
||||
declare function pipeline(
|
||||
url: string | URL | UrlObject,
|
||||
options: { dispatcher?: Dispatcher } & Omit<Dispatcher.PipelineOptions, 'origin' | 'path'>,
|
||||
handler: Dispatcher.PipelineHandler
|
||||
): Duplex;
|
||||
|
||||
/** Starts two-way communications with the requested resource. */
|
||||
declare function connect(
|
||||
url: string | URL | UrlObject,
|
||||
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions, 'origin' | 'path'>
|
||||
): Promise<Dispatcher.ConnectData>;
|
||||
|
||||
/** Upgrade to a different protocol. */
|
||||
declare function upgrade(
|
||||
url: string | URL | UrlObject,
|
||||
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.UpgradeOptions, 'origin' | 'path'>
|
||||
): Promise<Dispatcher.UpgradeData>;
|
||||
|
||||
25
backend/node_modules/undici-types/balanced-pool.d.ts
generated
vendored
25
backend/node_modules/undici-types/balanced-pool.d.ts
generated
vendored
@@ -4,15 +4,26 @@ import { URL } from 'url'
|
||||
|
||||
export default BalancedPool
|
||||
|
||||
declare class BalancedPool extends Dispatcher {
|
||||
constructor(url: string | string[] | URL | URL[], options?: Pool.Options);
|
||||
type BalancedPoolConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
|
||||
|
||||
addUpstream(upstream: string | URL): BalancedPool;
|
||||
removeUpstream(upstream: string | URL): BalancedPool;
|
||||
upstreams: Array<string>;
|
||||
declare class BalancedPool extends Dispatcher {
|
||||
constructor (url: string | string[] | URL | URL[], options?: Pool.Options)
|
||||
|
||||
addUpstream (upstream: string | URL): BalancedPool
|
||||
removeUpstream (upstream: string | URL): BalancedPool
|
||||
upstreams: Array<string>
|
||||
|
||||
/** `true` after `pool.close()` has been called. */
|
||||
closed: boolean;
|
||||
closed: boolean
|
||||
/** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
|
||||
destroyed: boolean;
|
||||
destroyed: boolean
|
||||
|
||||
// Override dispatcher APIs.
|
||||
override connect (
|
||||
options: BalancedPoolConnectOptions
|
||||
): Promise<Dispatcher.ConnectData>
|
||||
override connect (
|
||||
options: BalancedPoolConnectOptions,
|
||||
callback: (err: Error | null, data: Dispatcher.ConnectData) => void
|
||||
): void
|
||||
}
|
||||
|
||||
39
backend/node_modules/undici-types/client.d.ts
generated
vendored
39
backend/node_modules/undici-types/client.d.ts
generated
vendored
@@ -1,19 +1,32 @@
|
||||
import { URL } from 'url'
|
||||
import { TlsOptions } from 'tls'
|
||||
import Dispatcher from './dispatcher'
|
||||
import buildConnector from "./connector";
|
||||
import buildConnector from './connector'
|
||||
import TClientStats from './client-stats'
|
||||
|
||||
type ClientConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
|
||||
|
||||
/**
|
||||
* A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
|
||||
*/
|
||||
export class Client extends Dispatcher {
|
||||
constructor(url: string | URL, options?: Client.Options);
|
||||
constructor (url: string | URL, options?: Client.Options)
|
||||
/** Property to get and set the pipelining factor. */
|
||||
pipelining: number;
|
||||
pipelining: number
|
||||
/** `true` after `client.close()` has been called. */
|
||||
closed: boolean;
|
||||
closed: boolean
|
||||
/** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */
|
||||
destroyed: boolean;
|
||||
destroyed: boolean
|
||||
/** Aggregate stats for a Client. */
|
||||
readonly stats: TClientStats
|
||||
|
||||
// Override dispatcher APIs.
|
||||
override connect (
|
||||
options: ClientConnectOptions
|
||||
): Promise<Dispatcher.ConnectData>
|
||||
override connect (
|
||||
options: ClientConnectOptions,
|
||||
callback: (err: Error | null, data: Dispatcher.ConnectData) => void
|
||||
): void
|
||||
}
|
||||
|
||||
export declare namespace Client {
|
||||
@@ -58,9 +71,7 @@ export declare namespace Client {
|
||||
/** TODO */
|
||||
maxCachedSessions?: number;
|
||||
/** TODO */
|
||||
maxRedirections?: number;
|
||||
/** TODO */
|
||||
connect?: buildConnector.BuildOptions | buildConnector.connector;
|
||||
connect?: Partial<buildConnector.BuildOptions> | buildConnector.connector;
|
||||
/** TODO */
|
||||
maxRequestsPerClient?: number;
|
||||
/** TODO */
|
||||
@@ -74,13 +85,13 @@ export declare namespace Client {
|
||||
/**
|
||||
* @description Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation.
|
||||
* @default false
|
||||
*/
|
||||
*/
|
||||
allowH2?: boolean;
|
||||
/**
|
||||
* @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overriden by a SETTINGS remote frame.
|
||||
* @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
|
||||
* @default 100
|
||||
*/
|
||||
maxConcurrentStreams?: number
|
||||
*/
|
||||
maxConcurrentStreams?: number;
|
||||
}
|
||||
export interface SocketInfo {
|
||||
localAddress?: string
|
||||
@@ -94,4 +105,4 @@ export declare namespace Client {
|
||||
}
|
||||
}
|
||||
|
||||
export default Client;
|
||||
export default Client
|
||||
|
||||
2
backend/node_modules/undici-types/cookies.d.ts
generated
vendored
2
backend/node_modules/undici-types/cookies.d.ts
generated
vendored
@@ -26,3 +26,5 @@ export function getCookies (headers: Headers): Record<string, string>
|
||||
export function getSetCookies (headers: Headers): Cookie[]
|
||||
|
||||
export function setCookie (headers: Headers, cookie: Cookie): void
|
||||
|
||||
export function parseCookie (cookie: string): Cookie | null
|
||||
|
||||
31
backend/node_modules/undici-types/diagnostics-channel.d.ts
generated
vendored
31
backend/node_modules/undici-types/diagnostics-channel.d.ts
generated
vendored
@@ -1,7 +1,7 @@
|
||||
import { Socket } from "net";
|
||||
import { URL } from "url";
|
||||
import Connector from "./connector";
|
||||
import Dispatcher from "./dispatcher";
|
||||
import { Socket } from 'net'
|
||||
import { URL } from 'url'
|
||||
import buildConnector from './connector'
|
||||
import Dispatcher from './dispatcher'
|
||||
|
||||
declare namespace DiagnosticsChannel {
|
||||
interface Request {
|
||||
@@ -9,29 +9,36 @@ declare namespace DiagnosticsChannel {
|
||||
completed: boolean;
|
||||
method?: Dispatcher.HttpMethod;
|
||||
path: string;
|
||||
headers: string;
|
||||
addHeader(key: string, value: string): Request;
|
||||
headers: any;
|
||||
}
|
||||
interface Response {
|
||||
statusCode: number;
|
||||
statusText: string;
|
||||
headers: Array<Buffer>;
|
||||
}
|
||||
type Error = unknown;
|
||||
interface ConnectParams {
|
||||
host: URL["host"];
|
||||
hostname: URL["hostname"];
|
||||
protocol: URL["protocol"];
|
||||
port: URL["port"];
|
||||
host: URL['host'];
|
||||
hostname: URL['hostname'];
|
||||
protocol: URL['protocol'];
|
||||
port: URL['port'];
|
||||
servername: string | null;
|
||||
}
|
||||
type Connector = Connector.connector;
|
||||
type Connector = buildConnector.connector
|
||||
export interface RequestCreateMessage {
|
||||
request: Request;
|
||||
}
|
||||
export interface RequestBodySentMessage {
|
||||
request: Request;
|
||||
}
|
||||
|
||||
export interface RequestBodyChunkSentMessage {
|
||||
request: Request;
|
||||
chunk: Uint8Array | string;
|
||||
}
|
||||
export interface RequestBodyChunkReceivedMessage {
|
||||
request: Request;
|
||||
chunk: Buffer;
|
||||
}
|
||||
export interface RequestHeadersMessage {
|
||||
request: Request;
|
||||
response: Response;
|
||||
|
||||
233
backend/node_modules/undici-types/dispatcher.d.ts
generated
vendored
233
backend/node_modules/undici-types/dispatcher.d.ts
generated
vendored
@@ -6,93 +6,99 @@ import { IncomingHttpHeaders } from './header'
|
||||
import BodyReadable from './readable'
|
||||
import { FormData } from './formdata'
|
||||
import Errors from './errors'
|
||||
import { Autocomplete } from './utility'
|
||||
|
||||
type AbortSignal = unknown;
|
||||
type AbortSignal = unknown
|
||||
|
||||
export default Dispatcher
|
||||
|
||||
export type UndiciHeaders = Record<string, string | string[]> | IncomingHttpHeaders | string[] | Iterable<[string, string | string[] | undefined]> | null
|
||||
|
||||
/** Dispatcher is the core API used to dispatch requests. */
|
||||
declare class Dispatcher extends EventEmitter {
|
||||
/** Dispatches a request. This API is expected to evolve through semver-major versions and is less stable than the preceding higher level APIs. It is primarily intended for library developers who implement higher level APIs on top of this. */
|
||||
dispatch(options: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
|
||||
dispatch (options: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
|
||||
/** Starts two-way communications with the requested resource. */
|
||||
connect(options: Dispatcher.ConnectOptions): Promise<Dispatcher.ConnectData>;
|
||||
connect(options: Dispatcher.ConnectOptions, callback: (err: Error | null, data: Dispatcher.ConnectData) => void): void;
|
||||
connect<TOpaque = null>(options: Dispatcher.ConnectOptions<TOpaque>): Promise<Dispatcher.ConnectData<TOpaque>>
|
||||
connect<TOpaque = null>(options: Dispatcher.ConnectOptions<TOpaque>, callback: (err: Error | null, data: Dispatcher.ConnectData<TOpaque>) => void): void
|
||||
/** Compose a chain of dispatchers */
|
||||
compose (dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher
|
||||
compose (...dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher
|
||||
/** Performs an HTTP request. */
|
||||
request(options: Dispatcher.RequestOptions): Promise<Dispatcher.ResponseData>;
|
||||
request(options: Dispatcher.RequestOptions, callback: (err: Error | null, data: Dispatcher.ResponseData) => void): void;
|
||||
request<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>): Promise<Dispatcher.ResponseData<TOpaque>>
|
||||
request<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, callback: (err: Error | null, data: Dispatcher.ResponseData<TOpaque>) => void): void
|
||||
/** For easy use with `stream.pipeline`. */
|
||||
pipeline(options: Dispatcher.PipelineOptions, handler: Dispatcher.PipelineHandler): Duplex;
|
||||
pipeline<TOpaque = null>(options: Dispatcher.PipelineOptions<TOpaque>, handler: Dispatcher.PipelineHandler<TOpaque>): Duplex
|
||||
/** A faster version of `Dispatcher.request`. */
|
||||
stream(options: Dispatcher.RequestOptions, factory: Dispatcher.StreamFactory): Promise<Dispatcher.StreamData>;
|
||||
stream(options: Dispatcher.RequestOptions, factory: Dispatcher.StreamFactory, callback: (err: Error | null, data: Dispatcher.StreamData) => void): void;
|
||||
stream<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, factory: Dispatcher.StreamFactory<TOpaque>): Promise<Dispatcher.StreamData<TOpaque>>
|
||||
stream<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, factory: Dispatcher.StreamFactory<TOpaque>, callback: (err: Error | null, data: Dispatcher.StreamData<TOpaque>) => void): void
|
||||
/** Upgrade to a different protocol. */
|
||||
upgrade(options: Dispatcher.UpgradeOptions): Promise<Dispatcher.UpgradeData>;
|
||||
upgrade(options: Dispatcher.UpgradeOptions, callback: (err: Error | null, data: Dispatcher.UpgradeData) => void): void;
|
||||
upgrade (options: Dispatcher.UpgradeOptions): Promise<Dispatcher.UpgradeData>
|
||||
upgrade (options: Dispatcher.UpgradeOptions, callback: (err: Error | null, data: Dispatcher.UpgradeData) => void): void
|
||||
/** Closes the client and gracefully waits for enqueued requests to complete before invoking the callback (or returning a promise if no callback is provided). */
|
||||
close(): Promise<void>;
|
||||
close(callback: () => void): void;
|
||||
close (): Promise<void>
|
||||
close (callback: () => void): void
|
||||
/** Destroy the client abruptly with the given err. All the pending and running requests will be asynchronously aborted and error. Waits until socket is closed before invoking the callback (or returning a promise if no callback is provided). Since this operation is asynchronously dispatched there might still be some progress on dispatched requests. */
|
||||
destroy(): Promise<void>;
|
||||
destroy(err: Error | null): Promise<void>;
|
||||
destroy(callback: () => void): void;
|
||||
destroy(err: Error | null, callback: () => void): void;
|
||||
destroy (): Promise<void>
|
||||
destroy (err: Error | null): Promise<void>
|
||||
destroy (callback: () => void): void
|
||||
destroy (err: Error | null, callback: () => void): void
|
||||
|
||||
on(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
||||
on(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
on(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
on(eventName: 'drain', callback: (origin: URL) => void): this;
|
||||
on (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
|
||||
on (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
on (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
on (eventName: 'drain', callback: (origin: URL) => void): this
|
||||
|
||||
once (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
|
||||
once (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
once (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
once (eventName: 'drain', callback: (origin: URL) => void): this
|
||||
|
||||
once(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
||||
once(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
once(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
once(eventName: 'drain', callback: (origin: URL) => void): this;
|
||||
off (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
|
||||
off (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
off (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
off (eventName: 'drain', callback: (origin: URL) => void): this
|
||||
|
||||
addListener (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
|
||||
addListener (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
addListener (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
addListener (eventName: 'drain', callback: (origin: URL) => void): this
|
||||
|
||||
off(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
||||
off(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
off(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
off(eventName: 'drain', callback: (origin: URL) => void): this;
|
||||
removeListener (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
|
||||
removeListener (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
removeListener (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
removeListener (eventName: 'drain', callback: (origin: URL) => void): this
|
||||
|
||||
prependListener (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
|
||||
prependListener (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
prependListener (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
prependListener (eventName: 'drain', callback: (origin: URL) => void): this
|
||||
|
||||
addListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
||||
addListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
addListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
addListener(eventName: 'drain', callback: (origin: URL) => void): this;
|
||||
prependOnceListener (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
|
||||
prependOnceListener (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
prependOnceListener (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
|
||||
prependOnceListener (eventName: 'drain', callback: (origin: URL) => void): this
|
||||
|
||||
removeListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
||||
removeListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
removeListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
removeListener(eventName: 'drain', callback: (origin: URL) => void): this;
|
||||
listeners (eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[]
|
||||
listeners (eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]
|
||||
listeners (eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]
|
||||
listeners (eventName: 'drain'): ((origin: URL) => void)[]
|
||||
|
||||
prependListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
||||
prependListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
prependListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
prependListener(eventName: 'drain', callback: (origin: URL) => void): this;
|
||||
rawListeners (eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[]
|
||||
rawListeners (eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]
|
||||
rawListeners (eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]
|
||||
rawListeners (eventName: 'drain'): ((origin: URL) => void)[]
|
||||
|
||||
prependOnceListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
|
||||
prependOnceListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
prependOnceListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
||||
prependOnceListener(eventName: 'drain', callback: (origin: URL) => void): this;
|
||||
|
||||
listeners(eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[]
|
||||
listeners(eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
|
||||
listeners(eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
|
||||
listeners(eventName: 'drain'): ((origin: URL) => void)[];
|
||||
|
||||
rawListeners(eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[]
|
||||
rawListeners(eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
|
||||
rawListeners(eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
|
||||
rawListeners(eventName: 'drain'): ((origin: URL) => void)[];
|
||||
|
||||
emit(eventName: 'connect', origin: URL, targets: readonly Dispatcher[]): boolean;
|
||||
emit(eventName: 'disconnect', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean;
|
||||
emit(eventName: 'connectionError', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean;
|
||||
emit(eventName: 'drain', origin: URL): boolean;
|
||||
emit (eventName: 'connect', origin: URL, targets: readonly Dispatcher[]): boolean
|
||||
emit (eventName: 'disconnect', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean
|
||||
emit (eventName: 'connectionError', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean
|
||||
emit (eventName: 'drain', origin: URL): boolean
|
||||
}
|
||||
|
||||
declare namespace Dispatcher {
|
||||
export interface ComposedDispatcher extends Dispatcher {}
|
||||
export type Dispatch = Dispatcher['dispatch']
|
||||
export type DispatcherComposeInterceptor = (dispatch: Dispatch) => Dispatch
|
||||
export interface DispatchOptions {
|
||||
origin?: string | URL;
|
||||
path: string;
|
||||
@@ -100,12 +106,12 @@ declare namespace Dispatcher {
|
||||
/** Default: `null` */
|
||||
body?: string | Buffer | Uint8Array | Readable | null | FormData;
|
||||
/** Default: `null` */
|
||||
headers?: IncomingHttpHeaders | string[] | null;
|
||||
headers?: UndiciHeaders;
|
||||
/** Query string params to be embedded in the request URL. Default: `null` */
|
||||
query?: Record<string, any>;
|
||||
/** Whether the requests can be safely retried or not. If `false` the request won't be sent until all preceding requests in the pipeline have completed. Default: `true` if `method` is `HEAD` or `GET`. */
|
||||
idempotent?: boolean;
|
||||
/** Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to `true` further pipelining will be avoided on the same connection until headers have been received. */
|
||||
/** Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to `true` further pipelining will be avoided on the same connection until headers have been received. Defaults to `method !== 'HEAD'`. */
|
||||
blocking?: boolean;
|
||||
/** Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`. Default: `method === 'CONNECT' || null`. */
|
||||
upgrade?: boolean | string | null;
|
||||
@@ -117,37 +123,38 @@ declare namespace Dispatcher {
|
||||
reset?: boolean;
|
||||
/** Whether Undici should throw an error upon receiving a 4xx or 5xx response from the server. Defaults to false */
|
||||
throwOnError?: boolean;
|
||||
/** For H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server*/
|
||||
/** For H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server */
|
||||
expectContinue?: boolean;
|
||||
}
|
||||
export interface ConnectOptions {
|
||||
export interface ConnectOptions<TOpaque = null> {
|
||||
origin: string | URL;
|
||||
path: string;
|
||||
/** Default: `null` */
|
||||
headers?: IncomingHttpHeaders | string[] | null;
|
||||
headers?: UndiciHeaders;
|
||||
/** Default: `null` */
|
||||
signal?: AbortSignal | EventEmitter | null;
|
||||
/** This argument parameter is passed through to `ConnectData` */
|
||||
opaque?: unknown;
|
||||
/** Default: 0 */
|
||||
maxRedirections?: number;
|
||||
opaque?: TOpaque;
|
||||
/** Default: false */
|
||||
redirectionLimitReached?: boolean;
|
||||
/** Default: `null` */
|
||||
responseHeader?: 'raw' | null;
|
||||
responseHeaders?: 'raw' | null;
|
||||
}
|
||||
export interface RequestOptions extends DispatchOptions {
|
||||
export interface RequestOptions<TOpaque = null> extends DispatchOptions {
|
||||
/** Default: `null` */
|
||||
opaque?: unknown;
|
||||
opaque?: TOpaque;
|
||||
/** Default: `null` */
|
||||
signal?: AbortSignal | EventEmitter | null;
|
||||
/** Default: 0 */
|
||||
maxRedirections?: number;
|
||||
/** Default: false */
|
||||
redirectionLimitReached?: boolean;
|
||||
/** Default: `null` */
|
||||
onInfo?: (info: { statusCode: number, headers: Record<string, string | string[]> }) => void;
|
||||
/** Default: `null` */
|
||||
responseHeader?: 'raw' | null;
|
||||
responseHeaders?: 'raw' | null;
|
||||
/** Default: `64 KiB` */
|
||||
highWaterMark?: number;
|
||||
}
|
||||
export interface PipelineOptions extends RequestOptions {
|
||||
export interface PipelineOptions<TOpaque = null> extends RequestOptions<TOpaque> {
|
||||
/** `true` if the `handler` will return an object stream. Default: `false` */
|
||||
objectMode?: boolean;
|
||||
}
|
||||
@@ -156,86 +163,114 @@ declare namespace Dispatcher {
|
||||
/** Default: `'GET'` */
|
||||
method?: string;
|
||||
/** Default: `null` */
|
||||
headers?: IncomingHttpHeaders | string[] | null;
|
||||
headers?: UndiciHeaders;
|
||||
/** A string of comma separated protocols, in descending preference order. Default: `'Websocket'` */
|
||||
protocol?: string;
|
||||
/** Default: `null` */
|
||||
signal?: AbortSignal | EventEmitter | null;
|
||||
/** Default: 0 */
|
||||
maxRedirections?: number;
|
||||
/** Default: false */
|
||||
redirectionLimitReached?: boolean;
|
||||
/** Default: `null` */
|
||||
responseHeader?: 'raw' | null;
|
||||
responseHeaders?: 'raw' | null;
|
||||
}
|
||||
export interface ConnectData {
|
||||
export interface ConnectData<TOpaque = null> {
|
||||
statusCode: number;
|
||||
headers: IncomingHttpHeaders;
|
||||
socket: Duplex;
|
||||
opaque: unknown;
|
||||
opaque: TOpaque;
|
||||
}
|
||||
export interface ResponseData {
|
||||
export interface ResponseData<TOpaque = null> {
|
||||
statusCode: number;
|
||||
headers: IncomingHttpHeaders;
|
||||
body: BodyReadable & BodyMixin;
|
||||
trailers: Record<string, string>;
|
||||
opaque: unknown;
|
||||
opaque: TOpaque;
|
||||
context: object;
|
||||
}
|
||||
export interface PipelineHandlerData {
|
||||
export interface PipelineHandlerData<TOpaque = null> {
|
||||
statusCode: number;
|
||||
headers: IncomingHttpHeaders;
|
||||
opaque: unknown;
|
||||
opaque: TOpaque;
|
||||
body: BodyReadable;
|
||||
context: object;
|
||||
}
|
||||
export interface StreamData {
|
||||
opaque: unknown;
|
||||
export interface StreamData<TOpaque = null> {
|
||||
opaque: TOpaque;
|
||||
trailers: Record<string, string>;
|
||||
}
|
||||
export interface UpgradeData {
|
||||
export interface UpgradeData<TOpaque = null> {
|
||||
headers: IncomingHttpHeaders;
|
||||
socket: Duplex;
|
||||
opaque: unknown;
|
||||
opaque: TOpaque;
|
||||
}
|
||||
export interface StreamFactoryData {
|
||||
export interface StreamFactoryData<TOpaque = null> {
|
||||
statusCode: number;
|
||||
headers: IncomingHttpHeaders;
|
||||
opaque: unknown;
|
||||
opaque: TOpaque;
|
||||
context: object;
|
||||
}
|
||||
export type StreamFactory = (data: StreamFactoryData) => Writable;
|
||||
export interface DispatchHandlers {
|
||||
export type StreamFactory<TOpaque = null> = (data: StreamFactoryData<TOpaque>) => Writable
|
||||
|
||||
export interface DispatchController {
|
||||
get aborted () : boolean
|
||||
get paused () : boolean
|
||||
get reason () : Error | null
|
||||
abort (reason: Error): void
|
||||
pause(): void
|
||||
resume(): void
|
||||
}
|
||||
|
||||
export interface DispatchHandler {
|
||||
onRequestStart?(controller: DispatchController, context: any): void;
|
||||
onRequestUpgrade?(controller: DispatchController, statusCode: number, headers: IncomingHttpHeaders, socket: Duplex): void;
|
||||
onResponseStart?(controller: DispatchController, statusCode: number, headers: IncomingHttpHeaders, statusMessage?: string): void;
|
||||
onResponseData?(controller: DispatchController, chunk: Buffer): void;
|
||||
onResponseEnd?(controller: DispatchController, trailers: IncomingHttpHeaders): void;
|
||||
onResponseError?(controller: DispatchController, error: Error): void;
|
||||
|
||||
/** Invoked before request is dispatched on socket. May be invoked multiple times when a request is retried when the request at the head of the pipeline fails. */
|
||||
onConnect?(abort: () => void): void;
|
||||
/** @deprecated */
|
||||
onConnect?(abort: (err?: Error) => void): void;
|
||||
/** Invoked when an error has occurred. */
|
||||
/** @deprecated */
|
||||
onError?(err: Error): void;
|
||||
/** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */
|
||||
/** @deprecated */
|
||||
onUpgrade?(statusCode: number, headers: Buffer[] | string[] | null, socket: Duplex): void;
|
||||
/** Invoked when response is received, before headers have been read. **/
|
||||
/** @deprecated */
|
||||
onResponseStarted?(): void;
|
||||
/** Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. */
|
||||
onHeaders?(statusCode: number, headers: Buffer[] | string[] | null, resume: () => void): boolean;
|
||||
/** @deprecated */
|
||||
onHeaders?(statusCode: number, headers: Buffer[], resume: () => void, statusText: string): boolean;
|
||||
/** Invoked when response payload data is received. */
|
||||
/** @deprecated */
|
||||
onData?(chunk: Buffer): boolean;
|
||||
/** Invoked when response payload and trailers have been received and the request has completed. */
|
||||
/** @deprecated */
|
||||
onComplete?(trailers: string[] | null): void;
|
||||
/** Invoked when a body chunk is sent to the server. May be invoked multiple times for chunked requests */
|
||||
/** @deprecated */
|
||||
onBodySent?(chunkSize: number, totalBytesSent: number): void;
|
||||
}
|
||||
export type PipelineHandler = (data: PipelineHandlerData) => Readable;
|
||||
export type HttpMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH';
|
||||
export type PipelineHandler<TOpaque = null> = (data: PipelineHandlerData<TOpaque>) => Readable
|
||||
export type HttpMethod = Autocomplete<'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH'>
|
||||
|
||||
/**
|
||||
* @link https://fetch.spec.whatwg.org/#body-mixin
|
||||
*/
|
||||
interface BodyMixin {
|
||||
readonly body?: never; // throws on node v16.6.0
|
||||
readonly body?: never;
|
||||
readonly bodyUsed: boolean;
|
||||
arrayBuffer(): Promise<ArrayBuffer>;
|
||||
blob(): Promise<Blob>;
|
||||
bytes(): Promise<Uint8Array>;
|
||||
formData(): Promise<never>;
|
||||
json(): Promise<unknown>;
|
||||
text(): Promise<string>;
|
||||
}
|
||||
|
||||
export interface DispatchInterceptor {
|
||||
(dispatch: Dispatcher['dispatch']): Dispatcher['dispatch']
|
||||
(dispatch: Dispatch): Dispatch
|
||||
}
|
||||
}
|
||||
|
||||
125
backend/node_modules/undici-types/errors.d.ts
generated
vendored
125
backend/node_modules/undici-types/errors.d.ts
generated
vendored
@@ -1,24 +1,24 @@
|
||||
import { IncomingHttpHeaders } from "./header";
|
||||
import { IncomingHttpHeaders } from './header'
|
||||
import Client from './client'
|
||||
|
||||
export default Errors
|
||||
|
||||
declare namespace Errors {
|
||||
export class UndiciError extends Error {
|
||||
name: string;
|
||||
code: string;
|
||||
name: string
|
||||
code: string
|
||||
}
|
||||
|
||||
/** Connect timeout error. */
|
||||
export class ConnectTimeoutError extends UndiciError {
|
||||
name: 'ConnectTimeoutError';
|
||||
code: 'UND_ERR_CONNECT_TIMEOUT';
|
||||
name: 'ConnectTimeoutError'
|
||||
code: 'UND_ERR_CONNECT_TIMEOUT'
|
||||
}
|
||||
|
||||
/** A header exceeds the `headersTimeout` option. */
|
||||
export class HeadersTimeoutError extends UndiciError {
|
||||
name: 'HeadersTimeoutError';
|
||||
code: 'UND_ERR_HEADERS_TIMEOUT';
|
||||
name: 'HeadersTimeoutError'
|
||||
code: 'UND_ERR_HEADERS_TIMEOUT'
|
||||
}
|
||||
|
||||
/** Headers overflow error. */
|
||||
@@ -29,100 +29,133 @@ declare namespace Errors {
|
||||
|
||||
/** A body exceeds the `bodyTimeout` option. */
|
||||
export class BodyTimeoutError extends UndiciError {
|
||||
name: 'BodyTimeoutError';
|
||||
code: 'UND_ERR_BODY_TIMEOUT';
|
||||
name: 'BodyTimeoutError'
|
||||
code: 'UND_ERR_BODY_TIMEOUT'
|
||||
}
|
||||
|
||||
export class ResponseStatusCodeError extends UndiciError {
|
||||
export class ResponseError extends UndiciError {
|
||||
constructor (
|
||||
message?: string,
|
||||
statusCode?: number,
|
||||
headers?: IncomingHttpHeaders | string[] | null,
|
||||
body?: null | Record<string, any> | string
|
||||
);
|
||||
name: 'ResponseStatusCodeError';
|
||||
code: 'UND_ERR_RESPONSE_STATUS_CODE';
|
||||
body: null | Record<string, any> | string
|
||||
status: number
|
||||
message: string,
|
||||
code: number,
|
||||
options: {
|
||||
headers?: IncomingHttpHeaders | string[] | null,
|
||||
body?: null | Record<string, any> | string
|
||||
}
|
||||
)
|
||||
name: 'ResponseError'
|
||||
code: 'UND_ERR_RESPONSE'
|
||||
statusCode: number
|
||||
headers: IncomingHttpHeaders | string[] | null;
|
||||
body: null | Record<string, any> | string
|
||||
headers: IncomingHttpHeaders | string[] | null
|
||||
}
|
||||
|
||||
/** Passed an invalid argument. */
|
||||
export class InvalidArgumentError extends UndiciError {
|
||||
name: 'InvalidArgumentError';
|
||||
code: 'UND_ERR_INVALID_ARG';
|
||||
name: 'InvalidArgumentError'
|
||||
code: 'UND_ERR_INVALID_ARG'
|
||||
}
|
||||
|
||||
/** Returned an invalid value. */
|
||||
export class InvalidReturnValueError extends UndiciError {
|
||||
name: 'InvalidReturnValueError';
|
||||
code: 'UND_ERR_INVALID_RETURN_VALUE';
|
||||
name: 'InvalidReturnValueError'
|
||||
code: 'UND_ERR_INVALID_RETURN_VALUE'
|
||||
}
|
||||
|
||||
/** The request has been aborted by the user. */
|
||||
export class RequestAbortedError extends UndiciError {
|
||||
name: 'AbortError';
|
||||
code: 'UND_ERR_ABORTED';
|
||||
name: 'AbortError'
|
||||
code: 'UND_ERR_ABORTED'
|
||||
}
|
||||
|
||||
/** Expected error with reason. */
|
||||
export class InformationalError extends UndiciError {
|
||||
name: 'InformationalError';
|
||||
code: 'UND_ERR_INFO';
|
||||
name: 'InformationalError'
|
||||
code: 'UND_ERR_INFO'
|
||||
}
|
||||
|
||||
/** Request body length does not match content-length header. */
|
||||
export class RequestContentLengthMismatchError extends UndiciError {
|
||||
name: 'RequestContentLengthMismatchError';
|
||||
code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH';
|
||||
name: 'RequestContentLengthMismatchError'
|
||||
code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
|
||||
}
|
||||
|
||||
/** Response body length does not match content-length header. */
|
||||
export class ResponseContentLengthMismatchError extends UndiciError {
|
||||
name: 'ResponseContentLengthMismatchError';
|
||||
code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH';
|
||||
name: 'ResponseContentLengthMismatchError'
|
||||
code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
|
||||
}
|
||||
|
||||
/** Trying to use a destroyed client. */
|
||||
export class ClientDestroyedError extends UndiciError {
|
||||
name: 'ClientDestroyedError';
|
||||
code: 'UND_ERR_DESTROYED';
|
||||
name: 'ClientDestroyedError'
|
||||
code: 'UND_ERR_DESTROYED'
|
||||
}
|
||||
|
||||
/** Trying to use a closed client. */
|
||||
export class ClientClosedError extends UndiciError {
|
||||
name: 'ClientClosedError';
|
||||
code: 'UND_ERR_CLOSED';
|
||||
name: 'ClientClosedError'
|
||||
code: 'UND_ERR_CLOSED'
|
||||
}
|
||||
|
||||
/** There is an error with the socket. */
|
||||
export class SocketError extends UndiciError {
|
||||
name: 'SocketError';
|
||||
code: 'UND_ERR_SOCKET';
|
||||
name: 'SocketError'
|
||||
code: 'UND_ERR_SOCKET'
|
||||
socket: Client.SocketInfo | null
|
||||
}
|
||||
|
||||
/** Encountered unsupported functionality. */
|
||||
export class NotSupportedError extends UndiciError {
|
||||
name: 'NotSupportedError';
|
||||
code: 'UND_ERR_NOT_SUPPORTED';
|
||||
name: 'NotSupportedError'
|
||||
code: 'UND_ERR_NOT_SUPPORTED'
|
||||
}
|
||||
|
||||
/** No upstream has been added to the BalancedPool. */
|
||||
export class BalancedPoolMissingUpstreamError extends UndiciError {
|
||||
name: 'MissingUpstreamError';
|
||||
code: 'UND_ERR_BPL_MISSING_UPSTREAM';
|
||||
name: 'MissingUpstreamError'
|
||||
code: 'UND_ERR_BPL_MISSING_UPSTREAM'
|
||||
}
|
||||
|
||||
export class HTTPParserError extends UndiciError {
|
||||
name: 'HTTPParserError';
|
||||
code: string;
|
||||
name: 'HTTPParserError'
|
||||
code: string
|
||||
}
|
||||
|
||||
/** The response exceed the length allowed. */
|
||||
export class ResponseExceededMaxSizeError extends UndiciError {
|
||||
name: 'ResponseExceededMaxSizeError';
|
||||
code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE';
|
||||
name: 'ResponseExceededMaxSizeError'
|
||||
code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
|
||||
}
|
||||
|
||||
export class RequestRetryError extends UndiciError {
|
||||
constructor (
|
||||
message: string,
|
||||
statusCode: number,
|
||||
headers?: IncomingHttpHeaders | string[] | null,
|
||||
body?: null | Record<string, any> | string
|
||||
)
|
||||
name: 'RequestRetryError'
|
||||
code: 'UND_ERR_REQ_RETRY'
|
||||
statusCode: number
|
||||
data: {
|
||||
count: number;
|
||||
}
|
||||
|
||||
headers: Record<string, string | string[]>
|
||||
}
|
||||
|
||||
export class SecureProxyConnectionError extends UndiciError {
|
||||
constructor (
|
||||
cause?: Error,
|
||||
message?: string,
|
||||
options?: Record<any, any>
|
||||
)
|
||||
name: 'SecureProxyConnectionError'
|
||||
code: 'UND_ERR_PRX_TLS'
|
||||
}
|
||||
|
||||
class MaxOriginsReachedError extends UndiciError {
|
||||
name: 'MaxOriginsReachedError'
|
||||
code: 'UND_ERR_MAX_ORIGINS_REACHED'
|
||||
}
|
||||
}
|
||||
|
||||
78
backend/node_modules/undici-types/fetch.d.ts
generated
vendored
78
backend/node_modules/undici-types/fetch.d.ts
generated
vendored
@@ -6,7 +6,7 @@ import { Blob } from 'buffer'
|
||||
import { URL, URLSearchParams } from 'url'
|
||||
import { ReadableStream } from 'stream/web'
|
||||
import { FormData } from './formdata'
|
||||
|
||||
import { HeaderRecord } from './header'
|
||||
import Dispatcher from './dispatcher'
|
||||
|
||||
export type RequestInfo = string | URL | Request
|
||||
@@ -27,12 +27,30 @@ export type BodyInit =
|
||||
| null
|
||||
| string
|
||||
|
||||
export interface BodyMixin {
|
||||
export class BodyMixin {
|
||||
readonly body: ReadableStream | null
|
||||
readonly bodyUsed: boolean
|
||||
|
||||
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
||||
readonly blob: () => Promise<Blob>
|
||||
readonly bytes: () => Promise<Uint8Array>
|
||||
/**
|
||||
* @deprecated This method is not recommended for parsing multipart/form-data bodies in server environments.
|
||||
* It is recommended to use a library such as [@fastify/busboy](https://www.npmjs.com/package/@fastify/busboy) as follows:
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* import { Busboy } from '@fastify/busboy'
|
||||
* import { Readable } from 'node:stream'
|
||||
*
|
||||
* const response = await fetch('...')
|
||||
* const busboy = new Busboy({ headers: { 'content-type': response.headers.get('content-type') } })
|
||||
*
|
||||
* // handle events emitted from `busboy`
|
||||
*
|
||||
* Readable.fromWeb(response.body).pipe(busboy)
|
||||
* ```
|
||||
*/
|
||||
readonly formData: () => Promise<FormData>
|
||||
readonly json: () => Promise<unknown>
|
||||
readonly text: () => Promise<string>
|
||||
@@ -50,7 +68,7 @@ export interface SpecIterable<T> {
|
||||
[Symbol.iterator](): SpecIterator<T>;
|
||||
}
|
||||
|
||||
export type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers
|
||||
export type HeadersInit = [string, string][] | HeaderRecord | Headers
|
||||
|
||||
export declare class Headers implements SpecIterable<[string, string]> {
|
||||
constructor (init?: HeadersInit)
|
||||
@@ -68,7 +86,7 @@ export declare class Headers implements SpecIterable<[string, string]> {
|
||||
readonly keys: () => SpecIterableIterator<string>
|
||||
readonly values: () => SpecIterableIterator<string>
|
||||
readonly entries: () => SpecIterableIterator<[string, string]>
|
||||
readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
|
||||
readonly [Symbol.iterator]: () => SpecIterableIterator<[string, string]>
|
||||
}
|
||||
|
||||
export type RequestCache =
|
||||
@@ -102,20 +120,21 @@ type RequestDestination =
|
||||
| 'xslt'
|
||||
|
||||
export interface RequestInit {
|
||||
method?: string
|
||||
keepalive?: boolean
|
||||
headers?: HeadersInit
|
||||
body?: BodyInit
|
||||
redirect?: RequestRedirect
|
||||
integrity?: string
|
||||
signal?: AbortSignal
|
||||
body?: BodyInit | null
|
||||
cache?: RequestCache
|
||||
credentials?: RequestCredentials
|
||||
mode?: RequestMode
|
||||
referrer?: string
|
||||
referrerPolicy?: ReferrerPolicy
|
||||
window?: null
|
||||
dispatcher?: Dispatcher
|
||||
duplex?: RequestDuplex
|
||||
headers?: HeadersInit
|
||||
integrity?: string
|
||||
keepalive?: boolean
|
||||
method?: string
|
||||
mode?: RequestMode
|
||||
redirect?: RequestRedirect
|
||||
referrer?: string
|
||||
referrerPolicy?: ReferrerPolicy
|
||||
signal?: AbortSignal | null
|
||||
window?: null
|
||||
}
|
||||
|
||||
export type ReferrerPolicy =
|
||||
@@ -127,7 +146,7 @@ export type ReferrerPolicy =
|
||||
| 'same-origin'
|
||||
| 'strict-origin'
|
||||
| 'strict-origin-when-cross-origin'
|
||||
| 'unsafe-url';
|
||||
| 'unsafe-url'
|
||||
|
||||
export type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin'
|
||||
|
||||
@@ -135,7 +154,7 @@ export type RequestRedirect = 'error' | 'follow' | 'manual'
|
||||
|
||||
export type RequestDuplex = 'half'
|
||||
|
||||
export declare class Request implements BodyMixin {
|
||||
export declare class Request extends BodyMixin {
|
||||
constructor (input: RequestInfo, init?: RequestInit)
|
||||
|
||||
readonly cache: RequestCache
|
||||
@@ -146,22 +165,14 @@ export declare class Request implements BodyMixin {
|
||||
readonly method: string
|
||||
readonly mode: RequestMode
|
||||
readonly redirect: RequestRedirect
|
||||
readonly referrerPolicy: string
|
||||
readonly referrer: string
|
||||
readonly referrerPolicy: ReferrerPolicy
|
||||
readonly url: string
|
||||
|
||||
readonly keepalive: boolean
|
||||
readonly signal: AbortSignal
|
||||
readonly duplex: RequestDuplex
|
||||
|
||||
readonly body: ReadableStream | null
|
||||
readonly bodyUsed: boolean
|
||||
|
||||
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
||||
readonly blob: () => Promise<Blob>
|
||||
readonly formData: () => Promise<FormData>
|
||||
readonly json: () => Promise<unknown>
|
||||
readonly text: () => Promise<string>
|
||||
|
||||
readonly clone: () => Request
|
||||
}
|
||||
|
||||
@@ -181,7 +192,7 @@ export type ResponseType =
|
||||
|
||||
export type ResponseRedirectStatus = 301 | 302 | 303 | 307 | 308
|
||||
|
||||
export declare class Response implements BodyMixin {
|
||||
export declare class Response extends BodyMixin {
|
||||
constructor (body?: BodyInit, init?: ResponseInit)
|
||||
|
||||
readonly headers: Headers
|
||||
@@ -192,18 +203,9 @@ export declare class Response implements BodyMixin {
|
||||
readonly url: string
|
||||
readonly redirected: boolean
|
||||
|
||||
readonly body: ReadableStream | null
|
||||
readonly bodyUsed: boolean
|
||||
|
||||
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
||||
readonly blob: () => Promise<Blob>
|
||||
readonly formData: () => Promise<FormData>
|
||||
readonly json: () => Promise<unknown>
|
||||
readonly text: () => Promise<string>
|
||||
|
||||
readonly clone: () => Response
|
||||
|
||||
static error (): Response
|
||||
static json(data: any, init?: ResponseInit): Response
|
||||
static json (data: any, init?: ResponseInit): Response
|
||||
static redirect (url: string | URL, status: ResponseRedirectStatus): Response
|
||||
}
|
||||
|
||||
39
backend/node_modules/undici-types/file.d.ts
generated
vendored
39
backend/node_modules/undici-types/file.d.ts
generated
vendored
@@ -1,39 +0,0 @@
|
||||
// Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/File.ts (MIT)
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Blob } from 'buffer'
|
||||
|
||||
export interface BlobPropertyBag {
|
||||
type?: string
|
||||
endings?: 'native' | 'transparent'
|
||||
}
|
||||
|
||||
export interface FilePropertyBag extends BlobPropertyBag {
|
||||
/**
|
||||
* The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
|
||||
*/
|
||||
lastModified?: number
|
||||
}
|
||||
|
||||
export declare class File extends Blob {
|
||||
/**
|
||||
* Creates a new File instance.
|
||||
*
|
||||
* @param fileBits An `Array` strings, or [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), [`ArrayBufferView`](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView), [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) objects, or a mix of any of such objects, that will be put inside the [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File).
|
||||
* @param fileName The name of the file.
|
||||
* @param options An options object containing optional attributes for the file.
|
||||
*/
|
||||
constructor(fileBits: ReadonlyArray<string | NodeJS.ArrayBufferView | Blob>, fileName: string, options?: FilePropertyBag)
|
||||
|
||||
/**
|
||||
* Name of the file referenced by the File object.
|
||||
*/
|
||||
readonly name: string
|
||||
|
||||
/**
|
||||
* The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
|
||||
*/
|
||||
readonly lastModified: number
|
||||
|
||||
readonly [Symbol.toStringTag]: string
|
||||
}
|
||||
54
backend/node_modules/undici-types/filereader.d.ts
generated
vendored
54
backend/node_modules/undici-types/filereader.d.ts
generated
vendored
@@ -1,54 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Blob } from 'buffer'
|
||||
import { DOMException, Event, EventInit, EventTarget } from './patch'
|
||||
|
||||
export declare class FileReader {
|
||||
__proto__: EventTarget & FileReader
|
||||
|
||||
constructor ()
|
||||
|
||||
readAsArrayBuffer (blob: Blob): void
|
||||
readAsBinaryString (blob: Blob): void
|
||||
readAsText (blob: Blob, encoding?: string): void
|
||||
readAsDataURL (blob: Blob): void
|
||||
|
||||
abort (): void
|
||||
|
||||
static readonly EMPTY = 0
|
||||
static readonly LOADING = 1
|
||||
static readonly DONE = 2
|
||||
|
||||
readonly EMPTY = 0
|
||||
readonly LOADING = 1
|
||||
readonly DONE = 2
|
||||
|
||||
readonly readyState: number
|
||||
|
||||
readonly result: string | ArrayBuffer | null
|
||||
|
||||
readonly error: DOMException | null
|
||||
|
||||
onloadstart: null | ((this: FileReader, event: ProgressEvent) => void)
|
||||
onprogress: null | ((this: FileReader, event: ProgressEvent) => void)
|
||||
onload: null | ((this: FileReader, event: ProgressEvent) => void)
|
||||
onabort: null | ((this: FileReader, event: ProgressEvent) => void)
|
||||
onerror: null | ((this: FileReader, event: ProgressEvent) => void)
|
||||
onloadend: null | ((this: FileReader, event: ProgressEvent) => void)
|
||||
}
|
||||
|
||||
export interface ProgressEventInit extends EventInit {
|
||||
lengthComputable?: boolean
|
||||
loaded?: number
|
||||
total?: number
|
||||
}
|
||||
|
||||
export declare class ProgressEvent {
|
||||
__proto__: Event & ProgressEvent
|
||||
|
||||
constructor (type: string, eventInitDict?: ProgressEventInit)
|
||||
|
||||
readonly lengthComputable: boolean
|
||||
readonly loaded: number
|
||||
readonly total: number
|
||||
}
|
||||
16
backend/node_modules/undici-types/formdata.d.ts
generated
vendored
16
backend/node_modules/undici-types/formdata.d.ts
generated
vendored
@@ -1,8 +1,8 @@
|
||||
// Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/FormData.ts (MIT)
|
||||
/// <reference types="node" />
|
||||
|
||||
import { File } from './file'
|
||||
import { SpecIterator, SpecIterableIterator } from './fetch'
|
||||
import { File } from 'buffer'
|
||||
import { SpecIterableIterator } from './fetch'
|
||||
|
||||
/**
|
||||
* A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
|
||||
@@ -24,7 +24,7 @@ export declare class FormData {
|
||||
or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string.
|
||||
* @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
|
||||
*/
|
||||
append(name: string, value: unknown, fileName?: string): void
|
||||
append (name: string, value: unknown, fileName?: string): void
|
||||
|
||||
/**
|
||||
* Set a new value for an existing key inside FormData,
|
||||
@@ -36,7 +36,7 @@ export declare class FormData {
|
||||
* @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
|
||||
*
|
||||
*/
|
||||
set(name: string, value: unknown, fileName?: string): void
|
||||
set (name: string, value: unknown, fileName?: string): void
|
||||
|
||||
/**
|
||||
* Returns the first value associated with a given key from within a `FormData` object.
|
||||
@@ -46,7 +46,7 @@ export declare class FormData {
|
||||
*
|
||||
* @returns A `FormDataEntryValue` containing the value. If the key doesn't exist, the method returns null.
|
||||
*/
|
||||
get(name: string): FormDataEntryValue | null
|
||||
get (name: string): FormDataEntryValue | null
|
||||
|
||||
/**
|
||||
* Returns all the values associated with a given key from within a `FormData` object.
|
||||
@@ -55,7 +55,7 @@ export declare class FormData {
|
||||
*
|
||||
* @returns An array of `FormDataEntryValue` whose key matches the value passed in the `name` parameter. If the key doesn't exist, the method returns an empty list.
|
||||
*/
|
||||
getAll(name: string): FormDataEntryValue[]
|
||||
getAll (name: string): FormDataEntryValue[]
|
||||
|
||||
/**
|
||||
* Returns a boolean stating whether a `FormData` object contains a certain key.
|
||||
@@ -64,14 +64,14 @@ export declare class FormData {
|
||||
*
|
||||
* @return A boolean value.
|
||||
*/
|
||||
has(name: string): boolean
|
||||
has (name: string): boolean
|
||||
|
||||
/**
|
||||
* Deletes a key and its value(s) from a `FormData` object.
|
||||
*
|
||||
* @param name The name of the key you want to delete.
|
||||
*/
|
||||
delete(name: string): void
|
||||
delete (name: string): void
|
||||
|
||||
/**
|
||||
* Executes given callback function for each field of the FormData instance
|
||||
|
||||
8
backend/node_modules/undici-types/global-dispatcher.d.ts
generated
vendored
8
backend/node_modules/undici-types/global-dispatcher.d.ts
generated
vendored
@@ -1,9 +1,9 @@
|
||||
import Dispatcher from "./dispatcher";
|
||||
import Dispatcher from './dispatcher'
|
||||
|
||||
declare function setGlobalDispatcher<DispatcherImplementation extends Dispatcher> (dispatcher: DispatcherImplementation): void
|
||||
declare function getGlobalDispatcher (): Dispatcher
|
||||
|
||||
export {
|
||||
getGlobalDispatcher,
|
||||
setGlobalDispatcher
|
||||
}
|
||||
|
||||
declare function setGlobalDispatcher<DispatcherImplementation extends Dispatcher>(dispatcher: DispatcherImplementation): void;
|
||||
declare function getGlobalDispatcher(): Dispatcher;
|
||||
|
||||
10
backend/node_modules/undici-types/global-origin.d.ts
generated
vendored
10
backend/node_modules/undici-types/global-origin.d.ts
generated
vendored
@@ -1,7 +1,7 @@
|
||||
declare function setGlobalOrigin (origin: string | URL | undefined): void
|
||||
declare function getGlobalOrigin (): URL | undefined
|
||||
|
||||
export {
|
||||
setGlobalOrigin,
|
||||
getGlobalOrigin
|
||||
setGlobalOrigin,
|
||||
getGlobalOrigin
|
||||
}
|
||||
|
||||
declare function setGlobalOrigin(origin: string | URL | undefined): void;
|
||||
declare function getGlobalOrigin(): URL | undefined;
|
||||
16
backend/node_modules/undici-types/handlers.d.ts
generated
vendored
16
backend/node_modules/undici-types/handlers.d.ts
generated
vendored
@@ -1,9 +1,15 @@
|
||||
import Dispatcher from "./dispatcher";
|
||||
import Dispatcher from './dispatcher'
|
||||
|
||||
export declare class RedirectHandler implements Dispatcher.DispatchHandlers{
|
||||
constructor (dispatch: Dispatcher, maxRedirections: number, opts: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandlers)
|
||||
export declare class RedirectHandler implements Dispatcher.DispatchHandler {
|
||||
constructor (
|
||||
dispatch: Dispatcher.Dispatch,
|
||||
maxRedirections: number,
|
||||
opts: Dispatcher.DispatchOptions,
|
||||
handler: Dispatcher.DispatchHandler,
|
||||
redirectionLimitReached: boolean
|
||||
)
|
||||
}
|
||||
|
||||
export declare class DecoratorHandler implements Dispatcher.DispatchHandlers{
|
||||
constructor (handler: Dispatcher.DispatchHandlers)
|
||||
export declare class DecoratorHandler implements Dispatcher.DispatchHandler {
|
||||
constructor (handler: Dispatcher.DispatchHandler)
|
||||
}
|
||||
|
||||
158
backend/node_modules/undici-types/header.d.ts
generated
vendored
158
backend/node_modules/undici-types/header.d.ts
generated
vendored
@@ -1,4 +1,160 @@
|
||||
import { Autocomplete } from './utility'
|
||||
|
||||
/**
|
||||
* The header type declaration of `undici`.
|
||||
*/
|
||||
export type IncomingHttpHeaders = Record<string, string | string[] | undefined>;
|
||||
export type IncomingHttpHeaders = Record<string, string | string[] | undefined>
|
||||
|
||||
type HeaderNames = Autocomplete<
|
||||
| 'Accept'
|
||||
| 'Accept-CH'
|
||||
| 'Accept-Charset'
|
||||
| 'Accept-Encoding'
|
||||
| 'Accept-Language'
|
||||
| 'Accept-Patch'
|
||||
| 'Accept-Post'
|
||||
| 'Accept-Ranges'
|
||||
| 'Access-Control-Allow-Credentials'
|
||||
| 'Access-Control-Allow-Headers'
|
||||
| 'Access-Control-Allow-Methods'
|
||||
| 'Access-Control-Allow-Origin'
|
||||
| 'Access-Control-Expose-Headers'
|
||||
| 'Access-Control-Max-Age'
|
||||
| 'Access-Control-Request-Headers'
|
||||
| 'Access-Control-Request-Method'
|
||||
| 'Age'
|
||||
| 'Allow'
|
||||
| 'Alt-Svc'
|
||||
| 'Alt-Used'
|
||||
| 'Authorization'
|
||||
| 'Cache-Control'
|
||||
| 'Clear-Site-Data'
|
||||
| 'Connection'
|
||||
| 'Content-Disposition'
|
||||
| 'Content-Encoding'
|
||||
| 'Content-Language'
|
||||
| 'Content-Length'
|
||||
| 'Content-Location'
|
||||
| 'Content-Range'
|
||||
| 'Content-Security-Policy'
|
||||
| 'Content-Security-Policy-Report-Only'
|
||||
| 'Content-Type'
|
||||
| 'Cookie'
|
||||
| 'Cross-Origin-Embedder-Policy'
|
||||
| 'Cross-Origin-Opener-Policy'
|
||||
| 'Cross-Origin-Resource-Policy'
|
||||
| 'Date'
|
||||
| 'Device-Memory'
|
||||
| 'ETag'
|
||||
| 'Expect'
|
||||
| 'Expect-CT'
|
||||
| 'Expires'
|
||||
| 'Forwarded'
|
||||
| 'From'
|
||||
| 'Host'
|
||||
| 'If-Match'
|
||||
| 'If-Modified-Since'
|
||||
| 'If-None-Match'
|
||||
| 'If-Range'
|
||||
| 'If-Unmodified-Since'
|
||||
| 'Keep-Alive'
|
||||
| 'Last-Modified'
|
||||
| 'Link'
|
||||
| 'Location'
|
||||
| 'Max-Forwards'
|
||||
| 'Origin'
|
||||
| 'Permissions-Policy'
|
||||
| 'Priority'
|
||||
| 'Proxy-Authenticate'
|
||||
| 'Proxy-Authorization'
|
||||
| 'Range'
|
||||
| 'Referer'
|
||||
| 'Referrer-Policy'
|
||||
| 'Retry-After'
|
||||
| 'Sec-Fetch-Dest'
|
||||
| 'Sec-Fetch-Mode'
|
||||
| 'Sec-Fetch-Site'
|
||||
| 'Sec-Fetch-User'
|
||||
| 'Sec-Purpose'
|
||||
| 'Sec-WebSocket-Accept'
|
||||
| 'Server'
|
||||
| 'Server-Timing'
|
||||
| 'Service-Worker-Navigation-Preload'
|
||||
| 'Set-Cookie'
|
||||
| 'SourceMap'
|
||||
| 'Strict-Transport-Security'
|
||||
| 'TE'
|
||||
| 'Timing-Allow-Origin'
|
||||
| 'Trailer'
|
||||
| 'Transfer-Encoding'
|
||||
| 'Upgrade'
|
||||
| 'Upgrade-Insecure-Requests'
|
||||
| 'User-Agent'
|
||||
| 'Vary'
|
||||
| 'Via'
|
||||
| 'WWW-Authenticate'
|
||||
| 'X-Content-Type-Options'
|
||||
| 'X-Frame-Options'
|
||||
>
|
||||
|
||||
type IANARegisteredMimeType = Autocomplete<
|
||||
| 'audio/aac'
|
||||
| 'video/x-msvideo'
|
||||
| 'image/avif'
|
||||
| 'video/av1'
|
||||
| 'application/octet-stream'
|
||||
| 'image/bmp'
|
||||
| 'text/css'
|
||||
| 'text/csv'
|
||||
| 'application/vnd.ms-fontobject'
|
||||
| 'application/epub+zip'
|
||||
| 'image/gif'
|
||||
| 'application/gzip'
|
||||
| 'text/html'
|
||||
| 'image/x-icon'
|
||||
| 'text/calendar'
|
||||
| 'image/jpeg'
|
||||
| 'text/javascript'
|
||||
| 'application/json'
|
||||
| 'application/ld+json'
|
||||
| 'audio/x-midi'
|
||||
| 'audio/mpeg'
|
||||
| 'video/mp4'
|
||||
| 'video/mpeg'
|
||||
| 'audio/ogg'
|
||||
| 'video/ogg'
|
||||
| 'application/ogg'
|
||||
| 'audio/opus'
|
||||
| 'font/otf'
|
||||
| 'application/pdf'
|
||||
| 'image/png'
|
||||
| 'application/rtf'
|
||||
| 'image/svg+xml'
|
||||
| 'image/tiff'
|
||||
| 'video/mp2t'
|
||||
| 'font/ttf'
|
||||
| 'text/plain'
|
||||
| 'application/wasm'
|
||||
| 'video/webm'
|
||||
| 'audio/webm'
|
||||
| 'image/webp'
|
||||
| 'font/woff'
|
||||
| 'font/woff2'
|
||||
| 'application/xhtml+xml'
|
||||
| 'application/xml'
|
||||
| 'application/zip'
|
||||
| 'video/3gpp'
|
||||
| 'video/3gpp2'
|
||||
| 'model/gltf+json'
|
||||
| 'model/gltf-binary'
|
||||
>
|
||||
|
||||
type KnownHeaderValues = {
|
||||
'content-type': IANARegisteredMimeType
|
||||
}
|
||||
|
||||
export type HeaderRecord = {
|
||||
[K in HeaderNames | Lowercase<HeaderNames>]?: Lowercase<K> extends keyof KnownHeaderValues
|
||||
? KnownHeaderValues[Lowercase<K>]
|
||||
: string
|
||||
}
|
||||
|
||||
103
backend/node_modules/undici-types/index.d.ts
generated
vendored
103
backend/node_modules/undici-types/index.d.ts
generated
vendored
@@ -1,25 +1,32 @@
|
||||
import Dispatcher from'./dispatcher'
|
||||
import Dispatcher from './dispatcher'
|
||||
import { setGlobalDispatcher, getGlobalDispatcher } from './global-dispatcher'
|
||||
import { setGlobalOrigin, getGlobalOrigin } from './global-origin'
|
||||
import Pool from'./pool'
|
||||
import Pool from './pool'
|
||||
import { RedirectHandler, DecoratorHandler } from './handlers'
|
||||
|
||||
import BalancedPool from './balanced-pool'
|
||||
import Client from'./client'
|
||||
import buildConnector from'./connector'
|
||||
import errors from'./errors'
|
||||
import Agent from'./agent'
|
||||
import MockClient from'./mock-client'
|
||||
import MockPool from'./mock-pool'
|
||||
import MockAgent from'./mock-agent'
|
||||
import mockErrors from'./mock-errors'
|
||||
import ProxyAgent from'./proxy-agent'
|
||||
import Client from './client'
|
||||
import H2CClient from './h2c-client'
|
||||
import buildConnector from './connector'
|
||||
import errors from './errors'
|
||||
import Agent from './agent'
|
||||
import MockClient from './mock-client'
|
||||
import MockPool from './mock-pool'
|
||||
import MockAgent from './mock-agent'
|
||||
import { SnapshotAgent } from './snapshot-agent'
|
||||
import { MockCallHistory, MockCallHistoryLog } from './mock-call-history'
|
||||
import mockErrors from './mock-errors'
|
||||
import ProxyAgent from './proxy-agent'
|
||||
import EnvHttpProxyAgent from './env-http-proxy-agent'
|
||||
import RetryHandler from './retry-handler'
|
||||
import RetryAgent from './retry-agent'
|
||||
import { request, pipeline, stream, connect, upgrade } from './api'
|
||||
import interceptors from './interceptors'
|
||||
|
||||
export * from './util'
|
||||
export * from './cookies'
|
||||
export * from './eventsource'
|
||||
export * from './fetch'
|
||||
export * from './file'
|
||||
export * from './filereader'
|
||||
export * from './formdata'
|
||||
export * from './diagnostics-channel'
|
||||
export * from './websocket'
|
||||
@@ -27,37 +34,47 @@ export * from './content-type'
|
||||
export * from './cache'
|
||||
export { Interceptable } from './mock-interceptor'
|
||||
|
||||
export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, RedirectHandler, DecoratorHandler }
|
||||
declare function globalThisInstall (): void
|
||||
|
||||
export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient, globalThisInstall as install }
|
||||
export default Undici
|
||||
|
||||
declare namespace Undici {
|
||||
var Dispatcher: typeof import('./dispatcher').default
|
||||
var Pool: typeof import('./pool').default;
|
||||
var RedirectHandler: typeof import ('./handlers').RedirectHandler
|
||||
var DecoratorHandler: typeof import ('./handlers').DecoratorHandler
|
||||
var createRedirectInterceptor: typeof import ('./interceptors').createRedirectInterceptor
|
||||
var BalancedPool: typeof import('./balanced-pool').default;
|
||||
var Client: typeof import('./client').default;
|
||||
var buildConnector: typeof import('./connector').default;
|
||||
var errors: typeof import('./errors').default;
|
||||
var Agent: typeof import('./agent').default;
|
||||
var setGlobalDispatcher: typeof import('./global-dispatcher').setGlobalDispatcher;
|
||||
var getGlobalDispatcher: typeof import('./global-dispatcher').getGlobalDispatcher;
|
||||
var request: typeof import('./api').request;
|
||||
var stream: typeof import('./api').stream;
|
||||
var pipeline: typeof import('./api').pipeline;
|
||||
var connect: typeof import('./api').connect;
|
||||
var upgrade: typeof import('./api').upgrade;
|
||||
var MockClient: typeof import('./mock-client').default;
|
||||
var MockPool: typeof import('./mock-pool').default;
|
||||
var MockAgent: typeof import('./mock-agent').default;
|
||||
var mockErrors: typeof import('./mock-errors').default;
|
||||
var fetch: typeof import('./fetch').fetch;
|
||||
var Headers: typeof import('./fetch').Headers;
|
||||
var Response: typeof import('./fetch').Response;
|
||||
var Request: typeof import('./fetch').Request;
|
||||
var FormData: typeof import('./formdata').FormData;
|
||||
var File: typeof import('./file').File;
|
||||
var FileReader: typeof import('./filereader').FileReader;
|
||||
var caches: typeof import('./cache').caches;
|
||||
const Dispatcher: typeof import('./dispatcher').default
|
||||
const Pool: typeof import('./pool').default
|
||||
const RedirectHandler: typeof import ('./handlers').RedirectHandler
|
||||
const DecoratorHandler: typeof import ('./handlers').DecoratorHandler
|
||||
const RetryHandler: typeof import ('./retry-handler').default
|
||||
const BalancedPool: typeof import('./balanced-pool').default
|
||||
const Client: typeof import('./client').default
|
||||
const H2CClient: typeof import('./h2c-client').default
|
||||
const buildConnector: typeof import('./connector').default
|
||||
const errors: typeof import('./errors').default
|
||||
const Agent: typeof import('./agent').default
|
||||
const setGlobalDispatcher: typeof import('./global-dispatcher').setGlobalDispatcher
|
||||
const getGlobalDispatcher: typeof import('./global-dispatcher').getGlobalDispatcher
|
||||
const request: typeof import('./api').request
|
||||
const stream: typeof import('./api').stream
|
||||
const pipeline: typeof import('./api').pipeline
|
||||
const connect: typeof import('./api').connect
|
||||
const upgrade: typeof import('./api').upgrade
|
||||
const MockClient: typeof import('./mock-client').default
|
||||
const MockPool: typeof import('./mock-pool').default
|
||||
const MockAgent: typeof import('./mock-agent').default
|
||||
const SnapshotAgent: typeof import('./snapshot-agent').SnapshotAgent
|
||||
const MockCallHistory: typeof import('./mock-call-history').MockCallHistory
|
||||
const MockCallHistoryLog: typeof import('./mock-call-history').MockCallHistoryLog
|
||||
const mockErrors: typeof import('./mock-errors').default
|
||||
const fetch: typeof import('./fetch').fetch
|
||||
const Headers: typeof import('./fetch').Headers
|
||||
const Response: typeof import('./fetch').Response
|
||||
const Request: typeof import('./fetch').Request
|
||||
const FormData: typeof import('./formdata').FormData
|
||||
const caches: typeof import('./cache').caches
|
||||
const interceptors: typeof import('./interceptors').default
|
||||
const cacheStores: {
|
||||
MemoryCacheStore: typeof import('./cache-interceptor').default.MemoryCacheStore,
|
||||
SqliteCacheStore: typeof import('./cache-interceptor').default.SqliteCacheStore
|
||||
}
|
||||
const install: typeof globalThisInstall
|
||||
}
|
||||
|
||||
40
backend/node_modules/undici-types/interceptors.d.ts
generated
vendored
40
backend/node_modules/undici-types/interceptors.d.ts
generated
vendored
@@ -1,5 +1,39 @@
|
||||
import Dispatcher from "./dispatcher";
|
||||
import CacheHandler from './cache-interceptor'
|
||||
import Dispatcher from './dispatcher'
|
||||
import RetryHandler from './retry-handler'
|
||||
import { LookupOptions } from 'node:dns'
|
||||
|
||||
type RedirectInterceptorOpts = { maxRedirections?: number }
|
||||
export default Interceptors
|
||||
|
||||
export declare function createRedirectInterceptor (opts: RedirectInterceptorOpts): Dispatcher.DispatchInterceptor
|
||||
declare namespace Interceptors {
|
||||
export type DumpInterceptorOpts = { maxSize?: number }
|
||||
export type RetryInterceptorOpts = RetryHandler.RetryOptions
|
||||
export type RedirectInterceptorOpts = { maxRedirections?: number }
|
||||
export type DecompressInterceptorOpts = {
|
||||
skipErrorResponses?: boolean
|
||||
skipStatusCodes?: number[]
|
||||
}
|
||||
|
||||
export type ResponseErrorInterceptorOpts = { throwOnError: boolean }
|
||||
export type CacheInterceptorOpts = CacheHandler.CacheOptions
|
||||
|
||||
// DNS interceptor
|
||||
export type DNSInterceptorRecord = { address: string, ttl: number, family: 4 | 6 }
|
||||
export type DNSInterceptorOriginRecords = { 4: { ips: DNSInterceptorRecord[] } | null, 6: { ips: DNSInterceptorRecord[] } | null }
|
||||
export type DNSInterceptorOpts = {
|
||||
maxTTL?: number
|
||||
maxItems?: number
|
||||
lookup?: (hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, addresses: DNSInterceptorRecord[]) => void) => void
|
||||
pick?: (origin: URL, records: DNSInterceptorOriginRecords, affinity: 4 | 6) => DNSInterceptorRecord
|
||||
dualStack?: boolean
|
||||
affinity?: 4 | 6
|
||||
}
|
||||
|
||||
export function dump (opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
export function retry (opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
export function redirect (opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
export function decompress (opts?: DecompressInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
export function responseError (opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
export function cache (opts?: CacheInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
||||
}
|
||||
|
||||
54
backend/node_modules/undici-types/mock-agent.d.ts
generated
vendored
54
backend/node_modules/undici-types/mock-agent.d.ts
generated
vendored
@@ -1,7 +1,8 @@
|
||||
import Agent from './agent'
|
||||
import Dispatcher from './dispatcher'
|
||||
import { Interceptable, MockInterceptor } from './mock-interceptor'
|
||||
import MockDispatch = MockInterceptor.MockDispatch;
|
||||
import MockDispatch = MockInterceptor.MockDispatch
|
||||
import { MockCallHistory } from './mock-call-history'
|
||||
|
||||
export default MockAgent
|
||||
|
||||
@@ -11,30 +12,38 @@ interface PendingInterceptor extends MockDispatch {
|
||||
|
||||
/** A mocked Agent class that implements the Agent API. It allows one to intercept HTTP requests made through undici and return mocked responses instead. */
|
||||
declare class MockAgent<TMockAgentOptions extends MockAgent.Options = MockAgent.Options> extends Dispatcher {
|
||||
constructor(options?: MockAgent.Options)
|
||||
constructor (options?: TMockAgentOptions)
|
||||
/** Creates and retrieves mock Dispatcher instances which can then be used to intercept HTTP requests. If the number of connections on the mock agent is set to 1, a MockClient instance is returned. Otherwise a MockPool instance is returned. */
|
||||
get<TInterceptable extends Interceptable>(origin: string): TInterceptable;
|
||||
get<TInterceptable extends Interceptable>(origin: RegExp): TInterceptable;
|
||||
get<TInterceptable extends Interceptable>(origin: ((origin: string) => boolean)): TInterceptable;
|
||||
get<TInterceptable extends Interceptable>(origin: string): TInterceptable
|
||||
get<TInterceptable extends Interceptable>(origin: RegExp): TInterceptable
|
||||
get<TInterceptable extends Interceptable>(origin: ((origin: string) => boolean)): TInterceptable
|
||||
/** Dispatches a mocked request. */
|
||||
dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
|
||||
dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
|
||||
/** Closes the mock agent and waits for registered mock pools and clients to also close before resolving. */
|
||||
close(): Promise<void>;
|
||||
close (): Promise<void>
|
||||
/** Disables mocking in MockAgent. */
|
||||
deactivate(): void;
|
||||
deactivate (): void
|
||||
/** Enables mocking in a MockAgent instance. When instantiated, a MockAgent is automatically activated. Therefore, this method is only effective after `MockAgent.deactivate` has been called. */
|
||||
activate(): void;
|
||||
activate (): void
|
||||
/** Define host matchers so only matching requests that aren't intercepted by the mock dispatchers will be attempted. */
|
||||
enableNetConnect(): void;
|
||||
enableNetConnect(host: string): void;
|
||||
enableNetConnect(host: RegExp): void;
|
||||
enableNetConnect(host: ((host: string) => boolean)): void;
|
||||
enableNetConnect (): void
|
||||
enableNetConnect (host: string): void
|
||||
enableNetConnect (host: RegExp): void
|
||||
enableNetConnect (host: ((host: string) => boolean)): void
|
||||
/** Causes all requests to throw when requests are not matched in a MockAgent intercept. */
|
||||
disableNetConnect(): void;
|
||||
pendingInterceptors(): PendingInterceptor[];
|
||||
assertNoPendingInterceptors(options?: {
|
||||
disableNetConnect (): void
|
||||
/** get call history. returns the MockAgent call history or undefined if the option is not enabled. */
|
||||
getCallHistory (): MockCallHistory | undefined
|
||||
/** clear every call history. Any MockCallHistoryLog will be deleted on the MockCallHistory instance */
|
||||
clearCallHistory (): void
|
||||
/** Enable call history. Any subsequence calls will then be registered. */
|
||||
enableCallHistory (): this
|
||||
/** Disable call history. Any subsequence calls will then not be registered. */
|
||||
disableCallHistory (): this
|
||||
pendingInterceptors (): PendingInterceptor[]
|
||||
assertNoPendingInterceptors (options?: {
|
||||
pendingInterceptorsFormatter?: PendingInterceptorsFormatter;
|
||||
}): void;
|
||||
}): void
|
||||
}
|
||||
|
||||
interface PendingInterceptorsFormatter {
|
||||
@@ -45,6 +54,15 @@ declare namespace MockAgent {
|
||||
/** MockAgent options. */
|
||||
export interface Options extends Agent.Options {
|
||||
/** A custom agent to be encapsulated by the MockAgent. */
|
||||
agent?: Agent;
|
||||
agent?: Dispatcher;
|
||||
|
||||
/** Ignore trailing slashes in the path */
|
||||
ignoreTrailingSlash?: boolean;
|
||||
|
||||
/** Accept URLs with search parameters using non standard syntaxes. default false */
|
||||
acceptNonStandardSearchParameters?: boolean;
|
||||
|
||||
/** Enable call history. you can either call MockAgent.enableCallHistory(). default false */
|
||||
enableCallHistory?: boolean
|
||||
}
|
||||
}
|
||||
|
||||
10
backend/node_modules/undici-types/mock-client.d.ts
generated
vendored
10
backend/node_modules/undici-types/mock-client.d.ts
generated
vendored
@@ -7,13 +7,15 @@ export default MockClient
|
||||
|
||||
/** MockClient extends the Client API and allows one to mock requests. */
|
||||
declare class MockClient extends Client implements Interceptable {
|
||||
constructor(origin: string, options: MockClient.Options);
|
||||
constructor (origin: string, options: MockClient.Options)
|
||||
/** Intercepts any matching requests that use the same origin as this mock client. */
|
||||
intercept(options: MockInterceptor.Options): MockInterceptor;
|
||||
intercept (options: MockInterceptor.Options): MockInterceptor
|
||||
/** Dispatches a mocked request. */
|
||||
dispatch(options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandlers): boolean;
|
||||
dispatch (options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandler): boolean
|
||||
/** Closes the mock client and gracefully waits for enqueued requests to complete. */
|
||||
close(): Promise<void>;
|
||||
close (): Promise<void>
|
||||
/** Clean up all the prepared mocks. */
|
||||
cleanMocks (): void
|
||||
}
|
||||
|
||||
declare namespace MockClient {
|
||||
|
||||
6
backend/node_modules/undici-types/mock-errors.d.ts
generated
vendored
6
backend/node_modules/undici-types/mock-errors.d.ts
generated
vendored
@@ -5,8 +5,8 @@ export default MockErrors
|
||||
declare namespace MockErrors {
|
||||
/** The request does not match any registered mock dispatches. */
|
||||
export class MockNotMatchedError extends Errors.UndiciError {
|
||||
constructor(message?: string);
|
||||
name: 'MockNotMatchedError';
|
||||
code: 'UND_MOCK_ERR_MOCK_NOT_MATCHED';
|
||||
constructor (message?: string)
|
||||
name: 'MockNotMatchedError'
|
||||
code: 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
|
||||
}
|
||||
}
|
||||
|
||||
47
backend/node_modules/undici-types/mock-interceptor.d.ts
generated
vendored
47
backend/node_modules/undici-types/mock-interceptor.d.ts
generated
vendored
@@ -1,42 +1,36 @@
|
||||
import { IncomingHttpHeaders } from './header'
|
||||
import Dispatcher from './dispatcher';
|
||||
import Dispatcher from './dispatcher'
|
||||
import { BodyInit, Headers } from './fetch'
|
||||
|
||||
export {
|
||||
Interceptable,
|
||||
MockInterceptor,
|
||||
MockScope
|
||||
}
|
||||
|
||||
/** The scope associated with a mock dispatch. */
|
||||
declare class MockScope<TData extends object = object> {
|
||||
constructor(mockDispatch: MockInterceptor.MockDispatch<TData>);
|
||||
constructor (mockDispatch: MockInterceptor.MockDispatch<TData>)
|
||||
/** Delay a reply by a set amount of time in ms. */
|
||||
delay(waitInMs: number): MockScope<TData>;
|
||||
delay (waitInMs: number): MockScope<TData>
|
||||
/** Persist the defined mock data for the associated reply. It will return the defined mock data indefinitely. */
|
||||
persist(): MockScope<TData>;
|
||||
persist (): MockScope<TData>
|
||||
/** Define a reply for a set amount of matching requests. */
|
||||
times(repeatTimes: number): MockScope<TData>;
|
||||
times (repeatTimes: number): MockScope<TData>
|
||||
}
|
||||
|
||||
/** The interceptor for a Mock. */
|
||||
declare class MockInterceptor {
|
||||
constructor(options: MockInterceptor.Options, mockDispatches: MockInterceptor.MockDispatch[]);
|
||||
constructor (options: MockInterceptor.Options, mockDispatches: MockInterceptor.MockDispatch[])
|
||||
/** Mock an undici request with the defined reply. */
|
||||
reply<TData extends object = object>(replyOptionsCallback: MockInterceptor.MockReplyOptionsCallback<TData>): MockScope<TData>;
|
||||
reply<TData extends object = object>(replyOptionsCallback: MockInterceptor.MockReplyOptionsCallback<TData>): MockScope<TData>
|
||||
reply<TData extends object = object>(
|
||||
statusCode: number,
|
||||
data?: TData | Buffer | string | MockInterceptor.MockResponseDataHandler<TData>,
|
||||
responseOptions?: MockInterceptor.MockResponseOptions
|
||||
): MockScope<TData>;
|
||||
): MockScope<TData>
|
||||
/** Mock an undici request by throwing the defined reply error. */
|
||||
replyWithError<TError extends Error = Error>(error: TError): MockScope;
|
||||
replyWithError<TError extends Error = Error>(error: TError): MockScope
|
||||
/** Set default reply headers on the interceptor for subsequent mocked replies. */
|
||||
defaultReplyHeaders(headers: IncomingHttpHeaders): MockInterceptor;
|
||||
defaultReplyHeaders (headers: IncomingHttpHeaders): MockInterceptor
|
||||
/** Set default reply trailers on the interceptor for subsequent mocked replies. */
|
||||
defaultReplyTrailers(trailers: Record<string, string>): MockInterceptor;
|
||||
defaultReplyTrailers (trailers: Record<string, string>): MockInterceptor
|
||||
/** Set automatically calculated content-length header on subsequent mocked replies. */
|
||||
replyContentLength(): MockInterceptor;
|
||||
replyContentLength (): MockInterceptor
|
||||
}
|
||||
|
||||
declare namespace MockInterceptor {
|
||||
@@ -71,16 +65,15 @@ declare namespace MockInterceptor {
|
||||
|
||||
export interface MockResponseCallbackOptions {
|
||||
path: string;
|
||||
origin: string;
|
||||
method: string;
|
||||
body?: BodyInit | Dispatcher.DispatchOptions['body'];
|
||||
headers: Headers | Record<string, string>;
|
||||
maxRedirections: number;
|
||||
headers?: Headers | Record<string, string>;
|
||||
origin?: string;
|
||||
body?: BodyInit | Dispatcher.DispatchOptions['body'] | null;
|
||||
}
|
||||
|
||||
export type MockResponseDataHandler<TData extends object = object> = (
|
||||
opts: MockResponseCallbackOptions
|
||||
) => TData | Buffer | string;
|
||||
) => TData | Buffer | string
|
||||
|
||||
export type MockReplyOptionsCallback<TData extends object = object> = (
|
||||
opts: MockResponseCallbackOptions
|
||||
@@ -90,4 +83,12 @@ declare namespace MockInterceptor {
|
||||
interface Interceptable extends Dispatcher {
|
||||
/** Intercepts any matching requests that use the same origin as this mock client. */
|
||||
intercept(options: MockInterceptor.Options): MockInterceptor;
|
||||
/** Clean up all the prepared mocks. */
|
||||
cleanMocks (): void
|
||||
}
|
||||
|
||||
export {
|
||||
Interceptable,
|
||||
MockInterceptor,
|
||||
MockScope
|
||||
}
|
||||
|
||||
10
backend/node_modules/undici-types/mock-pool.d.ts
generated
vendored
10
backend/node_modules/undici-types/mock-pool.d.ts
generated
vendored
@@ -7,13 +7,15 @@ export default MockPool
|
||||
|
||||
/** MockPool extends the Pool API and allows one to mock requests. */
|
||||
declare class MockPool extends Pool implements Interceptable {
|
||||
constructor(origin: string, options: MockPool.Options);
|
||||
constructor (origin: string, options: MockPool.Options)
|
||||
/** Intercepts any matching requests that use the same origin as this mock pool. */
|
||||
intercept(options: MockInterceptor.Options): MockInterceptor;
|
||||
intercept (options: MockInterceptor.Options): MockInterceptor
|
||||
/** Dispatches a mocked request. */
|
||||
dispatch(options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandlers): boolean;
|
||||
dispatch (options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandler): boolean
|
||||
/** Closes the mock pool and gracefully waits for enqueued requests to complete. */
|
||||
close(): Promise<void>;
|
||||
close (): Promise<void>
|
||||
/** Clean up all the prepared mocks. */
|
||||
cleanMocks (): void
|
||||
}
|
||||
|
||||
declare namespace MockPool {
|
||||
|
||||
2
backend/node_modules/undici-types/package.json
generated
vendored
2
backend/node_modules/undici-types/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "undici-types",
|
||||
"version": "5.26.5",
|
||||
"version": "7.16.0",
|
||||
"description": "A stand-alone types package for Undici",
|
||||
"homepage": "https://undici.nodejs.org",
|
||||
"bugs": {
|
||||
|
||||
42
backend/node_modules/undici-types/patch.d.ts
generated
vendored
42
backend/node_modules/undici-types/patch.d.ts
generated
vendored
@@ -2,48 +2,6 @@
|
||||
|
||||
// See https://github.com/nodejs/undici/issues/1740
|
||||
|
||||
export type DOMException = typeof globalThis extends { DOMException: infer T }
|
||||
? T
|
||||
: any
|
||||
|
||||
export type EventTarget = typeof globalThis extends { EventTarget: infer T }
|
||||
? T
|
||||
: {
|
||||
addEventListener(
|
||||
type: string,
|
||||
listener: any,
|
||||
options?: any,
|
||||
): void
|
||||
dispatchEvent(event: Event): boolean
|
||||
removeEventListener(
|
||||
type: string,
|
||||
listener: any,
|
||||
options?: any | boolean,
|
||||
): void
|
||||
}
|
||||
|
||||
export type Event = typeof globalThis extends { Event: infer T }
|
||||
? T
|
||||
: {
|
||||
readonly bubbles: boolean
|
||||
cancelBubble: () => void
|
||||
readonly cancelable: boolean
|
||||
readonly composed: boolean
|
||||
composedPath(): [EventTarget?]
|
||||
readonly currentTarget: EventTarget | null
|
||||
readonly defaultPrevented: boolean
|
||||
readonly eventPhase: 0 | 2
|
||||
readonly isTrusted: boolean
|
||||
preventDefault(): void
|
||||
returnValue: boolean
|
||||
readonly srcElement: EventTarget | null
|
||||
stopImmediatePropagation(): void
|
||||
stopPropagation(): void
|
||||
readonly target: EventTarget | null
|
||||
readonly timeStamp: number
|
||||
readonly type: string
|
||||
}
|
||||
|
||||
export interface EventInit {
|
||||
bubbles?: boolean
|
||||
cancelable?: boolean
|
||||
|
||||
16
backend/node_modules/undici-types/pool-stats.d.ts
generated
vendored
16
backend/node_modules/undici-types/pool-stats.d.ts
generated
vendored
@@ -1,19 +1,19 @@
|
||||
import Pool from "./pool"
|
||||
import Pool from './pool'
|
||||
|
||||
export default PoolStats
|
||||
|
||||
declare class PoolStats {
|
||||
constructor(pool: Pool);
|
||||
constructor (pool: Pool)
|
||||
/** Number of open socket connections in this pool. */
|
||||
connected: number;
|
||||
connected: number
|
||||
/** Number of open socket connections in this pool that do not have an active request. */
|
||||
free: number;
|
||||
free: number
|
||||
/** Number of pending requests across all clients in this pool. */
|
||||
pending: number;
|
||||
pending: number
|
||||
/** Number of queued requests across all clients in this pool. */
|
||||
queued: number;
|
||||
queued: number
|
||||
/** Number of currently active requests across all clients in this pool. */
|
||||
running: number;
|
||||
running: number
|
||||
/** Number of active, pending, or queued requests across all clients in this pool. */
|
||||
size: number;
|
||||
size: number
|
||||
}
|
||||
|
||||
27
backend/node_modules/undici-types/pool.d.ts
generated
vendored
27
backend/node_modules/undici-types/pool.d.ts
generated
vendored
@@ -1,28 +1,41 @@
|
||||
import Client from './client'
|
||||
import TPoolStats from './pool-stats'
|
||||
import { URL } from 'url'
|
||||
import Dispatcher from "./dispatcher";
|
||||
import Dispatcher from './dispatcher'
|
||||
|
||||
export default Pool
|
||||
|
||||
type PoolConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
|
||||
|
||||
declare class Pool extends Dispatcher {
|
||||
constructor(url: string | URL, options?: Pool.Options)
|
||||
constructor (url: string | URL, options?: Pool.Options)
|
||||
/** `true` after `pool.close()` has been called. */
|
||||
closed: boolean;
|
||||
closed: boolean
|
||||
/** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
|
||||
destroyed: boolean;
|
||||
destroyed: boolean
|
||||
/** Aggregate stats for a Pool. */
|
||||
readonly stats: TPoolStats;
|
||||
readonly stats: TPoolStats
|
||||
|
||||
// Override dispatcher APIs.
|
||||
override connect (
|
||||
options: PoolConnectOptions
|
||||
): Promise<Dispatcher.ConnectData>
|
||||
override connect (
|
||||
options: PoolConnectOptions,
|
||||
callback: (err: Error | null, data: Dispatcher.ConnectData) => void
|
||||
): void
|
||||
}
|
||||
|
||||
declare namespace Pool {
|
||||
export type PoolStats = TPoolStats;
|
||||
export type PoolStats = TPoolStats
|
||||
export interface Options extends Client.Options {
|
||||
/** Default: `(origin, opts) => new Client(origin, opts)`. */
|
||||
factory?(origin: URL, opts: object): Dispatcher;
|
||||
/** The max number of clients to create. `null` if no limit. Default `null`. */
|
||||
connections?: number | null;
|
||||
/** The amount of time before a client is removed from the pool and closed. `null` if no time limit. Default `null` */
|
||||
clientTtl?: number | null;
|
||||
|
||||
interceptors?: { Pool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options["interceptors"]
|
||||
interceptors?: { Pool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options['interceptors']
|
||||
}
|
||||
}
|
||||
|
||||
11
backend/node_modules/undici-types/proxy-agent.d.ts
generated
vendored
11
backend/node_modules/undici-types/proxy-agent.d.ts
generated
vendored
@@ -1,17 +1,15 @@
|
||||
import Agent from './agent'
|
||||
import buildConnector from './connector';
|
||||
import Client from './client'
|
||||
import buildConnector from './connector'
|
||||
import Dispatcher from './dispatcher'
|
||||
import { IncomingHttpHeaders } from './header'
|
||||
import Pool from './pool'
|
||||
|
||||
export default ProxyAgent
|
||||
|
||||
declare class ProxyAgent extends Dispatcher {
|
||||
constructor(options: ProxyAgent.Options | string)
|
||||
constructor (options: ProxyAgent.Options | string)
|
||||
|
||||
dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
|
||||
close(): Promise<void>;
|
||||
dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
|
||||
close (): Promise<void>
|
||||
}
|
||||
|
||||
declare namespace ProxyAgent {
|
||||
@@ -26,5 +24,6 @@ declare namespace ProxyAgent {
|
||||
requestTls?: buildConnector.BuildOptions;
|
||||
proxyTls?: buildConnector.BuildOptions;
|
||||
clientFactory?(origin: URL, opts: object): Dispatcher;
|
||||
proxyTunnel?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
39
backend/node_modules/undici-types/readable.d.ts
generated
vendored
39
backend/node_modules/undici-types/readable.d.ts
generated
vendored
@@ -1,40 +1,47 @@
|
||||
import { Readable } from "stream";
|
||||
import { Readable } from 'stream'
|
||||
import { Blob } from 'buffer'
|
||||
|
||||
export default BodyReadable
|
||||
|
||||
declare class BodyReadable extends Readable {
|
||||
constructor(
|
||||
resume?: (this: Readable, size: number) => void | null,
|
||||
abort?: () => void | null,
|
||||
contentType?: string
|
||||
)
|
||||
constructor (opts: {
|
||||
resume: (this: Readable, size: number) => void | null;
|
||||
abort: () => void | null;
|
||||
contentType?: string;
|
||||
contentLength?: number;
|
||||
highWaterMark?: number;
|
||||
})
|
||||
|
||||
/** Consumes and returns the body as a string
|
||||
* https://fetch.spec.whatwg.org/#dom-body-text
|
||||
*/
|
||||
text(): Promise<string>
|
||||
text (): Promise<string>
|
||||
|
||||
/** Consumes and returns the body as a JavaScript Object
|
||||
* https://fetch.spec.whatwg.org/#dom-body-json
|
||||
*/
|
||||
json(): Promise<unknown>
|
||||
json (): Promise<unknown>
|
||||
|
||||
/** Consumes and returns the body as a Blob
|
||||
* https://fetch.spec.whatwg.org/#dom-body-blob
|
||||
*/
|
||||
blob(): Promise<Blob>
|
||||
blob (): Promise<Blob>
|
||||
|
||||
/** Consumes and returns the body as an Uint8Array
|
||||
* https://fetch.spec.whatwg.org/#dom-body-bytes
|
||||
*/
|
||||
bytes (): Promise<Uint8Array>
|
||||
|
||||
/** Consumes and returns the body as an ArrayBuffer
|
||||
* https://fetch.spec.whatwg.org/#dom-body-arraybuffer
|
||||
*/
|
||||
arrayBuffer(): Promise<ArrayBuffer>
|
||||
arrayBuffer (): Promise<ArrayBuffer>
|
||||
|
||||
/** Not implemented
|
||||
*
|
||||
* https://fetch.spec.whatwg.org/#dom-body-formdata
|
||||
*/
|
||||
formData(): Promise<never>
|
||||
formData (): Promise<never>
|
||||
|
||||
/** Returns true if the body is not null and the body has been consumed
|
||||
*
|
||||
@@ -44,9 +51,8 @@ declare class BodyReadable extends Readable {
|
||||
*/
|
||||
readonly bodyUsed: boolean
|
||||
|
||||
/** Throws on node 16.6.0
|
||||
*
|
||||
* If body is null, it should return null as the body
|
||||
/**
|
||||
* If body is null, it should return null as the body
|
||||
*
|
||||
* If body is not null, should return the body as a ReadableStream
|
||||
*
|
||||
@@ -55,7 +61,8 @@ declare class BodyReadable extends Readable {
|
||||
readonly body: never | undefined
|
||||
|
||||
/** Dumps the response body by reading `limit` number of bytes.
|
||||
* @param opts.limit Number of bytes to read (optional) - Default: 262144
|
||||
* @param opts.limit Number of bytes to read (optional) - Default: 131072
|
||||
* @param opts.signal AbortSignal to cancel the operation (optional)
|
||||
*/
|
||||
dump(opts?: { limit: number }): Promise<void>
|
||||
dump (opts?: { limit: number; signal?: AbortSignal }): Promise<void>
|
||||
}
|
||||
|
||||
195
backend/node_modules/undici-types/webidl.d.ts
generated
vendored
195
backend/node_modules/undici-types/webidl.d.ts
generated
vendored
@@ -1,23 +1,22 @@
|
||||
// These types are not exported, and are only used internally
|
||||
import * as undici from './index'
|
||||
|
||||
/**
|
||||
* Take in an unknown value and return one that is of type T
|
||||
*/
|
||||
type Converter<T> = (object: unknown) => T
|
||||
|
||||
type SequenceConverter<T> = (object: unknown) => T[]
|
||||
type SequenceConverter<T> = (object: unknown, iterable?: IterableIterator<T>) => T[]
|
||||
|
||||
type RecordConverter<K extends string, V> = (object: unknown) => Record<K, V>
|
||||
|
||||
interface ConvertToIntOpts {
|
||||
clamp?: boolean
|
||||
enforceRange?: boolean
|
||||
}
|
||||
|
||||
interface WebidlErrors {
|
||||
/**
|
||||
* @description Instantiate an error
|
||||
*/
|
||||
exception (opts: { header: string, message: string }): TypeError
|
||||
/**
|
||||
* @description Throw an error when conversion from one type to another has failed
|
||||
* @description Instantiate an error when conversion from one type to another has failed
|
||||
*/
|
||||
conversionFailed (opts: {
|
||||
prefix: string
|
||||
@@ -34,11 +33,24 @@ interface WebidlErrors {
|
||||
}): TypeError
|
||||
}
|
||||
|
||||
interface WebIDLTypes {
|
||||
UNDEFINED: 1,
|
||||
BOOLEAN: 2,
|
||||
STRING: 3,
|
||||
SYMBOL: 4,
|
||||
NUMBER: 5,
|
||||
BIGINT: 6,
|
||||
NULL: 7
|
||||
OBJECT: 8
|
||||
}
|
||||
|
||||
interface WebidlUtil {
|
||||
/**
|
||||
* @see https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
|
||||
*/
|
||||
Type (object: unknown):
|
||||
Type (object: unknown): WebIDLTypes[keyof WebIDLTypes]
|
||||
|
||||
TypeValueToString (o: unknown):
|
||||
| 'Undefined'
|
||||
| 'Boolean'
|
||||
| 'String'
|
||||
@@ -48,6 +60,8 @@ interface WebidlUtil {
|
||||
| 'Null'
|
||||
| 'Object'
|
||||
|
||||
Types: WebIDLTypes
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
|
||||
*/
|
||||
@@ -55,27 +69,42 @@ interface WebidlUtil {
|
||||
V: unknown,
|
||||
bitLength: number,
|
||||
signedness: 'signed' | 'unsigned',
|
||||
opts?: ConvertToIntOpts
|
||||
flags?: number
|
||||
): number
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
|
||||
* @see https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
|
||||
*/
|
||||
IntegerPart (N: number): number
|
||||
|
||||
/**
|
||||
* Stringifies {@param V}
|
||||
*/
|
||||
Stringify (V: any): string
|
||||
|
||||
MakeTypeAssertion <I>(I: I): (arg: any) => arg is I
|
||||
|
||||
/**
|
||||
* Mark a value as uncloneable for Node.js.
|
||||
* This is only effective in some newer Node.js versions.
|
||||
*/
|
||||
markAsUncloneable (V: any): void
|
||||
|
||||
IsResizableArrayBuffer (V: ArrayBufferLike): boolean
|
||||
|
||||
HasFlag (flag: number, attributes: number): boolean
|
||||
}
|
||||
|
||||
interface WebidlConverters {
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-DOMString
|
||||
*/
|
||||
DOMString (V: unknown, opts?: {
|
||||
legacyNullToEmptyString: boolean
|
||||
}): string
|
||||
DOMString (V: unknown, prefix: string, argument: string, flags?: number): string
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-ByteString
|
||||
*/
|
||||
ByteString (V: unknown): string
|
||||
ByteString (V: unknown, prefix: string, argument: string): string
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-USVString
|
||||
@@ -110,59 +139,140 @@ interface WebidlConverters {
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-unsigned-short
|
||||
*/
|
||||
['unsigned short'] (V: unknown, opts?: ConvertToIntOpts): number
|
||||
['unsigned short'] (V: unknown, flags?: number): number
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#idl-ArrayBuffer
|
||||
*/
|
||||
ArrayBuffer (V: unknown): ArrayBufferLike
|
||||
ArrayBuffer (V: unknown, opts: { allowShared: false }): ArrayBuffer
|
||||
ArrayBuffer (
|
||||
V: unknown,
|
||||
prefix: string,
|
||||
argument: string,
|
||||
options?: { allowResizable: boolean }
|
||||
): ArrayBuffer
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#idl-SharedArrayBuffer
|
||||
*/
|
||||
SharedArrayBuffer (
|
||||
V: unknown,
|
||||
prefix: string,
|
||||
argument: string,
|
||||
options?: { allowResizable: boolean }
|
||||
): SharedArrayBuffer
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-buffer-source-types
|
||||
*/
|
||||
TypedArray (
|
||||
V: unknown,
|
||||
TypedArray: NodeJS.TypedArray | ArrayBufferLike
|
||||
): NodeJS.TypedArray | ArrayBufferLike
|
||||
TypedArray (
|
||||
V: unknown,
|
||||
TypedArray: NodeJS.TypedArray | ArrayBufferLike,
|
||||
opts?: { allowShared: false }
|
||||
): NodeJS.TypedArray | ArrayBuffer
|
||||
T: new () => NodeJS.TypedArray,
|
||||
prefix: string,
|
||||
argument: string,
|
||||
flags?: number
|
||||
): NodeJS.TypedArray
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-buffer-source-types
|
||||
*/
|
||||
DataView (V: unknown, opts?: { allowShared: boolean }): DataView
|
||||
DataView (
|
||||
V: unknown,
|
||||
prefix: string,
|
||||
argument: string,
|
||||
flags?: number
|
||||
): DataView
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-buffer-source-types
|
||||
*/
|
||||
ArrayBufferView (
|
||||
V: unknown,
|
||||
prefix: string,
|
||||
argument: string,
|
||||
flags?: number
|
||||
): NodeJS.ArrayBufferView
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#BufferSource
|
||||
*/
|
||||
BufferSource (
|
||||
V: unknown,
|
||||
opts?: { allowShared: boolean }
|
||||
): NodeJS.TypedArray | ArrayBufferLike | DataView
|
||||
prefix: string,
|
||||
argument: string,
|
||||
flags?: number
|
||||
): ArrayBuffer | NodeJS.ArrayBufferView
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#AllowSharedBufferSource
|
||||
*/
|
||||
AllowSharedBufferSource (
|
||||
V: unknown,
|
||||
prefix: string,
|
||||
argument: string,
|
||||
flags?: number
|
||||
): ArrayBuffer | SharedArrayBuffer | NodeJS.ArrayBufferView
|
||||
|
||||
['sequence<ByteString>']: SequenceConverter<string>
|
||||
|
||||
|
||||
['sequence<sequence<ByteString>>']: SequenceConverter<string[]>
|
||||
|
||||
['record<ByteString, ByteString>']: RecordConverter<string, string>
|
||||
|
||||
/**
|
||||
* @see https://fetch.spec.whatwg.org/#requestinfo
|
||||
*/
|
||||
RequestInfo (V: unknown): undici.Request | string
|
||||
|
||||
/**
|
||||
* @see https://fetch.spec.whatwg.org/#requestinit
|
||||
*/
|
||||
RequestInit (V: unknown): undici.RequestInit
|
||||
|
||||
/**
|
||||
* @see https://html.spec.whatwg.org/multipage/webappapis.html#eventhandlernonnull
|
||||
*/
|
||||
EventHandlerNonNull (V: unknown): Function | null
|
||||
|
||||
WebSocketStreamWrite (V: unknown): ArrayBuffer | NodeJS.TypedArray | string
|
||||
|
||||
[Key: string]: (...args: any[]) => unknown
|
||||
}
|
||||
|
||||
type WebidlIsFunction<T> = (arg: any) => arg is T
|
||||
|
||||
interface WebidlIs {
|
||||
Request: WebidlIsFunction<undici.Request>
|
||||
Response: WebidlIsFunction<undici.Response>
|
||||
ReadableStream: WebidlIsFunction<ReadableStream>
|
||||
Blob: WebidlIsFunction<Blob>
|
||||
URLSearchParams: WebidlIsFunction<URLSearchParams>
|
||||
File: WebidlIsFunction<File>
|
||||
FormData: WebidlIsFunction<undici.FormData>
|
||||
URL: WebidlIsFunction<URL>
|
||||
WebSocketError: WebidlIsFunction<undici.WebSocketError>
|
||||
AbortSignal: WebidlIsFunction<AbortSignal>
|
||||
MessagePort: WebidlIsFunction<MessagePort>
|
||||
USVString: WebidlIsFunction<string>
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#BufferSource
|
||||
*/
|
||||
BufferSource: WebidlIsFunction<ArrayBuffer | NodeJS.TypedArray>
|
||||
}
|
||||
|
||||
export interface Webidl {
|
||||
errors: WebidlErrors
|
||||
util: WebidlUtil
|
||||
converters: WebidlConverters
|
||||
is: WebidlIs
|
||||
attributes: WebIDLExtendedAttributes
|
||||
|
||||
/**
|
||||
* @description Performs a brand-check on {@param V} to ensure it is a
|
||||
* {@param cls} object.
|
||||
*/
|
||||
brandCheck <Interface>(V: unknown, cls: Interface, opts?: { strict?: boolean }): asserts V is Interface
|
||||
brandCheck <Interface extends new () => unknown>(V: unknown, cls: Interface): asserts V is Interface
|
||||
|
||||
brandCheckMultiple <Interfaces extends (new () => unknown)[]> (list: Interfaces): (V: any) => asserts V is Interfaces[number]
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-sequence
|
||||
@@ -185,10 +295,11 @@ export interface Webidl {
|
||||
* Similar to {@link Webidl.brandCheck} but allows skipping the check if third party
|
||||
* interfaces are allowed.
|
||||
*/
|
||||
interfaceConverter <Interface>(cls: Interface): (
|
||||
interfaceConverter <Interface>(typeCheck: WebidlIsFunction<Interface>, name: string): (
|
||||
V: unknown,
|
||||
opts?: { strict: boolean }
|
||||
) => asserts V is typeof cls
|
||||
prefix: string,
|
||||
argument: string
|
||||
) => asserts V is Interface
|
||||
|
||||
// TODO(@KhafraDev): a type could likely be implemented that can infer the return type
|
||||
// from the converters given?
|
||||
@@ -199,7 +310,7 @@ export interface Webidl {
|
||||
*/
|
||||
dictionaryConverter (converters: {
|
||||
key: string,
|
||||
defaultValue?: unknown,
|
||||
defaultValue?: () => unknown,
|
||||
required?: boolean,
|
||||
converter: (...args: unknown[]) => unknown,
|
||||
allowedValues?: unknown[]
|
||||
@@ -213,8 +324,18 @@ export interface Webidl {
|
||||
converter: Converter<T>
|
||||
): (V: unknown) => ReturnType<typeof converter> | null
|
||||
|
||||
argumentLengthCheck (args: { length: number }, min: number, context: {
|
||||
header: string
|
||||
message?: string
|
||||
}): void
|
||||
argumentLengthCheck (args: { length: number }, min: number, context: string): void
|
||||
}
|
||||
|
||||
interface WebIDLExtendedAttributes {
|
||||
/** https://webidl.spec.whatwg.org/#Clamp */
|
||||
Clamp: number
|
||||
/** https://webidl.spec.whatwg.org/#EnforceRange */
|
||||
EnforceRange: number
|
||||
/** https://webidl.spec.whatwg.org/#AllowShared */
|
||||
AllowShared: number
|
||||
/** https://webidl.spec.whatwg.org/#AllowResizable */
|
||||
AllowResizable: number
|
||||
/** https://webidl.spec.whatwg.org/#LegacyNullToEmptyString */
|
||||
LegacyNullToEmptyString: number
|
||||
}
|
||||
|
||||
63
backend/node_modules/undici-types/websocket.d.ts
generated
vendored
63
backend/node_modules/undici-types/websocket.d.ts
generated
vendored
@@ -1,10 +1,9 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import type { Blob } from 'buffer'
|
||||
import type { ReadableStream, WritableStream } from 'stream/web'
|
||||
import type { MessagePort } from 'worker_threads'
|
||||
import {
|
||||
EventTarget,
|
||||
Event,
|
||||
EventInit,
|
||||
EventListenerOptions,
|
||||
AddEventListenerOptions,
|
||||
@@ -17,14 +16,14 @@ export type BinaryType = 'blob' | 'arraybuffer'
|
||||
|
||||
interface WebSocketEventMap {
|
||||
close: CloseEvent
|
||||
error: Event
|
||||
error: ErrorEvent
|
||||
message: MessageEvent
|
||||
open: Event
|
||||
}
|
||||
|
||||
interface WebSocket extends EventTarget {
|
||||
binaryType: BinaryType
|
||||
|
||||
|
||||
readonly bufferedAmount: number
|
||||
readonly extensions: string
|
||||
|
||||
@@ -124,8 +123,64 @@ export declare const MessageEvent: {
|
||||
new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>
|
||||
}
|
||||
|
||||
interface ErrorEventInit extends EventInit {
|
||||
message?: string
|
||||
filename?: string
|
||||
lineno?: number
|
||||
colno?: number
|
||||
error?: any
|
||||
}
|
||||
|
||||
interface ErrorEvent extends Event {
|
||||
readonly message: string
|
||||
readonly filename: string
|
||||
readonly lineno: number
|
||||
readonly colno: number
|
||||
readonly error: Error
|
||||
}
|
||||
|
||||
export declare const ErrorEvent: {
|
||||
prototype: ErrorEvent
|
||||
new (type: string, eventInitDict?: ErrorEventInit): ErrorEvent
|
||||
}
|
||||
|
||||
interface WebSocketInit {
|
||||
protocols?: string | string[],
|
||||
dispatcher?: Dispatcher,
|
||||
headers?: HeadersInit
|
||||
}
|
||||
|
||||
interface WebSocketStreamOptions {
|
||||
protocols?: string | string[]
|
||||
signal?: AbortSignal
|
||||
}
|
||||
|
||||
interface WebSocketCloseInfo {
|
||||
closeCode: number
|
||||
reason: string
|
||||
}
|
||||
|
||||
interface WebSocketStream {
|
||||
closed: Promise<WebSocketCloseInfo>
|
||||
opened: Promise<{
|
||||
extensions: string
|
||||
protocol: string
|
||||
readable: ReadableStream
|
||||
writable: WritableStream
|
||||
}>
|
||||
url: string
|
||||
}
|
||||
|
||||
export declare const WebSocketStream: {
|
||||
prototype: WebSocketStream
|
||||
new (url: string | URL, options?: WebSocketStreamOptions): WebSocketStream
|
||||
}
|
||||
|
||||
interface WebSocketError extends Event, WebSocketCloseInfo {}
|
||||
|
||||
export declare const WebSocketError: {
|
||||
prototype: WebSocketError
|
||||
new (type: string, init?: WebSocketCloseInfo): WebSocketError
|
||||
}
|
||||
|
||||
export declare const ping: (ws: WebSocket, body?: Buffer) => void
|
||||
|
||||
92
backend/node_modules/validator/README.md
generated
vendored
92
backend/node_modules/validator/README.md
generated
vendored
@@ -5,8 +5,8 @@
|
||||
[![Downloads][downloads-image]][npm-url]
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
[](https://github.com/alguerocode/validator.js/blob/master/LICENSE)
|
||||
[![Gitter][gitter-image]][gitter-url]
|
||||
[![Disclose a vulnerability][huntr-image]][huntr-url]
|
||||
|
||||
A library of string validators and sanitizers.
|
||||
|
||||
@@ -21,7 +21,13 @@ Passing anything other than a string will result in an error.
|
||||
|
||||
### Server-side usage
|
||||
|
||||
Install the library with `npm install validator`
|
||||
Install the `validator` package as:
|
||||
|
||||
```sh
|
||||
npm i validator
|
||||
yarn add validator
|
||||
pnpm i validator
|
||||
```
|
||||
|
||||
#### No ES6
|
||||
|
||||
@@ -78,33 +84,33 @@ Here is a list of the validators currently available.
|
||||
|
||||
Validator | Description
|
||||
--------------------------------------- | --------------------------------------
|
||||
**contains(str, seed [, options])** | check if the string contains the seed.<br/><br/>`options` is an object that defaults to `{ ignoreCase: false, minOccurrences: 1 }`.<br />Options: <br/> `ignoreCase`: Ignore case when doing comparison, default false.<br/>`minOccurences`: Minimum number of occurrences for the seed in the string. Defaults to 1.
|
||||
**contains(str, seed [, options])** | check if the string contains the seed.<br/><br/>`options` is an object that defaults to `{ ignoreCase: false, minOccurrences: 1 }`.<br />Options: <br/> `ignoreCase`: Ignore case when doing comparison, default false.<br/>`minOccurrences`: Minimum number of occurrences for the seed in the string. Defaults to 1.
|
||||
**equals(str, comparison)** | check if the string matches the comparison.
|
||||
**isAbaRouting(str)** | check if the string is an ABA routing number for US bank account / cheque.
|
||||
**isAfter(str [, options])** | check if the string is a date that is after the specified date.<br/><br/>`options` is an object that defaults to `{ comparisonDate: Date().toString() }`.<br/>**Options:**<br/>`comparisonDate`: Date to compare to. Defaults to `Date().toString()` (now).
|
||||
**isAlpha(str [, locale, options])** | check if the string contains only letters (a-zA-Z).<br/><br/>`locale` is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'bn', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'kk-KZ', 'ko-KR', 'ja-JP', 'ku-IQ', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'si-LK', 'sl-SI', 'sk-SK', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'th-TH', 'tr-TR', 'uk-UA']` and defaults to `en-US`. Locale list is `validator.isAlphaLocales`. `options` is an optional object that can be supplied with the following key(s): `ignore` which can either be a String or RegExp of characters to be ignored e.g. " -" will ignore spaces and -'s.
|
||||
**isAlphanumeric(str [, locale, options])** | check if the string contains only letters and numbers (a-zA-Z0-9).<br/><br/>`locale` is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bn', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'kk-KZ', 'ko-KR', 'ja-JP','ku-IQ', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'si-LK', 'sl-SI', 'sk-SK', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'th-TH', 'tr-TR', 'uk-UA']`) and defaults to `en-US`. Locale list is `validator.isAlphanumericLocales`. `options` is an optional object that can be supplied with the following key(s): `ignore` which can either be a String or RegExp of characters to be ignored e.g. " -" will ignore spaces and -'s.
|
||||
**isAlpha(str [, locale, options])** | check if the string contains only letters (a-zA-Z).<br/><br/>`locale` is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'bn', 'bn-IN', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'gu-IN', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'ja-JP', 'kk-KZ', 'kn-IN', 'ko-KR', 'ku-IQ', 'ml-IN', 'nb-NO', 'nl-NL', 'nn-NO', 'or-IN', 'pa-IN', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'si-LK', 'sk-SK', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'ta-IN', 'te-IN', 'th-TH', 'tr-TR', 'uk-UA']` and defaults to `en-US`. Locale list is `validator.isAlphaLocales`. `options` is an optional object that can be supplied with the following key(s): `ignore` which can either be a String or RegExp of characters to be ignored e.g. " -" will ignore spaces and -'s.
|
||||
**isAlphanumeric(str [, locale, options])** | check if the string contains only letters and numbers (a-zA-Z0-9).<br/><br/>`locale` is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'bn', 'bn-IN', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'gu-IN', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'ja-JP', 'kk-KZ', 'kn-IN', 'ko-KR', 'ku-IQ', 'ml-IN', 'nb-NO', 'nl-NL', 'nn-NO', 'or-IN', 'pa-IN', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'si-LK', 'sk-SK', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'ta-IN', 'te-IN', 'th-TH', 'tr-TR', 'uk-UA']`) and defaults to `en-US`. Locale list is `validator.isAlphanumericLocales`. `options` is an optional object that can be supplied with the following key(s): `ignore` which can either be a String or RegExp of characters to be ignored e.g. " -" will ignore spaces and -'s.
|
||||
**isAscii(str)** | check if the string contains ASCII chars only.
|
||||
**isBase32(str [, options])** | check if the string is base32 encoded. `options` is optional and defaults to `{ crockford: false }`.<br/> When `crockford` is true it tests the given base32 encoded string using [Crockford's base32 alternative][Crockford Base32].
|
||||
**isBase58(str)** | check if the string is base58 encoded.
|
||||
**isBase64(str [, options])** | check if the string is base64 encoded. `options` is optional and defaults to `{ urlSafe: false }`<br/> when `urlSafe` is true it tests the given base64 encoded string is [url safe][Base64 URL Safe].
|
||||
**isBefore(str [, date])** | check if the string is a date that is before the specified date.
|
||||
**isBase64(str [, options])** | check if the string is base64 encoded. `options` is optional and defaults to `{ urlSafe: false, padding: true }`<br/> when `urlSafe` is true default value for `padding` is false and it tests the given base64 encoded string is [url safe][Base64 URL Safe].
|
||||
**isBefore(str [, options])** | check if the string is a date that is before the specified date.<br/><br/>`options` is an object that defaults to `{ comparisonDate: Date().toString() }`.<br/><br/>**Options:**<br/>`comparisonDate`: Date to compare to. Defaults to `Date().toString()` (now).
|
||||
**isBIC(str)** | check if the string is a BIC (Bank Identification Code) or SWIFT code.
|
||||
**isBoolean(str [, options])** | check if the string is a boolean.<br/>`options` is an object which defaults to `{ loose: false }`. If `loose` is set to false, the validator will strictly match ['true', 'false', '0', '1']. If `loose` is set to true, the validator will also match 'yes', 'no', and will match a valid boolean string of any case. (e.g.: ['true', 'True', 'TRUE']).
|
||||
**isBtcAddress(str)** | check if the string is a valid BTC address.
|
||||
**isByteLength(str [, options])** | check if the string's length (in UTF-8 bytes) falls in a range.<br/><br/>`options` is an object which defaults to `{ min: 0, max: undefined }`.
|
||||
**isCreditCard(str [, options])** | check if the string is a credit card number.<br/><br/> `options` is an optional object that can be supplied with the following key(s): `provider` is an optional key whose value should be a string, and defines the company issuing the credit card. Valid values include `['amex', 'dinersclub', 'discover', 'jcb', 'mastercard', 'unionpay', 'visa']` or blank will check for any provider.
|
||||
**isCreditCard(str [, options])** | check if the string is a credit card number.<br/><br/> `options` is an optional object that can be supplied with the following key(s): `provider` is an optional key whose value should be a string, and defines the company issuing the credit card. Valid values include `['amex', 'dinersclub', 'discover', 'jcb', 'mastercard', 'unionpay', 'visa']` or blank will check for any provider.
|
||||
**isCurrency(str [, options])** | check if the string is a valid currency amount.<br/><br/>`options` is an object which defaults to `{ symbol: '$', require_symbol: false, allow_space_after_symbol: false, symbol_after_digits: false, allow_negatives: true, parens_for_negatives: false, negative_sign_before_digits: false, negative_sign_after_digits: false, allow_negative_sign_placeholder: false, thousands_separator: ',', decimal_separator: '.', allow_decimal: true, require_decimal: false, digits_after_decimal: [2], allow_space_after_digits: false }`.<br/>**Note:** The array `digits_after_decimal` is filled with the exact number of digits allowed not a range, for example a range 1 to 3 will be given as [1, 2, 3].
|
||||
**isDataURI(str)** | check if the string is a [data uri format][Data URI Format].
|
||||
**isDate(str [, options])** | check if the string is a valid date. e.g. [`2002-07-15`, new Date()].<br/><br/> `options` is an object which can contain the keys `format`, `strictMode` and/or `delimiters`.<br/><br/>`format` is a string and defaults to `YYYY/MM/DD`.<br/><br/>`strictMode` is a boolean and defaults to `false`. If `strictMode` is set to true, the validator will reject strings different from `format`.<br/><br/> `delimiters` is an array of allowed date delimiters and defaults to `['/', '-']`.
|
||||
**isDecimal(str [, options])** | check if the string represents a decimal number, such as 0.1, .3, 1.1, 1.00003, 4.0, etc.<br/><br/>`options` is an object which defaults to `{force_decimal: false, decimal_digits: '1,', locale: 'en-US'}`.<br/><br/>`locale` determines the decimal separator and is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'es-ES', 'fa', 'fa-AF', 'fa-IR', 'fr-FR', 'fr-CA', 'hu-HU', 'id-ID', 'it-IT', 'ku-IQ', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pl-Pl', 'pt-BR', 'pt-PT', 'ru-RU', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA', 'vi-VN']`.<br/>**Note:** `decimal_digits` is given as a range like '1,3', a specific value like '3' or min like '1,'.
|
||||
**isDecimal(str [, options])** | check if the string represents a decimal number, such as 0.1, .3, 1.1, 1.00003, 4.0, etc.<br/><br/>`options` is an object which defaults to `{force_decimal: false, decimal_digits: '1,', locale: 'en-US'}`.<br/><br/>`locale` determines the decimal separator and is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fa', 'fa-AF', 'fa-IR', 'fr-FR', 'fr-CA', 'hu-HU', 'id-ID', 'it-IT', 'ku-IQ', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pl-Pl', 'pt-BR', 'pt-PT', 'ru-RU', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA', 'vi-VN']`.<br/>**Note:** `decimal_digits` is given as a range like '1,3', a specific value like '3' or min like '1,'.
|
||||
**isDivisibleBy(str, number)** | check if the string is a number that is divisible by another.
|
||||
**isEAN(str)** | check if the string is an [EAN (European Article Number)][European Article Number].
|
||||
**isEmail(str [, options])** | check if the string is an email.<br/><br/>`options` is an object which defaults to `{ allow_display_name: false, require_display_name: false, allow_utf8_local_part: true, require_tld: true, allow_ip_domain: false, allow_underscores: false, domain_specific_validation: false, blacklisted_chars: '', host_blacklist: [] }`. If `allow_display_name` is set to true, the validator will also match `Display Name <email-address>`. If `require_display_name` is set to true, the validator will reject strings without the format `Display Name <email-address>`. If `allow_utf8_local_part` is set to false, the validator will not allow any non-English UTF8 character in email address' local part. If `require_tld` is set to false, email addresses without a TLD in their domain will also be matched. If `ignore_max_length` is set to true, the validator will not check for the standard max length of an email. If `allow_ip_domain` is set to true, the validator will allow IP addresses in the host part. If `domain_specific_validation` is true, some additional validation will be enabled, e.g. disallowing certain syntactically valid email addresses that are rejected by Gmail. If `blacklisted_chars` receives a string, then the validator will reject emails that include any of the characters in the string, in the name part. If `host_blacklist` is set to an array of strings and the part of the email after the `@` symbol matches one of the strings defined in it, the validation fails. If `host_whitelist` is set to an array of strings and the part of the email after the `@` symbol matches none of the strings defined in it, the validation fails.
|
||||
**isEmail(str [, options])** | check if the string is an email.<br/><br/>`options` is an object which defaults to `{ allow_display_name: false, require_display_name: false, allow_utf8_local_part: true, require_tld: true, allow_ip_domain: false, allow_underscores: false, domain_specific_validation: false, blacklisted_chars: '', host_blacklist: [] }`. If `allow_display_name` is set to true, the validator will also match `Display Name <email-address>`. If `require_display_name` is set to true, the validator will reject strings without the format `Display Name <email-address>`. If `allow_utf8_local_part` is set to false, the validator will not allow any non-English UTF8 character in email address' local part. If `require_tld` is set to false, email addresses without a TLD in their domain will also be matched. If `ignore_max_length` is set to true, the validator will not check for the standard max length of an email. If `allow_ip_domain` is set to true, the validator will allow IP addresses in the host part. If `domain_specific_validation` is true, some additional validation will be enabled, e.g. disallowing certain syntactically valid email addresses that are rejected by Gmail. If `blacklisted_chars` receives a string, then the validator will reject emails that include any of the characters in the string, in the name part. If `host_blacklist` is set to an array of strings or regexp, and the part of the email after the `@` symbol matches one of the strings defined in it, the validation fails. If `host_whitelist` is set to an array of strings or regexp, and the part of the email after the `@` symbol matches none of the strings defined in it, the validation fails.
|
||||
**isEmpty(str [, options])** | check if the string has a length of zero.<br/><br/>`options` is an object which defaults to `{ ignore_whitespace: false }`.
|
||||
**isEthereumAddress(str)** | check if the string is an [Ethereum][Ethereum] address. Does not validate address checksums.
|
||||
**isFloat(str [, options])** | check if the string is a float.<br/><br/>`options` is an object which can contain the keys `min`, `max`, `gt`, and/or `lt` to validate the float is within boundaries (e.g. `{ min: 7.22, max: 9.55 }`) it also has `locale` as an option.<br/><br/>`min` and `max` are equivalent to 'greater or equal' and 'less or equal', respectively while `gt` and `lt` are their strict counterparts.<br/><br/>`locale` determines the decimal separator and is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'es-ES', 'fr-CA', 'fr-FR', 'hu-HU', 'it-IT', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']`. Locale list is `validator.isFloatLocales`.
|
||||
**isFQDN(str [, options])** | check if the string is a fully qualified domain name (e.g. domain.com).<br/><br/>`options` is an object which defaults to `{ require_tld: true, allow_underscores: false, allow_trailing_dot: false, allow_numeric_tld: false, allow_wildcard: false, ignore_max_length: false }`. If `allow_wildcard` is set to true, the validator will allow domain starting with `*.` (e.g. `*.example.com` or `*.shop.example.com`).
|
||||
**isFloat(str [, options])** | check if the string is a float.<br/><br/>`options` is an object which can contain the keys `min`, `max`, `gt`, and/or `lt` to validate the float is within boundaries (e.g. `{ min: 7.22, max: 9.55 }`) it also has `locale` as an option.<br/><br/>`min` and `max` are equivalent to 'greater or equal' and 'less or equal', respectively while `gt` and `lt` are their strict counterparts.<br/><br/>`locale` determines the decimal separator and is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fr-CA', 'fr-FR', 'hu-HU', 'it-IT', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']`. Locale list is `validator.isFloatLocales`.
|
||||
**isFQDN(str [, options])** | check if the string is a fully qualified domain name (e.g. domain.com).<br/><br/>`options` is an object which defaults to `{ require_tld: true, allow_underscores: false, allow_trailing_dot: false, allow_numeric_tld: false, allow_wildcard: false, ignore_max_length: false }`.<br/><br/>`require_tld` - If set to false the validator will not check if the domain includes a TLD.<br/>`allow_underscores` - if set to true, the validator will allow underscores in the domain.<br/>`allow_trailing_dot` - if set to true, the validator will allow the domain to end with a `.` character.<br/>`allow_numeric_tld` - if set to true, the validator will allow the TLD of the domain to be made up solely of numbers.<br />`allow_wildcard` - if set to true, the validator will allow domains starting with `*.` (e.g. `*.example.com` or `*.shop.example.com`).<br/>`ignore_max_length` - if set to true, the validator will not check for the standard max length of a domain.<br/>
|
||||
**isFreightContainerID(str)** | alias for `isISO6346`, check if the string is a valid [ISO 6346](https://en.wikipedia.org/wiki/ISO_6346) shipping container identification.
|
||||
**isFullWidth(str)** | check if the string contains any full-width chars.
|
||||
**isHalfWidth(str)** | check if the string contains any half-width chars.
|
||||
@@ -113,54 +119,57 @@ Validator | Description
|
||||
**isHexColor(str)** | check if the string is a hexadecimal color.
|
||||
**isHSL(str)** | check if the string is an HSL (hue, saturation, lightness, optional alpha) color based on [CSS Colors Level 4 specification][CSS Colors Level 4 Specification].<br/><br/>Comma-separated format supported. Space-separated format supported with the exception of a few edge cases (ex: `hsl(200grad+.1%62%/1)`).
|
||||
**isIBAN(str, [, options])** | check if the string is an IBAN (International Bank Account Number).<br/><br/>`options` is an object which accepts two attributes: `whitelist`: where you can restrict IBAN codes you want to receive data from and `blacklist`: where you can remove some of the countries from the current list. For both you can use an array with the following values `['AD','AE','AL','AT','AZ','BA','BE','BG','BH','BR','BY','CH','CR','CY','CZ','DE','DK','DO','EE','EG','ES','FI','FO','FR','GB','GE','GI','GL','GR','GT','HR','HU','IE','IL','IQ','IR','IS','IT','JO','KW','KZ','LB','LC','LI','LT','LU','LV','MC','MD','ME','MK','MR','MT','MU','MZ','NL','NO','PK','PL','PS','PT','QA','RO','RS','SA','SC','SE','SI','SK','SM','SV','TL','TN','TR','UA','VA','VG','XK']`.
|
||||
**isIdentityCard(str [, locale])** | check if the string is a valid identity card code.<br/><br/>`locale` is one of `['LK', 'PL', 'ES', 'FI', 'IN', 'IT', 'IR', 'MZ', 'NO', 'TH', 'zh-TW', 'he-IL', 'ar-LY', 'ar-TN', 'zh-CN', 'zh-HK']` OR `'any'`. If 'any' is used, function will check if any of the locales match.<br/><br/>Defaults to 'any'.
|
||||
**isIdentityCard(str [, locale])** | check if the string is a valid identity card code.<br/><br/>`locale` is one of `['LK', 'PL', 'ES', 'FI', 'IN', 'IT', 'IR', 'MZ', 'NO', 'TH', 'zh-TW', 'he-IL', 'ar-LY', 'ar-TN', 'zh-CN', 'zh-HK', 'PK']` OR `'any'`. If 'any' is used, function will check if any of the locales match.<br/><br/>Defaults to 'any'.
|
||||
**isIMEI(str [, options]))** | check if the string is a valid [IMEI number][IMEI]. IMEI should be of format `###############` or `##-######-######-#`.<br/><br/>`options` is an object which can contain the keys `allow_hyphens`. Defaults to first format. If `allow_hyphens` is set to true, the validator will validate the second format.
|
||||
**isIn(str, values)** | check if the string is in an array of allowed values.
|
||||
**isInt(str [, options])** | check if the string is an integer.<br/><br/>`options` is an object which can contain the keys `min` and/or `max` to check the integer is within boundaries (e.g. `{ min: 10, max: 99 }`). `options` can also contain the key `allow_leading_zeroes`, which when set to false will disallow integer values with leading zeroes (e.g. `{ allow_leading_zeroes: false }`). Finally, `options` can contain the keys `gt` and/or `lt` which will enforce integers being greater than or less than, respectively, the value provided (e.g. `{gt: 1, lt: 4}` for a number between 1 and 4).
|
||||
**isIP(str [, version])** | check if the string is an IP (version 4 or 6).
|
||||
**isIP(str [, options])** | check if the string is an IP address (version 4 or 6).<br/><br/>`options` is an object that defaults to `{ version: '' }`.<br/><br/>**Options:**<br/>`version`: defines which IP version to compare to. Accepted values: `4`, `6`, `'4'`, `'6'`.
|
||||
**isIPRange(str [, version])** | check if the string is an IP Range (version 4 or 6).
|
||||
**isISBN(str [, options])** | check if the string is an [ISBN][ISBN].<br/><br/>`options` is an object that has no default.<br/>**Options:**<br/>`version`: ISBN version to compare to. Accepted values are '10' and '13'. If none provided, both will be tested.
|
||||
**isISIN(str)** | check if the string is an [ISIN][ISIN] (stock/security identifier).
|
||||
**isISO6346(str)** | check if the string is a valid [ISO 6346](https://en.wikipedia.org/wiki/ISO_6346) shipping container identification.
|
||||
**isISO6391(str)** | check if the string is a valid [ISO 639-1][ISO 639-1] language code.
|
||||
**isISO8601(str [, options])** | check if the string is a valid [ISO 8601][ISO 8601] date. <br/>`options` is an object which defaults to `{ strict: false, strictSeparator: false }`. If `strict` is true, date strings with invalid dates like `2009-02-29` will be invalid. If `strictSeparator` is true, date strings with date and time separated by anything other than a T will be invalid.
|
||||
**isISO15924(str)** | check if the string is a valid [ISO 15924][ISO 15924] officially assigned script code.
|
||||
**isISO31661Alpha2(str)** | check if the string is a valid [ISO 3166-1 alpha-2][ISO 3166-1 alpha-2] officially assigned country code.
|
||||
**isISO31661Alpha3(str)** | check if the string is a valid [ISO 3166-1 alpha-3][ISO 3166-1 alpha-3] officially assigned country code.
|
||||
**isISO31661Numeric(str)** | check if the string is a valid [ISO 3166-1 numeric][ISO 3166-1 numeric] officially assigned country code.
|
||||
**isISO4217(str)** | check if the string is a valid [ISO 4217][ISO 4217] officially assigned currency code.
|
||||
**isISRC(str)** | check if the string is an [ISRC][ISRC].
|
||||
**isISSN(str [, options])** | check if the string is an [ISSN][ISSN].<br/><br/>`options` is an object which defaults to `{ case_sensitive: false, require_hyphen: false }`. If `case_sensitive` is true, ISSNs with a lowercase `'x'` as the check digit are rejected.
|
||||
**isJSON(str [, options])** | check if the string is valid JSON (note: uses JSON.parse).<br/><br/>`options` is an object which defaults to `{ allow_primitives: false }`. If `allow_primitives` is true, the primitives 'true', 'false' and 'null' are accepted as valid JSON values.
|
||||
**isJWT(str)** | check if the string is valid JWT token.
|
||||
**isLatLong(str [, options])** | check if the string is a valid latitude-longitude coordinate in the format `lat,long` or `lat, long`.<br/><br/>`options` is an object that defaults to `{ checkDMS: false }`. Pass `checkDMS` as `true` to validate DMS(degrees, minutes, and seconds) latitude-longitude format.
|
||||
**isLength(str [, options])** | check if the string's length falls in a range.<br/><br/>`options` is an object which defaults to `{ min: 0, max: undefined }`. Note: this function takes into account surrogate pairs.
|
||||
**isLicensePlate(str, locale)** | check if the string matches the format of a country's license plate.<br/><br/>`locale` is one of `['cs-CZ', 'de-DE', 'de-LI', 'en-IN', 'en-PK', 'es-AR', 'hu-HU', 'pt-BR', 'pt-PT', 'sq-AL', 'sv-SE']` or `'any'`.
|
||||
**isLength(str [, options])** | check if the string's length falls in a range and equal to any of the integers of the `discreteLengths` array if provided.<br/><br/>`options` is an object which defaults to `{ min: 0, max: undefined, discreteLengths: undefined }`. Note: this function takes into account surrogate pairs.
|
||||
**isLicensePlate(str, locale)** | check if the string matches the format of a country's license plate.<br/><br/>`locale` is one of `['cs-CZ', 'de-DE', 'de-LI', 'en-IN', 'en-SG', 'en-PK', 'es-AR', 'hu-HU', 'pt-BR', 'pt-PT', 'sq-AL', 'sv-SE']` or `'any'`.
|
||||
**isLocale(str)** | check if the string is a locale.
|
||||
**isLowercase(str)** | check if the string is lowercase.
|
||||
**isLuhnNumber(str)** | check if the string passes the [Luhn algorithm check](https://en.wikipedia.org/wiki/Luhn_algorithm).
|
||||
**isMACAddress(str [, options])** | check if the string is a MAC address.<br/><br/>`options` is an object which defaults to `{ no_separators: false }`. If `no_separators` is true, the validator will allow MAC addresses without separators. Also, it allows the use of hyphens, spaces or dots e.g. '01 02 03 04 05 ab', '01-02-03-04-05-ab' or '0102.0304.05ab'. The options also allow a `eui` property to specify if it needs to be validated against EUI-48 or EUI-64. The accepted values of `eui` are: 48, 64.
|
||||
**isMACAddress(str [, options])** | check if the string is a MAC address.<br/><br/>`options` is an object which defaults to `{ no_separators: false }`. It allows the use of hyphens, spaces or dots e.g. '01 02 03 04 05 ab', '01-02-03-04-05-ab' or '0102.0304.05ab'. If `no_separators` is true, the validator will then only check MAC addresses without separators. The options also allow a `eui` property to specify if it needs to be validated against EUI-48 or EUI-64. The accepted values of `eui` are: 48, 64.
|
||||
**isMagnetURI(str)** | check if the string is a [Magnet URI format][Magnet URI Format].
|
||||
**isMailtoURI(str, [, options])** | check if the string is a [Mailto URI format][Mailto URI Format].<br/><br/>`options` is an object of validating emails inside the URI (check `isEmail`s options for details).
|
||||
**isMD5(str)** | check if the string is a MD5 hash.<br/><br/>Please note that you can also use the `isHash(str, 'md5')` function. Keep in mind that MD5 has some collision weaknesses compared to other algorithms (e.g., SHA).
|
||||
**isMimeType(str)** | check if the string matches to a valid [MIME type][MIME Type] format.
|
||||
**isMobilePhone(str [, locale [, options]])** | check if the string is a mobile phone number,<br/><br/>`locale` is either an array of locales (e.g. `['sk-SK', 'sr-RS']`) OR one of `['am-Am', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-EH', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-PS', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'az-AZ', 'az-LB', 'az-LY', 'be-BY', 'bg-BG', 'bn-BD', 'bs-BA', 'ca-AD', 'cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'de-LU', 'dv-MV', 'dz-BT', 'el-CY', 'el-GR', 'en-AG', 'en-AI', 'en-AU', 'en-BM', 'en-BS', 'en-BW', 'en-CA', 'en-GB', 'en-GG', 'en-GH', 'en-GY', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-KE', 'en-KI', 'en-KN', 'en-LS', 'en-MO', 'en-MT', 'en-MU', 'en-MW', 'en-NG', 'en-NZ', 'en-PG', 'en-PH', 'en-PK', 'en-RW', 'en-SG', 'en-SL', 'en-SS', 'en-TZ', 'en-UG', 'en-US', 'en-ZA', 'en-ZM', 'en-ZW', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PY', 'es-SV', 'es-UY', 'es-VE', 'et-EE', 'fa-AF', 'fa-IR', 'fi-FI', 'fj-FJ', 'fo-FO', 'fr-BE', 'fr-BF', 'fr-BJ', 'fr-CD', 'fr-CF', 'fr-FR', 'fr-GF', 'fr-GP', 'fr-MQ', 'fr-PF', 'fr-RE', 'fr-WF', 'ga-IE', 'he-IL', 'hu-HU', 'id-ID', 'ir-IR', 'it-IT', 'it-SM', 'ja-JP', 'ka-GE', 'kk-KZ', 'kl-GL', 'ko-KR', 'ky-KG', 'lt-LT', 'mg-MG', 'mn-MN', 'ms-MY', 'my-MM', 'mz-MZ', 'nb-NO', 'ne-NP', 'nl-AW', 'nl-BE', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-AO', 'pt-BR', 'pt-PT', 'ro-Md', 'ro-RO', 'ru-RU', 'si-LK', 'sk-SK', 'sl-SI', 'so-SO', 'sq-AL', 'sr-RS', 'sv-SE', 'tg-TJ', 'th-TH', 'tk-TM', 'tr-TR', 'uk-UA', 'uz-UZ', 'vi-VN', 'zh-CN', 'zh-HK', 'zh-MO', 'zh-TW']` OR defaults to `'any'`. If 'any' or a falsey value is used, function will check if any of the locales match).<br/><br/>`options` is an optional object that can be supplied with the following keys: `strictMode`, if this is set to `true`, the mobile phone number must be supplied with the country code and therefore must start with `+`. Locale list is `validator.isMobilePhoneLocales`.
|
||||
**isMobilePhone(str [, locale [, options]])** | check if the string is a mobile phone number,<br/><br/>`locale` is either an array of locales (e.g. `['sk-SK', 'sr-RS']`) OR one of `['am-Am', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-EH', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-PS', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'az-AZ', 'az-LB', 'az-LY', 'be-BY', 'bg-BG', 'bn-BD', 'bs-BA', 'ca-AD', 'cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'de-LU', 'dv-MV', 'dz-BT', 'el-CY', 'el-GR', 'en-AG', 'en-AI', 'en-AU', 'en-BM', 'en-BS', 'en-BW', 'en-CA', 'en-GB', 'en-GG', 'en-GH', 'en-GY', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-KE', 'en-KI', 'en-KN', 'en-LS', 'en-MO', 'en-MT', 'en-MU', 'en-MW', 'en-NG', 'en-NZ', 'en-PG', 'en-PH', 'en-PK', 'en-RW', 'en-SG', 'en-SL', 'en-SS', 'en-TZ', 'en-UG', 'en-US', 'en-ZA', 'en-ZM', 'en-ZW', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GT','es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PY', 'es-SV', 'es-UY', 'es-VE', 'et-EE', 'fa-AF', 'fa-IR', 'fi-FI', 'fj-FJ', 'fo-FO', 'fr-BE', 'fr-BF', 'fr-BJ', 'fr-CD', 'fr-CF', 'fr-FR', 'fr-GF', 'fr-GP', 'fr-MQ', 'fr-PF', 'fr-RE', 'fr-WF', 'ga-IE', 'he-IL', 'hu-HU', 'id-ID', 'ir-IR', 'it-IT', 'it-SM', 'ja-JP', 'ka-GE', 'kk-KZ', 'kl-GL', 'ko-KR', 'ky-KG', 'lt-LT', 'mg-MG', 'mn-MN', 'mk-MK', 'ms-MY', 'my-MM', 'mz-MZ', 'nb-NO', 'ne-NP', 'nl-AW', 'nl-BE', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-AO', 'pt-BR', 'pt-PT', 'ro-Md', 'ro-RO', 'ru-RU', 'si-LK', 'sk-SK', 'sl-SI', 'so-SO', 'sq-AL', 'sr-RS', 'sv-SE', 'tg-TJ', 'th-TH', 'tk-TM', 'tr-TR', 'uk-UA', 'uz-UZ', 'vi-VN', 'zh-CN', 'zh-HK', 'zh-MO', 'zh-TW']` OR defaults to `'any'`. If 'any' or a falsey value is used, function will check if any of the locales match).<br/><br/>`options` is an optional object that can be supplied with the following keys: `strictMode`, if this is set to `true`, the mobile phone number must be supplied with the country code and therefore must start with `+`. Locale list is `validator.isMobilePhoneLocales`.
|
||||
**isMongoId(str)** | check if the string is a valid hex-encoded representation of a [MongoDB ObjectId][mongoid].
|
||||
**isMultibyte(str)** | check if the string contains one or more multibyte chars.
|
||||
**isNumeric(str [, options])** | check if the string contains only numbers.<br/><br/>`options` is an object which defaults to `{ no_symbols: false }` it also has `locale` as an option. If `no_symbols` is true, the validator will reject numeric strings that feature a symbol (e.g. `+`, `-`, or `.`).<br/><br/>`locale` determines the decimal separator and is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'es-ES', 'fr-FR', 'fr-CA', 'hu-HU', 'it-IT', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']`.
|
||||
**isNumeric(str [, options])** | check if the string contains only numbers.<br/><br/>`options` is an object which defaults to `{ no_symbols: false }` it also has `locale` as an option. If `no_symbols` is true, the validator will reject numeric strings that feature a symbol (e.g. `+`, `-`, or `.`).<br/><br/>`locale` determines the decimal separator and is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fr-FR', 'fr-CA', 'hu-HU', 'it-IT', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']`.
|
||||
**isOctal(str)** | check if the string is a valid octal number.
|
||||
**isPassportNumber(str, countryCode)** | check if the string is a valid passport number.<br/><br/>`countryCode` is one of `['AM', 'AR', 'AT', 'AU', 'AZ', 'BE', 'BG', 'BY', 'BR', 'CA', 'CH', 'CN', 'CY', 'CZ', 'DE', 'DK', 'DZ', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HU', 'IE', 'IN', 'IR', 'ID', 'IS', 'IT', 'JM', 'JP', 'KR', 'KZ', 'LI', 'LT', 'LU', 'LV', 'LY', 'MT', 'MX', 'MY', 'MZ', 'NL', 'NZ', 'PH', 'PK', 'PL', 'PT', 'RO', 'RU', 'SE', 'SL', 'SK', 'TH', 'TR', 'UA', 'US', 'ZA']`.
|
||||
**isPassportNumber(str, countryCode)** | check if the string is a valid passport number.<br/><br/>`countryCode` is one of `['AM', 'AR', 'AT', 'AU', 'AZ', 'BE', 'BG', 'BY', 'BR', 'CA', 'CH', 'CN', 'CY', 'CZ', 'DE', 'DK', 'DZ', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HU', 'IE', 'IN', 'IR', 'ID', 'IS', 'IT', 'JM', 'JP', 'KR', 'KZ', 'LI', 'LT', 'LU', 'LV', 'LY', 'MT', 'MX', 'MY', 'MZ', 'NL', 'NZ', 'PH', 'PK', 'PL', 'PT', 'RO', 'RU', 'SE', 'SL', 'SK', 'TH', 'TR', 'UA', 'US', 'ZA']`. Locale list is `validator.passportNumberLocales`.
|
||||
**isPort(str)** | check if the string is a valid port number.
|
||||
**isPostalCode(str, locale)** | check if the string is a postal code.<br/><br/>`locale` is one of `['AD', 'AT', 'AU', 'AZ', 'BA', 'BE', 'BG', 'BR', 'BY', 'CA', 'CH', 'CN', 'CZ', 'DE', 'DK', 'DO', 'DZ', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IN', 'IR', 'IS', 'IT', 'JP', 'KE', 'KR', 'LI', 'LK', 'LT', 'LU', 'LV', 'MG', 'MT', 'MX', 'MY', 'NL', 'NO', 'NP', 'NZ', 'PL', 'PR', 'PT', 'RO', 'RU', 'SA', 'SE', 'SG', 'SI', 'SK', 'TH', 'TN', 'TW', 'UA', 'US', 'ZA', 'ZM']` OR `'any'`. If 'any' is used, function will check if any of the locales match. Locale list is `validator.isPostalCodeLocales`.
|
||||
**isPostalCode(str, locale)** | check if the string is a postal code.<br/><br/>`locale` is one of `['AD', 'AT', 'AU', 'AZ', 'BA', 'BD', 'BE', 'BG', 'BR', 'BY', 'CA', 'CH', 'CN', 'CO', 'CZ', 'DE', 'DK', 'DO', 'DZ', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IN', 'IR', 'IS', 'IT', 'JP', 'KE', 'KR', 'LI', 'LK', 'LT', 'LU', 'LV', 'MG', 'MT', 'MX', 'MY', 'NL', 'NO', 'NP', 'NZ', 'PK', 'PL', 'PR', 'PT', 'RO', 'RU', 'SA', 'SE', 'SG', 'SI', 'SK', 'TH', 'TN', 'TW', 'UA', 'US', 'ZA', 'ZM']` OR `'any'`. If 'any' is used, function will check if any of the locales match. Locale list is `validator.isPostalCodeLocales`.
|
||||
**isRFC3339(str)** | check if the string is a valid [RFC 3339][RFC 3339] date.
|
||||
**isRgbColor(str [, includePercentValues])** | check if the string is a rgb or rgba color.<br/><br/>`includePercentValues` defaults to `true`. If you don't want to allow to set `rgb` or `rgba` values with percents, like `rgb(5%,5%,5%)`, or `rgba(90%,90%,90%,.3)`, then set it to false.
|
||||
**isRgbColor(str [,options])** | check if the string is a rgb or rgba color.<br/></br>`options` is an object with the following properties<br/><br/>`includePercentValues` defaults to `true`. If you don't want to allow to set `rgb` or `rgba` values with percents, like `rgb(5%,5%,5%)`, or `rgba(90%,90%,90%,.3)`, then set it to false.<br/><br/>`allowSpaces` defaults to `true`, which prohibits whitespace. If set to false, whitespace between color values is allowed, such as `rgb(255, 255, 255)` or even `rgba(255, 128, 0, 0.7)`.
|
||||
**isSemVer(str)** | check if the string is a Semantic Versioning Specification (SemVer).
|
||||
**isSurrogatePair(str)** | check if the string contains any surrogate pairs chars.
|
||||
**isUppercase(str)** | check if the string is uppercase.
|
||||
**isSlug(str)** | check if the string is of type slug.
|
||||
**isStrongPassword(str [, options])** | check if the string can be considered a strong password or not. Allows for custom requirements or scoring rules. If `returnScore` is true, then the function returns an integer score for the password rather than a boolean.<br/>Default options: <br/>`{ minLength: 8, minLowercase: 1, minUppercase: 1, minNumbers: 1, minSymbols: 1, returnScore: false, pointsPerUnique: 1, pointsPerRepeat: 0.5, pointsForContainingLower: 10, pointsForContainingUpper: 10, pointsForContainingNumber: 10, pointsForContainingSymbol: 10 }`
|
||||
**isTime(str [, options])** | check if the string is a valid time e.g. [`23:01:59`, new Date().toLocaleTimeString()].<br/><br/> `options` is an object which can contain the keys `hourFormat` or `mode`.<br/><br/>`hourFormat` is a key and defaults to `'hour24'`.<br/><br/>`mode` is a key and defaults to `'default'`. <br/><br/>`hourFomat` can contain the values `'hour12'` or `'hour24'`, `'hour24'` will validate hours in 24 format and `'hour12'` will validate hours in 12 format. <br/><br/>`mode` can contain the values `'default'` or `'withSeconds'`, `'default'` will validate `HH:MM` format, `'withSeconds'` will validate the `HH:MM:SS` format.
|
||||
**isTime(str [, options])** | check if the string is a valid time e.g. [`23:01:59`, new Date().toLocaleTimeString()].<br/><br/> `options` is an object which can contain the keys `hourFormat` or `mode`.<br/><br/>`hourFormat` is a key and defaults to `'hour24'`.<br/><br/>`mode` is a key and defaults to `'default'`. <br/><br/>`hourFormat` can contain the values `'hour12'` or `'hour24'`, `'hour24'` will validate hours in 24 format and `'hour12'` will validate hours in 12 format. <br/><br/>`mode` can contain the values `'default', 'withSeconds', withOptionalSeconds`, `'default'` will validate `HH:MM` format, `'withSeconds'` will validate the `HH:MM:SS` format, `'withOptionalSeconds'` will validate `'HH:MM'` and `'HH:MM:SS'` formats.
|
||||
**isTaxID(str, locale)** | check if the string is a valid Tax Identification Number. Default locale is `en-US`.<br/><br/>More info about exact TIN support can be found in `src/lib/isTaxID.js`.<br/><br/>Supported locales: `[ 'bg-BG', 'cs-CZ', 'de-AT', 'de-DE', 'dk-DK', 'el-CY', 'el-GR', 'en-CA', 'en-GB', 'en-IE', 'en-US', 'es-AR', 'es-ES', 'et-EE', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-FR', 'fr-LU', 'hr-HR', 'hu-HU', 'it-IT', 'lb-LU', 'lt-LT', 'lv-LV', 'mt-MT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-BR', 'pt-PT', 'ro-RO', 'sk-SK', 'sl-SI', 'sv-SE', 'uk-UA']`.
|
||||
**isURL(str [, options])** | check if the string is a URL.<br/><br/>`options` is an object which defaults to `{ protocols: ['http','https','ftp'], require_tld: true, require_protocol: false, require_host: true, require_port: false, require_valid_protocol: true, allow_underscores: false, host_whitelist: false, host_blacklist: false, allow_trailing_dot: false, allow_protocol_relative_urls: false, allow_fragments: true, allow_query_components: true, disallow_auth: false, validate_length: true }`.<br/><br/>`require_protocol` - if set to true isURL will return false if protocol is not present in the URL.<br/>`require_valid_protocol` - isURL will check if the URL's protocol is present in the protocols option.<br/>`protocols` - valid protocols can be modified with this option.<br/>`require_host` - if set to false isURL will not check if host is present in the URL.<br/>`require_port` - if set to true isURL will check if port is present in the URL.<br/>`allow_protocol_relative_urls` - if set to true protocol relative URLs will be allowed.<br/>`allow_fragments` - if set to false isURL will return false if fragments are present.<br/>`allow_query_components` - if set to false isURL will return false if query components are present.<br/>`validate_length` - if set to false isURL will skip string length validation (2083 characters is IE max URL length).
|
||||
**isUUID(str [, version])** | check if the string is a UUID (version 1, 2, 3, 4 or 5).
|
||||
**isURL(str [, options])** | check if the string is a URL.<br/><br/>`options` is an object which defaults to `{ protocols: ['http','https','ftp'], require_tld: true, require_protocol: false, require_host: true, require_port: false, require_valid_protocol: true, allow_underscores: false, host_whitelist: false, host_blacklist: false, allow_trailing_dot: false, allow_protocol_relative_urls: false, allow_fragments: true, allow_query_components: true, disallow_auth: false, validate_length: true }`.<br/><br/>`protocols` - valid protocols can be modified with this option.<br/>`require_tld` - If set to false isURL will not check if the URL's host includes a top-level domain.<br/>`require_protocol` - **RECOMMENDED** if set to true isURL will return false if protocol is not present in the URL. Without this setting, some malicious URLs cannot be distinguishable from a valid URL with authentication information.<br/>`require_host` - if set to false isURL will not check if host is present in the URL.<br/>`require_port` - if set to true isURL will check if port is present in the URL.<br/>`require_valid_protocol` - isURL will check if the URL's protocol is present in the protocols option.<br/>`allow_underscores` - if set to true, the validator will allow underscores in the URL.<br/>`host_whitelist` - if set to an array of strings or regexp, and the domain matches none of the strings defined in it, the validation fails.<br/>`host_blacklist` - if set to an array of strings or regexp, and the domain matches any of the strings defined in it, the validation fails.<br/>`allow_trailing_dot` - if set to true, the validator will allow the domain to end with a `.` character.<br/>`allow_protocol_relative_urls` - if set to true protocol relative URLs will be allowed.<br/>`allow_fragments` - if set to false isURL will return false if fragments are present.<br/>`allow_query_components` - if set to false isURL will return false if query components are present.<br/>`disallow_auth` - if set to true, the validator will fail if the URL contains an authentication component, e.g. `http://username:password@example.com`.<br/>`validate_length` - if set to false isURL will skip string length validation. `max_allowed_length` will be ignored if this is set as `false`.<br/>`max_allowed_length` - if set, isURL will not allow URLs longer than the specified value (default is 2084 that IE maximum URL length).<br/>
|
||||
**isULID(str)** | check if the string is a [ULID](https://github.com/ulid/spec).
|
||||
**isUUID(str [, version])** | check if the string is an RFC9562 UUID.<br/>`version` is one of `'1'`-`'8'`, `'nil'`, `'max'`, `'all'` or `'loose'`. The `'loose'` option checks if the string is a UUID-like string with hexadecimal values, ignoring RFC9565.
|
||||
**isVariableWidth(str)** | check if the string contains a mixture of full and half-width chars.
|
||||
**isVAT(str, countryCode)** | check if the string is a [valid VAT number][VAT Number] if validation is available for the given country code matching [ISO 3166-1 alpha-2][ISO 3166-1 alpha-2]. <br/><br/>`countryCode` is one of `['AL', 'AR', 'AT', 'AU', 'BE', 'BG', 'BO', 'BR', 'BY', 'CA', 'CH', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DE', 'DK', 'DO', 'EC', 'EE', 'EL', 'ES', 'FI', 'FR', 'GB', 'GT', 'HN', 'HR', 'HU', 'ID', 'IE', 'IL', 'IN', 'IS', 'IT', 'KZ', 'LT', 'LU', 'LV', 'MK', 'MT', 'MX', 'NG', 'NI', 'NL', 'NO', 'NZ', 'PA', 'PE', 'PH', 'PL', 'PT', 'PY', 'RO', 'RS', 'RU', 'SA', 'SE', 'SI', 'SK', 'SM', 'SV', 'TR', 'UA', 'UY', 'UZ', 'VE']`.
|
||||
**isWhitelisted(str, chars)** | check if the string consists only of characters that appear in the whitelist `chars`.
|
||||
@@ -173,7 +182,7 @@ Here is a list of the sanitizers currently available.
|
||||
Sanitizer | Description
|
||||
-------------------------------------- | -------------------------------
|
||||
**blacklist(input, chars)** | remove characters that appear in the blacklist. The characters are used in a RegExp and so you will need to escape some chars, e.g. `blacklist(input, '\\[\\]')`.
|
||||
**escape(input)** | replace `<`, `>`, `&`, `'`, `"` and `/` with HTML entities.
|
||||
**escape(input)** | replace `<`, `>`, `&`, `'`, `"`, `` ` ``, `\` and `/` with HTML entities.
|
||||
**ltrim(input [, chars])** | trim characters from the left-side of the input.
|
||||
**normalizeEmail(email [, options])** | canonicalize an email address. (This doesn't validate that the input is an email, if you want to validate the email use isEmail beforehand).<br/><br/>`options` is an object with the following keys and default values:<br/><ul><li>*all_lowercase: true* - Transforms the local part (before the @ symbol) of all email addresses to lowercase. Please note that this may violate RFC 5321, which gives providers the possibility to treat the local part of email addresses in a case sensitive way (although in practice most - yet not all - providers don't). The domain part of the email address is always lowercased, as it is case insensitive per RFC 1035.</li><li>*gmail_lowercase: true* - Gmail addresses are known to be case-insensitive, so this switch allows lowercasing them even when *all_lowercase* is set to false. Please note that when *all_lowercase* is true, Gmail addresses are lowercased regardless of the value of this setting.</li><li>*gmail_remove_dots: true*: Removes dots from the local part of the email address, as Gmail ignores them (e.g. "john.doe" and "johndoe" are considered equal).</li><li>*gmail_remove_subaddress: true*: Normalizes addresses by removing "sub-addresses", which is the part following a "+" sign (e.g. "foo+bar@gmail.com" becomes "foo@gmail.com").</li><li>*gmail_convert_googlemaildotcom: true*: Converts addresses with domain @googlemail.com to @gmail.com, as they're equivalent.</li><li>*outlookdotcom_lowercase: true* - Outlook.com addresses (including Windows Live and Hotmail) are known to be case-insensitive, so this switch allows lowercasing them even when *all_lowercase* is set to false. Please note that when *all_lowercase* is true, Outlook.com addresses are lowercased regardless of the value of this setting.</li><li>*outlookdotcom_remove_subaddress: true*: Normalizes addresses by removing "sub-addresses", which is the part following a "+" sign (e.g. "foo+bar@outlook.com" becomes "foo@outlook.com").</li><li>*yahoo_lowercase: true* - Yahoo Mail addresses are known to be case-insensitive, so this switch allows lowercasing them even when *all_lowercase* is set to false. Please note that when *all_lowercase* is true, Yahoo Mail addresses are lowercased regardless of the value of this setting.</li><li>*yahoo_remove_subaddress: true*: Normalizes addresses by removing "sub-addresses", which is the part following a "-" sign (e.g. "foo-bar@yahoo.com" becomes "foo@yahoo.com").</li><li>*icloud_lowercase: true* - iCloud addresses (including MobileMe) are known to be case-insensitive, so this switch allows lowercasing them even when *all_lowercase* is set to false. Please note that when *all_lowercase* is true, iCloud addresses are lowercased regardless of the value of this setting.</li><li>*icloud_remove_subaddress: true*: Normalizes addresses by removing "sub-addresses", which is the part following a "+" sign (e.g. "foo+bar@icloud.com" becomes "foo@icloud.com").</li></ul>
|
||||
**rtrim(input [, chars])** | trim characters from the right-side of the input.
|
||||
@@ -183,7 +192,7 @@ Sanitizer | Description
|
||||
**toFloat(input)** | convert the input string to a float, or `NaN` if the input is not a float.
|
||||
**toInt(input [, radix])** | convert the input string to an integer, or `NaN` if the input is not an integer.
|
||||
**trim(input [, chars])** | trim characters (whitespace by default) from both sides of the input.
|
||||
**unescape(input)** | replace HTML encoded entities with `<`, `>`, `&`, `'`, `"` and `/`.
|
||||
**unescape(input)** | replace HTML encoded entities with `<`, `>`, `&`, `'`, `"`, `` ` ``, `\` and `/`.
|
||||
**whitelist(input, chars)** | remove characters that do not appear in the whitelist. The characters are used in a RegExp and so you will need to escape some chars, e.g. `whitelist(input, '\\[\\]')`.
|
||||
|
||||
### XSS Sanitization
|
||||
@@ -196,6 +205,8 @@ For an alternative, have a look at Yahoo's [xss-filters library](https://github.
|
||||
|
||||
- [chriso](https://github.com/chriso) - **Chris O'Hara** (author)
|
||||
- [profnandaa](https://github.com/profnandaa) - **Anthony Nandaa**
|
||||
- [rubiin](https://github.com/rubiin) - **Rubin Bhandari**
|
||||
- [wikirik](https://github.com/wikirik) - **Rik Smale**
|
||||
- [ezkemboi](https://github.com/ezkemboi) - **Ezrqn Kemboi**
|
||||
- [tux-tn](https://github.com/tux-tn) - **Sarhan Aissi**
|
||||
|
||||
@@ -203,30 +214,13 @@ For an alternative, have a look at Yahoo's [xss-filters library](https://github.
|
||||
|
||||
Remember, validating can be troublesome sometimes. See [A list of articles about programming assumptions commonly made that aren't true](https://github.com/jameslk/awesome-falsehoods).
|
||||
|
||||
## License (MIT)
|
||||
## Contributing
|
||||
|
||||
```
|
||||
Copyright (c) 2018 Chris O'Hara <cohara87@gmail.com>
|
||||
We welcome contributions from the community! If you're interested in contributing to this project, please read our [Contribution Guide](CONTRIBUTING.md) to get started.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
## License
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
```
|
||||
This project is licensed under the [MIT](LICENSE). See the [LICENSE](LICENSE) file for details.
|
||||
|
||||
[downloads-image]: http://img.shields.io/npm/dm/validator.svg
|
||||
|
||||
@@ -259,8 +253,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
[ISIN]: https://en.wikipedia.org/wiki/International_Securities_Identification_Number
|
||||
[ISO 639-1]: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
|
||||
[ISO 8601]: https://en.wikipedia.org/wiki/ISO_8601
|
||||
[ISO 15924]: https://en.wikipedia.org/wiki/ISO_15924
|
||||
[ISO 3166-1 alpha-2]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
||||
[ISO 3166-1 alpha-3]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
|
||||
[ISO 3166-1 numeric]: https://en.wikipedia.org/wiki/ISO_3166-1_numeric
|
||||
[ISO 4217]: https://en.wikipedia.org/wiki/ISO_4217
|
||||
[ISRC]: https://en.wikipedia.org/wiki/International_Standard_Recording_Code
|
||||
[ISSN]: https://en.wikipedia.org/wiki/International_Standard_Serial_Number
|
||||
|
||||
11
backend/node_modules/validator/es/index.js
generated
vendored
11
backend/node_modules/validator/es/index.js
generated
vendored
@@ -19,7 +19,7 @@ import isAbaRouting from './lib/isAbaRouting';
|
||||
import isAlpha, { locales as isAlphaLocales } from './lib/isAlpha';
|
||||
import isAlphanumeric, { locales as isAlphanumericLocales } from './lib/isAlphanumeric';
|
||||
import isNumeric from './lib/isNumeric';
|
||||
import isPassportNumber from './lib/isPassportNumber';
|
||||
import isPassportNumber, { locales as passportNumberLocales } from './lib/isPassportNumber';
|
||||
import isPort from './lib/isPort';
|
||||
import isLowercase from './lib/isLowercase';
|
||||
import isUppercase from './lib/isUppercase';
|
||||
@@ -50,6 +50,7 @@ import isJSON from './lib/isJSON';
|
||||
import isEmpty from './lib/isEmpty';
|
||||
import isLength from './lib/isLength';
|
||||
import isByteLength from './lib/isByteLength';
|
||||
import isULID from './lib/isULID';
|
||||
import isUUID from './lib/isUUID';
|
||||
import isMongoId from './lib/isMongoId';
|
||||
import isAfter from './lib/isAfter';
|
||||
@@ -71,8 +72,10 @@ import { isISO6346, isFreightContainerID } from './lib/isISO6346';
|
||||
import isISO6391 from './lib/isISO6391';
|
||||
import isISO8601 from './lib/isISO8601';
|
||||
import isRFC3339 from './lib/isRFC3339';
|
||||
import isISO15924 from './lib/isISO15924';
|
||||
import isISO31661Alpha2 from './lib/isISO31661Alpha2';
|
||||
import isISO31661Alpha3 from './lib/isISO31661Alpha3';
|
||||
import isISO31661Numeric from './lib/isISO31661Numeric';
|
||||
import isISO4217 from './lib/isISO4217';
|
||||
import isBase32 from './lib/isBase32';
|
||||
import isBase58 from './lib/isBase58';
|
||||
@@ -97,7 +100,7 @@ import isSlug from './lib/isSlug';
|
||||
import isLicensePlate from './lib/isLicensePlate';
|
||||
import isStrongPassword from './lib/isStrongPassword';
|
||||
import isVAT from './lib/isVAT';
|
||||
var version = '13.12.0';
|
||||
var version = '13.15.23';
|
||||
var validator = {
|
||||
version: version,
|
||||
toDate: toDate,
|
||||
@@ -123,6 +126,7 @@ var validator = {
|
||||
isAlphanumericLocales: isAlphanumericLocales,
|
||||
isNumeric: isNumeric,
|
||||
isPassportNumber: isPassportNumber,
|
||||
passportNumberLocales: passportNumberLocales,
|
||||
isPort: isPort,
|
||||
isLowercase: isLowercase,
|
||||
isUppercase: isUppercase,
|
||||
@@ -153,6 +157,7 @@ var validator = {
|
||||
isLength: isLength,
|
||||
isLocale: isLocale,
|
||||
isByteLength: isByteLength,
|
||||
isULID: isULID,
|
||||
isUUID: isUUID,
|
||||
isMongoId: isMongoId,
|
||||
isAfter: isAfter,
|
||||
@@ -176,9 +181,11 @@ var validator = {
|
||||
isFreightContainerID: isFreightContainerID,
|
||||
isISO6391: isISO6391,
|
||||
isISO8601: isISO8601,
|
||||
isISO15924: isISO15924,
|
||||
isRFC3339: isRFC3339,
|
||||
isISO31661Alpha2: isISO31661Alpha2,
|
||||
isISO31661Alpha3: isISO31661Alpha3,
|
||||
isISO31661Numeric: isISO31661Numeric,
|
||||
isISO4217: isISO4217,
|
||||
isBase32: isBase32,
|
||||
isBase58: isBase58,
|
||||
|
||||
20
backend/node_modules/validator/es/lib/alpha.js
generated
vendored
20
backend/node_modules/validator/es/lib/alpha.js
generated
vendored
@@ -37,7 +37,14 @@ export var alpha = {
|
||||
bn: /^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,
|
||||
eo: /^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,
|
||||
'hi-IN': /^[\u0900-\u0961]+[\u0972-\u097F]*$/i,
|
||||
'si-LK': /^[\u0D80-\u0DFF]+$/
|
||||
'si-LK': /^[\u0D80-\u0DFF]+$/,
|
||||
'ta-IN': /^[\u0B80-\u0BFF]+$/i,
|
||||
'te-IN': /^[\u0C00-\u0C7F]+$/i,
|
||||
'kn-IN': /^[\u0C80-\u0CFF]+$/i,
|
||||
'ml-IN': /^[\u0D00-\u0D7F]+$/i,
|
||||
'gu-IN': /^[\u0A80-\u0AFF]+$/i,
|
||||
'pa-IN': /^[\u0A00-\u0A7F]+$/i,
|
||||
'or-IN': /^[\u0B00-\u0B7F]+$/i
|
||||
};
|
||||
export var alphanumeric = {
|
||||
'en-US': /^[0-9A-Z]+$/i,
|
||||
@@ -77,7 +84,14 @@ export var alphanumeric = {
|
||||
bn: /^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,
|
||||
eo: /^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,
|
||||
'hi-IN': /^[\u0900-\u0963]+[\u0966-\u097F]*$/i,
|
||||
'si-LK': /^[0-9\u0D80-\u0DFF]+$/
|
||||
'si-LK': /^[0-9\u0D80-\u0DFF]+$/,
|
||||
'ta-IN': /^[0-9\u0B80-\u0BFF.]+$/i,
|
||||
'te-IN': /^[0-9\u0C00-\u0C7F.]+$/i,
|
||||
'kn-IN': /^[0-9\u0C80-\u0CFF.]+$/i,
|
||||
'ml-IN': /^[0-9\u0D00-\u0D7F.]+$/i,
|
||||
'gu-IN': /^[0-9\u0A80-\u0AFF.]+$/i,
|
||||
'pa-IN': /^[0-9\u0A00-\u0A7F.]+$/i,
|
||||
'or-IN': /^[0-9\u0B00-\u0B7F.]+$/i
|
||||
};
|
||||
export var decimal = {
|
||||
'en-US': '.',
|
||||
@@ -115,7 +129,7 @@ for (var _locale3, _i3 = 0; _i3 < bengaliLocales.length; _i3++) {
|
||||
|
||||
// Source: https://en.wikipedia.org/wiki/Decimal_mark
|
||||
export var dotDecimal = ['ar-EG', 'ar-LB', 'ar-LY'];
|
||||
export var commaDecimal = ['bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-ZM', 'eo', 'es-ES', 'fr-CA', 'fr-FR', 'id-ID', 'it-IT', 'ku-IQ', 'hi-IN', 'hu-HU', 'nb-NO', 'nn-NO', 'nl-NL', 'pl-PL', 'pt-PT', 'ru-RU', 'kk-KZ', 'si-LK', 'sl-SI', 'sr-RS@latin', 'sr-RS', 'sv-SE', 'tr-TR', 'uk-UA', 'vi-VN'];
|
||||
export var commaDecimal = ['bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-ZM', 'eo', 'es-ES', 'fr-CA', 'fr-FR', 'gu-IN', 'hi-IN', 'hu-HU', 'id-ID', 'it-IT', 'kk-KZ', 'kn-IN', 'ku-IQ', 'ml-IN', 'nb-NO', 'nl-NL', 'nn-NO', 'or-IN', 'pa-IN', 'pl-PL', 'pt-PT', 'ru-RU', 'si-LK', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'ta-IN', 'te-IN', 'tr-TR', 'uk-UA', 'vi-VN'];
|
||||
for (var _i4 = 0; _i4 < dotDecimal.length; _i4++) {
|
||||
decimal[dotDecimal[_i4]] = decimal['en-US'];
|
||||
}
|
||||
|
||||
4
backend/node_modules/validator/es/lib/contains.js
generated
vendored
4
backend/node_modules/validator/es/lib/contains.js
generated
vendored
@@ -1,13 +1,13 @@
|
||||
import assertString from './util/assertString';
|
||||
import toString from './util/toString';
|
||||
import merge from './util/merge';
|
||||
var defaulContainsOptions = {
|
||||
var defaultContainsOptions = {
|
||||
ignoreCase: false,
|
||||
minOccurrences: 1
|
||||
};
|
||||
export default function contains(str, elem, options) {
|
||||
assertString(str);
|
||||
options = merge(options, defaulContainsOptions);
|
||||
options = merge(options, defaultContainsOptions);
|
||||
if (options.ignoreCase) {
|
||||
return str.toLowerCase().split(toString(elem).toLowerCase()).length > options.minOccurrences;
|
||||
}
|
||||
|
||||
3
backend/node_modules/validator/es/lib/isAfter.js
generated
vendored
3
backend/node_modules/validator/es/lib/isAfter.js
generated
vendored
@@ -1,8 +1,9 @@
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
import toDate from './toDate';
|
||||
export default function isAfter(date, options) {
|
||||
// For backwards compatibility:
|
||||
// isAfter(str [, date]), i.e. `options` could be used as argument for the legacy `date`
|
||||
var comparisonDate = (options === null || options === void 0 ? void 0 : options.comparisonDate) || options || Date().toString();
|
||||
var comparisonDate = (_typeof(options) === 'object' ? options.comparisonDate : options) || Date().toString();
|
||||
var comparison = toDate(comparisonDate);
|
||||
var original = toDate(date);
|
||||
return !!(original && comparison && original > comparison);
|
||||
|
||||
29
backend/node_modules/validator/es/lib/isBase64.js
generated
vendored
29
backend/node_modules/validator/es/lib/isBase64.js
generated
vendored
@@ -1,20 +1,23 @@
|
||||
import assertString from './util/assertString';
|
||||
import merge from './util/merge';
|
||||
var notBase64 = /[^A-Z0-9+\/=]/i;
|
||||
var urlSafeBase64 = /^[A-Z0-9_\-]*$/i;
|
||||
var defaultBase64Options = {
|
||||
urlSafe: false
|
||||
};
|
||||
var base64WithPadding = /^[A-Za-z0-9+/]+={0,2}$/;
|
||||
var base64WithoutPadding = /^[A-Za-z0-9+/]+$/;
|
||||
var base64UrlWithPadding = /^[A-Za-z0-9_-]+={0,2}$/;
|
||||
var base64UrlWithoutPadding = /^[A-Za-z0-9_-]+$/;
|
||||
export default function isBase64(str, options) {
|
||||
var _options;
|
||||
assertString(str);
|
||||
options = merge(options, defaultBase64Options);
|
||||
var len = str.length;
|
||||
options = merge(options, {
|
||||
urlSafe: false,
|
||||
padding: !((_options = options) !== null && _options !== void 0 && _options.urlSafe)
|
||||
});
|
||||
if (str === '') return true;
|
||||
if (options.padding && str.length % 4 !== 0) return false;
|
||||
var regex;
|
||||
if (options.urlSafe) {
|
||||
return urlSafeBase64.test(str);
|
||||
regex = options.padding ? base64UrlWithPadding : base64UrlWithoutPadding;
|
||||
} else {
|
||||
regex = options.padding ? base64WithPadding : base64WithoutPadding;
|
||||
}
|
||||
if (len % 4 !== 0 || notBase64.test(str)) {
|
||||
return false;
|
||||
}
|
||||
var firstPaddingChar = str.indexOf('=');
|
||||
return firstPaddingChar === -1 || firstPaddingChar === len - 1 || firstPaddingChar === len - 2 && str[len - 1] === '=';
|
||||
return (!options.padding || str.length % 4 === 0) && regex.test(str);
|
||||
}
|
||||
13
backend/node_modules/validator/es/lib/isBefore.js
generated
vendored
13
backend/node_modules/validator/es/lib/isBefore.js
generated
vendored
@@ -1,9 +1,10 @@
|
||||
import assertString from './util/assertString';
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
import toDate from './toDate';
|
||||
export default function isBefore(str) {
|
||||
var date = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : String(new Date());
|
||||
assertString(str);
|
||||
var comparison = toDate(date);
|
||||
var original = toDate(str);
|
||||
export default function isBefore(date, options) {
|
||||
// For backwards compatibility:
|
||||
// isBefore(str [, date]), i.e. `options` could be used as argument for the legacy `date`
|
||||
var comparisonDate = (_typeof(options) === 'object' ? options.comparisonDate : options) || Date().toString();
|
||||
var comparison = toDate(comparisonDate);
|
||||
var original = toDate(date);
|
||||
return !!(original && comparison && original < comparison);
|
||||
}
|
||||
5
backend/node_modules/validator/es/lib/isBoolean.js
generated
vendored
5
backend/node_modules/validator/es/lib/isBoolean.js
generated
vendored
@@ -1,4 +1,5 @@
|
||||
import assertString from './util/assertString';
|
||||
import includes from './util/includesArray';
|
||||
var defaultOptions = {
|
||||
loose: false
|
||||
};
|
||||
@@ -8,7 +9,7 @@ export default function isBoolean(str) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultOptions;
|
||||
assertString(str);
|
||||
if (options.loose) {
|
||||
return looseBooleans.includes(str.toLowerCase());
|
||||
return includes(looseBooleans, str.toLowerCase());
|
||||
}
|
||||
return strictBooleans.includes(str);
|
||||
return includes(strictBooleans, str);
|
||||
}
|
||||
4
backend/node_modules/validator/es/lib/isBtcAddress.js
generated
vendored
4
backend/node_modules/validator/es/lib/isBtcAddress.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
import assertString from './util/assertString';
|
||||
var bech32 = /^(bc1)[a-z0-9]{25,39}$/;
|
||||
var base58 = /^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/;
|
||||
var bech32 = /^(bc1|tb1|bc1p|tb1p)[ac-hj-np-z02-9]{39,58}$/;
|
||||
var base58 = /^(1|2|3|m)[A-HJ-NP-Za-km-z1-9]{25,39}$/;
|
||||
export default function isBtcAddress(str) {
|
||||
assertString(str);
|
||||
return bech32.test(str) || base58.test(str);
|
||||
|
||||
15
backend/node_modules/validator/es/lib/isDate.js
generated
vendored
15
backend/node_modules/validator/es/lib/isDate.js
generated
vendored
@@ -1,10 +1,10 @@
|
||||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
||||
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
||||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
||||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
||||
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
||||
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
||||
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
||||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
||||
import merge from './util/merge';
|
||||
var default_date_options = {
|
||||
format: 'YYYY/MM/DD',
|
||||
@@ -16,7 +16,7 @@ function isValidFormat(format) {
|
||||
}
|
||||
function zip(date, format) {
|
||||
var zippedArr = [],
|
||||
len = Math.min(date.length, format.length);
|
||||
len = Math.max(date.length, format.length);
|
||||
for (var i = 0; i < len; i++) {
|
||||
zippedArr.push([date[i], format[i]]);
|
||||
}
|
||||
@@ -32,6 +32,7 @@ export default function isDate(input, options) {
|
||||
options = merge(options, default_date_options);
|
||||
}
|
||||
if (typeof input === 'string' && isValidFormat(options.format)) {
|
||||
if (options.strictMode && input.length !== options.format.length) return false;
|
||||
var formatDelimiter = options.delimiters.find(function (delimiter) {
|
||||
return options.format.indexOf(delimiter) !== -1;
|
||||
});
|
||||
@@ -47,7 +48,7 @@ export default function isDate(input, options) {
|
||||
var _step$value = _slicedToArray(_step.value, 2),
|
||||
dateWord = _step$value[0],
|
||||
formatWord = _step$value[1];
|
||||
if (dateWord.length !== formatWord.length) {
|
||||
if (!dateWord || !formatWord || dateWord.length !== formatWord.length) {
|
||||
return false;
|
||||
}
|
||||
dateObj[formatWord.charAt(0)] = dateWord;
|
||||
|
||||
2
backend/node_modules/validator/es/lib/isDecimal.js
generated
vendored
2
backend/node_modules/validator/es/lib/isDecimal.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
import merge from './util/merge';
|
||||
import assertString from './util/assertString';
|
||||
import includes from './util/includes';
|
||||
import includes from './util/includesArray';
|
||||
import { decimal } from './alpha';
|
||||
function decimalRegExp(options) {
|
||||
var regExp = new RegExp("^[-+]?([0-9]+)?(\\".concat(decimal[options.locale], "[0-9]{").concat(options.decimal_digits, "})").concat(options.force_decimal ? '' : '?', "$"));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user