diff --git a/.env b/.env deleted file mode 100644 index 586c1ce..0000000 --- a/.env +++ /dev/null @@ -1,5 +0,0 @@ -POSTGRES_HOST=68.248.140.20 -POSTGRES_PORT=5432 -POSTGRES_USER=postgres -POSTGRES_PASSWORD=4yMn7npVkpaQOSmXMZGPf5OP8W09NcdITdVWrxifg69LRD2zZQuJSY8YLEAbduhQ -POSTGRES_DB=postgres \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..32c96c1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +/node_modules \ No newline at end of file diff --git a/node_modules/.prisma/client/default.d.ts b/node_modules/.prisma/client/default.d.ts deleted file mode 100644 index bac7a5c..0000000 --- a/node_modules/.prisma/client/default.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ - -import * as runtime from '@prisma/client/runtime/library' - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare const PrismaClient: any - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare type PrismaClient = any - -export declare class PrismaClientExtends< - ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, -> { - $extends: { extArgs: ExtArgs } & (< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ) => PrismaClientExtends & Args['client']) - - $transaction( - fn: (prisma: Omit) => Promise, - options?: { maxWait?: number; timeout?: number; isolationLevel?: string }, - ): Promise - $transaction

[]>( - arg: [...P], - options?: { isolationLevel?: string }, - ): Promise> -} - -export declare const dmmf: any -export declare type dmmf = any - -/** - * Get the type of the value, that the Promise holds. - */ -export declare type PromiseType> = T extends PromiseLike ? U : T - -/** - * Get the return type of a function which returns a Promise. - */ -export declare type PromiseReturnType Promise> = PromiseType> - -export namespace Prisma { - export type TransactionClient = any - - export function defineExtension< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ): (client: any) => PrismaClientExtends - - export type Extension = runtime.Types.Extensions.UserArgs - export import getExtensionContext = runtime.Extensions.getExtensionContext - export import Args = runtime.Types.Public.Args - export import Payload = runtime.Types.Public.Payload - export import Result = runtime.Types.Public.Result - export import Exact = runtime.Types.Public.Exact - export import PrismaPromise = runtime.Types.Public.PrismaPromise - - export const prismaVersion: { - client: string - engine: string - } -} diff --git a/node_modules/.prisma/client/default.js b/node_modules/.prisma/client/default.js deleted file mode 100644 index 6c1378f..0000000 --- a/node_modules/.prisma/client/default.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/scripts/default-index.ts -var default_index_exports = {}; -__export(default_index_exports, { - Prisma: () => Prisma, - PrismaClient: () => PrismaClient, - default: () => default_index_default -}); -module.exports = __toCommonJS(default_index_exports); - -// ../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/package.json -var prisma = { - enginesVersion: "bf0e5e8a04cada8225617067eaa03d041e2bba36" -}; - -// package.json -var version = "5.21.1"; - -// src/runtime/utils/clientVersion.ts -var clientVersion = version; - -// src/scripts/default-index.ts -var PrismaClient = class { - constructor() { - throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.'); - } -}; -function defineExtension(ext) { - if (typeof ext === "function") { - return ext; - } - return (client) => client.$extends(ext); -} -function getExtensionContext(that) { - return that; -} -var Prisma = { - defineExtension, - getExtensionContext, - prismaVersion: { client: clientVersion, engine: prisma.enginesVersion } -}; -var default_index_default = { Prisma }; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Prisma, - PrismaClient -}); diff --git a/node_modules/.prisma/client/deno/edge.d.ts b/node_modules/.prisma/client/deno/edge.d.ts deleted file mode 100644 index bca0a97..0000000 --- a/node_modules/.prisma/client/deno/edge.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -class PrismaClient { - constructor() { - throw new Error( - '@prisma/client/deno/edge did not initialize yet. Please run "prisma generate" and try to import it again.', - ) - } -} - -export { PrismaClient } diff --git a/node_modules/.prisma/client/edge.d.ts b/node_modules/.prisma/client/edge.d.ts deleted file mode 100644 index bac7a5c..0000000 --- a/node_modules/.prisma/client/edge.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ - -import * as runtime from '@prisma/client/runtime/library' - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare const PrismaClient: any - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare type PrismaClient = any - -export declare class PrismaClientExtends< - ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, -> { - $extends: { extArgs: ExtArgs } & (< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ) => PrismaClientExtends & Args['client']) - - $transaction( - fn: (prisma: Omit) => Promise, - options?: { maxWait?: number; timeout?: number; isolationLevel?: string }, - ): Promise - $transaction

[]>( - arg: [...P], - options?: { isolationLevel?: string }, - ): Promise> -} - -export declare const dmmf: any -export declare type dmmf = any - -/** - * Get the type of the value, that the Promise holds. - */ -export declare type PromiseType> = T extends PromiseLike ? U : T - -/** - * Get the return type of a function which returns a Promise. - */ -export declare type PromiseReturnType Promise> = PromiseType> - -export namespace Prisma { - export type TransactionClient = any - - export function defineExtension< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ): (client: any) => PrismaClientExtends - - export type Extension = runtime.Types.Extensions.UserArgs - export import getExtensionContext = runtime.Extensions.getExtensionContext - export import Args = runtime.Types.Public.Args - export import Payload = runtime.Types.Public.Payload - export import Result = runtime.Types.Public.Result - export import Exact = runtime.Types.Public.Exact - export import PrismaPromise = runtime.Types.Public.PrismaPromise - - export const prismaVersion: { - client: string - engine: string - } -} diff --git a/node_modules/.prisma/client/edge.js b/node_modules/.prisma/client/edge.js deleted file mode 100644 index 6c1378f..0000000 --- a/node_modules/.prisma/client/edge.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/scripts/default-index.ts -var default_index_exports = {}; -__export(default_index_exports, { - Prisma: () => Prisma, - PrismaClient: () => PrismaClient, - default: () => default_index_default -}); -module.exports = __toCommonJS(default_index_exports); - -// ../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/package.json -var prisma = { - enginesVersion: "bf0e5e8a04cada8225617067eaa03d041e2bba36" -}; - -// package.json -var version = "5.21.1"; - -// src/runtime/utils/clientVersion.ts -var clientVersion = version; - -// src/scripts/default-index.ts -var PrismaClient = class { - constructor() { - throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.'); - } -}; -function defineExtension(ext) { - if (typeof ext === "function") { - return ext; - } - return (client) => client.$extends(ext); -} -function getExtensionContext(that) { - return that; -} -var Prisma = { - defineExtension, - getExtensionContext, - prismaVersion: { client: clientVersion, engine: prisma.enginesVersion } -}; -var default_index_default = { Prisma }; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Prisma, - PrismaClient -}); diff --git a/node_modules/.prisma/client/index-browser.js b/node_modules/.prisma/client/index-browser.js deleted file mode 100644 index 6c1378f..0000000 --- a/node_modules/.prisma/client/index-browser.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/scripts/default-index.ts -var default_index_exports = {}; -__export(default_index_exports, { - Prisma: () => Prisma, - PrismaClient: () => PrismaClient, - default: () => default_index_default -}); -module.exports = __toCommonJS(default_index_exports); - -// ../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/package.json -var prisma = { - enginesVersion: "bf0e5e8a04cada8225617067eaa03d041e2bba36" -}; - -// package.json -var version = "5.21.1"; - -// src/runtime/utils/clientVersion.ts -var clientVersion = version; - -// src/scripts/default-index.ts -var PrismaClient = class { - constructor() { - throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.'); - } -}; -function defineExtension(ext) { - if (typeof ext === "function") { - return ext; - } - return (client) => client.$extends(ext); -} -function getExtensionContext(that) { - return that; -} -var Prisma = { - defineExtension, - getExtensionContext, - prismaVersion: { client: clientVersion, engine: prisma.enginesVersion } -}; -var default_index_default = { Prisma }; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Prisma, - PrismaClient -}); diff --git a/node_modules/.prisma/client/index.d.ts b/node_modules/.prisma/client/index.d.ts deleted file mode 100644 index bac7a5c..0000000 --- a/node_modules/.prisma/client/index.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ - -import * as runtime from '@prisma/client/runtime/library' - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare const PrismaClient: any - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare type PrismaClient = any - -export declare class PrismaClientExtends< - ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, -> { - $extends: { extArgs: ExtArgs } & (< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ) => PrismaClientExtends & Args['client']) - - $transaction( - fn: (prisma: Omit) => Promise, - options?: { maxWait?: number; timeout?: number; isolationLevel?: string }, - ): Promise - $transaction

[]>( - arg: [...P], - options?: { isolationLevel?: string }, - ): Promise> -} - -export declare const dmmf: any -export declare type dmmf = any - -/** - * Get the type of the value, that the Promise holds. - */ -export declare type PromiseType> = T extends PromiseLike ? U : T - -/** - * Get the return type of a function which returns a Promise. - */ -export declare type PromiseReturnType Promise> = PromiseType> - -export namespace Prisma { - export type TransactionClient = any - - export function defineExtension< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ): (client: any) => PrismaClientExtends - - export type Extension = runtime.Types.Extensions.UserArgs - export import getExtensionContext = runtime.Extensions.getExtensionContext - export import Args = runtime.Types.Public.Args - export import Payload = runtime.Types.Public.Payload - export import Result = runtime.Types.Public.Result - export import Exact = runtime.Types.Public.Exact - export import PrismaPromise = runtime.Types.Public.PrismaPromise - - export const prismaVersion: { - client: string - engine: string - } -} diff --git a/node_modules/.prisma/client/index.js b/node_modules/.prisma/client/index.js deleted file mode 100644 index 6c1378f..0000000 --- a/node_modules/.prisma/client/index.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/scripts/default-index.ts -var default_index_exports = {}; -__export(default_index_exports, { - Prisma: () => Prisma, - PrismaClient: () => PrismaClient, - default: () => default_index_default -}); -module.exports = __toCommonJS(default_index_exports); - -// ../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/package.json -var prisma = { - enginesVersion: "bf0e5e8a04cada8225617067eaa03d041e2bba36" -}; - -// package.json -var version = "5.21.1"; - -// src/runtime/utils/clientVersion.ts -var clientVersion = version; - -// src/scripts/default-index.ts -var PrismaClient = class { - constructor() { - throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.'); - } -}; -function defineExtension(ext) { - if (typeof ext === "function") { - return ext; - } - return (client) => client.$extends(ext); -} -function getExtensionContext(that) { - return that; -} -var Prisma = { - defineExtension, - getExtensionContext, - prismaVersion: { client: clientVersion, engine: prisma.enginesVersion } -}; -var default_index_default = { Prisma }; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Prisma, - PrismaClient -}); diff --git a/node_modules/.prisma/client/wasm.d.ts b/node_modules/.prisma/client/wasm.d.ts deleted file mode 100644 index bac7a5c..0000000 --- a/node_modules/.prisma/client/wasm.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ - -import * as runtime from '@prisma/client/runtime/library' - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare const PrismaClient: any - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare type PrismaClient = any - -export declare class PrismaClientExtends< - ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, -> { - $extends: { extArgs: ExtArgs } & (< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ) => PrismaClientExtends & Args['client']) - - $transaction( - fn: (prisma: Omit) => Promise, - options?: { maxWait?: number; timeout?: number; isolationLevel?: string }, - ): Promise - $transaction

[]>( - arg: [...P], - options?: { isolationLevel?: string }, - ): Promise> -} - -export declare const dmmf: any -export declare type dmmf = any - -/** - * Get the type of the value, that the Promise holds. - */ -export declare type PromiseType> = T extends PromiseLike ? U : T - -/** - * Get the return type of a function which returns a Promise. - */ -export declare type PromiseReturnType Promise> = PromiseType> - -export namespace Prisma { - export type TransactionClient = any - - export function defineExtension< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ): (client: any) => PrismaClientExtends - - export type Extension = runtime.Types.Extensions.UserArgs - export import getExtensionContext = runtime.Extensions.getExtensionContext - export import Args = runtime.Types.Public.Args - export import Payload = runtime.Types.Public.Payload - export import Result = runtime.Types.Public.Result - export import Exact = runtime.Types.Public.Exact - export import PrismaPromise = runtime.Types.Public.PrismaPromise - - export const prismaVersion: { - client: string - engine: string - } -} diff --git a/node_modules/.prisma/client/wasm.js b/node_modules/.prisma/client/wasm.js deleted file mode 100644 index 6c1378f..0000000 --- a/node_modules/.prisma/client/wasm.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/scripts/default-index.ts -var default_index_exports = {}; -__export(default_index_exports, { - Prisma: () => Prisma, - PrismaClient: () => PrismaClient, - default: () => default_index_default -}); -module.exports = __toCommonJS(default_index_exports); - -// ../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/package.json -var prisma = { - enginesVersion: "bf0e5e8a04cada8225617067eaa03d041e2bba36" -}; - -// package.json -var version = "5.21.1"; - -// src/runtime/utils/clientVersion.ts -var clientVersion = version; - -// src/scripts/default-index.ts -var PrismaClient = class { - constructor() { - throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.'); - } -}; -function defineExtension(ext) { - if (typeof ext === "function") { - return ext; - } - return (client) => client.$extends(ext); -} -function getExtensionContext(that) { - return that; -} -var Prisma = { - defineExtension, - getExtensionContext, - prismaVersion: { client: clientVersion, engine: prisma.enginesVersion } -}; -var default_index_default = { Prisma }; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Prisma, - PrismaClient -}); diff --git a/node_modules/@msgpack/msgpack/LICENSE b/node_modules/@msgpack/msgpack/LICENSE deleted file mode 100644 index f0e7f3e..0000000 --- a/node_modules/@msgpack/msgpack/LICENSE +++ /dev/null @@ -1,5 +0,0 @@ -Copyright 2019 The MessagePack Community. - -Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/@msgpack/msgpack/README.md b/node_modules/@msgpack/msgpack/README.md deleted file mode 100644 index 19854d6..0000000 --- a/node_modules/@msgpack/msgpack/README.md +++ /dev/null @@ -1,621 +0,0 @@ -# MessagePack for JavaScript/ECMA-262 - -[![npm version](https://img.shields.io/npm/v/@msgpack/msgpack.svg)](https://www.npmjs.com/package/@msgpack/msgpack) ![CI](https://github.com/msgpack/msgpack-javascript/workflows/CI/badge.svg) [![codecov](https://codecov.io/gh/msgpack/msgpack-javascript/branch/master/graphs/badge.svg)](https://codecov.io/gh/msgpack/msgpack-javascript) [![minzip](https://badgen.net/bundlephobia/minzip/@msgpack/msgpack)](https://bundlephobia.com/result?p=@msgpack/msgpack) [![tree-shaking](https://badgen.net/bundlephobia/tree-shaking/@msgpack/msgpack)](https://bundlephobia.com/result?p=@msgpack/msgpack) - -This is a JavaScript/ECMA-262 implementation of **MessagePack**, an efficient binary serilization format: - -https://msgpack.org/ - -This library is a universal JavaScript, meaning it is compatible with all the major browsers and NodeJS. In addition, because it is implemented in [TypeScript](https://www.typescriptlang.org/), type definition files (`d.ts`) are always up-to-date and bundled in the distribution. - -*Note that this is the second version of MessagePack for JavaScript. The first version, which was implemented in ES5 and was never released to npmjs.com, is tagged as [classic](https://github.com/msgpack/msgpack-javascript/tree/classic).* - -## Synopsis - -```typescript -import { deepStrictEqual } from "assert"; -import { encode, decode } from "@msgpack/msgpack"; - -const object = { - nil: null, - integer: 1, - float: Math.PI, - string: "Hello, world!", - binary: Uint8Array.from([1, 2, 3]), - array: [10, 20, 30], - map: { foo: "bar" }, - timestampExt: new Date(), -}; - -const encoded: Uint8Array = encode(object); - -deepStrictEqual(decode(encoded), object); -``` - -## Table of Contents - -- [Synopsis](#synopsis) -- [Table of Contents](#table-of-contents) -- [Install](#install) -- [API](#api) - - [`encode(data: unknown, options?: EncodeOptions): Uint8Array`](#encodedata-unknown-options-encodeoptions-uint8array) - - [`EncodeOptions`](#encodeoptions) - - [`decode(buffer: ArrayLike | BufferSource, options?: DecodeOptions): unknown`](#decodebuffer-arraylikenumber--buffersource-options-decodeoptions-unknown) - - [`DecodeOptions`](#decodeoptions) - - [`decodeMulti(buffer: ArrayLike | BufferSource, options?: DecodeOptions): Generator`](#decodemultibuffer-arraylikenumber--buffersource-options-decodeoptions-generatorunknown-void-unknown) - - [`decodeAsync(stream: ReadableStreamLike | BufferSource>, options?: DecodeAsyncOptions): Promise`](#decodeasyncstream-readablestreamlikearraylikenumber--buffersource-options-decodeasyncoptions-promiseunknown) - - [`decodeArrayStream(stream: ReadableStreamLike | BufferSource>, options?: DecodeAsyncOptions): AsyncIterable`](#decodearraystreamstream-readablestreamlikearraylikenumber--buffersource-options-decodeasyncoptions-asynciterableunknown) - - [`decodeMultiStream(stream: ReadableStreamLike | BufferSource>, options?: DecodeAsyncOptions): AsyncIterable`](#decodemultistreamstream-readablestreamlikearraylikenumber--buffersource-options-decodeasyncoptions-asynciterableunknown) - - [Reusing Encoder and Decoder instances](#reusing-encoder-and-decoder-instances) -- [Extension Types](#extension-types) - - [ExtensionCodec context](#extensioncodec-context) - - [Handling BigInt with ExtensionCodec](#handling-bigint-with-extensioncodec) - - [The temporal module as timestamp extensions](#the-temporal-module-as-timestamp-extensions) -- [Decoding a Blob](#decoding-a-blob) -- [MessagePack Specification](#messagepack-specification) - - [MessagePack Mapping Table](#messagepack-mapping-table) -- [Prerequisites](#prerequisites) - - [ECMA-262](#ecma-262) - - [NodeJS](#nodejs) - - [TypeScript Compiler / Type Definitions](#typescript-compiler--type-definitions) -- [Benchmark](#benchmark) -- [Distribution](#distribution) - - [NPM / npmjs.com](#npm--npmjscom) - - [CDN / unpkg.com](#cdn--unpkgcom) -- [Deno Support](#deno-support) -- [Maintenance](#maintenance) - - [Testing](#testing) - - [Continuous Integration](#continuous-integration) - - [Release Engineering](#release-engineering) - - [Updating Dependencies](#updating-dependencies) -- [License](#license) - -## Install - -This library is published to `npmjs.com` as [@msgpack/msgpack](https://www.npmjs.com/package/@msgpack/msgpack). - -```shell -npm install @msgpack/msgpack -``` - -## API - -### `encode(data: unknown, options?: EncodeOptions): Uint8Array` - -It encodes `data` into a single MessagePack-encoded object, and returns a byte array as `Uint8Array`. It throws errors if `data` is, or includes, a non-serializable object such as a `function` or a `symbol`. - -for example: - -```typescript -import { encode } from "@msgpack/msgpack"; - -const encoded: Uint8Array = encode({ foo: "bar" }); -console.log(encoded); -``` - -If you'd like to convert an `uint8array` to a NodeJS `Buffer`, use `Buffer.from(arrayBuffer, offset, length)` in order not to copy the underlying `ArrayBuffer`, while `Buffer.from(uint8array)` copies it: - -```typescript -import { encode } from "@msgpack/msgpack"; - -const encoded: Uint8Array = encode({ foo: "bar" }); - -// `buffer` refers the same ArrayBuffer as `encoded`. -const buffer: Buffer = Buffer.from(encoded.buffer, encoded.byteOffset, encoded.byteLength); -console.log(buffer); -``` - -#### `EncodeOptions` - -Name|Type|Default -----|----|---- -extensionCodec | ExtensionCodec | `ExtensionCodec.defaultCodec` -maxDepth | number | `100` -initialBufferSize | number | `2048` -sortKeys | boolean | false -forceFloat32 | boolean | false -forceIntegerToFloat | boolean | false -ignoreUndefined | boolean | false -context | user-defined | - - -### `decode(buffer: ArrayLike | BufferSource, options?: DecodeOptions): unknown` - -It decodes `buffer` that includes a MessagePack-encoded object, and returns the decoded object typed `unknown`. - -`buffer` must be an array of bytes, which is typically `Uint8Array` or `ArrayBuffer`. `BufferSource` is defined as `ArrayBuffer | ArrayBufferView`. - -The `buffer` must include a single encoded object. If the `buffer` includes extra bytes after an object or the `buffer` is empty, it throws `RangeError`. To decode `buffer` that includes multiple encoded objects, use `decodeMulti()` or `decodeMultiStream()` (recommended) instead. - -for example: - -```typescript -import { decode } from "@msgpack/msgpack"; - -const encoded: Uint8Array; -const object = decode(encoded); -console.log(object); -``` - -NodeJS `Buffer` is also acceptable because it is a subclass of `Uint8Array`. - -#### `DecodeOptions` - -Name|Type|Default -----|----|---- -extensionCodec | ExtensionCodec | `ExtensionCodec.defaultCodec` -maxStrLength | number | `4_294_967_295` (UINT32_MAX) -maxBinLength | number | `4_294_967_295` (UINT32_MAX) -maxArrayLength | number | `4_294_967_295` (UINT32_MAX) -maxMapLength | number | `4_294_967_295` (UINT32_MAX) -maxExtLength | number | `4_294_967_295` (UINT32_MAX) -context | user-defined | - - -You can use `max${Type}Length` to limit the length of each type decoded. - -### `decodeMulti(buffer: ArrayLike | BufferSource, options?: DecodeOptions): Generator` - -It decodes `buffer` that includes multiple MessagePack-encoded objects, and returns decoded objects as a generator. See also `decodeMultiStream()`, which is an asynchronous variant of this function. - -This function is not recommended to decode a MessagePack binary via I/O stream including sockets because it's synchronous. Instead, `decodeMultiStream()` decodes a binary stream asynchronously, typically spending less CPU and memory. - -for example: - -```typescript -import { decode } from "@msgpack/msgpack"; - -const encoded: Uint8Array; - -for (const object of decodeMulti(encoded)) { - console.log(object); -} -``` - -### `decodeAsync(stream: ReadableStreamLike | BufferSource>, options?: DecodeAsyncOptions): Promise` - -It decodes `stream`, where `ReadableStreamLike` is defined as `ReadableStream | AsyncIterable`, in an async iterable of byte arrays, and returns decoded object as `unknown` type, wrapped in `Promise`. - -This function works asynchronously, and might CPU resources more efficiently compared with synchronous `decode()`, because it doesn't wait for the completion of downloading. - -`DecodeAsyncOptions` is the same as `DecodeOptions` for `decode()`. - -This function is designed to work with whatwg `fetch()` like this: - -```typescript -import { decodeAsync } from "@msgpack/msgpack"; - -const MSGPACK_TYPE = "application/x-msgpack"; - -const response = await fetch(url); -const contentType = response.headers.get("Content-Type"); -if (contentType && contentType.startsWith(MSGPACK_TYPE) && response.body != null) { - const object = await decodeAsync(response.body); - // do something with object -} else { /* handle errors */ } -``` - -### `decodeArrayStream(stream: ReadableStreamLike | BufferSource>, options?: DecodeAsyncOptions): AsyncIterable` - -It is alike to `decodeAsync()`, but only accepts a `stream` that includes an array of items, and emits a decoded item one by one. - -for example: - -```typescript -import { decodeArrayStream } from "@msgpack/msgpack"; - -const stream: AsyncIterator; - -// in an async function: -for await (const item of decodeArrayStream(stream)) { - console.log(item); -} -``` - -### `decodeMultiStream(stream: ReadableStreamLike | BufferSource>, options?: DecodeAsyncOptions): AsyncIterable` - -It is alike to `decodeAsync()` and `decodeArrayStream()`, but the input `stream` must consist of multiple MessagePack-encoded items. This is an asynchronous variant for `decodeMulti()`. - -In other words, it could decode an unlimited stream and emits a decoded item one by one. - -for example: - -```typescript -import { decodeMultiStream } from "@msgpack/msgpack"; - -const stream: AsyncIterator; - -// in an async function: -for await (const item of decodeMultiStream(stream)) { - console.log(item); -} -``` - -This function is available since v2.4.0; previously it was called as `decodeStream()`. - -### Reusing Encoder and Decoder instances - -`Encoder` and `Decoder` classes is provided to have better performance by reusing instances: - -```typescript -import { deepStrictEqual } from "assert"; -import { Encoder, Decoder } from "@msgpack/msgpack"; - -const encoder = new Encoder(); -const decoder = new Decoder(); - -const encoded: Uint8Array = encoder.encode(object); -deepStrictEqual(decoder.decode(encoded), object); -``` - -According to our benchmark, reusing `Encoder` instance is about 20% faster -than `encode()` function, and reusing `Decoder` instance is about 2% faster -than `decode()` function. Note that the result should vary in environments -and data structure. - -## Extension Types - -To handle [MessagePack Extension Types](https://github.com/msgpack/msgpack/blob/master/spec.md#extension-types), this library provides `ExtensionCodec` class. - -This is an example to setup custom extension types that handles `Map` and `Set` classes in TypeScript: - -```typescript -import { encode, decode, ExtensionCodec } from "@msgpack/msgpack"; - -const extensionCodec = new ExtensionCodec(); - -// Set -const SET_EXT_TYPE = 0 // Any in 0-127 -extensionCodec.register({ - type: SET_EXT_TYPE, - encode: (object: unknown): Uint8Array | null => { - if (object instanceof Set) { - return encode([...object]); - } else { - return null; - } - }, - decode: (data: Uint8Array) => { - const array = decode(data) as Array; - return new Set(array); - }, -}); - -// Map -const MAP_EXT_TYPE = 1; // Any in 0-127 -extensionCodec.register({ - type: MAP_EXT_TYPE, - encode: (object: unknown): Uint8Array => { - if (object instanceof Map) { - return encode([...object]); - } else { - return null; - } - }, - decode: (data: Uint8Array) => { - const array = decode(data) as Array<[unknown, unknown]>; - return new Map(array); - }, -}); - -const encoded = encode([new Set(), new Map()], { extensionCodec }); -const decoded = decode(encoded, { extensionCodec }); -``` - -Not that extension types for custom objects must be `[0, 127]`, while `[-1, -128]` is reserved for MessagePack itself. - -#### ExtensionCodec context - -When you use an extension codec, it might be necessary to have encoding/decoding state to keep track of which objects got encoded/re-created. To do this, pass a `context` to the `EncodeOptions` and `DecodeOptions`: - -```typescript -import { encode, decode, ExtensionCodec } from "@msgpack/msgpack"; - -class MyContext { - track(object: any) { /*...*/ } -} - -class MyType { /* ... */ } - -const extensionCodec = new ExtensionCodec(); - -// MyType -const MYTYPE_EXT_TYPE = 0 // Any in 0-127 -extensionCodec.register({ - type: MYTYPE_EXT_TYPE, - encode: (object, context) => { - if (object instanceof MyType) { - context.track(object); // <-- like this - return encode(object.toJSON(), { extensionCodec, context }); - } else { - return null; - } - }, - decode: (data, extType, context) => { - const decoded = decode(data, { extensionCodec, context }); - const my = new MyType(decoded); - context.track(my); // <-- and like this - return my; - }, -}); - -// and later -import { encode, decode } from "@msgpack/msgpack"; - -const context = new MyContext(); - -const encoded = = encode({myType: new MyType()}, { extensionCodec, context }); -const decoded = decode(encoded, { extensionCodec, context }); -``` - -#### Handling BigInt with ExtensionCodec - -This library does not handle BigInt by default, but you can handle it with `ExtensionCodec` like this: - -```typescript -import { deepStrictEqual } from "assert"; -import { encode, decode, ExtensionCodec } from "@msgpack/msgpack"; - -const BIGINT_EXT_TYPE = 0; // Any in 0-127 -const extensionCodec = new ExtensionCodec(); -extensionCodec.register({ - type: BIGINT_EXT_TYPE, - encode: (input: unknown) => { - if (typeof input === "bigint") { - if (input <= Number.MAX_SAFE_INTEGER && input >= Number.MIN_SAFE_INTEGER) { - return encode(parseInt(input.toString(), 10)); - } else { - return encode(input.toString()); - } - } else { - return null; - } - }, - decode: (data: Uint8Array) => { - return BigInt(decode(data)); - }, -}); - -const value = BigInt(Number.MAX_SAFE_INTEGER) + BigInt(1); -const encoded: = encode(value, { extensionCodec }); -deepStrictEqual(decode(encoded, { extensionCodec }), value); -``` - -#### The temporal module as timestamp extensions - -There is a proposal for a new date/time representations in JavaScript: - -* https://github.com/tc39/proposal-temporal - -This library maps `Date` to the MessagePack timestamp extension by default, but you can re-map the temporal module (or [Temporal Polyfill](https://github.com/tc39/proposal-temporal/tree/main/polyfill)) to the timestamp extension like this: - -```typescript -import { Instant } from "@std-proposal/temporal"; -import { deepStrictEqual } from "assert"; -import { - encode, - decode, - ExtensionCodec, - EXT_TIMESTAMP, - encodeTimeSpecToTimestamp, - decodeTimestampToTimeSpec, -} from "@msgpack/msgpack"; - -const extensionCodec = new ExtensionCodec(); -extensionCodec.register({ - type: EXT_TIMESTAMP, // override the default behavior! - encode: (input: any) => { - if (input instanceof Instant) { - const sec = input.seconds; - const nsec = Number(input.nanoseconds - BigInt(sec) * BigInt(1e9)); - return encodeTimeSpecToTimestamp({ sec, nsec }); - } else { - return null; - } - }, - decode: (data: Uint8Array) => { - const timeSpec = decodeTimestampToTimeSpec(data); - const sec = BigInt(timeSpec.sec); - const nsec = BigInt(timeSpec.nsec); - return Instant.fromEpochNanoseconds(sec * BigInt(1e9) + nsec); - }, -}); - -const instant = Instant.fromEpochMilliseconds(Date.now()); -const encoded = encode(instant, { extensionCodec }); -const decoded = decode(encoded, { extensionCodec }); -deepStrictEqual(decoded, instant); -``` - -This will become default in this library with major-version increment, if the temporal module is standardized. - -## Decoding a Blob - -[`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) is a binary data container provided by browsers. To read its contents, you can use `Blob#arrayBuffer()` or `Blob#stream()`. `Blob#stream()` -is recommended if your target platform support it. This is because streaming -decode should be faster for large objects. In both ways, you need to use -asynchronous API. - -```typescript -async function decodeFromBlob(blob: Blob): unknown { - if (blob.stream) { - // Blob#stream(): ReadableStream (recommended) - return await decodeAsync(blob.stream()); - } else { - // Blob#arrayBuffer(): Promise (if stream() is not available) - return decode(await blob.arrayBuffer()); - } -} -``` - -## MessagePack Specification - -This library is compatible with the "August 2017" revision of MessagePack specification at the point where timestamp ext was added: - -* [x] str/bin separation, added at August 2013 -* [x] extension types, added at August 2013 -* [x] timestamp ext type, added at August 2017 - -The living specification is here: - -https://github.com/msgpack/msgpack - -Note that as of June 2019 there're no official "version" on the MessagePack specification. See https://github.com/msgpack/msgpack/issues/195 for the discussions. - -### MessagePack Mapping Table - -The following table shows how JavaScript values are mapped to [MessagePack formats](https://github.com/msgpack/msgpack/blob/master/spec.md) and vice versa. - -Source Value|MessagePack Format|Value Decoded -----|----|---- -null, undefined|nil|null (*1) -boolean (true, false)|bool family|boolean (true, false) -number (53-bit int)|int family|number (53-bit int) -number (64-bit float)|float family|number (64-bit float) -string|str family|string -ArrayBufferView |bin family|Uint8Array (*2) -Array|array family|Array -Object|map family|Object (*3) -Date|timestamp ext family|Date (*4) - -* *1 Both `null` and `undefined` are mapped to `nil` (`0xC0`) type, and are decoded into `null` -* *2 Any `ArrayBufferView`s including NodeJS's `Buffer` are mapped to `bin` family, and are decoded into `Uint8Array` -* *3 In handling `Object`, it is regarded as `Record` in terms of TypeScript -* *4 MessagePack timestamps may have nanoseconds, which will lost when it is decoded into JavaScript `Date`. This behavior can be overridden by registering `-1` for the extension codec. - -## Prerequisites - -This is a universal JavaScript library that supports major browsers and NodeJS. - -### ECMA-262 - -* ES5 language features -* ES2018 standard library, including: - * Typed arrays (ES2015) - * Async iterations (ES2018) - * Features added in ES2015-ES2018 - -ES2018 standard library used in this library can be polyfilled with [core-js](https://github.com/zloirock/core-js). - -If you support IE11, import `core-js` in your application entrypoints, as this library does in testing for browsers. - -### NodeJS - -NodeJS v10 is required, but NodeJS v12 or later is recommended because it includes the V8 feature of [Improving DataView performance in V8](https://v8.dev/blog/dataview). - -NodeJS before v10 will work by importing `@msgpack/msgpack/dist.es5+umd/msgpack`. - -### TypeScript Compiler / Type Definitions - -This module requires type definitions of `AsyncIterator`, `SourceBuffer`, whatwg streams, and so on. They are provided by `"lib": ["ES2021", "DOM"]` in `tsconfig.json`. - -Regarding the TypeScript compiler version, only the latest TypeScript is tested in development. - -## Benchmark - -Run-time performance is not the only reason to use MessagePack, but it's important to choose MessagePack libraries, so a benchmark suite is provided to monitor the performance of this library. - -V8's built-in JSON has been improved for years, esp. `JSON.parse()` is [significantly improved in V8/7.6](https://v8.dev/blog/v8-release-76), it is the fastest deserializer as of 2019, as the benchmark result bellow suggests. - -However, MessagePack can handles binary data effectively, actual performance depends on situations. You'd better take benchmark on your own use-case if performance matters. - -Benchmark on NodeJS/v18.1.0 (V8/10.1) - -operation | op | ms | op/s ------------------------------------------------------------------ | ------: | ----: | ------: -buf = Buffer.from(JSON.stringify(obj)); | 902100 | 5000 | 180420 -obj = JSON.parse(buf.toString("utf-8")); | 898700 | 5000 | 179740 -buf = require("msgpack-lite").encode(obj); | 411000 | 5000 | 82200 -obj = require("msgpack-lite").decode(buf); | 246200 | 5001 | 49230 -buf = require("@msgpack/msgpack").encode(obj); | 843300 | 5000 | 168660 -obj = require("@msgpack/msgpack").decode(buf); | 489300 | 5000 | 97860 -buf = /* @msgpack/msgpack */ encoder.encode(obj); | 1154200 | 5000 | 230840 -obj = /* @msgpack/msgpack */ decoder.decode(buf); | 448900 | 5000 | 89780 - -Note that `JSON` cases use `Buffer` to emulate I/O where a JavaScript string must be converted into a byte array encoded in UTF-8, whereas MessagePack modules deal with byte arrays. - -## Distribution - -### NPM / npmjs.com - -The NPM package distributed in npmjs.com includes both ES2015+ and ES5 files: - -* `dist/` is compiled into ES2019 with CommomJS, provided for NodeJS v10 -* `dist.es5+umd/` is compiled into ES5 with UMD - * `dist.es5+umd/msgpack.min.js` - the minified file - * `dist.es5+umd/msgpack.js` - the non-minified file -* `dist.es5+esm/` is compiled into ES5 with ES modules, provided for webpack-like bundlers and NodeJS's ESM-mode - -If you use NodeJS and/or webpack, their module resolvers use the suitable one automatically. - -### CDN / unpkg.com - -This library is available via CDN: - -```html - -``` - -It loads `MessagePack` module to the global object. - - -## Deno Support - -You can use this module on Deno. - -See `example/deno-*.ts` for examples. - -`deno.land/x` is not supported yet. - -## Maintenance - -### Testing - -For simple testing: - -``` -npm run test -``` - -### Continuous Integration - -This library uses Travis CI. - -test matrix: - -* TypeScript targets - * `target=es2019` / `target=es5` -* JavaScript engines - * NodeJS, browsers (Chrome, Firefox, Safari, IE11, and so on) - -See [test:* in package.json](./package.json) and [.travis.yml](./.travis.yml) for details. - -### Release Engineering - -```console -# run tests on NodeJS, Chrome, and Firefox -make test-all - -# edit the changelog -code CHANGELOG.md - -# bump version -npm version patch|minor|major - -# run the publishing task -make publish -``` - -### Updating Dependencies - -```console -npm run update-dependencies -``` - -## License - -Copyright 2019 The MessagePack community. - -This software uses the ISC license: - -https://opensource.org/licenses/ISC - -See [LICENSE](./LICENSE) for details. diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs deleted file mode 100644 index 853b7cd..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs +++ /dev/null @@ -1,64 +0,0 @@ -import { utf8DecodeJs } from "./utils/utf8.mjs"; -var DEFAULT_MAX_KEY_LENGTH = 16; -var DEFAULT_MAX_LENGTH_PER_KEY = 16; -var CachedKeyDecoder = /** @class */ (function () { - function CachedKeyDecoder(maxKeyLength, maxLengthPerKey) { - if (maxKeyLength === void 0) { maxKeyLength = DEFAULT_MAX_KEY_LENGTH; } - if (maxLengthPerKey === void 0) { maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY; } - this.maxKeyLength = maxKeyLength; - this.maxLengthPerKey = maxLengthPerKey; - this.hit = 0; - this.miss = 0; - // avoid `new Array(N)`, which makes a sparse array, - // because a sparse array is typically slower than a non-sparse array. - this.caches = []; - for (var i = 0; i < this.maxKeyLength; i++) { - this.caches.push([]); - } - } - CachedKeyDecoder.prototype.canBeCached = function (byteLength) { - return byteLength > 0 && byteLength <= this.maxKeyLength; - }; - CachedKeyDecoder.prototype.find = function (bytes, inputOffset, byteLength) { - var records = this.caches[byteLength - 1]; - FIND_CHUNK: for (var _i = 0, records_1 = records; _i < records_1.length; _i++) { - var record = records_1[_i]; - var recordBytes = record.bytes; - for (var j = 0; j < byteLength; j++) { - if (recordBytes[j] !== bytes[inputOffset + j]) { - continue FIND_CHUNK; - } - } - return record.str; - } - return null; - }; - CachedKeyDecoder.prototype.store = function (bytes, value) { - var records = this.caches[bytes.length - 1]; - var record = { bytes: bytes, str: value }; - if (records.length >= this.maxLengthPerKey) { - // `records` are full! - // Set `record` to an arbitrary position. - records[(Math.random() * records.length) | 0] = record; - } - else { - records.push(record); - } - }; - CachedKeyDecoder.prototype.decode = function (bytes, inputOffset, byteLength) { - var cachedValue = this.find(bytes, inputOffset, byteLength); - if (cachedValue != null) { - this.hit++; - return cachedValue; - } - this.miss++; - var str = utf8DecodeJs(bytes, inputOffset, byteLength); - // Ensure to copy a slice of bytes because the byte may be NodeJS Buffer and Buffer#slice() returns a reference to its internal ArrayBuffer. - var slicedCopyOfBytes = Uint8Array.prototype.slice.call(bytes, inputOffset, inputOffset + byteLength); - this.store(slicedCopyOfBytes, str); - return str; - }; - return CachedKeyDecoder; -}()); -export { CachedKeyDecoder }; -//# sourceMappingURL=CachedKeyDecoder.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs.map deleted file mode 100644 index 328257d..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CachedKeyDecoder.mjs","sourceRoot":"","sources":["../src/CachedKeyDecoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,IAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,IAAM,0BAA0B,GAAG,EAAE,CAAC;AAWtC;IAKE,0BAAqB,YAAqC,EAAW,eAA4C;QAA5F,6BAAA,EAAA,qCAAqC;QAAW,gCAAA,EAAA,4CAA4C;QAA5F,iBAAY,GAAZ,YAAY,CAAyB;QAAW,oBAAe,GAAf,eAAe,CAA6B;QAJjH,QAAG,GAAG,CAAC,CAAC;QACR,SAAI,GAAG,CAAC,CAAC;QAIP,oDAAoD;QACpD,sEAAsE;QACtE,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,EAAE,EAAE;YAC1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACtB;IACH,CAAC;IAEM,sCAAW,GAAlB,UAAmB,UAAkB;QACnC,OAAO,UAAU,GAAG,CAAC,IAAI,UAAU,IAAI,IAAI,CAAC,YAAY,CAAC;IAC3D,CAAC;IA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WAAW,IAAI,IAAI,EAAE;YACvB,IAAI,CAAC,GAAG,EAAE,CAAC;YACX,OAAO,WAAW,CAAC;SACpB;QACD,IAAI,CAAC,IAAI,EAAE,CAAC;QAEZ,IAAM,GAAG,GAAG,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QACzD,4IAA4I;QAC5I,IAAM,iBAAiB,GAAG,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;QACxG,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;QACnC,OAAO,GAAG,CAAC;IACb,CAAC;IACH,uBAAC;AAAD,CAAC,AA7DD,IA6DC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/DecodeError.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/DecodeError.mjs deleted file mode 100644 index 983f3f6..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/DecodeError.mjs +++ /dev/null @@ -1,33 +0,0 @@ -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var DecodeError = /** @class */ (function (_super) { - __extends(DecodeError, _super); - function DecodeError(message) { - var _this = _super.call(this, message) || this; - // fix the prototype chain in a cross-platform way - var proto = Object.create(DecodeError.prototype); - Object.setPrototypeOf(_this, proto); - Object.defineProperty(_this, "name", { - configurable: true, - enumerable: false, - value: DecodeError.name, - }); - return _this; - } - return DecodeError; -}(Error)); -export { DecodeError }; -//# sourceMappingURL=DecodeError.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/DecodeError.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/DecodeError.mjs.map deleted file mode 100644 index 537cb78..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/DecodeError.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DecodeError.mjs","sourceRoot":"","sources":["../src/DecodeError.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;IAAiC,+BAAK;IACpC,qBAAY,OAAe;QAA3B,YACE,kBAAM,OAAO,CAAC,SAWf;QATC,kDAAkD;QAClD,IAAM,KAAK,GAAiC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACjF,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,KAAK,CAAC,CAAC;QAEnC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,MAAM,EAAE;YAClC,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,WAAW,CAAC,IAAI;SACxB,CAAC,CAAC;;IACL,CAAC;IACH,kBAAC;AAAD,CAAC,AAdD,CAAiC,KAAK,GAcrC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs deleted file mode 100644 index bb6ed34..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs +++ /dev/null @@ -1,734 +0,0 @@ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __asyncValues = (this && this.__asyncValues) || function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -}; -var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } -var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -}; -import { prettyByte } from "./utils/prettyByte.mjs"; -import { ExtensionCodec } from "./ExtensionCodec.mjs"; -import { getInt64, getUint64, UINT32_MAX } from "./utils/int.mjs"; -import { utf8DecodeJs, TEXT_DECODER_THRESHOLD, utf8DecodeTD } from "./utils/utf8.mjs"; -import { createDataView, ensureUint8Array } from "./utils/typedArrays.mjs"; -import { CachedKeyDecoder } from "./CachedKeyDecoder.mjs"; -import { DecodeError } from "./DecodeError.mjs"; -var isValidMapKeyType = function (key) { - var keyType = typeof key; - return keyType === "string" || keyType === "number"; -}; -var HEAD_BYTE_REQUIRED = -1; -var EMPTY_VIEW = new DataView(new ArrayBuffer(0)); -var EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer); -// IE11: Hack to support IE11. -// IE11: Drop this hack and just use RangeError when IE11 is obsolete. -export var DataViewIndexOutOfBoundsError = (function () { - try { - // IE11: The spec says it should throw RangeError, - // IE11: but in IE11 it throws TypeError. - EMPTY_VIEW.getInt8(0); - } - catch (e) { - return e.constructor; - } - throw new Error("never reached"); -})(); -var MORE_DATA = new DataViewIndexOutOfBoundsError("Insufficient data"); -var sharedCachedKeyDecoder = new CachedKeyDecoder(); -var Decoder = /** @class */ (function () { - function Decoder(extensionCodec, context, maxStrLength, maxBinLength, maxArrayLength, maxMapLength, maxExtLength, keyDecoder) { - if (extensionCodec === void 0) { extensionCodec = ExtensionCodec.defaultCodec; } - if (context === void 0) { context = undefined; } - if (maxStrLength === void 0) { maxStrLength = UINT32_MAX; } - if (maxBinLength === void 0) { maxBinLength = UINT32_MAX; } - if (maxArrayLength === void 0) { maxArrayLength = UINT32_MAX; } - if (maxMapLength === void 0) { maxMapLength = UINT32_MAX; } - if (maxExtLength === void 0) { maxExtLength = UINT32_MAX; } - if (keyDecoder === void 0) { keyDecoder = sharedCachedKeyDecoder; } - this.extensionCodec = extensionCodec; - this.context = context; - this.maxStrLength = maxStrLength; - this.maxBinLength = maxBinLength; - this.maxArrayLength = maxArrayLength; - this.maxMapLength = maxMapLength; - this.maxExtLength = maxExtLength; - this.keyDecoder = keyDecoder; - this.totalPos = 0; - this.pos = 0; - this.view = EMPTY_VIEW; - this.bytes = EMPTY_BYTES; - this.headByte = HEAD_BYTE_REQUIRED; - this.stack = []; - } - Decoder.prototype.reinitializeState = function () { - this.totalPos = 0; - this.headByte = HEAD_BYTE_REQUIRED; - this.stack.length = 0; - // view, bytes, and pos will be re-initialized in setBuffer() - }; - Decoder.prototype.setBuffer = function (buffer) { - this.bytes = ensureUint8Array(buffer); - this.view = createDataView(this.bytes); - this.pos = 0; - }; - Decoder.prototype.appendBuffer = function (buffer) { - if (this.headByte === HEAD_BYTE_REQUIRED && !this.hasRemaining(1)) { - this.setBuffer(buffer); - } - else { - var remainingData = this.bytes.subarray(this.pos); - var newData = ensureUint8Array(buffer); - // concat remainingData + newData - var newBuffer = new Uint8Array(remainingData.length + newData.length); - newBuffer.set(remainingData); - newBuffer.set(newData, remainingData.length); - this.setBuffer(newBuffer); - } - }; - Decoder.prototype.hasRemaining = function (size) { - return this.view.byteLength - this.pos >= size; - }; - Decoder.prototype.createExtraByteError = function (posToShow) { - var _a = this, view = _a.view, pos = _a.pos; - return new RangeError("Extra ".concat(view.byteLength - pos, " of ").concat(view.byteLength, " byte(s) found at buffer[").concat(posToShow, "]")); - }; - /** - * @throws {@link DecodeError} - * @throws {@link RangeError} - */ - Decoder.prototype.decode = function (buffer) { - this.reinitializeState(); - this.setBuffer(buffer); - var object = this.doDecodeSync(); - if (this.hasRemaining(1)) { - throw this.createExtraByteError(this.pos); - } - return object; - }; - Decoder.prototype.decodeMulti = function (buffer) { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - this.reinitializeState(); - this.setBuffer(buffer); - _a.label = 1; - case 1: - if (!this.hasRemaining(1)) return [3 /*break*/, 3]; - return [4 /*yield*/, this.doDecodeSync()]; - case 2: - _a.sent(); - return [3 /*break*/, 1]; - case 3: return [2 /*return*/]; - } - }); - }; - Decoder.prototype.decodeAsync = function (stream) { - var stream_1, stream_1_1; - var e_1, _a; - return __awaiter(this, void 0, void 0, function () { - var decoded, object, buffer, e_1_1, _b, headByte, pos, totalPos; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - decoded = false; - _c.label = 1; - case 1: - _c.trys.push([1, 6, 7, 12]); - stream_1 = __asyncValues(stream); - _c.label = 2; - case 2: return [4 /*yield*/, stream_1.next()]; - case 3: - if (!(stream_1_1 = _c.sent(), !stream_1_1.done)) return [3 /*break*/, 5]; - buffer = stream_1_1.value; - if (decoded) { - throw this.createExtraByteError(this.totalPos); - } - this.appendBuffer(buffer); - try { - object = this.doDecodeSync(); - decoded = true; - } - catch (e) { - if (!(e instanceof DataViewIndexOutOfBoundsError)) { - throw e; // rethrow - } - // fallthrough - } - this.totalPos += this.pos; - _c.label = 4; - case 4: return [3 /*break*/, 2]; - case 5: return [3 /*break*/, 12]; - case 6: - e_1_1 = _c.sent(); - e_1 = { error: e_1_1 }; - return [3 /*break*/, 12]; - case 7: - _c.trys.push([7, , 10, 11]); - if (!(stream_1_1 && !stream_1_1.done && (_a = stream_1.return))) return [3 /*break*/, 9]; - return [4 /*yield*/, _a.call(stream_1)]; - case 8: - _c.sent(); - _c.label = 9; - case 9: return [3 /*break*/, 11]; - case 10: - if (e_1) throw e_1.error; - return [7 /*endfinally*/]; - case 11: return [7 /*endfinally*/]; - case 12: - if (decoded) { - if (this.hasRemaining(1)) { - throw this.createExtraByteError(this.totalPos); - } - return [2 /*return*/, object]; - } - _b = this, headByte = _b.headByte, pos = _b.pos, totalPos = _b.totalPos; - throw new RangeError("Insufficient data in parsing ".concat(prettyByte(headByte), " at ").concat(totalPos, " (").concat(pos, " in the current buffer)")); - } - }); - }); - }; - Decoder.prototype.decodeArrayStream = function (stream) { - return this.decodeMultiAsync(stream, true); - }; - Decoder.prototype.decodeStream = function (stream) { - return this.decodeMultiAsync(stream, false); - }; - Decoder.prototype.decodeMultiAsync = function (stream, isArray) { - return __asyncGenerator(this, arguments, function decodeMultiAsync_1() { - var isArrayHeaderRequired, arrayItemsLeft, stream_2, stream_2_1, buffer, e_2, e_3_1; - var e_3, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - isArrayHeaderRequired = isArray; - arrayItemsLeft = -1; - _b.label = 1; - case 1: - _b.trys.push([1, 13, 14, 19]); - stream_2 = __asyncValues(stream); - _b.label = 2; - case 2: return [4 /*yield*/, __await(stream_2.next())]; - case 3: - if (!(stream_2_1 = _b.sent(), !stream_2_1.done)) return [3 /*break*/, 12]; - buffer = stream_2_1.value; - if (isArray && arrayItemsLeft === 0) { - throw this.createExtraByteError(this.totalPos); - } - this.appendBuffer(buffer); - if (isArrayHeaderRequired) { - arrayItemsLeft = this.readArraySize(); - isArrayHeaderRequired = false; - this.complete(); - } - _b.label = 4; - case 4: - _b.trys.push([4, 9, , 10]); - _b.label = 5; - case 5: - if (!true) return [3 /*break*/, 8]; - return [4 /*yield*/, __await(this.doDecodeSync())]; - case 6: return [4 /*yield*/, _b.sent()]; - case 7: - _b.sent(); - if (--arrayItemsLeft === 0) { - return [3 /*break*/, 8]; - } - return [3 /*break*/, 5]; - case 8: return [3 /*break*/, 10]; - case 9: - e_2 = _b.sent(); - if (!(e_2 instanceof DataViewIndexOutOfBoundsError)) { - throw e_2; // rethrow - } - return [3 /*break*/, 10]; - case 10: - this.totalPos += this.pos; - _b.label = 11; - case 11: return [3 /*break*/, 2]; - case 12: return [3 /*break*/, 19]; - case 13: - e_3_1 = _b.sent(); - e_3 = { error: e_3_1 }; - return [3 /*break*/, 19]; - case 14: - _b.trys.push([14, , 17, 18]); - if (!(stream_2_1 && !stream_2_1.done && (_a = stream_2.return))) return [3 /*break*/, 16]; - return [4 /*yield*/, __await(_a.call(stream_2))]; - case 15: - _b.sent(); - _b.label = 16; - case 16: return [3 /*break*/, 18]; - case 17: - if (e_3) throw e_3.error; - return [7 /*endfinally*/]; - case 18: return [7 /*endfinally*/]; - case 19: return [2 /*return*/]; - } - }); - }); - }; - Decoder.prototype.doDecodeSync = function () { - DECODE: while (true) { - var headByte = this.readHeadByte(); - var object = void 0; - if (headByte >= 0xe0) { - // negative fixint (111x xxxx) 0xe0 - 0xff - object = headByte - 0x100; - } - else if (headByte < 0xc0) { - if (headByte < 0x80) { - // positive fixint (0xxx xxxx) 0x00 - 0x7f - object = headByte; - } - else if (headByte < 0x90) { - // fixmap (1000 xxxx) 0x80 - 0x8f - var size = headByte - 0x80; - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } - else { - object = {}; - } - } - else if (headByte < 0xa0) { - // fixarray (1001 xxxx) 0x90 - 0x9f - var size = headByte - 0x90; - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } - else { - object = []; - } - } - else { - // fixstr (101x xxxx) 0xa0 - 0xbf - var byteLength = headByte - 0xa0; - object = this.decodeUtf8String(byteLength, 0); - } - } - else if (headByte === 0xc0) { - // nil - object = null; - } - else if (headByte === 0xc2) { - // false - object = false; - } - else if (headByte === 0xc3) { - // true - object = true; - } - else if (headByte === 0xca) { - // float 32 - object = this.readF32(); - } - else if (headByte === 0xcb) { - // float 64 - object = this.readF64(); - } - else if (headByte === 0xcc) { - // uint 8 - object = this.readU8(); - } - else if (headByte === 0xcd) { - // uint 16 - object = this.readU16(); - } - else if (headByte === 0xce) { - // uint 32 - object = this.readU32(); - } - else if (headByte === 0xcf) { - // uint 64 - object = this.readU64(); - } - else if (headByte === 0xd0) { - // int 8 - object = this.readI8(); - } - else if (headByte === 0xd1) { - // int 16 - object = this.readI16(); - } - else if (headByte === 0xd2) { - // int 32 - object = this.readI32(); - } - else if (headByte === 0xd3) { - // int 64 - object = this.readI64(); - } - else if (headByte === 0xd9) { - // str 8 - var byteLength = this.lookU8(); - object = this.decodeUtf8String(byteLength, 1); - } - else if (headByte === 0xda) { - // str 16 - var byteLength = this.lookU16(); - object = this.decodeUtf8String(byteLength, 2); - } - else if (headByte === 0xdb) { - // str 32 - var byteLength = this.lookU32(); - object = this.decodeUtf8String(byteLength, 4); - } - else if (headByte === 0xdc) { - // array 16 - var size = this.readU16(); - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } - else { - object = []; - } - } - else if (headByte === 0xdd) { - // array 32 - var size = this.readU32(); - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } - else { - object = []; - } - } - else if (headByte === 0xde) { - // map 16 - var size = this.readU16(); - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } - else { - object = {}; - } - } - else if (headByte === 0xdf) { - // map 32 - var size = this.readU32(); - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } - else { - object = {}; - } - } - else if (headByte === 0xc4) { - // bin 8 - var size = this.lookU8(); - object = this.decodeBinary(size, 1); - } - else if (headByte === 0xc5) { - // bin 16 - var size = this.lookU16(); - object = this.decodeBinary(size, 2); - } - else if (headByte === 0xc6) { - // bin 32 - var size = this.lookU32(); - object = this.decodeBinary(size, 4); - } - else if (headByte === 0xd4) { - // fixext 1 - object = this.decodeExtension(1, 0); - } - else if (headByte === 0xd5) { - // fixext 2 - object = this.decodeExtension(2, 0); - } - else if (headByte === 0xd6) { - // fixext 4 - object = this.decodeExtension(4, 0); - } - else if (headByte === 0xd7) { - // fixext 8 - object = this.decodeExtension(8, 0); - } - else if (headByte === 0xd8) { - // fixext 16 - object = this.decodeExtension(16, 0); - } - else if (headByte === 0xc7) { - // ext 8 - var size = this.lookU8(); - object = this.decodeExtension(size, 1); - } - else if (headByte === 0xc8) { - // ext 16 - var size = this.lookU16(); - object = this.decodeExtension(size, 2); - } - else if (headByte === 0xc9) { - // ext 32 - var size = this.lookU32(); - object = this.decodeExtension(size, 4); - } - else { - throw new DecodeError("Unrecognized type byte: ".concat(prettyByte(headByte))); - } - this.complete(); - var stack = this.stack; - while (stack.length > 0) { - // arrays and maps - var state = stack[stack.length - 1]; - if (state.type === 0 /* State.ARRAY */) { - state.array[state.position] = object; - state.position++; - if (state.position === state.size) { - stack.pop(); - object = state.array; - } - else { - continue DECODE; - } - } - else if (state.type === 1 /* State.MAP_KEY */) { - if (!isValidMapKeyType(object)) { - throw new DecodeError("The type of key must be string or number but " + typeof object); - } - if (object === "__proto__") { - throw new DecodeError("The key __proto__ is not allowed"); - } - state.key = object; - state.type = 2 /* State.MAP_VALUE */; - continue DECODE; - } - else { - // it must be `state.type === State.MAP_VALUE` here - state.map[state.key] = object; - state.readCount++; - if (state.readCount === state.size) { - stack.pop(); - object = state.map; - } - else { - state.key = null; - state.type = 1 /* State.MAP_KEY */; - continue DECODE; - } - } - } - return object; - } - }; - Decoder.prototype.readHeadByte = function () { - if (this.headByte === HEAD_BYTE_REQUIRED) { - this.headByte = this.readU8(); - // console.log("headByte", prettyByte(this.headByte)); - } - return this.headByte; - }; - Decoder.prototype.complete = function () { - this.headByte = HEAD_BYTE_REQUIRED; - }; - Decoder.prototype.readArraySize = function () { - var headByte = this.readHeadByte(); - switch (headByte) { - case 0xdc: - return this.readU16(); - case 0xdd: - return this.readU32(); - default: { - if (headByte < 0xa0) { - return headByte - 0x90; - } - else { - throw new DecodeError("Unrecognized array type byte: ".concat(prettyByte(headByte))); - } - } - } - }; - Decoder.prototype.pushMapState = function (size) { - if (size > this.maxMapLength) { - throw new DecodeError("Max length exceeded: map length (".concat(size, ") > maxMapLengthLength (").concat(this.maxMapLength, ")")); - } - this.stack.push({ - type: 1 /* State.MAP_KEY */, - size: size, - key: null, - readCount: 0, - map: {}, - }); - }; - Decoder.prototype.pushArrayState = function (size) { - if (size > this.maxArrayLength) { - throw new DecodeError("Max length exceeded: array length (".concat(size, ") > maxArrayLength (").concat(this.maxArrayLength, ")")); - } - this.stack.push({ - type: 0 /* State.ARRAY */, - size: size, - array: new Array(size), - position: 0, - }); - }; - Decoder.prototype.decodeUtf8String = function (byteLength, headerOffset) { - var _a; - if (byteLength > this.maxStrLength) { - throw new DecodeError("Max length exceeded: UTF-8 byte length (".concat(byteLength, ") > maxStrLength (").concat(this.maxStrLength, ")")); - } - if (this.bytes.byteLength < this.pos + headerOffset + byteLength) { - throw MORE_DATA; - } - var offset = this.pos + headerOffset; - var object; - if (this.stateIsMapKey() && ((_a = this.keyDecoder) === null || _a === void 0 ? void 0 : _a.canBeCached(byteLength))) { - object = this.keyDecoder.decode(this.bytes, offset, byteLength); - } - else if (byteLength > TEXT_DECODER_THRESHOLD) { - object = utf8DecodeTD(this.bytes, offset, byteLength); - } - else { - object = utf8DecodeJs(this.bytes, offset, byteLength); - } - this.pos += headerOffset + byteLength; - return object; - }; - Decoder.prototype.stateIsMapKey = function () { - if (this.stack.length > 0) { - var state = this.stack[this.stack.length - 1]; - return state.type === 1 /* State.MAP_KEY */; - } - return false; - }; - Decoder.prototype.decodeBinary = function (byteLength, headOffset) { - if (byteLength > this.maxBinLength) { - throw new DecodeError("Max length exceeded: bin length (".concat(byteLength, ") > maxBinLength (").concat(this.maxBinLength, ")")); - } - if (!this.hasRemaining(byteLength + headOffset)) { - throw MORE_DATA; - } - var offset = this.pos + headOffset; - var object = this.bytes.subarray(offset, offset + byteLength); - this.pos += headOffset + byteLength; - return object; - }; - Decoder.prototype.decodeExtension = function (size, headOffset) { - if (size > this.maxExtLength) { - throw new DecodeError("Max length exceeded: ext length (".concat(size, ") > maxExtLength (").concat(this.maxExtLength, ")")); - } - var extType = this.view.getInt8(this.pos + headOffset); - var data = this.decodeBinary(size, headOffset + 1 /* extType */); - return this.extensionCodec.decode(data, extType, this.context); - }; - Decoder.prototype.lookU8 = function () { - return this.view.getUint8(this.pos); - }; - Decoder.prototype.lookU16 = function () { - return this.view.getUint16(this.pos); - }; - Decoder.prototype.lookU32 = function () { - return this.view.getUint32(this.pos); - }; - Decoder.prototype.readU8 = function () { - var value = this.view.getUint8(this.pos); - this.pos++; - return value; - }; - Decoder.prototype.readI8 = function () { - var value = this.view.getInt8(this.pos); - this.pos++; - return value; - }; - Decoder.prototype.readU16 = function () { - var value = this.view.getUint16(this.pos); - this.pos += 2; - return value; - }; - Decoder.prototype.readI16 = function () { - var value = this.view.getInt16(this.pos); - this.pos += 2; - return value; - }; - Decoder.prototype.readU32 = function () { - var value = this.view.getUint32(this.pos); - this.pos += 4; - return value; - }; - Decoder.prototype.readI32 = function () { - var value = this.view.getInt32(this.pos); - this.pos += 4; - return value; - }; - Decoder.prototype.readU64 = function () { - var value = getUint64(this.view, this.pos); - this.pos += 8; - return value; - }; - Decoder.prototype.readI64 = function () { - var value = getInt64(this.view, this.pos); - this.pos += 8; - return value; - }; - Decoder.prototype.readF32 = function () { - var value = this.view.getFloat32(this.pos); - this.pos += 4; - return value; - }; - Decoder.prototype.readF64 = function () { - var value = this.view.getFloat64(this.pos); - this.pos += 8; - return value; - }; - return Decoder; -}()); -export { Decoder }; -//# sourceMappingURL=Decoder.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs.map deleted file mode 100644 index 4a664b7..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Decoder.mjs","sourceRoot":"","sources":["../src/Decoder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAsB,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAc,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAU5C,IAAM,iBAAiB,GAAG,UAAC,GAAY;IACrC,IAAM,OAAO,GAAG,OAAO,GAAG,CAAC;IAE3B,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,CAAC;AACtD,CAAC,CAAC;AAmBF,IAAM,kBAAkB,GAAG,CAAC,CAAC,CAAC;AAE9B,IAAM,UAAU,GAAG,IAAI,QAAQ,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AACpD,IAAM,WAAW,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAEtD,8BAA8B;AAC9B,sEAAsE;AACtE,MAAM,CAAC,IAAM,6BAA6B,GAAiB,CAAC;IAC1D,IAAI;QACF,kDAAkD;QAClD,yCAAyC;QACzC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;KACvB;IAAC,OAAO,CAAM,EAAE;QACf,OAAO,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IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,yBAAO,GAAf;QACE,IAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IACH,cAAC;AAAD,CAAC,AArjBD,IAqjBC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs deleted file mode 100644 index 6b24b57..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs +++ /dev/null @@ -1,417 +0,0 @@ -import { utf8EncodeJs, utf8Count, TEXT_ENCODER_THRESHOLD, utf8EncodeTE } from "./utils/utf8.mjs"; -import { ExtensionCodec } from "./ExtensionCodec.mjs"; -import { setInt64, setUint64 } from "./utils/int.mjs"; -import { ensureUint8Array } from "./utils/typedArrays.mjs"; -export var DEFAULT_MAX_DEPTH = 100; -export var DEFAULT_INITIAL_BUFFER_SIZE = 2048; -var Encoder = /** @class */ (function () { - function Encoder(extensionCodec, context, maxDepth, initialBufferSize, sortKeys, forceFloat32, ignoreUndefined, forceIntegerToFloat) { - if (extensionCodec === void 0) { extensionCodec = ExtensionCodec.defaultCodec; } - if (context === void 0) { context = undefined; } - if (maxDepth === void 0) { maxDepth = DEFAULT_MAX_DEPTH; } - if (initialBufferSize === void 0) { initialBufferSize = DEFAULT_INITIAL_BUFFER_SIZE; } - if (sortKeys === void 0) { sortKeys = false; } - if (forceFloat32 === void 0) { forceFloat32 = false; } - if (ignoreUndefined === void 0) { ignoreUndefined = false; } - if (forceIntegerToFloat === void 0) { forceIntegerToFloat = false; } - this.extensionCodec = extensionCodec; - this.context = context; - this.maxDepth = maxDepth; - this.initialBufferSize = initialBufferSize; - this.sortKeys = sortKeys; - this.forceFloat32 = forceFloat32; - this.ignoreUndefined = ignoreUndefined; - this.forceIntegerToFloat = forceIntegerToFloat; - this.pos = 0; - this.view = new DataView(new ArrayBuffer(this.initialBufferSize)); - this.bytes = new Uint8Array(this.view.buffer); - } - Encoder.prototype.reinitializeState = function () { - this.pos = 0; - }; - /** - * This is almost equivalent to {@link Encoder#encode}, but it returns an reference of the encoder's internal buffer and thus much faster than {@link Encoder#encode}. - * - * @returns Encodes the object and returns a shared reference the encoder's internal buffer. - */ - Encoder.prototype.encodeSharedRef = function (object) { - this.reinitializeState(); - this.doEncode(object, 1); - return this.bytes.subarray(0, this.pos); - }; - /** - * @returns Encodes the object and returns a copy of the encoder's internal buffer. - */ - Encoder.prototype.encode = function (object) { - this.reinitializeState(); - this.doEncode(object, 1); - return this.bytes.slice(0, this.pos); - }; - Encoder.prototype.doEncode = function (object, depth) { - if (depth > this.maxDepth) { - throw new Error("Too deep objects in depth ".concat(depth)); - } - if (object == null) { - this.encodeNil(); - } - else if (typeof object === "boolean") { - this.encodeBoolean(object); - } - else if (typeof object === "number") { - this.encodeNumber(object); - } - else if (typeof object === "string") { - this.encodeString(object); - } - else { - this.encodeObject(object, depth); - } - }; - Encoder.prototype.ensureBufferSizeToWrite = function (sizeToWrite) { - var requiredSize = this.pos + sizeToWrite; - if (this.view.byteLength < requiredSize) { - this.resizeBuffer(requiredSize * 2); - } - }; - Encoder.prototype.resizeBuffer = function (newSize) { - var newBuffer = new ArrayBuffer(newSize); - var newBytes = new Uint8Array(newBuffer); - var newView = new DataView(newBuffer); - newBytes.set(this.bytes); - this.view = newView; - this.bytes = newBytes; - }; - Encoder.prototype.encodeNil = function () { - this.writeU8(0xc0); - }; - Encoder.prototype.encodeBoolean = function (object) { - if (object === false) { - this.writeU8(0xc2); - } - else { - this.writeU8(0xc3); - } - }; - Encoder.prototype.encodeNumber = function (object) { - if (Number.isSafeInteger(object) && !this.forceIntegerToFloat) { - if (object >= 0) { - if (object < 0x80) { - // positive fixint - this.writeU8(object); - } - else if (object < 0x100) { - // uint 8 - this.writeU8(0xcc); - this.writeU8(object); - } - else if (object < 0x10000) { - // uint 16 - this.writeU8(0xcd); - this.writeU16(object); - } - else if (object < 0x100000000) { - // uint 32 - this.writeU8(0xce); - this.writeU32(object); - } - else { - // uint 64 - this.writeU8(0xcf); - this.writeU64(object); - } - } - else { - if (object >= -0x20) { - // negative fixint - this.writeU8(0xe0 | (object + 0x20)); - } - else if (object >= -0x80) { - // int 8 - this.writeU8(0xd0); - this.writeI8(object); - } - else if (object >= -0x8000) { - // int 16 - this.writeU8(0xd1); - this.writeI16(object); - } - else if (object >= -0x80000000) { - // int 32 - this.writeU8(0xd2); - this.writeI32(object); - } - else { - // int 64 - this.writeU8(0xd3); - this.writeI64(object); - } - } - } - else { - // non-integer numbers - if (this.forceFloat32) { - // float 32 - this.writeU8(0xca); - this.writeF32(object); - } - else { - // float 64 - this.writeU8(0xcb); - this.writeF64(object); - } - } - }; - Encoder.prototype.writeStringHeader = function (byteLength) { - if (byteLength < 32) { - // fixstr - this.writeU8(0xa0 + byteLength); - } - else if (byteLength < 0x100) { - // str 8 - this.writeU8(0xd9); - this.writeU8(byteLength); - } - else if (byteLength < 0x10000) { - // str 16 - this.writeU8(0xda); - this.writeU16(byteLength); - } - else if (byteLength < 0x100000000) { - // str 32 - this.writeU8(0xdb); - this.writeU32(byteLength); - } - else { - throw new Error("Too long string: ".concat(byteLength, " bytes in UTF-8")); - } - }; - Encoder.prototype.encodeString = function (object) { - var maxHeaderSize = 1 + 4; - var strLength = object.length; - if (strLength > TEXT_ENCODER_THRESHOLD) { - var byteLength = utf8Count(object); - this.ensureBufferSizeToWrite(maxHeaderSize + byteLength); - this.writeStringHeader(byteLength); - utf8EncodeTE(object, this.bytes, this.pos); - this.pos += byteLength; - } - else { - var byteLength = utf8Count(object); - this.ensureBufferSizeToWrite(maxHeaderSize + byteLength); - this.writeStringHeader(byteLength); - utf8EncodeJs(object, this.bytes, this.pos); - this.pos += byteLength; - } - }; - Encoder.prototype.encodeObject = function (object, depth) { - // try to encode objects with custom codec first of non-primitives - var ext = this.extensionCodec.tryToEncode(object, this.context); - if (ext != null) { - this.encodeExtension(ext); - } - else if (Array.isArray(object)) { - this.encodeArray(object, depth); - } - else if (ArrayBuffer.isView(object)) { - this.encodeBinary(object); - } - else if (typeof object === "object") { - this.encodeMap(object, depth); - } - else { - // symbol, function and other special object come here unless extensionCodec handles them. - throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(object))); - } - }; - Encoder.prototype.encodeBinary = function (object) { - var size = object.byteLength; - if (size < 0x100) { - // bin 8 - this.writeU8(0xc4); - this.writeU8(size); - } - else if (size < 0x10000) { - // bin 16 - this.writeU8(0xc5); - this.writeU16(size); - } - else if (size < 0x100000000) { - // bin 32 - this.writeU8(0xc6); - this.writeU32(size); - } - else { - throw new Error("Too large binary: ".concat(size)); - } - var bytes = ensureUint8Array(object); - this.writeU8a(bytes); - }; - Encoder.prototype.encodeArray = function (object, depth) { - var size = object.length; - if (size < 16) { - // fixarray - this.writeU8(0x90 + size); - } - else if (size < 0x10000) { - // array 16 - this.writeU8(0xdc); - this.writeU16(size); - } - else if (size < 0x100000000) { - // array 32 - this.writeU8(0xdd); - this.writeU32(size); - } - else { - throw new Error("Too large array: ".concat(size)); - } - for (var _i = 0, object_1 = object; _i < object_1.length; _i++) { - var item = object_1[_i]; - this.doEncode(item, depth + 1); - } - }; - Encoder.prototype.countWithoutUndefined = function (object, keys) { - var count = 0; - for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { - var key = keys_1[_i]; - if (object[key] !== undefined) { - count++; - } - } - return count; - }; - Encoder.prototype.encodeMap = function (object, depth) { - var keys = Object.keys(object); - if (this.sortKeys) { - keys.sort(); - } - var size = this.ignoreUndefined ? this.countWithoutUndefined(object, keys) : keys.length; - if (size < 16) { - // fixmap - this.writeU8(0x80 + size); - } - else if (size < 0x10000) { - // map 16 - this.writeU8(0xde); - this.writeU16(size); - } - else if (size < 0x100000000) { - // map 32 - this.writeU8(0xdf); - this.writeU32(size); - } - else { - throw new Error("Too large map object: ".concat(size)); - } - for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) { - var key = keys_2[_i]; - var value = object[key]; - if (!(this.ignoreUndefined && value === undefined)) { - this.encodeString(key); - this.doEncode(value, depth + 1); - } - } - }; - Encoder.prototype.encodeExtension = function (ext) { - var size = ext.data.length; - if (size === 1) { - // fixext 1 - this.writeU8(0xd4); - } - else if (size === 2) { - // fixext 2 - this.writeU8(0xd5); - } - else if (size === 4) { - // fixext 4 - this.writeU8(0xd6); - } - else if (size === 8) { - // fixext 8 - this.writeU8(0xd7); - } - else if (size === 16) { - // fixext 16 - this.writeU8(0xd8); - } - else if (size < 0x100) { - // ext 8 - this.writeU8(0xc7); - this.writeU8(size); - } - else if (size < 0x10000) { - // ext 16 - this.writeU8(0xc8); - this.writeU16(size); - } - else if (size < 0x100000000) { - // ext 32 - this.writeU8(0xc9); - this.writeU32(size); - } - else { - throw new Error("Too large extension object: ".concat(size)); - } - this.writeI8(ext.type); - this.writeU8a(ext.data); - }; - Encoder.prototype.writeU8 = function (value) { - this.ensureBufferSizeToWrite(1); - this.view.setUint8(this.pos, value); - this.pos++; - }; - Encoder.prototype.writeU8a = function (values) { - var size = values.length; - this.ensureBufferSizeToWrite(size); - this.bytes.set(values, this.pos); - this.pos += size; - }; - Encoder.prototype.writeI8 = function (value) { - this.ensureBufferSizeToWrite(1); - this.view.setInt8(this.pos, value); - this.pos++; - }; - Encoder.prototype.writeU16 = function (value) { - this.ensureBufferSizeToWrite(2); - this.view.setUint16(this.pos, value); - this.pos += 2; - }; - Encoder.prototype.writeI16 = function (value) { - this.ensureBufferSizeToWrite(2); - this.view.setInt16(this.pos, value); - this.pos += 2; - }; - Encoder.prototype.writeU32 = function (value) { - this.ensureBufferSizeToWrite(4); - this.view.setUint32(this.pos, value); - this.pos += 4; - }; - Encoder.prototype.writeI32 = function (value) { - this.ensureBufferSizeToWrite(4); - this.view.setInt32(this.pos, value); - this.pos += 4; - }; - Encoder.prototype.writeF32 = function (value) { - this.ensureBufferSizeToWrite(4); - this.view.setFloat32(this.pos, value); - this.pos += 4; - }; - Encoder.prototype.writeF64 = function (value) { - this.ensureBufferSizeToWrite(8); - this.view.setFloat64(this.pos, value); - this.pos += 8; - }; - Encoder.prototype.writeU64 = function (value) { - this.ensureBufferSizeToWrite(8); - setUint64(this.view, this.pos, value); - this.pos += 8; - }; - Encoder.prototype.writeI64 = function (value) { - this.ensureBufferSizeToWrite(8); - setInt64(this.view, this.pos, value); - this.pos += 8; - }; - return Encoder; -}()); -export { Encoder }; -//# sourceMappingURL=Encoder.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs.map deleted file mode 100644 index 064915b..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Encoder.mjs","sourceRoot":"","sources":["../src/Encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAsB,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,MAAM,CAAC,IAAM,iBAAiB,GAAG,GAAG,CAAC;AACrC,MAAM,CAAC,IAAM,2BAA2B,GAAG,IAAI,CAAC;AAEhD;IAKE,iBACmB,cAAoF,EACpF,OAAuC,EACvC,QAA4B,EAC5B,iBAA+C,EAC/C,QAAgB,EAChB,YAAoB,EACpB,eAAuB,EACvB,mBAA2B;QAP3B,+BAAA,EAAA,iBAAkD,cAAc,CAAC,YAAmB;QACpF,wBAAA,EAAA,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,CAAC,CAAC,CAAC;QAEhC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAChB,CAAC;IACH,cAAC;AAAD,CAAC,AAlZD,IAkZC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs deleted file mode 100644 index d0d86a5..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs +++ /dev/null @@ -1,12 +0,0 @@ -/** - * ExtData is used to handle Extension Types that are not registered to ExtensionCodec. - */ -var ExtData = /** @class */ (function () { - function ExtData(type, data) { - this.type = type; - this.data = data; - } - return ExtData; -}()); -export { ExtData }; -//# sourceMappingURL=ExtData.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs.map deleted file mode 100644 index a2e020b..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ExtData.mjs","sourceRoot":"","sources":["../src/ExtData.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;IACE,iBAAqB,IAAY,EAAW,IAAgB;QAAvC,SAAI,GAAJ,IAAI,CAAQ;QAAW,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAClE,cAAC;AAAD,CAAC,AAFD,IAEC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs deleted file mode 100644 index 56bac53..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs +++ /dev/null @@ -1,71 +0,0 @@ -// ExtensionCodec to handle MessagePack extensions -import { ExtData } from "./ExtData.mjs"; -import { timestampExtension } from "./timestamp.mjs"; -var ExtensionCodec = /** @class */ (function () { - function ExtensionCodec() { - // built-in extensions - this.builtInEncoders = []; - this.builtInDecoders = []; - // custom extensions - this.encoders = []; - this.decoders = []; - this.register(timestampExtension); - } - ExtensionCodec.prototype.register = function (_a) { - var type = _a.type, encode = _a.encode, decode = _a.decode; - if (type >= 0) { - // custom extensions - this.encoders[type] = encode; - this.decoders[type] = decode; - } - else { - // built-in extensions - var index = 1 + type; - this.builtInEncoders[index] = encode; - this.builtInDecoders[index] = decode; - } - }; - ExtensionCodec.prototype.tryToEncode = function (object, context) { - // built-in extensions - for (var i = 0; i < this.builtInEncoders.length; i++) { - var encodeExt = this.builtInEncoders[i]; - if (encodeExt != null) { - var data = encodeExt(object, context); - if (data != null) { - var type = -1 - i; - return new ExtData(type, data); - } - } - } - // custom extensions - for (var i = 0; i < this.encoders.length; i++) { - var encodeExt = this.encoders[i]; - if (encodeExt != null) { - var data = encodeExt(object, context); - if (data != null) { - var type = i; - return new ExtData(type, data); - } - } - } - if (object instanceof ExtData) { - // to keep ExtData as is - return object; - } - return null; - }; - ExtensionCodec.prototype.decode = function (data, type, context) { - var decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type]; - if (decodeExt) { - return decodeExt(data, type, context); - } - else { - // decode() does not fail, returns ExtData instead. - return new ExtData(type, data); - } - }; - ExtensionCodec.defaultCodec = new ExtensionCodec(); - return ExtensionCodec; -}()); -export { ExtensionCodec }; -//# sourceMappingURL=ExtensionCodec.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs.map deleted file mode 100644 index fe9949d..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ExtensionCodec.mjs","sourceRoot":"","sources":["../src/Extension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msgpack/msgpack/dist.es5+esm/context.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/context.mjs deleted file mode 100644 index b14618b..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/context.mjs +++ /dev/null @@ -1,3 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-types */ -export {}; -//# sourceMappingURL=context.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/context.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/context.mjs.map deleted file mode 100644 index c5cb521..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/context.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"context.mjs","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,iDAAiD"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs deleted file mode 100644 index d26588d..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs +++ /dev/null @@ -1,29 +0,0 @@ -import { Decoder } from "./Decoder.mjs"; -export var defaultDecodeOptions = {}; -/** - * It decodes a single MessagePack object in a buffer. - * - * This is a synchronous decoding function. - * See other variants for asynchronous decoding: {@link decodeAsync()}, {@link decodeStream()}, or {@link decodeArrayStream()}. - * - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -export function decode(buffer, options) { - if (options === void 0) { options = defaultDecodeOptions; } - var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decode(buffer); -} -/** - * It decodes multiple MessagePack objects in a buffer. - * This is corresponding to {@link decodeMultiStream()}. - * - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -export function decodeMulti(buffer, options) { - if (options === void 0) { options = defaultDecodeOptions; } - var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decodeMulti(buffer); -} -//# sourceMappingURL=decode.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs.map deleted file mode 100644 index e58ef6c..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.mjs","sourceRoot":"","sources":["../src/decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0CpC,MAAM,CAAC,IAAM,oBAAoB,GAAkB,EAAE,CAAC;AAEtD;;;;;;;;GAQG;AACH,MAAM,UAAU,MAAM,CACpB,MAAwC,EACxC,OAAiF;IAAjF,wBAAA,EAAA,UAAsD,oBAA2B;IAEjF,IAAM,OAAO,GAAG,IAAI,OAAO,CACzB,OAAO,CAAC,cAAc,EACrB,OAA6C,CAAC,OAAO,EACtD,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,CACrB,CAAC;IACF,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,MAAwC,EACxC,OAAiF;IAAjF,wBAAA,EAAA,UAAsD,oBAA2B;IAEjF,IAAM,OAAO,GAAG,IAAI,OAAO,CACzB,OAAO,CAAC,cAAc,EACrB,OAA6C,CAAC,OAAO,EACtD,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,CACrB,CAAC;IACF,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs deleted file mode 100644 index 614150c..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs +++ /dev/null @@ -1,82 +0,0 @@ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -import { Decoder } from "./Decoder.mjs"; -import { ensureAsyncIterable } from "./utils/stream.mjs"; -import { defaultDecodeOptions } from "./decode.mjs"; -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -export function decodeAsync(streamLike, options) { - if (options === void 0) { options = defaultDecodeOptions; } - return __awaiter(this, void 0, void 0, function () { - var stream, decoder; - return __generator(this, function (_a) { - stream = ensureAsyncIterable(streamLike); - decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return [2 /*return*/, decoder.decodeAsync(stream)]; - }); - }); -} -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -export function decodeArrayStream(streamLike, options) { - if (options === void 0) { options = defaultDecodeOptions; } - var stream = ensureAsyncIterable(streamLike); - var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decodeArrayStream(stream); -} -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -export function decodeMultiStream(streamLike, options) { - if (options === void 0) { options = defaultDecodeOptions; } - var stream = ensureAsyncIterable(streamLike); - var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decodeStream(stream); -} -/** - * @deprecated Use {@link decodeMultiStream()} instead. - */ -export function decodeStream(streamLike, options) { - if (options === void 0) { options = defaultDecodeOptions; } - return decodeMultiStream(streamLike, options); -} -//# sourceMappingURL=decodeAsync.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs.map deleted file mode 100644 index 1c0cb5d..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decodeAsync.mjs","sourceRoot":"","sources":["../src/decodeAsync.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAKhD;;;GAGG;AACF,MAAM,UAAgB,WAAW,CAChC,UAAgE,EAChE,OAAiF;IAAjF,wBAAA,EAAA,UAAsD,oBAA2B;;;;YAE3E,MAAM,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;YAEzC,OAAO,GAAG,IAAI,OAAO,CACzB,OAAO,CAAC,cAAc,EACrB,OAA6C,CAAC,OAAO,EACtD,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,CACrB,CAAC;YACF,sBAAO,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,EAAC;;;CACpC;AAED;;;GAGG;AACF,MAAM,UAAU,iBAAiB,CAChC,UAAgE,EAChE,OAAiF;IAAjF,wBAAA,EAAA,UAAsD,oBAA2B;IAEjF,IAAM,MAAM,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAE/C,IAAM,OAAO,GAAG,IAAI,OAAO,CACzB,OAAO,CAAC,cAAc,EACrB,OAA6C,CAAC,OAAO,EACtD,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,CACrB,CAAC;IAEF,OAAO,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAAgE,EAChE,OAAiF;IAAjF,wBAAA,EAAA,UAAsD,oBAA2B;IAEjF,IAAM,MAAM,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAE/C,IAAM,OAAO,GAAG,IAAI,OAAO,CACzB,OAAO,CAAC,cAAc,EACrB,OAA6C,CAAC,OAAO,EACtD,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,CACrB,CAAC;IAEF,OAAO,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,UAAgE,EAChE,OAAiF;IAAjF,wBAAA,EAAA,UAAsD,oBAA2B;IAEjF,OAAO,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs deleted file mode 100644 index 2491973..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs +++ /dev/null @@ -1,14 +0,0 @@ -import { Encoder } from "./Encoder.mjs"; -var defaultEncodeOptions = {}; -/** - * It encodes `value` in the MessagePack format and - * returns a byte buffer. - * - * The returned buffer is a slice of a larger `ArrayBuffer`, so you have to use its `#byteOffset` and `#byteLength` in order to convert it to another typed arrays including NodeJS `Buffer`. - */ -export function encode(value, options) { - if (options === void 0) { options = defaultEncodeOptions; } - var encoder = new Encoder(options.extensionCodec, options.context, options.maxDepth, options.initialBufferSize, options.sortKeys, options.forceFloat32, options.ignoreUndefined, options.forceIntegerToFloat); - return encoder.encodeSharedRef(value); -} -//# sourceMappingURL=encode.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs.map deleted file mode 100644 index 0342ca3..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode.mjs","sourceRoot":"","sources":["../src/encode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyDpC,IAAM,oBAAoB,GAAkB,EAAE,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CACpB,KAAc,EACd,OAAiF;IAAjF,wBAAA,EAAA,UAAsD,oBAA2B;IAEjF,IAAM,OAAO,GAAG,IAAI,OAAO,CACzB,OAAO,CAAC,cAAc,EACrB,OAA6C,CAAC,OAAO,EACtD,OAAO,CAAC,QAAQ,EAChB,OAAO,CAAC,iBAAiB,EACzB,OAAO,CAAC,QAAQ,EAChB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,eAAe,EACvB,OAAO,CAAC,mBAAmB,CAC5B,CAAC;IACF,OAAO,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs deleted file mode 100644 index a0179b2..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs +++ /dev/null @@ -1,20 +0,0 @@ -// Main Functions: -import { encode } from "./encode.mjs"; -export { encode }; -import { decode, decodeMulti } from "./decode.mjs"; -export { decode, decodeMulti }; -import { decodeAsync, decodeArrayStream, decodeMultiStream, decodeStream } from "./decodeAsync.mjs"; -export { decodeAsync, decodeArrayStream, decodeMultiStream, decodeStream }; -import { Decoder, DataViewIndexOutOfBoundsError } from "./Decoder.mjs"; -import { DecodeError } from "./DecodeError.mjs"; -export { Decoder, DecodeError, DataViewIndexOutOfBoundsError }; -import { Encoder } from "./Encoder.mjs"; -export { Encoder }; -// Utilitiies for Extension Types: -import { ExtensionCodec } from "./ExtensionCodec.mjs"; -export { ExtensionCodec }; -import { ExtData } from "./ExtData.mjs"; -export { ExtData }; -import { EXT_TIMESTAMP, encodeDateToTimeSpec, encodeTimeSpecToTimestamp, decodeTimestampToTimeSpec, encodeTimestampExtension, decodeTimestampExtension, } from "./timestamp.mjs"; -export { EXT_TIMESTAMP, encodeDateToTimeSpec, encodeTimeSpecToTimestamp, decodeTimestampToTimeSpec, encodeTimestampExtension, decodeTimestampExtension, }; -//# sourceMappingURL=index.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs.map deleted file mode 100644 index dfaef4a..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAElB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,CAAC;AAIlB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAI/B,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;AAE3E,OAAO,EAAE,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,kCAAkC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,CAAC;AAG1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,GACzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs deleted file mode 100644 index bbfd364..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs +++ /dev/null @@ -1,97 +0,0 @@ -// https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type -import { DecodeError } from "./DecodeError.mjs"; -import { getInt64, setInt64 } from "./utils/int.mjs"; -export var EXT_TIMESTAMP = -1; -var TIMESTAMP32_MAX_SEC = 0x100000000 - 1; // 32-bit unsigned int -var TIMESTAMP64_MAX_SEC = 0x400000000 - 1; // 34-bit unsigned int -export function encodeTimeSpecToTimestamp(_a) { - var sec = _a.sec, nsec = _a.nsec; - if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) { - // Here sec >= 0 && nsec >= 0 - if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) { - // timestamp 32 = { sec32 (unsigned) } - var rv = new Uint8Array(4); - var view = new DataView(rv.buffer); - view.setUint32(0, sec); - return rv; - } - else { - // timestamp 64 = { nsec30 (unsigned), sec34 (unsigned) } - var secHigh = sec / 0x100000000; - var secLow = sec & 0xffffffff; - var rv = new Uint8Array(8); - var view = new DataView(rv.buffer); - // nsec30 | secHigh2 - view.setUint32(0, (nsec << 2) | (secHigh & 0x3)); - // secLow32 - view.setUint32(4, secLow); - return rv; - } - } - else { - // timestamp 96 = { nsec32 (unsigned), sec64 (signed) } - var rv = new Uint8Array(12); - var view = new DataView(rv.buffer); - view.setUint32(0, nsec); - setInt64(view, 4, sec); - return rv; - } -} -export function encodeDateToTimeSpec(date) { - var msec = date.getTime(); - var sec = Math.floor(msec / 1e3); - var nsec = (msec - sec * 1e3) * 1e6; - // Normalizes { sec, nsec } to ensure nsec is unsigned. - var nsecInSec = Math.floor(nsec / 1e9); - return { - sec: sec + nsecInSec, - nsec: nsec - nsecInSec * 1e9, - }; -} -export function encodeTimestampExtension(object) { - if (object instanceof Date) { - var timeSpec = encodeDateToTimeSpec(object); - return encodeTimeSpecToTimestamp(timeSpec); - } - else { - return null; - } -} -export function decodeTimestampToTimeSpec(data) { - var view = new DataView(data.buffer, data.byteOffset, data.byteLength); - // data may be 32, 64, or 96 bits - switch (data.byteLength) { - case 4: { - // timestamp 32 = { sec32 } - var sec = view.getUint32(0); - var nsec = 0; - return { sec: sec, nsec: nsec }; - } - case 8: { - // timestamp 64 = { nsec30, sec34 } - var nsec30AndSecHigh2 = view.getUint32(0); - var secLow32 = view.getUint32(4); - var sec = (nsec30AndSecHigh2 & 0x3) * 0x100000000 + secLow32; - var nsec = nsec30AndSecHigh2 >>> 2; - return { sec: sec, nsec: nsec }; - } - case 12: { - // timestamp 96 = { nsec32 (unsigned), sec64 (signed) } - var sec = getInt64(view, 4); - var nsec = view.getUint32(0); - return { sec: sec, nsec: nsec }; - } - default: - throw new DecodeError("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(data.length)); - } -} -export function decodeTimestampExtension(data) { - var timeSpec = decodeTimestampToTimeSpec(data); - return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6); -} -export var timestampExtension = { - type: EXT_TIMESTAMP, - encode: encodeTimestampExtension, - decode: decodeTimestampExtension, -}; -//# sourceMappingURL=timestamp.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs.map deleted file mode 100644 index cfb7100..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"timestamp.mjs","sourceRoot":"","sources":["../src/timestamp.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,CAAC,IAAM,aAAa,GAAG,CAAC,CAAC,CAAC;AAOhC,IAAM,mBAAmB,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,sBAAsB;AACnE,IAAM,mBAAmB,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,sBAAsB;AAEnE,MAAM,UAAU,yBAAyB,CAAC,EAAuB;QAArB,GAAG,SAAA,EAAE,IAAI,UAAA;IACnD,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,mBAAmB,EAAE;QACvD,6BAA6B;QAC7B,IAAI,IAAI,KAAK,CAAC,IAAI,GAAG,IAAI,mBAAmB,EAAE;YAC5C,sCAAsC;YACtC,IAAM,EAAE,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;YACrC,IAAI,CAAC,S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AAC,IAAI,EAAE,CAAC,CAAC,CAAC;YAC9B,IAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAC/B,OAAO,EAAE,GAAG,KAAA,EAAE,IAAI,MAAA,EAAE,CAAC;SACtB;QACD;YACE,MAAM,IAAI,WAAW,CAAC,uEAAgE,IAAI,CAAC,MAAM,CAAE,CAAC,CAAC;KACxG;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAAgB;IACvD,IAAM,QAAQ,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;IACjD,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,CAAC,IAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE,wBAAwB;IAChC,MAAM,EAAE,wBAAwB;CACjC,CAAC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs deleted file mode 100644 index 139369b..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs +++ /dev/null @@ -1,27 +0,0 @@ -// Integer Utility -export var UINT32_MAX = 4294967295; -// DataView extension to handle int64 / uint64, -// where the actual range is 53-bits integer (a.k.a. safe integer) -export function setUint64(view, offset, value) { - var high = value / 4294967296; - var low = value; // high bits are truncated by DataView - view.setUint32(offset, high); - view.setUint32(offset + 4, low); -} -export function setInt64(view, offset, value) { - var high = Math.floor(value / 4294967296); - var low = value; // high bits are truncated by DataView - view.setUint32(offset, high); - view.setUint32(offset + 4, low); -} -export function getInt64(view, offset) { - var high = view.getInt32(offset); - var low = view.getUint32(offset + 4); - return high * 4294967296 + low; -} -export function getUint64(view, offset) { - var high = view.getUint32(offset); - var low = view.getUint32(offset + 4); - return high * 4294967296 + low; -} -//# sourceMappingURL=int.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs.map deleted file mode 100644 index 52d29e8..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"int.mjs","sourceRoot":"","sources":["../../src/utils/int.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAElB,MAAM,CAAC,IAAM,UAAU,GAAG,UAAW,CAAC;AAEtC,+CAA+C;AAC/C,kEAAkE;AAElE,MAAM,UAAU,SAAS,CAAC,IAAc,EAAE,MAAc,EAAE,KAAa;IACrE,IAAM,IAAI,GAAG,KAAK,GAAG,UAAa,CAAC;IACnC,IAAM,GAAG,GAAG,KAAK,CAAC,CAAC,sCAAsC;IACzD,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAc,EAAE,MAAc,EAAE,KAAa;IACpE,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAa,CAAC,CAAC;IAC/C,IAAM,GAAG,GAAG,KAAK,CAAC,CAAC,sCAAsC;IACzD,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAc,EAAE,MAAc;IACrD,IAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACnC,IAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACvC,OAAO,IAAI,GAAG,UAAa,GAAG,GAAG,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAc,EAAE,MAAc;IACtD,IAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACpC,IAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACvC,OAAO,IAAI,GAAG,UAAa,GAAG,GAAG,CAAC;AACpC,CAAC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs deleted file mode 100644 index b5cbaf9..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs +++ /dev/null @@ -1,4 +0,0 @@ -export function prettyByte(byte) { - return "".concat(byte < 0 ? "-" : "", "0x").concat(Math.abs(byte).toString(16).padStart(2, "0")); -} -//# sourceMappingURL=prettyByte.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs.map deleted file mode 100644 index eef54de..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"prettyByte.mjs","sourceRoot":"","sources":["../../src/utils/prettyByte.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,UAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,eAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAE,CAAC;AACnF,CAAC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs deleted file mode 100644 index 51e9d8a..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs +++ /dev/null @@ -1,92 +0,0 @@ -// utility for whatwg streams -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } -var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -}; -export function isAsyncIterable(object) { - return object[Symbol.asyncIterator] != null; -} -function assertNonNull(value) { - if (value == null) { - throw new Error("Assertion Failure: value must not be null nor undefined"); - } -} -export function asyncIterableFromStream(stream) { - return __asyncGenerator(this, arguments, function asyncIterableFromStream_1() { - var reader, _a, done, value; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - reader = stream.getReader(); - _b.label = 1; - case 1: - _b.trys.push([1, , 9, 10]); - _b.label = 2; - case 2: - if (!true) return [3 /*break*/, 8]; - return [4 /*yield*/, __await(reader.read())]; - case 3: - _a = _b.sent(), done = _a.done, value = _a.value; - if (!done) return [3 /*break*/, 5]; - return [4 /*yield*/, __await(void 0)]; - case 4: return [2 /*return*/, _b.sent()]; - case 5: - assertNonNull(value); - return [4 /*yield*/, __await(value)]; - case 6: return [4 /*yield*/, _b.sent()]; - case 7: - _b.sent(); - return [3 /*break*/, 2]; - case 8: return [3 /*break*/, 10]; - case 9: - reader.releaseLock(); - return [7 /*endfinally*/]; - case 10: return [2 /*return*/]; - } - }); - }); -} -export function ensureAsyncIterable(streamLike) { - if (isAsyncIterable(streamLike)) { - return streamLike; - } - else { - return asyncIterableFromStream(streamLike); - } -} -//# sourceMappingURL=stream.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs.map deleted file mode 100644 index ad04a36..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.mjs","sourceRoot":"","sources":["../../src/utils/stream.ts"],"names":[],"mappings":"AAAA,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQ7B,MAAM,UAAU,eAAe,CAAI,MAA6B;IAC9D,OAAQ,MAAc,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC;AACvD,CAAC;AAED,SAAS,aAAa,CAAI,KAA2B;IACnD,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;KAC5E;AACH,CAAC;AAED,MAAM,UAAiB,uBAAuB,CAAI,MAAyB;;;;;;oBACnE,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;;;;;;yBAGzB,IAAI;oBACe,6BAAM,MAAM,CAAC,IAAI,EAAE,GAAA;;oBAArC,KAAkB,SAAmB,EAAnC,IAAI,UAAA,EAAE,KAAK,WAAA;yBACf,IAAI,EAAJ,wBAAI;;wBACN,iCAAO;;oBAET,aAAa,CAAC,KAAK,CAAC,CAAC;iDACf,KAAK;wBAAX,gCAAW;;oBAAX,SAAW,CAAC;;;;oBAGd,MAAM,CAAC,WAAW,EAAE,CAAC;;;;;;CAExB;AAED,MAAM,UAAU,mBAAmB,CAAI,UAAiC;IACtE,IAAI,eAAe,CAAC,UAAU,CAAC,EAAE;QAC/B,OAAO,UAAU,CAAC;KACnB;SAAM;QACL,OAAO,uBAAuB,CAAC,UAAU,CAAC,CAAC;KAC5C;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs deleted file mode 100644 index fe3ba43..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs +++ /dev/null @@ -1,23 +0,0 @@ -export function ensureUint8Array(buffer) { - if (buffer instanceof Uint8Array) { - return buffer; - } - else if (ArrayBuffer.isView(buffer)) { - return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); - } - else if (buffer instanceof ArrayBuffer) { - return new Uint8Array(buffer); - } - else { - // ArrayLike - return Uint8Array.from(buffer); - } -} -export function createDataView(buffer) { - if (buffer instanceof ArrayBuffer) { - return new DataView(buffer); - } - var bufferView = ensureUint8Array(buffer); - return new DataView(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength); -} -//# sourceMappingURL=typedArrays.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs.map deleted file mode 100644 index 1a116d8..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typedArrays.mjs","sourceRoot":"","sources":["../../src/utils/typedArrays.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,MAAsE;IACrG,IAAI,MAAM,YAAY,UAAU,EAAE;QAChC,OAAO,MAAM,CAAC;KACf;SAAM,IAAI,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;QACrC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;KAC5E;SAAM,IAAI,MAAM,YAAY,WAAW,EAAE;QACxC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;KAC/B;SAAM;QACL,oBAAoB;QACpB,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAChC;AACH,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAyD;IACtF,IAAI,MAAM,YAAY,WAAW,EAAE;QACjC,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC7B;IAED,IAAM,UAAU,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;AACvF,CAAC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs b/node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs deleted file mode 100644 index 0cc4f8e..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs +++ /dev/null @@ -1,160 +0,0 @@ -var _a, _b, _c; -/* eslint-disable @typescript-eslint/no-unnecessary-condition */ -import { UINT32_MAX } from "./int.mjs"; -var TEXT_ENCODING_AVAILABLE = (typeof process === "undefined" || ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a["TEXT_ENCODING"]) !== "never") && - typeof TextEncoder !== "undefined" && - typeof TextDecoder !== "undefined"; -export function utf8Count(str) { - var strLength = str.length; - var byteLength = 0; - var pos = 0; - while (pos < strLength) { - var value = str.charCodeAt(pos++); - if ((value & 0xffffff80) === 0) { - // 1-byte - byteLength++; - continue; - } - else if ((value & 0xfffff800) === 0) { - // 2-bytes - byteLength += 2; - } - else { - // handle surrogate pair - if (value >= 0xd800 && value <= 0xdbff) { - // high surrogate - if (pos < strLength) { - var extra = str.charCodeAt(pos); - if ((extra & 0xfc00) === 0xdc00) { - ++pos; - value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000; - } - } - } - if ((value & 0xffff0000) === 0) { - // 3-byte - byteLength += 3; - } - else { - // 4-byte - byteLength += 4; - } - } - } - return byteLength; -} -export function utf8EncodeJs(str, output, outputOffset) { - var strLength = str.length; - var offset = outputOffset; - var pos = 0; - while (pos < strLength) { - var value = str.charCodeAt(pos++); - if ((value & 0xffffff80) === 0) { - // 1-byte - output[offset++] = value; - continue; - } - else if ((value & 0xfffff800) === 0) { - // 2-bytes - output[offset++] = ((value >> 6) & 0x1f) | 0xc0; - } - else { - // handle surrogate pair - if (value >= 0xd800 && value <= 0xdbff) { - // high surrogate - if (pos < strLength) { - var extra = str.charCodeAt(pos); - if ((extra & 0xfc00) === 0xdc00) { - ++pos; - value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000; - } - } - } - if ((value & 0xffff0000) === 0) { - // 3-byte - output[offset++] = ((value >> 12) & 0x0f) | 0xe0; - output[offset++] = ((value >> 6) & 0x3f) | 0x80; - } - else { - // 4-byte - output[offset++] = ((value >> 18) & 0x07) | 0xf0; - output[offset++] = ((value >> 12) & 0x3f) | 0x80; - output[offset++] = ((value >> 6) & 0x3f) | 0x80; - } - } - output[offset++] = (value & 0x3f) | 0x80; - } -} -var sharedTextEncoder = TEXT_ENCODING_AVAILABLE ? new TextEncoder() : undefined; -export var TEXT_ENCODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE - ? UINT32_MAX - : typeof process !== "undefined" && ((_b = process === null || process === void 0 ? void 0 : process.env) === null || _b === void 0 ? void 0 : _b["TEXT_ENCODING"]) !== "force" - ? 200 - : 0; -function utf8EncodeTEencode(str, output, outputOffset) { - output.set(sharedTextEncoder.encode(str), outputOffset); -} -function utf8EncodeTEencodeInto(str, output, outputOffset) { - sharedTextEncoder.encodeInto(str, output.subarray(outputOffset)); -} -export var utf8EncodeTE = (sharedTextEncoder === null || sharedTextEncoder === void 0 ? void 0 : sharedTextEncoder.encodeInto) ? utf8EncodeTEencodeInto : utf8EncodeTEencode; -var CHUNK_SIZE = 4096; -export function utf8DecodeJs(bytes, inputOffset, byteLength) { - var offset = inputOffset; - var end = offset + byteLength; - var units = []; - var result = ""; - while (offset < end) { - var byte1 = bytes[offset++]; - if ((byte1 & 0x80) === 0) { - // 1 byte - units.push(byte1); - } - else if ((byte1 & 0xe0) === 0xc0) { - // 2 bytes - var byte2 = bytes[offset++] & 0x3f; - units.push(((byte1 & 0x1f) << 6) | byte2); - } - else if ((byte1 & 0xf0) === 0xe0) { - // 3 bytes - var byte2 = bytes[offset++] & 0x3f; - var byte3 = bytes[offset++] & 0x3f; - units.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3); - } - else if ((byte1 & 0xf8) === 0xf0) { - // 4 bytes - var byte2 = bytes[offset++] & 0x3f; - var byte3 = bytes[offset++] & 0x3f; - var byte4 = bytes[offset++] & 0x3f; - var unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4; - if (unit > 0xffff) { - unit -= 0x10000; - units.push(((unit >>> 10) & 0x3ff) | 0xd800); - unit = 0xdc00 | (unit & 0x3ff); - } - units.push(unit); - } - else { - units.push(byte1); - } - if (units.length >= CHUNK_SIZE) { - result += String.fromCharCode.apply(String, units); - units.length = 0; - } - } - if (units.length > 0) { - result += String.fromCharCode.apply(String, units); - } - return result; -} -var sharedTextDecoder = TEXT_ENCODING_AVAILABLE ? new TextDecoder() : null; -export var TEXT_DECODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE - ? UINT32_MAX - : typeof process !== "undefined" && ((_c = process === null || process === void 0 ? void 0 : process.env) === null || _c === void 0 ? void 0 : _c["TEXT_DECODER"]) !== "force" - ? 200 - : 0; -export function utf8DecodeTD(bytes, inputOffset, byteLength) { - var stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength); - return sharedTextDecoder.decode(stringBytes); -} -//# sourceMappingURL=utf8.mjs.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs.map b/node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs.map deleted file mode 100644 index 9a84a9a..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utf8.mjs","sourceRoot":"","sources":["../../src/utils/utf8.ts"],"names":[],"mappings":";AAAA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;YACxC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;SAClB;KACF;IAED,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,MAAM,IAAI,MAAM,CAAC,YAAY,OAAnB,MAAM,EAAiB,KAAK,CAAC,CAAC;KACzC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,IAAM,iBAAiB,GAAG,uBAAuB,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7E,MAAM,CAAC,IAAM,sBAAsB,GAAG,CAAC,uBAAuB;IAC5D,CAAC,CAAC,UAAU;IACZ,CAAC,CAAC,OAAO,OAAO,KAAK,WAAW,IAAI,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,0CAAG,cAAc,CAAC,MAAK,OAAO;QAC9E,CAAC,CAAC,GAAG;QACL,CAAC,CAAC,CAAC,CAAC;AAEN,MAAM,UAAU,YAAY,CAAC,KAAiB,EAAE,WAAmB,EAAE,UAAkB;IACrF,IAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;IAC1E,OAAO,iBAAkB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAChD,CAAC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+umd/msgpack.js b/node_modules/@msgpack/msgpack/dist.es5+umd/msgpack.js deleted file mode 100644 index 33e5b23..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+umd/msgpack.js +++ /dev/null @@ -1,2059 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["MessagePack"] = factory(); - else - root["MessagePack"] = factory(); -})(this, function() { -return /******/ (function() { // webpackBootstrap -/******/ "use strict"; -/******/ // The require scope -/******/ var __webpack_require__ = {}; -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ !function() { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = function(exports, definition) { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ !function() { -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -/******/ }(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ !function() { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ }(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, { - "DataViewIndexOutOfBoundsError": function() { return /* reexport */ DataViewIndexOutOfBoundsError; }, - "DecodeError": function() { return /* reexport */ DecodeError; }, - "Decoder": function() { return /* reexport */ Decoder; }, - "EXT_TIMESTAMP": function() { return /* reexport */ EXT_TIMESTAMP; }, - "Encoder": function() { return /* reexport */ Encoder; }, - "ExtData": function() { return /* reexport */ ExtData; }, - "ExtensionCodec": function() { return /* reexport */ ExtensionCodec; }, - "decode": function() { return /* reexport */ decode; }, - "decodeArrayStream": function() { return /* reexport */ decodeArrayStream; }, - "decodeAsync": function() { return /* reexport */ decodeAsync; }, - "decodeMulti": function() { return /* reexport */ decodeMulti; }, - "decodeMultiStream": function() { return /* reexport */ decodeMultiStream; }, - "decodeStream": function() { return /* reexport */ decodeStream; }, - "decodeTimestampExtension": function() { return /* reexport */ decodeTimestampExtension; }, - "decodeTimestampToTimeSpec": function() { return /* reexport */ decodeTimestampToTimeSpec; }, - "encode": function() { return /* reexport */ encode; }, - "encodeDateToTimeSpec": function() { return /* reexport */ encodeDateToTimeSpec; }, - "encodeTimeSpecToTimestamp": function() { return /* reexport */ encodeTimeSpecToTimestamp; }, - "encodeTimestampExtension": function() { return /* reexport */ encodeTimestampExtension; } -}); - -;// CONCATENATED MODULE: ./src/utils/int.ts -// Integer Utility -var UINT32_MAX = 4294967295; -// DataView extension to handle int64 / uint64, -// where the actual range is 53-bits integer (a.k.a. safe integer) -function setUint64(view, offset, value) { - var high = value / 4294967296; - var low = value; // high bits are truncated by DataView - view.setUint32(offset, high); - view.setUint32(offset + 4, low); -} -function setInt64(view, offset, value) { - var high = Math.floor(value / 4294967296); - var low = value; // high bits are truncated by DataView - view.setUint32(offset, high); - view.setUint32(offset + 4, low); -} -function getInt64(view, offset) { - var high = view.getInt32(offset); - var low = view.getUint32(offset + 4); - return high * 4294967296 + low; -} -function getUint64(view, offset) { - var high = view.getUint32(offset); - var low = view.getUint32(offset + 4); - return high * 4294967296 + low; -} - -;// CONCATENATED MODULE: ./src/utils/utf8.ts -var __read = (undefined && undefined.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -}; -var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -var _a, _b, _c; -/* eslint-disable @typescript-eslint/no-unnecessary-condition */ - -var TEXT_ENCODING_AVAILABLE = (typeof process === "undefined" || ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a["TEXT_ENCODING"]) !== "never") && - typeof TextEncoder !== "undefined" && - typeof TextDecoder !== "undefined"; -function utf8Count(str) { - var strLength = str.length; - var byteLength = 0; - var pos = 0; - while (pos < strLength) { - var value = str.charCodeAt(pos++); - if ((value & 0xffffff80) === 0) { - // 1-byte - byteLength++; - continue; - } - else if ((value & 0xfffff800) === 0) { - // 2-bytes - byteLength += 2; - } - else { - // handle surrogate pair - if (value >= 0xd800 && value <= 0xdbff) { - // high surrogate - if (pos < strLength) { - var extra = str.charCodeAt(pos); - if ((extra & 0xfc00) === 0xdc00) { - ++pos; - value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000; - } - } - } - if ((value & 0xffff0000) === 0) { - // 3-byte - byteLength += 3; - } - else { - // 4-byte - byteLength += 4; - } - } - } - return byteLength; -} -function utf8EncodeJs(str, output, outputOffset) { - var strLength = str.length; - var offset = outputOffset; - var pos = 0; - while (pos < strLength) { - var value = str.charCodeAt(pos++); - if ((value & 0xffffff80) === 0) { - // 1-byte - output[offset++] = value; - continue; - } - else if ((value & 0xfffff800) === 0) { - // 2-bytes - output[offset++] = ((value >> 6) & 0x1f) | 0xc0; - } - else { - // handle surrogate pair - if (value >= 0xd800 && value <= 0xdbff) { - // high surrogate - if (pos < strLength) { - var extra = str.charCodeAt(pos); - if ((extra & 0xfc00) === 0xdc00) { - ++pos; - value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000; - } - } - } - if ((value & 0xffff0000) === 0) { - // 3-byte - output[offset++] = ((value >> 12) & 0x0f) | 0xe0; - output[offset++] = ((value >> 6) & 0x3f) | 0x80; - } - else { - // 4-byte - output[offset++] = ((value >> 18) & 0x07) | 0xf0; - output[offset++] = ((value >> 12) & 0x3f) | 0x80; - output[offset++] = ((value >> 6) & 0x3f) | 0x80; - } - } - output[offset++] = (value & 0x3f) | 0x80; - } -} -var sharedTextEncoder = TEXT_ENCODING_AVAILABLE ? new TextEncoder() : undefined; -var TEXT_ENCODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE - ? UINT32_MAX - : typeof process !== "undefined" && ((_b = process === null || process === void 0 ? void 0 : process.env) === null || _b === void 0 ? void 0 : _b["TEXT_ENCODING"]) !== "force" - ? 200 - : 0; -function utf8EncodeTEencode(str, output, outputOffset) { - output.set(sharedTextEncoder.encode(str), outputOffset); -} -function utf8EncodeTEencodeInto(str, output, outputOffset) { - sharedTextEncoder.encodeInto(str, output.subarray(outputOffset)); -} -var utf8EncodeTE = (sharedTextEncoder === null || sharedTextEncoder === void 0 ? void 0 : sharedTextEncoder.encodeInto) ? utf8EncodeTEencodeInto : utf8EncodeTEencode; -var CHUNK_SIZE = 4096; -function utf8DecodeJs(bytes, inputOffset, byteLength) { - var offset = inputOffset; - var end = offset + byteLength; - var units = []; - var result = ""; - while (offset < end) { - var byte1 = bytes[offset++]; - if ((byte1 & 0x80) === 0) { - // 1 byte - units.push(byte1); - } - else if ((byte1 & 0xe0) === 0xc0) { - // 2 bytes - var byte2 = bytes[offset++] & 0x3f; - units.push(((byte1 & 0x1f) << 6) | byte2); - } - else if ((byte1 & 0xf0) === 0xe0) { - // 3 bytes - var byte2 = bytes[offset++] & 0x3f; - var byte3 = bytes[offset++] & 0x3f; - units.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3); - } - else if ((byte1 & 0xf8) === 0xf0) { - // 4 bytes - var byte2 = bytes[offset++] & 0x3f; - var byte3 = bytes[offset++] & 0x3f; - var byte4 = bytes[offset++] & 0x3f; - var unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4; - if (unit > 0xffff) { - unit -= 0x10000; - units.push(((unit >>> 10) & 0x3ff) | 0xd800); - unit = 0xdc00 | (unit & 0x3ff); - } - units.push(unit); - } - else { - units.push(byte1); - } - if (units.length >= CHUNK_SIZE) { - result += String.fromCharCode.apply(String, __spreadArray([], __read(units), false)); - units.length = 0; - } - } - if (units.length > 0) { - result += String.fromCharCode.apply(String, __spreadArray([], __read(units), false)); - } - return result; -} -var sharedTextDecoder = TEXT_ENCODING_AVAILABLE ? new TextDecoder() : null; -var TEXT_DECODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE - ? UINT32_MAX - : typeof process !== "undefined" && ((_c = process === null || process === void 0 ? void 0 : process.env) === null || _c === void 0 ? void 0 : _c["TEXT_DECODER"]) !== "force" - ? 200 - : 0; -function utf8DecodeTD(bytes, inputOffset, byteLength) { - var stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength); - return sharedTextDecoder.decode(stringBytes); -} - -;// CONCATENATED MODULE: ./src/ExtData.ts -/** - * ExtData is used to handle Extension Types that are not registered to ExtensionCodec. - */ -var ExtData = /** @class */ (function () { - function ExtData(type, data) { - this.type = type; - this.data = data; - } - return ExtData; -}()); - - -;// CONCATENATED MODULE: ./src/DecodeError.ts -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var DecodeError = /** @class */ (function (_super) { - __extends(DecodeError, _super); - function DecodeError(message) { - var _this = _super.call(this, message) || this; - // fix the prototype chain in a cross-platform way - var proto = Object.create(DecodeError.prototype); - Object.setPrototypeOf(_this, proto); - Object.defineProperty(_this, "name", { - configurable: true, - enumerable: false, - value: DecodeError.name, - }); - return _this; - } - return DecodeError; -}(Error)); - - -;// CONCATENATED MODULE: ./src/timestamp.ts -// https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type - - -var EXT_TIMESTAMP = -1; -var TIMESTAMP32_MAX_SEC = 0x100000000 - 1; // 32-bit unsigned int -var TIMESTAMP64_MAX_SEC = 0x400000000 - 1; // 34-bit unsigned int -function encodeTimeSpecToTimestamp(_a) { - var sec = _a.sec, nsec = _a.nsec; - if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) { - // Here sec >= 0 && nsec >= 0 - if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) { - // timestamp 32 = { sec32 (unsigned) } - var rv = new Uint8Array(4); - var view = new DataView(rv.buffer); - view.setUint32(0, sec); - return rv; - } - else { - // timestamp 64 = { nsec30 (unsigned), sec34 (unsigned) } - var secHigh = sec / 0x100000000; - var secLow = sec & 0xffffffff; - var rv = new Uint8Array(8); - var view = new DataView(rv.buffer); - // nsec30 | secHigh2 - view.setUint32(0, (nsec << 2) | (secHigh & 0x3)); - // secLow32 - view.setUint32(4, secLow); - return rv; - } - } - else { - // timestamp 96 = { nsec32 (unsigned), sec64 (signed) } - var rv = new Uint8Array(12); - var view = new DataView(rv.buffer); - view.setUint32(0, nsec); - setInt64(view, 4, sec); - return rv; - } -} -function encodeDateToTimeSpec(date) { - var msec = date.getTime(); - var sec = Math.floor(msec / 1e3); - var nsec = (msec - sec * 1e3) * 1e6; - // Normalizes { sec, nsec } to ensure nsec is unsigned. - var nsecInSec = Math.floor(nsec / 1e9); - return { - sec: sec + nsecInSec, - nsec: nsec - nsecInSec * 1e9, - }; -} -function encodeTimestampExtension(object) { - if (object instanceof Date) { - var timeSpec = encodeDateToTimeSpec(object); - return encodeTimeSpecToTimestamp(timeSpec); - } - else { - return null; - } -} -function decodeTimestampToTimeSpec(data) { - var view = new DataView(data.buffer, data.byteOffset, data.byteLength); - // data may be 32, 64, or 96 bits - switch (data.byteLength) { - case 4: { - // timestamp 32 = { sec32 } - var sec = view.getUint32(0); - var nsec = 0; - return { sec: sec, nsec: nsec }; - } - case 8: { - // timestamp 64 = { nsec30, sec34 } - var nsec30AndSecHigh2 = view.getUint32(0); - var secLow32 = view.getUint32(4); - var sec = (nsec30AndSecHigh2 & 0x3) * 0x100000000 + secLow32; - var nsec = nsec30AndSecHigh2 >>> 2; - return { sec: sec, nsec: nsec }; - } - case 12: { - // timestamp 96 = { nsec32 (unsigned), sec64 (signed) } - var sec = getInt64(view, 4); - var nsec = view.getUint32(0); - return { sec: sec, nsec: nsec }; - } - default: - throw new DecodeError("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(data.length)); - } -} -function decodeTimestampExtension(data) { - var timeSpec = decodeTimestampToTimeSpec(data); - return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6); -} -var timestampExtension = { - type: EXT_TIMESTAMP, - encode: encodeTimestampExtension, - decode: decodeTimestampExtension, -}; - -;// CONCATENATED MODULE: ./src/ExtensionCodec.ts -// ExtensionCodec to handle MessagePack extensions - - -var ExtensionCodec = /** @class */ (function () { - function ExtensionCodec() { - // built-in extensions - this.builtInEncoders = []; - this.builtInDecoders = []; - // custom extensions - this.encoders = []; - this.decoders = []; - this.register(timestampExtension); - } - ExtensionCodec.prototype.register = function (_a) { - var type = _a.type, encode = _a.encode, decode = _a.decode; - if (type >= 0) { - // custom extensions - this.encoders[type] = encode; - this.decoders[type] = decode; - } - else { - // built-in extensions - var index = 1 + type; - this.builtInEncoders[index] = encode; - this.builtInDecoders[index] = decode; - } - }; - ExtensionCodec.prototype.tryToEncode = function (object, context) { - // built-in extensions - for (var i = 0; i < this.builtInEncoders.length; i++) { - var encodeExt = this.builtInEncoders[i]; - if (encodeExt != null) { - var data = encodeExt(object, context); - if (data != null) { - var type = -1 - i; - return new ExtData(type, data); - } - } - } - // custom extensions - for (var i = 0; i < this.encoders.length; i++) { - var encodeExt = this.encoders[i]; - if (encodeExt != null) { - var data = encodeExt(object, context); - if (data != null) { - var type = i; - return new ExtData(type, data); - } - } - } - if (object instanceof ExtData) { - // to keep ExtData as is - return object; - } - return null; - }; - ExtensionCodec.prototype.decode = function (data, type, context) { - var decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type]; - if (decodeExt) { - return decodeExt(data, type, context); - } - else { - // decode() does not fail, returns ExtData instead. - return new ExtData(type, data); - } - }; - ExtensionCodec.defaultCodec = new ExtensionCodec(); - return ExtensionCodec; -}()); - - -;// CONCATENATED MODULE: ./src/utils/typedArrays.ts -function ensureUint8Array(buffer) { - if (buffer instanceof Uint8Array) { - return buffer; - } - else if (ArrayBuffer.isView(buffer)) { - return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); - } - else if (buffer instanceof ArrayBuffer) { - return new Uint8Array(buffer); - } - else { - // ArrayLike - return Uint8Array.from(buffer); - } -} -function createDataView(buffer) { - if (buffer instanceof ArrayBuffer) { - return new DataView(buffer); - } - var bufferView = ensureUint8Array(buffer); - return new DataView(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength); -} - -;// CONCATENATED MODULE: ./src/Encoder.ts -var Encoder_values = (undefined && undefined.__values) || function(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -}; - - - - -var DEFAULT_MAX_DEPTH = 100; -var DEFAULT_INITIAL_BUFFER_SIZE = 2048; -var Encoder = /** @class */ (function () { - function Encoder(extensionCodec, context, maxDepth, initialBufferSize, sortKeys, forceFloat32, ignoreUndefined, forceIntegerToFloat) { - if (extensionCodec === void 0) { extensionCodec = ExtensionCodec.defaultCodec; } - if (context === void 0) { context = undefined; } - if (maxDepth === void 0) { maxDepth = DEFAULT_MAX_DEPTH; } - if (initialBufferSize === void 0) { initialBufferSize = DEFAULT_INITIAL_BUFFER_SIZE; } - if (sortKeys === void 0) { sortKeys = false; } - if (forceFloat32 === void 0) { forceFloat32 = false; } - if (ignoreUndefined === void 0) { ignoreUndefined = false; } - if (forceIntegerToFloat === void 0) { forceIntegerToFloat = false; } - this.extensionCodec = extensionCodec; - this.context = context; - this.maxDepth = maxDepth; - this.initialBufferSize = initialBufferSize; - this.sortKeys = sortKeys; - this.forceFloat32 = forceFloat32; - this.ignoreUndefined = ignoreUndefined; - this.forceIntegerToFloat = forceIntegerToFloat; - this.pos = 0; - this.view = new DataView(new ArrayBuffer(this.initialBufferSize)); - this.bytes = new Uint8Array(this.view.buffer); - } - Encoder.prototype.reinitializeState = function () { - this.pos = 0; - }; - /** - * This is almost equivalent to {@link Encoder#encode}, but it returns an reference of the encoder's internal buffer and thus much faster than {@link Encoder#encode}. - * - * @returns Encodes the object and returns a shared reference the encoder's internal buffer. - */ - Encoder.prototype.encodeSharedRef = function (object) { - this.reinitializeState(); - this.doEncode(object, 1); - return this.bytes.subarray(0, this.pos); - }; - /** - * @returns Encodes the object and returns a copy of the encoder's internal buffer. - */ - Encoder.prototype.encode = function (object) { - this.reinitializeState(); - this.doEncode(object, 1); - return this.bytes.slice(0, this.pos); - }; - Encoder.prototype.doEncode = function (object, depth) { - if (depth > this.maxDepth) { - throw new Error("Too deep objects in depth ".concat(depth)); - } - if (object == null) { - this.encodeNil(); - } - else if (typeof object === "boolean") { - this.encodeBoolean(object); - } - else if (typeof object === "number") { - this.encodeNumber(object); - } - else if (typeof object === "string") { - this.encodeString(object); - } - else { - this.encodeObject(object, depth); - } - }; - Encoder.prototype.ensureBufferSizeToWrite = function (sizeToWrite) { - var requiredSize = this.pos + sizeToWrite; - if (this.view.byteLength < requiredSize) { - this.resizeBuffer(requiredSize * 2); - } - }; - Encoder.prototype.resizeBuffer = function (newSize) { - var newBuffer = new ArrayBuffer(newSize); - var newBytes = new Uint8Array(newBuffer); - var newView = new DataView(newBuffer); - newBytes.set(this.bytes); - this.view = newView; - this.bytes = newBytes; - }; - Encoder.prototype.encodeNil = function () { - this.writeU8(0xc0); - }; - Encoder.prototype.encodeBoolean = function (object) { - if (object === false) { - this.writeU8(0xc2); - } - else { - this.writeU8(0xc3); - } - }; - Encoder.prototype.encodeNumber = function (object) { - if (Number.isSafeInteger(object) && !this.forceIntegerToFloat) { - if (object >= 0) { - if (object < 0x80) { - // positive fixint - this.writeU8(object); - } - else if (object < 0x100) { - // uint 8 - this.writeU8(0xcc); - this.writeU8(object); - } - else if (object < 0x10000) { - // uint 16 - this.writeU8(0xcd); - this.writeU16(object); - } - else if (object < 0x100000000) { - // uint 32 - this.writeU8(0xce); - this.writeU32(object); - } - else { - // uint 64 - this.writeU8(0xcf); - this.writeU64(object); - } - } - else { - if (object >= -0x20) { - // negative fixint - this.writeU8(0xe0 | (object + 0x20)); - } - else if (object >= -0x80) { - // int 8 - this.writeU8(0xd0); - this.writeI8(object); - } - else if (object >= -0x8000) { - // int 16 - this.writeU8(0xd1); - this.writeI16(object); - } - else if (object >= -0x80000000) { - // int 32 - this.writeU8(0xd2); - this.writeI32(object); - } - else { - // int 64 - this.writeU8(0xd3); - this.writeI64(object); - } - } - } - else { - // non-integer numbers - if (this.forceFloat32) { - // float 32 - this.writeU8(0xca); - this.writeF32(object); - } - else { - // float 64 - this.writeU8(0xcb); - this.writeF64(object); - } - } - }; - Encoder.prototype.writeStringHeader = function (byteLength) { - if (byteLength < 32) { - // fixstr - this.writeU8(0xa0 + byteLength); - } - else if (byteLength < 0x100) { - // str 8 - this.writeU8(0xd9); - this.writeU8(byteLength); - } - else if (byteLength < 0x10000) { - // str 16 - this.writeU8(0xda); - this.writeU16(byteLength); - } - else if (byteLength < 0x100000000) { - // str 32 - this.writeU8(0xdb); - this.writeU32(byteLength); - } - else { - throw new Error("Too long string: ".concat(byteLength, " bytes in UTF-8")); - } - }; - Encoder.prototype.encodeString = function (object) { - var maxHeaderSize = 1 + 4; - var strLength = object.length; - if (strLength > TEXT_ENCODER_THRESHOLD) { - var byteLength = utf8Count(object); - this.ensureBufferSizeToWrite(maxHeaderSize + byteLength); - this.writeStringHeader(byteLength); - utf8EncodeTE(object, this.bytes, this.pos); - this.pos += byteLength; - } - else { - var byteLength = utf8Count(object); - this.ensureBufferSizeToWrite(maxHeaderSize + byteLength); - this.writeStringHeader(byteLength); - utf8EncodeJs(object, this.bytes, this.pos); - this.pos += byteLength; - } - }; - Encoder.prototype.encodeObject = function (object, depth) { - // try to encode objects with custom codec first of non-primitives - var ext = this.extensionCodec.tryToEncode(object, this.context); - if (ext != null) { - this.encodeExtension(ext); - } - else if (Array.isArray(object)) { - this.encodeArray(object, depth); - } - else if (ArrayBuffer.isView(object)) { - this.encodeBinary(object); - } - else if (typeof object === "object") { - this.encodeMap(object, depth); - } - else { - // symbol, function and other special object come here unless extensionCodec handles them. - throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(object))); - } - }; - Encoder.prototype.encodeBinary = function (object) { - var size = object.byteLength; - if (size < 0x100) { - // bin 8 - this.writeU8(0xc4); - this.writeU8(size); - } - else if (size < 0x10000) { - // bin 16 - this.writeU8(0xc5); - this.writeU16(size); - } - else if (size < 0x100000000) { - // bin 32 - this.writeU8(0xc6); - this.writeU32(size); - } - else { - throw new Error("Too large binary: ".concat(size)); - } - var bytes = ensureUint8Array(object); - this.writeU8a(bytes); - }; - Encoder.prototype.encodeArray = function (object, depth) { - var e_1, _a; - var size = object.length; - if (size < 16) { - // fixarray - this.writeU8(0x90 + size); - } - else if (size < 0x10000) { - // array 16 - this.writeU8(0xdc); - this.writeU16(size); - } - else if (size < 0x100000000) { - // array 32 - this.writeU8(0xdd); - this.writeU32(size); - } - else { - throw new Error("Too large array: ".concat(size)); - } - try { - for (var object_1 = Encoder_values(object), object_1_1 = object_1.next(); !object_1_1.done; object_1_1 = object_1.next()) { - var item = object_1_1.value; - this.doEncode(item, depth + 1); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (object_1_1 && !object_1_1.done && (_a = object_1.return)) _a.call(object_1); - } - finally { if (e_1) throw e_1.error; } - } - }; - Encoder.prototype.countWithoutUndefined = function (object, keys) { - var e_2, _a; - var count = 0; - try { - for (var keys_1 = Encoder_values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) { - var key = keys_1_1.value; - if (object[key] !== undefined) { - count++; - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1); - } - finally { if (e_2) throw e_2.error; } - } - return count; - }; - Encoder.prototype.encodeMap = function (object, depth) { - var e_3, _a; - var keys = Object.keys(object); - if (this.sortKeys) { - keys.sort(); - } - var size = this.ignoreUndefined ? this.countWithoutUndefined(object, keys) : keys.length; - if (size < 16) { - // fixmap - this.writeU8(0x80 + size); - } - else if (size < 0x10000) { - // map 16 - this.writeU8(0xde); - this.writeU16(size); - } - else if (size < 0x100000000) { - // map 32 - this.writeU8(0xdf); - this.writeU32(size); - } - else { - throw new Error("Too large map object: ".concat(size)); - } - try { - for (var keys_2 = Encoder_values(keys), keys_2_1 = keys_2.next(); !keys_2_1.done; keys_2_1 = keys_2.next()) { - var key = keys_2_1.value; - var value = object[key]; - if (!(this.ignoreUndefined && value === undefined)) { - this.encodeString(key); - this.doEncode(value, depth + 1); - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (keys_2_1 && !keys_2_1.done && (_a = keys_2.return)) _a.call(keys_2); - } - finally { if (e_3) throw e_3.error; } - } - }; - Encoder.prototype.encodeExtension = function (ext) { - var size = ext.data.length; - if (size === 1) { - // fixext 1 - this.writeU8(0xd4); - } - else if (size === 2) { - // fixext 2 - this.writeU8(0xd5); - } - else if (size === 4) { - // fixext 4 - this.writeU8(0xd6); - } - else if (size === 8) { - // fixext 8 - this.writeU8(0xd7); - } - else if (size === 16) { - // fixext 16 - this.writeU8(0xd8); - } - else if (size < 0x100) { - // ext 8 - this.writeU8(0xc7); - this.writeU8(size); - } - else if (size < 0x10000) { - // ext 16 - this.writeU8(0xc8); - this.writeU16(size); - } - else if (size < 0x100000000) { - // ext 32 - this.writeU8(0xc9); - this.writeU32(size); - } - else { - throw new Error("Too large extension object: ".concat(size)); - } - this.writeI8(ext.type); - this.writeU8a(ext.data); - }; - Encoder.prototype.writeU8 = function (value) { - this.ensureBufferSizeToWrite(1); - this.view.setUint8(this.pos, value); - this.pos++; - }; - Encoder.prototype.writeU8a = function (values) { - var size = values.length; - this.ensureBufferSizeToWrite(size); - this.bytes.set(values, this.pos); - this.pos += size; - }; - Encoder.prototype.writeI8 = function (value) { - this.ensureBufferSizeToWrite(1); - this.view.setInt8(this.pos, value); - this.pos++; - }; - Encoder.prototype.writeU16 = function (value) { - this.ensureBufferSizeToWrite(2); - this.view.setUint16(this.pos, value); - this.pos += 2; - }; - Encoder.prototype.writeI16 = function (value) { - this.ensureBufferSizeToWrite(2); - this.view.setInt16(this.pos, value); - this.pos += 2; - }; - Encoder.prototype.writeU32 = function (value) { - this.ensureBufferSizeToWrite(4); - this.view.setUint32(this.pos, value); - this.pos += 4; - }; - Encoder.prototype.writeI32 = function (value) { - this.ensureBufferSizeToWrite(4); - this.view.setInt32(this.pos, value); - this.pos += 4; - }; - Encoder.prototype.writeF32 = function (value) { - this.ensureBufferSizeToWrite(4); - this.view.setFloat32(this.pos, value); - this.pos += 4; - }; - Encoder.prototype.writeF64 = function (value) { - this.ensureBufferSizeToWrite(8); - this.view.setFloat64(this.pos, value); - this.pos += 8; - }; - Encoder.prototype.writeU64 = function (value) { - this.ensureBufferSizeToWrite(8); - setUint64(this.view, this.pos, value); - this.pos += 8; - }; - Encoder.prototype.writeI64 = function (value) { - this.ensureBufferSizeToWrite(8); - setInt64(this.view, this.pos, value); - this.pos += 8; - }; - return Encoder; -}()); - - -;// CONCATENATED MODULE: ./src/encode.ts - -var defaultEncodeOptions = {}; -/** - * It encodes `value` in the MessagePack format and - * returns a byte buffer. - * - * The returned buffer is a slice of a larger `ArrayBuffer`, so you have to use its `#byteOffset` and `#byteLength` in order to convert it to another typed arrays including NodeJS `Buffer`. - */ -function encode(value, options) { - if (options === void 0) { options = defaultEncodeOptions; } - var encoder = new Encoder(options.extensionCodec, options.context, options.maxDepth, options.initialBufferSize, options.sortKeys, options.forceFloat32, options.ignoreUndefined, options.forceIntegerToFloat); - return encoder.encodeSharedRef(value); -} - -;// CONCATENATED MODULE: ./src/utils/prettyByte.ts -function prettyByte(byte) { - return "".concat(byte < 0 ? "-" : "", "0x").concat(Math.abs(byte).toString(16).padStart(2, "0")); -} - -;// CONCATENATED MODULE: ./src/CachedKeyDecoder.ts -var CachedKeyDecoder_values = (undefined && undefined.__values) || function(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -}; - -var DEFAULT_MAX_KEY_LENGTH = 16; -var DEFAULT_MAX_LENGTH_PER_KEY = 16; -var CachedKeyDecoder = /** @class */ (function () { - function CachedKeyDecoder(maxKeyLength, maxLengthPerKey) { - if (maxKeyLength === void 0) { maxKeyLength = DEFAULT_MAX_KEY_LENGTH; } - if (maxLengthPerKey === void 0) { maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY; } - this.maxKeyLength = maxKeyLength; - this.maxLengthPerKey = maxLengthPerKey; - this.hit = 0; - this.miss = 0; - // avoid `new Array(N)`, which makes a sparse array, - // because a sparse array is typically slower than a non-sparse array. - this.caches = []; - for (var i = 0; i < this.maxKeyLength; i++) { - this.caches.push([]); - } - } - CachedKeyDecoder.prototype.canBeCached = function (byteLength) { - return byteLength > 0 && byteLength <= this.maxKeyLength; - }; - CachedKeyDecoder.prototype.find = function (bytes, inputOffset, byteLength) { - var e_1, _a; - var records = this.caches[byteLength - 1]; - try { - FIND_CHUNK: for (var records_1 = CachedKeyDecoder_values(records), records_1_1 = records_1.next(); !records_1_1.done; records_1_1 = records_1.next()) { - var record = records_1_1.value; - var recordBytes = record.bytes; - for (var j = 0; j < byteLength; j++) { - if (recordBytes[j] !== bytes[inputOffset + j]) { - continue FIND_CHUNK; - } - } - return record.str; - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (records_1_1 && !records_1_1.done && (_a = records_1.return)) _a.call(records_1); - } - finally { if (e_1) throw e_1.error; } - } - return null; - }; - CachedKeyDecoder.prototype.store = function (bytes, value) { - var records = this.caches[bytes.length - 1]; - var record = { bytes: bytes, str: value }; - if (records.length >= this.maxLengthPerKey) { - // `records` are full! - // Set `record` to an arbitrary position. - records[(Math.random() * records.length) | 0] = record; - } - else { - records.push(record); - } - }; - CachedKeyDecoder.prototype.decode = function (bytes, inputOffset, byteLength) { - var cachedValue = this.find(bytes, inputOffset, byteLength); - if (cachedValue != null) { - this.hit++; - return cachedValue; - } - this.miss++; - var str = utf8DecodeJs(bytes, inputOffset, byteLength); - // Ensure to copy a slice of bytes because the byte may be NodeJS Buffer and Buffer#slice() returns a reference to its internal ArrayBuffer. - var slicedCopyOfBytes = Uint8Array.prototype.slice.call(bytes, inputOffset, inputOffset + byteLength); - this.store(slicedCopyOfBytes, str); - return str; - }; - return CachedKeyDecoder; -}()); - - -;// CONCATENATED MODULE: ./src/Decoder.ts -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (undefined && undefined.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __asyncValues = (undefined && undefined.__asyncValues) || function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -}; -var __await = (undefined && undefined.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } -var __asyncGenerator = (undefined && undefined.__asyncGenerator) || function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -}; - - - - - - - -var isValidMapKeyType = function (key) { - var keyType = typeof key; - return keyType === "string" || keyType === "number"; -}; -var HEAD_BYTE_REQUIRED = -1; -var EMPTY_VIEW = new DataView(new ArrayBuffer(0)); -var EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer); -// IE11: Hack to support IE11. -// IE11: Drop this hack and just use RangeError when IE11 is obsolete. -var DataViewIndexOutOfBoundsError = (function () { - try { - // IE11: The spec says it should throw RangeError, - // IE11: but in IE11 it throws TypeError. - EMPTY_VIEW.getInt8(0); - } - catch (e) { - return e.constructor; - } - throw new Error("never reached"); -})(); -var MORE_DATA = new DataViewIndexOutOfBoundsError("Insufficient data"); -var sharedCachedKeyDecoder = new CachedKeyDecoder(); -var Decoder = /** @class */ (function () { - function Decoder(extensionCodec, context, maxStrLength, maxBinLength, maxArrayLength, maxMapLength, maxExtLength, keyDecoder) { - if (extensionCodec === void 0) { extensionCodec = ExtensionCodec.defaultCodec; } - if (context === void 0) { context = undefined; } - if (maxStrLength === void 0) { maxStrLength = UINT32_MAX; } - if (maxBinLength === void 0) { maxBinLength = UINT32_MAX; } - if (maxArrayLength === void 0) { maxArrayLength = UINT32_MAX; } - if (maxMapLength === void 0) { maxMapLength = UINT32_MAX; } - if (maxExtLength === void 0) { maxExtLength = UINT32_MAX; } - if (keyDecoder === void 0) { keyDecoder = sharedCachedKeyDecoder; } - this.extensionCodec = extensionCodec; - this.context = context; - this.maxStrLength = maxStrLength; - this.maxBinLength = maxBinLength; - this.maxArrayLength = maxArrayLength; - this.maxMapLength = maxMapLength; - this.maxExtLength = maxExtLength; - this.keyDecoder = keyDecoder; - this.totalPos = 0; - this.pos = 0; - this.view = EMPTY_VIEW; - this.bytes = EMPTY_BYTES; - this.headByte = HEAD_BYTE_REQUIRED; - this.stack = []; - } - Decoder.prototype.reinitializeState = function () { - this.totalPos = 0; - this.headByte = HEAD_BYTE_REQUIRED; - this.stack.length = 0; - // view, bytes, and pos will be re-initialized in setBuffer() - }; - Decoder.prototype.setBuffer = function (buffer) { - this.bytes = ensureUint8Array(buffer); - this.view = createDataView(this.bytes); - this.pos = 0; - }; - Decoder.prototype.appendBuffer = function (buffer) { - if (this.headByte === HEAD_BYTE_REQUIRED && !this.hasRemaining(1)) { - this.setBuffer(buffer); - } - else { - var remainingData = this.bytes.subarray(this.pos); - var newData = ensureUint8Array(buffer); - // concat remainingData + newData - var newBuffer = new Uint8Array(remainingData.length + newData.length); - newBuffer.set(remainingData); - newBuffer.set(newData, remainingData.length); - this.setBuffer(newBuffer); - } - }; - Decoder.prototype.hasRemaining = function (size) { - return this.view.byteLength - this.pos >= size; - }; - Decoder.prototype.createExtraByteError = function (posToShow) { - var _a = this, view = _a.view, pos = _a.pos; - return new RangeError("Extra ".concat(view.byteLength - pos, " of ").concat(view.byteLength, " byte(s) found at buffer[").concat(posToShow, "]")); - }; - /** - * @throws {@link DecodeError} - * @throws {@link RangeError} - */ - Decoder.prototype.decode = function (buffer) { - this.reinitializeState(); - this.setBuffer(buffer); - var object = this.doDecodeSync(); - if (this.hasRemaining(1)) { - throw this.createExtraByteError(this.pos); - } - return object; - }; - Decoder.prototype.decodeMulti = function (buffer) { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - this.reinitializeState(); - this.setBuffer(buffer); - _a.label = 1; - case 1: - if (!this.hasRemaining(1)) return [3 /*break*/, 3]; - return [4 /*yield*/, this.doDecodeSync()]; - case 2: - _a.sent(); - return [3 /*break*/, 1]; - case 3: return [2 /*return*/]; - } - }); - }; - Decoder.prototype.decodeAsync = function (stream) { - var stream_1, stream_1_1; - var e_1, _a; - return __awaiter(this, void 0, void 0, function () { - var decoded, object, buffer, e_1_1, _b, headByte, pos, totalPos; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - decoded = false; - _c.label = 1; - case 1: - _c.trys.push([1, 6, 7, 12]); - stream_1 = __asyncValues(stream); - _c.label = 2; - case 2: return [4 /*yield*/, stream_1.next()]; - case 3: - if (!(stream_1_1 = _c.sent(), !stream_1_1.done)) return [3 /*break*/, 5]; - buffer = stream_1_1.value; - if (decoded) { - throw this.createExtraByteError(this.totalPos); - } - this.appendBuffer(buffer); - try { - object = this.doDecodeSync(); - decoded = true; - } - catch (e) { - if (!(e instanceof DataViewIndexOutOfBoundsError)) { - throw e; // rethrow - } - // fallthrough - } - this.totalPos += this.pos; - _c.label = 4; - case 4: return [3 /*break*/, 2]; - case 5: return [3 /*break*/, 12]; - case 6: - e_1_1 = _c.sent(); - e_1 = { error: e_1_1 }; - return [3 /*break*/, 12]; - case 7: - _c.trys.push([7, , 10, 11]); - if (!(stream_1_1 && !stream_1_1.done && (_a = stream_1.return))) return [3 /*break*/, 9]; - return [4 /*yield*/, _a.call(stream_1)]; - case 8: - _c.sent(); - _c.label = 9; - case 9: return [3 /*break*/, 11]; - case 10: - if (e_1) throw e_1.error; - return [7 /*endfinally*/]; - case 11: return [7 /*endfinally*/]; - case 12: - if (decoded) { - if (this.hasRemaining(1)) { - throw this.createExtraByteError(this.totalPos); - } - return [2 /*return*/, object]; - } - _b = this, headByte = _b.headByte, pos = _b.pos, totalPos = _b.totalPos; - throw new RangeError("Insufficient data in parsing ".concat(prettyByte(headByte), " at ").concat(totalPos, " (").concat(pos, " in the current buffer)")); - } - }); - }); - }; - Decoder.prototype.decodeArrayStream = function (stream) { - return this.decodeMultiAsync(stream, true); - }; - Decoder.prototype.decodeStream = function (stream) { - return this.decodeMultiAsync(stream, false); - }; - Decoder.prototype.decodeMultiAsync = function (stream, isArray) { - return __asyncGenerator(this, arguments, function decodeMultiAsync_1() { - var isArrayHeaderRequired, arrayItemsLeft, stream_2, stream_2_1, buffer, e_2, e_3_1; - var e_3, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - isArrayHeaderRequired = isArray; - arrayItemsLeft = -1; - _b.label = 1; - case 1: - _b.trys.push([1, 13, 14, 19]); - stream_2 = __asyncValues(stream); - _b.label = 2; - case 2: return [4 /*yield*/, __await(stream_2.next())]; - case 3: - if (!(stream_2_1 = _b.sent(), !stream_2_1.done)) return [3 /*break*/, 12]; - buffer = stream_2_1.value; - if (isArray && arrayItemsLeft === 0) { - throw this.createExtraByteError(this.totalPos); - } - this.appendBuffer(buffer); - if (isArrayHeaderRequired) { - arrayItemsLeft = this.readArraySize(); - isArrayHeaderRequired = false; - this.complete(); - } - _b.label = 4; - case 4: - _b.trys.push([4, 9, , 10]); - _b.label = 5; - case 5: - if (false) {} - return [4 /*yield*/, __await(this.doDecodeSync())]; - case 6: return [4 /*yield*/, _b.sent()]; - case 7: - _b.sent(); - if (--arrayItemsLeft === 0) { - return [3 /*break*/, 8]; - } - return [3 /*break*/, 5]; - case 8: return [3 /*break*/, 10]; - case 9: - e_2 = _b.sent(); - if (!(e_2 instanceof DataViewIndexOutOfBoundsError)) { - throw e_2; // rethrow - } - return [3 /*break*/, 10]; - case 10: - this.totalPos += this.pos; - _b.label = 11; - case 11: return [3 /*break*/, 2]; - case 12: return [3 /*break*/, 19]; - case 13: - e_3_1 = _b.sent(); - e_3 = { error: e_3_1 }; - return [3 /*break*/, 19]; - case 14: - _b.trys.push([14, , 17, 18]); - if (!(stream_2_1 && !stream_2_1.done && (_a = stream_2.return))) return [3 /*break*/, 16]; - return [4 /*yield*/, __await(_a.call(stream_2))]; - case 15: - _b.sent(); - _b.label = 16; - case 16: return [3 /*break*/, 18]; - case 17: - if (e_3) throw e_3.error; - return [7 /*endfinally*/]; - case 18: return [7 /*endfinally*/]; - case 19: return [2 /*return*/]; - } - }); - }); - }; - Decoder.prototype.doDecodeSync = function () { - DECODE: while (true) { - var headByte = this.readHeadByte(); - var object = void 0; - if (headByte >= 0xe0) { - // negative fixint (111x xxxx) 0xe0 - 0xff - object = headByte - 0x100; - } - else if (headByte < 0xc0) { - if (headByte < 0x80) { - // positive fixint (0xxx xxxx) 0x00 - 0x7f - object = headByte; - } - else if (headByte < 0x90) { - // fixmap (1000 xxxx) 0x80 - 0x8f - var size = headByte - 0x80; - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } - else { - object = {}; - } - } - else if (headByte < 0xa0) { - // fixarray (1001 xxxx) 0x90 - 0x9f - var size = headByte - 0x90; - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } - else { - object = []; - } - } - else { - // fixstr (101x xxxx) 0xa0 - 0xbf - var byteLength = headByte - 0xa0; - object = this.decodeUtf8String(byteLength, 0); - } - } - else if (headByte === 0xc0) { - // nil - object = null; - } - else if (headByte === 0xc2) { - // false - object = false; - } - else if (headByte === 0xc3) { - // true - object = true; - } - else if (headByte === 0xca) { - // float 32 - object = this.readF32(); - } - else if (headByte === 0xcb) { - // float 64 - object = this.readF64(); - } - else if (headByte === 0xcc) { - // uint 8 - object = this.readU8(); - } - else if (headByte === 0xcd) { - // uint 16 - object = this.readU16(); - } - else if (headByte === 0xce) { - // uint 32 - object = this.readU32(); - } - else if (headByte === 0xcf) { - // uint 64 - object = this.readU64(); - } - else if (headByte === 0xd0) { - // int 8 - object = this.readI8(); - } - else if (headByte === 0xd1) { - // int 16 - object = this.readI16(); - } - else if (headByte === 0xd2) { - // int 32 - object = this.readI32(); - } - else if (headByte === 0xd3) { - // int 64 - object = this.readI64(); - } - else if (headByte === 0xd9) { - // str 8 - var byteLength = this.lookU8(); - object = this.decodeUtf8String(byteLength, 1); - } - else if (headByte === 0xda) { - // str 16 - var byteLength = this.lookU16(); - object = this.decodeUtf8String(byteLength, 2); - } - else if (headByte === 0xdb) { - // str 32 - var byteLength = this.lookU32(); - object = this.decodeUtf8String(byteLength, 4); - } - else if (headByte === 0xdc) { - // array 16 - var size = this.readU16(); - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } - else { - object = []; - } - } - else if (headByte === 0xdd) { - // array 32 - var size = this.readU32(); - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } - else { - object = []; - } - } - else if (headByte === 0xde) { - // map 16 - var size = this.readU16(); - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } - else { - object = {}; - } - } - else if (headByte === 0xdf) { - // map 32 - var size = this.readU32(); - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } - else { - object = {}; - } - } - else if (headByte === 0xc4) { - // bin 8 - var size = this.lookU8(); - object = this.decodeBinary(size, 1); - } - else if (headByte === 0xc5) { - // bin 16 - var size = this.lookU16(); - object = this.decodeBinary(size, 2); - } - else if (headByte === 0xc6) { - // bin 32 - var size = this.lookU32(); - object = this.decodeBinary(size, 4); - } - else if (headByte === 0xd4) { - // fixext 1 - object = this.decodeExtension(1, 0); - } - else if (headByte === 0xd5) { - // fixext 2 - object = this.decodeExtension(2, 0); - } - else if (headByte === 0xd6) { - // fixext 4 - object = this.decodeExtension(4, 0); - } - else if (headByte === 0xd7) { - // fixext 8 - object = this.decodeExtension(8, 0); - } - else if (headByte === 0xd8) { - // fixext 16 - object = this.decodeExtension(16, 0); - } - else if (headByte === 0xc7) { - // ext 8 - var size = this.lookU8(); - object = this.decodeExtension(size, 1); - } - else if (headByte === 0xc8) { - // ext 16 - var size = this.lookU16(); - object = this.decodeExtension(size, 2); - } - else if (headByte === 0xc9) { - // ext 32 - var size = this.lookU32(); - object = this.decodeExtension(size, 4); - } - else { - throw new DecodeError("Unrecognized type byte: ".concat(prettyByte(headByte))); - } - this.complete(); - var stack = this.stack; - while (stack.length > 0) { - // arrays and maps - var state = stack[stack.length - 1]; - if (state.type === 0 /* State.ARRAY */) { - state.array[state.position] = object; - state.position++; - if (state.position === state.size) { - stack.pop(); - object = state.array; - } - else { - continue DECODE; - } - } - else if (state.type === 1 /* State.MAP_KEY */) { - if (!isValidMapKeyType(object)) { - throw new DecodeError("The type of key must be string or number but " + typeof object); - } - if (object === "__proto__") { - throw new DecodeError("The key __proto__ is not allowed"); - } - state.key = object; - state.type = 2 /* State.MAP_VALUE */; - continue DECODE; - } - else { - // it must be `state.type === State.MAP_VALUE` here - state.map[state.key] = object; - state.readCount++; - if (state.readCount === state.size) { - stack.pop(); - object = state.map; - } - else { - state.key = null; - state.type = 1 /* State.MAP_KEY */; - continue DECODE; - } - } - } - return object; - } - }; - Decoder.prototype.readHeadByte = function () { - if (this.headByte === HEAD_BYTE_REQUIRED) { - this.headByte = this.readU8(); - // console.log("headByte", prettyByte(this.headByte)); - } - return this.headByte; - }; - Decoder.prototype.complete = function () { - this.headByte = HEAD_BYTE_REQUIRED; - }; - Decoder.prototype.readArraySize = function () { - var headByte = this.readHeadByte(); - switch (headByte) { - case 0xdc: - return this.readU16(); - case 0xdd: - return this.readU32(); - default: { - if (headByte < 0xa0) { - return headByte - 0x90; - } - else { - throw new DecodeError("Unrecognized array type byte: ".concat(prettyByte(headByte))); - } - } - } - }; - Decoder.prototype.pushMapState = function (size) { - if (size > this.maxMapLength) { - throw new DecodeError("Max length exceeded: map length (".concat(size, ") > maxMapLengthLength (").concat(this.maxMapLength, ")")); - } - this.stack.push({ - type: 1 /* State.MAP_KEY */, - size: size, - key: null, - readCount: 0, - map: {}, - }); - }; - Decoder.prototype.pushArrayState = function (size) { - if (size > this.maxArrayLength) { - throw new DecodeError("Max length exceeded: array length (".concat(size, ") > maxArrayLength (").concat(this.maxArrayLength, ")")); - } - this.stack.push({ - type: 0 /* State.ARRAY */, - size: size, - array: new Array(size), - position: 0, - }); - }; - Decoder.prototype.decodeUtf8String = function (byteLength, headerOffset) { - var _a; - if (byteLength > this.maxStrLength) { - throw new DecodeError("Max length exceeded: UTF-8 byte length (".concat(byteLength, ") > maxStrLength (").concat(this.maxStrLength, ")")); - } - if (this.bytes.byteLength < this.pos + headerOffset + byteLength) { - throw MORE_DATA; - } - var offset = this.pos + headerOffset; - var object; - if (this.stateIsMapKey() && ((_a = this.keyDecoder) === null || _a === void 0 ? void 0 : _a.canBeCached(byteLength))) { - object = this.keyDecoder.decode(this.bytes, offset, byteLength); - } - else if (byteLength > TEXT_DECODER_THRESHOLD) { - object = utf8DecodeTD(this.bytes, offset, byteLength); - } - else { - object = utf8DecodeJs(this.bytes, offset, byteLength); - } - this.pos += headerOffset + byteLength; - return object; - }; - Decoder.prototype.stateIsMapKey = function () { - if (this.stack.length > 0) { - var state = this.stack[this.stack.length - 1]; - return state.type === 1 /* State.MAP_KEY */; - } - return false; - }; - Decoder.prototype.decodeBinary = function (byteLength, headOffset) { - if (byteLength > this.maxBinLength) { - throw new DecodeError("Max length exceeded: bin length (".concat(byteLength, ") > maxBinLength (").concat(this.maxBinLength, ")")); - } - if (!this.hasRemaining(byteLength + headOffset)) { - throw MORE_DATA; - } - var offset = this.pos + headOffset; - var object = this.bytes.subarray(offset, offset + byteLength); - this.pos += headOffset + byteLength; - return object; - }; - Decoder.prototype.decodeExtension = function (size, headOffset) { - if (size > this.maxExtLength) { - throw new DecodeError("Max length exceeded: ext length (".concat(size, ") > maxExtLength (").concat(this.maxExtLength, ")")); - } - var extType = this.view.getInt8(this.pos + headOffset); - var data = this.decodeBinary(size, headOffset + 1 /* extType */); - return this.extensionCodec.decode(data, extType, this.context); - }; - Decoder.prototype.lookU8 = function () { - return this.view.getUint8(this.pos); - }; - Decoder.prototype.lookU16 = function () { - return this.view.getUint16(this.pos); - }; - Decoder.prototype.lookU32 = function () { - return this.view.getUint32(this.pos); - }; - Decoder.prototype.readU8 = function () { - var value = this.view.getUint8(this.pos); - this.pos++; - return value; - }; - Decoder.prototype.readI8 = function () { - var value = this.view.getInt8(this.pos); - this.pos++; - return value; - }; - Decoder.prototype.readU16 = function () { - var value = this.view.getUint16(this.pos); - this.pos += 2; - return value; - }; - Decoder.prototype.readI16 = function () { - var value = this.view.getInt16(this.pos); - this.pos += 2; - return value; - }; - Decoder.prototype.readU32 = function () { - var value = this.view.getUint32(this.pos); - this.pos += 4; - return value; - }; - Decoder.prototype.readI32 = function () { - var value = this.view.getInt32(this.pos); - this.pos += 4; - return value; - }; - Decoder.prototype.readU64 = function () { - var value = getUint64(this.view, this.pos); - this.pos += 8; - return value; - }; - Decoder.prototype.readI64 = function () { - var value = getInt64(this.view, this.pos); - this.pos += 8; - return value; - }; - Decoder.prototype.readF32 = function () { - var value = this.view.getFloat32(this.pos); - this.pos += 4; - return value; - }; - Decoder.prototype.readF64 = function () { - var value = this.view.getFloat64(this.pos); - this.pos += 8; - return value; - }; - return Decoder; -}()); - - -;// CONCATENATED MODULE: ./src/decode.ts - -var defaultDecodeOptions = {}; -/** - * It decodes a single MessagePack object in a buffer. - * - * This is a synchronous decoding function. - * See other variants for asynchronous decoding: {@link decodeAsync()}, {@link decodeStream()}, or {@link decodeArrayStream()}. - * - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -function decode(buffer, options) { - if (options === void 0) { options = defaultDecodeOptions; } - var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decode(buffer); -} -/** - * It decodes multiple MessagePack objects in a buffer. - * This is corresponding to {@link decodeMultiStream()}. - * - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -function decodeMulti(buffer, options) { - if (options === void 0) { options = defaultDecodeOptions; } - var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decodeMulti(buffer); -} - -;// CONCATENATED MODULE: ./src/utils/stream.ts -// utility for whatwg streams -var stream_generator = (undefined && undefined.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var stream_await = (undefined && undefined.__await) || function (v) { return this instanceof stream_await ? (this.v = v, this) : new stream_await(v); } -var stream_asyncGenerator = (undefined && undefined.__asyncGenerator) || function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof stream_await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -}; -function isAsyncIterable(object) { - return object[Symbol.asyncIterator] != null; -} -function assertNonNull(value) { - if (value == null) { - throw new Error("Assertion Failure: value must not be null nor undefined"); - } -} -function asyncIterableFromStream(stream) { - return stream_asyncGenerator(this, arguments, function asyncIterableFromStream_1() { - var reader, _a, done, value; - return stream_generator(this, function (_b) { - switch (_b.label) { - case 0: - reader = stream.getReader(); - _b.label = 1; - case 1: - _b.trys.push([1, , 9, 10]); - _b.label = 2; - case 2: - if (false) {} - return [4 /*yield*/, stream_await(reader.read())]; - case 3: - _a = _b.sent(), done = _a.done, value = _a.value; - if (!done) return [3 /*break*/, 5]; - return [4 /*yield*/, stream_await(void 0)]; - case 4: return [2 /*return*/, _b.sent()]; - case 5: - assertNonNull(value); - return [4 /*yield*/, stream_await(value)]; - case 6: return [4 /*yield*/, _b.sent()]; - case 7: - _b.sent(); - return [3 /*break*/, 2]; - case 8: return [3 /*break*/, 10]; - case 9: - reader.releaseLock(); - return [7 /*endfinally*/]; - case 10: return [2 /*return*/]; - } - }); - }); -} -function ensureAsyncIterable(streamLike) { - if (isAsyncIterable(streamLike)) { - return streamLike; - } - else { - return asyncIterableFromStream(streamLike); - } -} - -;// CONCATENATED MODULE: ./src/decodeAsync.ts -var decodeAsync_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var decodeAsync_generator = (undefined && undefined.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; - - - -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -function decodeAsync(streamLike, options) { - if (options === void 0) { options = defaultDecodeOptions; } - return decodeAsync_awaiter(this, void 0, void 0, function () { - var stream, decoder; - return decodeAsync_generator(this, function (_a) { - stream = ensureAsyncIterable(streamLike); - decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return [2 /*return*/, decoder.decodeAsync(stream)]; - }); - }); -} -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -function decodeArrayStream(streamLike, options) { - if (options === void 0) { options = defaultDecodeOptions; } - var stream = ensureAsyncIterable(streamLike); - var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decodeArrayStream(stream); -} -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -function decodeMultiStream(streamLike, options) { - if (options === void 0) { options = defaultDecodeOptions; } - var stream = ensureAsyncIterable(streamLike); - var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decodeStream(stream); -} -/** - * @deprecated Use {@link decodeMultiStream()} instead. - */ -function decodeStream(streamLike, options) { - if (options === void 0) { options = defaultDecodeOptions; } - return decodeMultiStream(streamLike, options); -} - -;// CONCATENATED MODULE: ./src/index.ts -// Main Functions: - - - - - - - - - - - -// Utilitiies for Extension Types: - - - - - - - -/******/ return __webpack_exports__; -/******/ })() -; -}); -//# sourceMappingURL=msgpack.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+umd/msgpack.js.map b/node_modules/@msgpack/msgpack/dist.es5+umd/msgpack.js.map deleted file mode 100644 index 0389f55..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+umd/msgpack.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"msgpack.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA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CAAC;IAEF,OAAO,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC;AAED;;;GAGG;AACI,SAAS,iBAAiB,CAC/B,UAAgE,EAChE,OAAiF;IAAjF,oCAAsD,oBAA2B;IAEjF,IAAM,MAAM,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAE/C,IAAM,OAAO,GAAG,IAAI,OAAO,CACzB,OAAO,CAAC,cAAc,EACrB,OAA6C,CAAC,OAAO,EACtD,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,CACrB,CAAC;IAEF,OAAO,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACI,SAAS,YAAY,CAC1B,UAAgE,EAChE,OAAiF;IAAjF,oCAAsD,oBAA2B;IAEjF,OAAO,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;;;ACnFD,kBAAkB;AAEgB;AAChB;AAI6B;AAChB;AAIiE;AACrB;AAER;AACvB;AACmB;AAE3B;AACjB;AAEnB,kCAAkC;AAEgB;AACxB;AAGU;AACjB;AASE;AAQnB","sources":["webpack://MessagePack/webpack/universalModuleDefinition","webpack://MessagePack/webpack/bootstrap","webpack://MessagePack/webpack/runtime/define property getters","webpack://MessagePack/webpack/runtime/hasOwnProperty shorthand","webpack://MessagePack/webpack/runtime/make namespace object","webpack://MessagePack/./src/utils/int.ts","webpack://MessagePack/./src/utils/utf8.ts","webpack://MessagePack/./src/ExtData.ts","webpack://MessagePack/./src/DecodeError.ts","webpack://MessagePack/./src/timestamp.ts","webpack://MessagePack/./src/ExtensionCodec.ts","webpack://MessagePack/./src/utils/typedArrays.ts","webpack://MessagePack/./src/Encoder.ts","webpack://MessagePack/./src/encode.ts","webpack://MessagePack/./src/utils/prettyByte.ts","webpack://MessagePack/./src/CachedKeyDecoder.ts","webpack://MessagePack/./src/Decoder.ts","webpack://MessagePack/./src/decode.ts","webpack://MessagePack/./src/utils/stream.ts","webpack://MessagePack/./src/decodeAsync.ts","webpack://MessagePack/./src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"MessagePack\"] = factory();\n\telse\n\t\troot[\"MessagePack\"] = factory();\n})(this, function() {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// Integer Utility\n\nexport const UINT32_MAX = 0xffff_ffff;\n\n// DataView extension to handle int64 / uint64,\n// where the actual range is 53-bits integer (a.k.a. safe integer)\n\nexport function setUint64(view: DataView, offset: number, value: number): void {\n const high = value / 0x1_0000_0000;\n const low = value; // high bits are truncated by DataView\n view.setUint32(offset, high);\n view.setUint32(offset + 4, low);\n}\n\nexport function setInt64(view: DataView, offset: number, value: number): void {\n const high = Math.floor(value / 0x1_0000_0000);\n const low = value; // high bits are truncated by DataView\n view.setUint32(offset, high);\n view.setUint32(offset + 4, low);\n}\n\nexport function getInt64(view: DataView, offset: number): number {\n const high = view.getInt32(offset);\n const low = view.getUint32(offset + 4);\n return high * 0x1_0000_0000 + low;\n}\n\nexport function getUint64(view: DataView, offset: number): number {\n const high = view.getUint32(offset);\n const low = view.getUint32(offset + 4);\n return high * 0x1_0000_0000 + low;\n}\n","/* eslint-disable @typescript-eslint/no-unnecessary-condition */\nimport { UINT32_MAX } from \"./int\";\n\nconst TEXT_ENCODING_AVAILABLE =\n (typeof process === \"undefined\" || process?.env?.[\"TEXT_ENCODING\"] !== \"never\") &&\n typeof TextEncoder !== \"undefined\" &&\n typeof TextDecoder !== \"undefined\";\n\nexport function utf8Count(str: string): number {\n const strLength = str.length;\n\n let byteLength = 0;\n let pos = 0;\n while (pos < strLength) {\n let value = str.charCodeAt(pos++);\n\n if ((value & 0xffffff80) === 0) {\n // 1-byte\n byteLength++;\n continue;\n } else if ((value & 0xfffff800) === 0) {\n // 2-bytes\n byteLength += 2;\n } else {\n // handle surrogate pair\n if (value >= 0xd800 && value <= 0xdbff) {\n // high surrogate\n if (pos < strLength) {\n const extra = str.charCodeAt(pos);\n if ((extra & 0xfc00) === 0xdc00) {\n ++pos;\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n }\n }\n\n if ((value & 0xffff0000) === 0) {\n // 3-byte\n byteLength += 3;\n } else {\n // 4-byte\n byteLength += 4;\n }\n }\n }\n return byteLength;\n}\n\nexport function utf8EncodeJs(str: string, output: Uint8Array, outputOffset: number): void {\n const strLength = str.length;\n let offset = outputOffset;\n let pos = 0;\n while (pos < strLength) {\n let value = str.charCodeAt(pos++);\n\n if ((value & 0xffffff80) === 0) {\n // 1-byte\n output[offset++] = value;\n continue;\n } else if ((value & 0xfffff800) === 0) {\n // 2-bytes\n output[offset++] = ((value >> 6) & 0x1f) | 0xc0;\n } else {\n // handle surrogate pair\n if (value >= 0xd800 && value <= 0xdbff) {\n // high surrogate\n if (pos < strLength) {\n const extra = str.charCodeAt(pos);\n if ((extra & 0xfc00) === 0xdc00) {\n ++pos;\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n }\n }\n\n if ((value & 0xffff0000) === 0) {\n // 3-byte\n output[offset++] = ((value >> 12) & 0x0f) | 0xe0;\n output[offset++] = ((value >> 6) & 0x3f) | 0x80;\n } else {\n // 4-byte\n output[offset++] = ((value >> 18) & 0x07) | 0xf0;\n output[offset++] = ((value >> 12) & 0x3f) | 0x80;\n output[offset++] = ((value >> 6) & 0x3f) | 0x80;\n }\n }\n\n output[offset++] = (value & 0x3f) | 0x80;\n }\n}\n\nconst sharedTextEncoder = TEXT_ENCODING_AVAILABLE ? new TextEncoder() : undefined;\nexport const TEXT_ENCODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE\n ? UINT32_MAX\n : typeof process !== \"undefined\" && process?.env?.[\"TEXT_ENCODING\"] !== \"force\"\n ? 200\n : 0;\n\nfunction utf8EncodeTEencode(str: string, output: Uint8Array, outputOffset: number): void {\n output.set(sharedTextEncoder!.encode(str), outputOffset);\n}\n\nfunction utf8EncodeTEencodeInto(str: string, output: Uint8Array, outputOffset: number): void {\n sharedTextEncoder!.encodeInto(str, output.subarray(outputOffset));\n}\n\nexport const utf8EncodeTE = sharedTextEncoder?.encodeInto ? utf8EncodeTEencodeInto : utf8EncodeTEencode;\n\nconst CHUNK_SIZE = 0x1_000;\n\nexport function utf8DecodeJs(bytes: Uint8Array, inputOffset: number, byteLength: number): string {\n let offset = inputOffset;\n const end = offset + byteLength;\n\n const units: Array = [];\n let result = \"\";\n while (offset < end) {\n const byte1 = bytes[offset++]!;\n if ((byte1 & 0x80) === 0) {\n // 1 byte\n units.push(byte1);\n } else if ((byte1 & 0xe0) === 0xc0) {\n // 2 bytes\n const byte2 = bytes[offset++]! & 0x3f;\n units.push(((byte1 & 0x1f) << 6) | byte2);\n } else if ((byte1 & 0xf0) === 0xe0) {\n // 3 bytes\n const byte2 = bytes[offset++]! & 0x3f;\n const byte3 = bytes[offset++]! & 0x3f;\n units.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3);\n } else if ((byte1 & 0xf8) === 0xf0) {\n // 4 bytes\n const byte2 = bytes[offset++]! & 0x3f;\n const byte3 = bytes[offset++]! & 0x3f;\n const byte4 = bytes[offset++]! & 0x3f;\n let unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4;\n if (unit > 0xffff) {\n unit -= 0x10000;\n units.push(((unit >>> 10) & 0x3ff) | 0xd800);\n unit = 0xdc00 | (unit & 0x3ff);\n }\n units.push(unit);\n } else {\n units.push(byte1);\n }\n\n if (units.length >= CHUNK_SIZE) {\n result += String.fromCharCode(...units);\n units.length = 0;\n }\n }\n\n if (units.length > 0) {\n result += String.fromCharCode(...units);\n }\n\n return result;\n}\n\nconst sharedTextDecoder = TEXT_ENCODING_AVAILABLE ? new TextDecoder() : null;\nexport const TEXT_DECODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE\n ? UINT32_MAX\n : typeof process !== \"undefined\" && process?.env?.[\"TEXT_DECODER\"] !== \"force\"\n ? 200\n : 0;\n\nexport function utf8DecodeTD(bytes: Uint8Array, inputOffset: number, byteLength: number): string {\n const stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength);\n return sharedTextDecoder!.decode(stringBytes);\n}\n","/**\n * ExtData is used to handle Extension Types that are not registered to ExtensionCodec.\n */\nexport class ExtData {\n constructor(readonly type: number, readonly data: Uint8Array) {}\n}\n","export class DecodeError extends Error {\n constructor(message: string) {\n super(message);\n\n // fix the prototype chain in a cross-platform way\n const proto: typeof DecodeError.prototype = Object.create(DecodeError.prototype);\n Object.setPrototypeOf(this, proto);\n\n Object.defineProperty(this, \"name\", {\n configurable: true,\n enumerable: false,\n value: DecodeError.name,\n });\n }\n}\n","// https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type\nimport { DecodeError } from \"./DecodeError\";\nimport { getInt64, setInt64 } from \"./utils/int\";\n\nexport const EXT_TIMESTAMP = -1;\n\nexport type TimeSpec = {\n sec: number;\n nsec: number;\n};\n\nconst TIMESTAMP32_MAX_SEC = 0x100000000 - 1; // 32-bit unsigned int\nconst TIMESTAMP64_MAX_SEC = 0x400000000 - 1; // 34-bit unsigned int\n\nexport function encodeTimeSpecToTimestamp({ sec, nsec }: TimeSpec): Uint8Array {\n if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {\n // Here sec >= 0 && nsec >= 0\n if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {\n // timestamp 32 = { sec32 (unsigned) }\n const rv = new Uint8Array(4);\n const view = new DataView(rv.buffer);\n view.setUint32(0, sec);\n return rv;\n } else {\n // timestamp 64 = { nsec30 (unsigned), sec34 (unsigned) }\n const secHigh = sec / 0x100000000;\n const secLow = sec & 0xffffffff;\n const rv = new Uint8Array(8);\n const view = new DataView(rv.buffer);\n // nsec30 | secHigh2\n view.setUint32(0, (nsec << 2) | (secHigh & 0x3));\n // secLow32\n view.setUint32(4, secLow);\n return rv;\n }\n } else {\n // timestamp 96 = { nsec32 (unsigned), sec64 (signed) }\n const rv = new Uint8Array(12);\n const view = new DataView(rv.buffer);\n view.setUint32(0, nsec);\n setInt64(view, 4, sec);\n return rv;\n }\n}\n\nexport function encodeDateToTimeSpec(date: Date): TimeSpec {\n const msec = date.getTime();\n const sec = Math.floor(msec / 1e3);\n const nsec = (msec - sec * 1e3) * 1e6;\n\n // Normalizes { sec, nsec } to ensure nsec is unsigned.\n const nsecInSec = Math.floor(nsec / 1e9);\n return {\n sec: sec + nsecInSec,\n nsec: nsec - nsecInSec * 1e9,\n };\n}\n\nexport function encodeTimestampExtension(object: unknown): Uint8Array | null {\n if (object instanceof Date) {\n const timeSpec = encodeDateToTimeSpec(object);\n return encodeTimeSpecToTimestamp(timeSpec);\n } else {\n return null;\n }\n}\n\nexport function decodeTimestampToTimeSpec(data: Uint8Array): TimeSpec {\n const view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n\n // data may be 32, 64, or 96 bits\n switch (data.byteLength) {\n case 4: {\n // timestamp 32 = { sec32 }\n const sec = view.getUint32(0);\n const nsec = 0;\n return { sec, nsec };\n }\n case 8: {\n // timestamp 64 = { nsec30, sec34 }\n const nsec30AndSecHigh2 = view.getUint32(0);\n const secLow32 = view.getUint32(4);\n const sec = (nsec30AndSecHigh2 & 0x3) * 0x100000000 + secLow32;\n const nsec = nsec30AndSecHigh2 >>> 2;\n return { sec, nsec };\n }\n case 12: {\n // timestamp 96 = { nsec32 (unsigned), sec64 (signed) }\n\n const sec = getInt64(view, 4);\n const nsec = view.getUint32(0);\n return { sec, nsec };\n }\n default:\n throw new DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${data.length}`);\n }\n}\n\nexport function decodeTimestampExtension(data: Uint8Array): Date {\n const timeSpec = decodeTimestampToTimeSpec(data);\n return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6);\n}\n\nexport const timestampExtension = {\n type: EXT_TIMESTAMP,\n encode: encodeTimestampExtension,\n decode: decodeTimestampExtension,\n};\n","// ExtensionCodec to handle MessagePack extensions\n\nimport { ExtData } from \"./ExtData\";\nimport { timestampExtension } from \"./timestamp\";\n\nexport type ExtensionDecoderType = (\n data: Uint8Array,\n extensionType: number,\n context: ContextType,\n) => unknown;\n\nexport type ExtensionEncoderType = (input: unknown, context: ContextType) => Uint8Array | null;\n\n// immutable interface to ExtensionCodec\nexport type ExtensionCodecType = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n __brand?: ContextType;\n tryToEncode(object: unknown, context: ContextType): ExtData | null;\n decode(data: Uint8Array, extType: number, context: ContextType): unknown;\n};\n\nexport class ExtensionCodec implements ExtensionCodecType {\n public static readonly defaultCodec: ExtensionCodecType = new ExtensionCodec();\n\n // ensures ExtensionCodecType matches ExtensionCodec\n // this will make type errors a lot more clear\n // eslint-disable-next-line @typescript-eslint/naming-convention\n __brand?: ContextType;\n\n // built-in extensions\n private readonly builtInEncoders: Array | undefined | null> = [];\n private readonly builtInDecoders: Array | undefined | null> = [];\n\n // custom extensions\n private readonly encoders: Array | undefined | null> = [];\n private readonly decoders: Array | undefined | null> = [];\n\n public constructor() {\n this.register(timestampExtension);\n }\n\n public register({\n type,\n encode,\n decode,\n }: {\n type: number;\n encode: ExtensionEncoderType;\n decode: ExtensionDecoderType;\n }): void {\n if (type >= 0) {\n // custom extensions\n this.encoders[type] = encode;\n this.decoders[type] = decode;\n } else {\n // built-in extensions\n const index = 1 + type;\n this.builtInEncoders[index] = encode;\n this.builtInDecoders[index] = decode;\n }\n }\n\n public tryToEncode(object: unknown, context: ContextType): ExtData | null {\n // built-in extensions\n for (let i = 0; i < this.builtInEncoders.length; i++) {\n const encodeExt = this.builtInEncoders[i];\n if (encodeExt != null) {\n const data = encodeExt(object, context);\n if (data != null) {\n const type = -1 - i;\n return new ExtData(type, data);\n }\n }\n }\n\n // custom extensions\n for (let i = 0; i < this.encoders.length; i++) {\n const encodeExt = this.encoders[i];\n if (encodeExt != null) {\n const data = encodeExt(object, context);\n if (data != null) {\n const type = i;\n return new ExtData(type, data);\n }\n }\n }\n\n if (object instanceof ExtData) {\n // to keep ExtData as is\n return object;\n }\n return null;\n }\n\n public decode(data: Uint8Array, type: number, context: ContextType): unknown {\n const decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type];\n if (decodeExt) {\n return decodeExt(data, type, context);\n } else {\n // decode() does not fail, returns ExtData instead.\n return new ExtData(type, data);\n }\n }\n}\n","export function ensureUint8Array(buffer: ArrayLike | Uint8Array | ArrayBufferView | ArrayBuffer): Uint8Array {\n if (buffer instanceof Uint8Array) {\n return buffer;\n } else if (ArrayBuffer.isView(buffer)) {\n return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n } else if (buffer instanceof ArrayBuffer) {\n return new Uint8Array(buffer);\n } else {\n // ArrayLike\n return Uint8Array.from(buffer);\n }\n}\n\nexport function createDataView(buffer: ArrayLike | ArrayBufferView | ArrayBuffer): DataView {\n if (buffer instanceof ArrayBuffer) {\n return new DataView(buffer);\n }\n\n const bufferView = ensureUint8Array(buffer);\n return new DataView(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\n}\n","import { utf8EncodeJs, utf8Count, TEXT_ENCODER_THRESHOLD, utf8EncodeTE } from \"./utils/utf8\";\nimport { ExtensionCodec, ExtensionCodecType } from \"./ExtensionCodec\";\nimport { setInt64, setUint64 } from \"./utils/int\";\nimport { ensureUint8Array } from \"./utils/typedArrays\";\nimport type { ExtData } from \"./ExtData\";\n\nexport const DEFAULT_MAX_DEPTH = 100;\nexport const DEFAULT_INITIAL_BUFFER_SIZE = 2048;\n\nexport class Encoder {\n private pos = 0;\n private view = new DataView(new ArrayBuffer(this.initialBufferSize));\n private bytes = new Uint8Array(this.view.buffer);\n\n public constructor(\n private readonly extensionCodec: ExtensionCodecType = ExtensionCodec.defaultCodec as any,\n private readonly context: ContextType = undefined as any,\n private readonly maxDepth = DEFAULT_MAX_DEPTH,\n private readonly initialBufferSize = DEFAULT_INITIAL_BUFFER_SIZE,\n private readonly sortKeys = false,\n private readonly forceFloat32 = false,\n private readonly ignoreUndefined = false,\n private readonly forceIntegerToFloat = false,\n ) {}\n\n private reinitializeState() {\n this.pos = 0;\n }\n\n /**\n * This is almost equivalent to {@link Encoder#encode}, but it returns an reference of the encoder's internal buffer and thus much faster than {@link Encoder#encode}.\n *\n * @returns Encodes the object and returns a shared reference the encoder's internal buffer.\n */\n public encodeSharedRef(object: unknown): Uint8Array {\n this.reinitializeState();\n this.doEncode(object, 1);\n return this.bytes.subarray(0, this.pos);\n }\n\n /**\n * @returns Encodes the object and returns a copy of the encoder's internal buffer.\n */\n public encode(object: unknown): Uint8Array {\n this.reinitializeState();\n this.doEncode(object, 1);\n return this.bytes.slice(0, this.pos);\n }\n\n private doEncode(object: unknown, depth: number): void {\n if (depth > this.maxDepth) {\n throw new Error(`Too deep objects in depth ${depth}`);\n }\n\n if (object == null) {\n this.encodeNil();\n } else if (typeof object === \"boolean\") {\n this.encodeBoolean(object);\n } else if (typeof object === \"number\") {\n this.encodeNumber(object);\n } else if (typeof object === \"string\") {\n this.encodeString(object);\n } else {\n this.encodeObject(object, depth);\n }\n }\n\n private ensureBufferSizeToWrite(sizeToWrite: number) {\n const requiredSize = this.pos + sizeToWrite;\n\n if (this.view.byteLength < requiredSize) {\n this.resizeBuffer(requiredSize * 2);\n }\n }\n\n private resizeBuffer(newSize: number) {\n const newBuffer = new ArrayBuffer(newSize);\n const newBytes = new Uint8Array(newBuffer);\n const newView = new DataView(newBuffer);\n\n newBytes.set(this.bytes);\n\n this.view = newView;\n this.bytes = newBytes;\n }\n\n private encodeNil() {\n this.writeU8(0xc0);\n }\n\n private encodeBoolean(object: boolean) {\n if (object === false) {\n this.writeU8(0xc2);\n } else {\n this.writeU8(0xc3);\n }\n }\n private encodeNumber(object: number) {\n if (Number.isSafeInteger(object) && !this.forceIntegerToFloat) {\n if (object >= 0) {\n if (object < 0x80) {\n // positive fixint\n this.writeU8(object);\n } else if (object < 0x100) {\n // uint 8\n this.writeU8(0xcc);\n this.writeU8(object);\n } else if (object < 0x10000) {\n // uint 16\n this.writeU8(0xcd);\n this.writeU16(object);\n } else if (object < 0x100000000) {\n // uint 32\n this.writeU8(0xce);\n this.writeU32(object);\n } else {\n // uint 64\n this.writeU8(0xcf);\n this.writeU64(object);\n }\n } else {\n if (object >= -0x20) {\n // negative fixint\n this.writeU8(0xe0 | (object + 0x20));\n } else if (object >= -0x80) {\n // int 8\n this.writeU8(0xd0);\n this.writeI8(object);\n } else if (object >= -0x8000) {\n // int 16\n this.writeU8(0xd1);\n this.writeI16(object);\n } else if (object >= -0x80000000) {\n // int 32\n this.writeU8(0xd2);\n this.writeI32(object);\n } else {\n // int 64\n this.writeU8(0xd3);\n this.writeI64(object);\n }\n }\n } else {\n // non-integer numbers\n if (this.forceFloat32) {\n // float 32\n this.writeU8(0xca);\n this.writeF32(object);\n } else {\n // float 64\n this.writeU8(0xcb);\n this.writeF64(object);\n }\n }\n }\n\n private writeStringHeader(byteLength: number) {\n if (byteLength < 32) {\n // fixstr\n this.writeU8(0xa0 + byteLength);\n } else if (byteLength < 0x100) {\n // str 8\n this.writeU8(0xd9);\n this.writeU8(byteLength);\n } else if (byteLength < 0x10000) {\n // str 16\n this.writeU8(0xda);\n this.writeU16(byteLength);\n } else if (byteLength < 0x100000000) {\n // str 32\n this.writeU8(0xdb);\n this.writeU32(byteLength);\n } else {\n throw new Error(`Too long string: ${byteLength} bytes in UTF-8`);\n }\n }\n\n private encodeString(object: string) {\n const maxHeaderSize = 1 + 4;\n const strLength = object.length;\n\n if (strLength > TEXT_ENCODER_THRESHOLD) {\n const byteLength = utf8Count(object);\n this.ensureBufferSizeToWrite(maxHeaderSize + byteLength);\n this.writeStringHeader(byteLength);\n utf8EncodeTE(object, this.bytes, this.pos);\n this.pos += byteLength;\n } else {\n const byteLength = utf8Count(object);\n this.ensureBufferSizeToWrite(maxHeaderSize + byteLength);\n this.writeStringHeader(byteLength);\n utf8EncodeJs(object, this.bytes, this.pos);\n this.pos += byteLength;\n }\n }\n\n private encodeObject(object: unknown, depth: number) {\n // try to encode objects with custom codec first of non-primitives\n const ext = this.extensionCodec.tryToEncode(object, this.context);\n if (ext != null) {\n this.encodeExtension(ext);\n } else if (Array.isArray(object)) {\n this.encodeArray(object, depth);\n } else if (ArrayBuffer.isView(object)) {\n this.encodeBinary(object);\n } else if (typeof object === \"object\") {\n this.encodeMap(object as Record, depth);\n } else {\n // symbol, function and other special object come here unless extensionCodec handles them.\n throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(object)}`);\n }\n }\n\n private encodeBinary(object: ArrayBufferView) {\n const size = object.byteLength;\n if (size < 0x100) {\n // bin 8\n this.writeU8(0xc4);\n this.writeU8(size);\n } else if (size < 0x10000) {\n // bin 16\n this.writeU8(0xc5);\n this.writeU16(size);\n } else if (size < 0x100000000) {\n // bin 32\n this.writeU8(0xc6);\n this.writeU32(size);\n } else {\n throw new Error(`Too large binary: ${size}`);\n }\n const bytes = ensureUint8Array(object);\n this.writeU8a(bytes);\n }\n\n private encodeArray(object: Array, depth: number) {\n const size = object.length;\n if (size < 16) {\n // fixarray\n this.writeU8(0x90 + size);\n } else if (size < 0x10000) {\n // array 16\n this.writeU8(0xdc);\n this.writeU16(size);\n } else if (size < 0x100000000) {\n // array 32\n this.writeU8(0xdd);\n this.writeU32(size);\n } else {\n throw new Error(`Too large array: ${size}`);\n }\n for (const item of object) {\n this.doEncode(item, depth + 1);\n }\n }\n\n private countWithoutUndefined(object: Record, keys: ReadonlyArray): number {\n let count = 0;\n\n for (const key of keys) {\n if (object[key] !== undefined) {\n count++;\n }\n }\n\n return count;\n }\n\n private encodeMap(object: Record, depth: number) {\n const keys = Object.keys(object);\n if (this.sortKeys) {\n keys.sort();\n }\n\n const size = this.ignoreUndefined ? this.countWithoutUndefined(object, keys) : keys.length;\n\n if (size < 16) {\n // fixmap\n this.writeU8(0x80 + size);\n } else if (size < 0x10000) {\n // map 16\n this.writeU8(0xde);\n this.writeU16(size);\n } else if (size < 0x100000000) {\n // map 32\n this.writeU8(0xdf);\n this.writeU32(size);\n } else {\n throw new Error(`Too large map object: ${size}`);\n }\n\n for (const key of keys) {\n const value = object[key];\n\n if (!(this.ignoreUndefined && value === undefined)) {\n this.encodeString(key);\n this.doEncode(value, depth + 1);\n }\n }\n }\n\n private encodeExtension(ext: ExtData) {\n const size = ext.data.length;\n if (size === 1) {\n // fixext 1\n this.writeU8(0xd4);\n } else if (size === 2) {\n // fixext 2\n this.writeU8(0xd5);\n } else if (size === 4) {\n // fixext 4\n this.writeU8(0xd6);\n } else if (size === 8) {\n // fixext 8\n this.writeU8(0xd7);\n } else if (size === 16) {\n // fixext 16\n this.writeU8(0xd8);\n } else if (size < 0x100) {\n // ext 8\n this.writeU8(0xc7);\n this.writeU8(size);\n } else if (size < 0x10000) {\n // ext 16\n this.writeU8(0xc8);\n this.writeU16(size);\n } else if (size < 0x100000000) {\n // ext 32\n this.writeU8(0xc9);\n this.writeU32(size);\n } else {\n throw new Error(`Too large extension object: ${size}`);\n }\n this.writeI8(ext.type);\n this.writeU8a(ext.data);\n }\n\n private writeU8(value: number) {\n this.ensureBufferSizeToWrite(1);\n\n this.view.setUint8(this.pos, value);\n this.pos++;\n }\n\n private writeU8a(values: ArrayLike) {\n const size = values.length;\n this.ensureBufferSizeToWrite(size);\n\n this.bytes.set(values, this.pos);\n this.pos += size;\n }\n\n private writeI8(value: number) {\n this.ensureBufferSizeToWrite(1);\n\n this.view.setInt8(this.pos, value);\n this.pos++;\n }\n\n private writeU16(value: number) {\n this.ensureBufferSizeToWrite(2);\n\n this.view.setUint16(this.pos, value);\n this.pos += 2;\n }\n\n private writeI16(value: number) {\n this.ensureBufferSizeToWrite(2);\n\n this.view.setInt16(this.pos, value);\n this.pos += 2;\n }\n\n private writeU32(value: number) {\n this.ensureBufferSizeToWrite(4);\n\n this.view.setUint32(this.pos, value);\n this.pos += 4;\n }\n\n private writeI32(value: number) {\n this.ensureBufferSizeToWrite(4);\n\n this.view.setInt32(this.pos, value);\n this.pos += 4;\n }\n\n private writeF32(value: number) {\n this.ensureBufferSizeToWrite(4);\n this.view.setFloat32(this.pos, value);\n this.pos += 4;\n }\n\n private writeF64(value: number) {\n this.ensureBufferSizeToWrite(8);\n this.view.setFloat64(this.pos, value);\n this.pos += 8;\n }\n\n private writeU64(value: number) {\n this.ensureBufferSizeToWrite(8);\n\n setUint64(this.view, this.pos, value);\n this.pos += 8;\n }\n\n private writeI64(value: number) {\n this.ensureBufferSizeToWrite(8);\n\n setInt64(this.view, this.pos, value);\n this.pos += 8;\n }\n}\n","import { Encoder } from \"./Encoder\";\nimport type { ExtensionCodecType } from \"./ExtensionCodec\";\nimport type { ContextOf, SplitUndefined } from \"./context\";\n\nexport type EncodeOptions = Partial<\n Readonly<{\n extensionCodec: ExtensionCodecType;\n\n /**\n * The maximum depth in nested objects and arrays.\n *\n * Defaults to 100.\n */\n maxDepth: number;\n\n /**\n * The initial size of the internal buffer.\n *\n * Defaults to 2048.\n */\n initialBufferSize: number;\n\n /**\n * If `true`, the keys of an object is sorted. In other words, the encoded\n * binary is canonical and thus comparable to another encoded binary.\n *\n * Defaults to `false`. If enabled, it spends more time in encoding objects.\n */\n sortKeys: boolean;\n /**\n * If `true`, non-integer numbers are encoded in float32, not in float64 (the default).\n *\n * Only use it if precisions don't matter.\n *\n * Defaults to `false`.\n */\n forceFloat32: boolean;\n\n /**\n * If `true`, an object property with `undefined` value are ignored.\n * e.g. `{ foo: undefined }` will be encoded as `{}`, as `JSON.stringify()` does.\n *\n * Defaults to `false`. If enabled, it spends more time in encoding objects.\n */\n ignoreUndefined: boolean;\n\n /**\n * If `true`, integer numbers are encoded as floating point numbers,\n * with the `forceFloat32` option taken into account.\n *\n * Defaults to `false`.\n */\n forceIntegerToFloat: boolean;\n }>\n> &\n ContextOf;\n\nconst defaultEncodeOptions: EncodeOptions = {};\n\n/**\n * It encodes `value` in the MessagePack format and\n * returns a byte buffer.\n *\n * The returned buffer is a slice of a larger `ArrayBuffer`, so you have to use its `#byteOffset` and `#byteLength` in order to convert it to another typed arrays including NodeJS `Buffer`.\n */\nexport function encode(\n value: unknown,\n options: EncodeOptions> = defaultEncodeOptions as any,\n): Uint8Array {\n const encoder = new Encoder(\n options.extensionCodec,\n (options as typeof options & { context: any }).context,\n options.maxDepth,\n options.initialBufferSize,\n options.sortKeys,\n options.forceFloat32,\n options.ignoreUndefined,\n options.forceIntegerToFloat,\n );\n return encoder.encodeSharedRef(value);\n}\n","export function prettyByte(byte: number): string {\n return `${byte < 0 ? \"-\" : \"\"}0x${Math.abs(byte).toString(16).padStart(2, \"0\")}`;\n}\n","import { utf8DecodeJs } from \"./utils/utf8\";\n\nconst DEFAULT_MAX_KEY_LENGTH = 16;\nconst DEFAULT_MAX_LENGTH_PER_KEY = 16;\n\nexport interface KeyDecoder {\n canBeCached(byteLength: number): boolean;\n decode(bytes: Uint8Array, inputOffset: number, byteLength: number): string;\n}\ninterface KeyCacheRecord {\n readonly bytes: Uint8Array;\n readonly str: string;\n}\n\nexport class CachedKeyDecoder implements KeyDecoder {\n hit = 0;\n miss = 0;\n private readonly caches: Array>;\n\n constructor(readonly maxKeyLength = DEFAULT_MAX_KEY_LENGTH, readonly maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY) {\n // avoid `new Array(N)`, which makes a sparse array,\n // because a sparse array is typically slower than a non-sparse array.\n this.caches = [];\n for (let i = 0; i < this.maxKeyLength; i++) {\n this.caches.push([]);\n }\n }\n\n public canBeCached(byteLength: number): boolean {\n return byteLength > 0 && byteLength <= this.maxKeyLength;\n }\n\n private find(bytes: Uint8Array, inputOffset: number, byteLength: number): string | null {\n const records = this.caches[byteLength - 1]!;\n\n FIND_CHUNK: for (const record of records) {\n const recordBytes = record.bytes;\n\n for (let j = 0; j < byteLength; j++) {\n if (recordBytes[j] !== bytes[inputOffset + j]) {\n continue FIND_CHUNK;\n }\n }\n return record.str;\n }\n return null;\n }\n\n private store(bytes: Uint8Array, value: string) {\n const records = this.caches[bytes.length - 1]!;\n const record: KeyCacheRecord = { bytes, str: value };\n\n if (records.length >= this.maxLengthPerKey) {\n // `records` are full!\n // Set `record` to an arbitrary position.\n records[(Math.random() * records.length) | 0] = record;\n } else {\n records.push(record);\n }\n }\n\n public decode(bytes: Uint8Array, inputOffset: number, byteLength: number): string {\n const cachedValue = this.find(bytes, inputOffset, byteLength);\n if (cachedValue != null) {\n this.hit++;\n return cachedValue;\n }\n this.miss++;\n\n const str = utf8DecodeJs(bytes, inputOffset, byteLength);\n // Ensure to copy a slice of bytes because the byte may be NodeJS Buffer and Buffer#slice() returns a reference to its internal ArrayBuffer.\n const slicedCopyOfBytes = Uint8Array.prototype.slice.call(bytes, inputOffset, inputOffset + byteLength);\n this.store(slicedCopyOfBytes, str);\n return str;\n }\n}\n","import { prettyByte } from \"./utils/prettyByte\";\nimport { ExtensionCodec, ExtensionCodecType } from \"./ExtensionCodec\";\nimport { getInt64, getUint64, UINT32_MAX } from \"./utils/int\";\nimport { utf8DecodeJs, TEXT_DECODER_THRESHOLD, utf8DecodeTD } from \"./utils/utf8\";\nimport { createDataView, ensureUint8Array } from \"./utils/typedArrays\";\nimport { CachedKeyDecoder, KeyDecoder } from \"./CachedKeyDecoder\";\nimport { DecodeError } from \"./DecodeError\";\n\nconst enum State {\n ARRAY,\n MAP_KEY,\n MAP_VALUE,\n}\n\ntype MapKeyType = string | number;\n\nconst isValidMapKeyType = (key: unknown): key is MapKeyType => {\n const keyType = typeof key;\n\n return keyType === \"string\" || keyType === \"number\";\n};\n\ntype StackMapState = {\n type: State.MAP_KEY | State.MAP_VALUE;\n size: number;\n key: MapKeyType | null;\n readCount: number;\n map: Record;\n};\n\ntype StackArrayState = {\n type: State.ARRAY;\n size: number;\n array: Array;\n position: number;\n};\n\ntype StackState = StackArrayState | StackMapState;\n\nconst HEAD_BYTE_REQUIRED = -1;\n\nconst EMPTY_VIEW = new DataView(new ArrayBuffer(0));\nconst EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer);\n\n// IE11: Hack to support IE11.\n// IE11: Drop this hack and just use RangeError when IE11 is obsolete.\nexport const DataViewIndexOutOfBoundsError: typeof Error = (() => {\n try {\n // IE11: The spec says it should throw RangeError,\n // IE11: but in IE11 it throws TypeError.\n EMPTY_VIEW.getInt8(0);\n } catch (e: any) {\n return e.constructor;\n }\n throw new Error(\"never reached\");\n})();\n\nconst MORE_DATA = new DataViewIndexOutOfBoundsError(\"Insufficient data\");\n\nconst sharedCachedKeyDecoder = new CachedKeyDecoder();\n\nexport class Decoder {\n private totalPos = 0;\n private pos = 0;\n\n private view = EMPTY_VIEW;\n private bytes = EMPTY_BYTES;\n private headByte = HEAD_BYTE_REQUIRED;\n private readonly stack: Array = [];\n\n public constructor(\n private readonly extensionCodec: ExtensionCodecType = ExtensionCodec.defaultCodec as any,\n private readonly context: ContextType = undefined as any,\n private readonly maxStrLength = UINT32_MAX,\n private readonly maxBinLength = UINT32_MAX,\n private readonly maxArrayLength = UINT32_MAX,\n private readonly maxMapLength = UINT32_MAX,\n private readonly maxExtLength = UINT32_MAX,\n private readonly keyDecoder: KeyDecoder | null = sharedCachedKeyDecoder,\n ) {}\n\n private reinitializeState() {\n this.totalPos = 0;\n this.headByte = HEAD_BYTE_REQUIRED;\n this.stack.length = 0;\n\n // view, bytes, and pos will be re-initialized in setBuffer()\n }\n\n private setBuffer(buffer: ArrayLike | BufferSource): void {\n this.bytes = ensureUint8Array(buffer);\n this.view = createDataView(this.bytes);\n this.pos = 0;\n }\n\n private appendBuffer(buffer: ArrayLike | BufferSource) {\n if (this.headByte === HEAD_BYTE_REQUIRED && !this.hasRemaining(1)) {\n this.setBuffer(buffer);\n } else {\n const remainingData = this.bytes.subarray(this.pos);\n const newData = ensureUint8Array(buffer);\n\n // concat remainingData + newData\n const newBuffer = new Uint8Array(remainingData.length + newData.length);\n newBuffer.set(remainingData);\n newBuffer.set(newData, remainingData.length);\n this.setBuffer(newBuffer);\n }\n }\n\n private hasRemaining(size: number) {\n return this.view.byteLength - this.pos >= size;\n }\n\n private createExtraByteError(posToShow: number): Error {\n const { view, pos } = this;\n return new RangeError(`Extra ${view.byteLength - pos} of ${view.byteLength} byte(s) found at buffer[${posToShow}]`);\n }\n\n /**\n * @throws {@link DecodeError}\n * @throws {@link RangeError}\n */\n public decode(buffer: ArrayLike | BufferSource): unknown {\n this.reinitializeState();\n this.setBuffer(buffer);\n\n const object = this.doDecodeSync();\n if (this.hasRemaining(1)) {\n throw this.createExtraByteError(this.pos);\n }\n return object;\n }\n\n public *decodeMulti(buffer: ArrayLike | BufferSource): Generator {\n this.reinitializeState();\n this.setBuffer(buffer);\n\n while (this.hasRemaining(1)) {\n yield this.doDecodeSync();\n }\n }\n\n public async decodeAsync(stream: AsyncIterable | BufferSource>): Promise {\n let decoded = false;\n let object: unknown;\n for await (const buffer of stream) {\n if (decoded) {\n throw this.createExtraByteError(this.totalPos);\n }\n\n this.appendBuffer(buffer);\n\n try {\n object = this.doDecodeSync();\n decoded = true;\n } catch (e) {\n if (!(e instanceof DataViewIndexOutOfBoundsError)) {\n throw e; // rethrow\n }\n // fallthrough\n }\n this.totalPos += this.pos;\n }\n\n if (decoded) {\n if (this.hasRemaining(1)) {\n throw this.createExtraByteError(this.totalPos);\n }\n return object;\n }\n\n const { headByte, pos, totalPos } = this;\n throw new RangeError(\n `Insufficient data in parsing ${prettyByte(headByte)} at ${totalPos} (${pos} in the current buffer)`,\n );\n }\n\n public decodeArrayStream(\n stream: AsyncIterable | BufferSource>,\n ): AsyncGenerator {\n return this.decodeMultiAsync(stream, true);\n }\n\n public decodeStream(stream: AsyncIterable | BufferSource>): AsyncGenerator {\n return this.decodeMultiAsync(stream, false);\n }\n\n private async *decodeMultiAsync(stream: AsyncIterable | BufferSource>, isArray: boolean) {\n let isArrayHeaderRequired = isArray;\n let arrayItemsLeft = -1;\n\n for await (const buffer of stream) {\n if (isArray && arrayItemsLeft === 0) {\n throw this.createExtraByteError(this.totalPos);\n }\n\n this.appendBuffer(buffer);\n\n if (isArrayHeaderRequired) {\n arrayItemsLeft = this.readArraySize();\n isArrayHeaderRequired = false;\n this.complete();\n }\n\n try {\n while (true) {\n yield this.doDecodeSync();\n if (--arrayItemsLeft === 0) {\n break;\n }\n }\n } catch (e) {\n if (!(e instanceof DataViewIndexOutOfBoundsError)) {\n throw e; // rethrow\n }\n // fallthrough\n }\n this.totalPos += this.pos;\n }\n }\n\n private doDecodeSync(): unknown {\n DECODE: while (true) {\n const headByte = this.readHeadByte();\n let object: unknown;\n\n if (headByte >= 0xe0) {\n // negative fixint (111x xxxx) 0xe0 - 0xff\n object = headByte - 0x100;\n } else if (headByte < 0xc0) {\n if (headByte < 0x80) {\n // positive fixint (0xxx xxxx) 0x00 - 0x7f\n object = headByte;\n } else if (headByte < 0x90) {\n // fixmap (1000 xxxx) 0x80 - 0x8f\n const size = headByte - 0x80;\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n } else {\n object = {};\n }\n } else if (headByte < 0xa0) {\n // fixarray (1001 xxxx) 0x90 - 0x9f\n const size = headByte - 0x90;\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n } else {\n object = [];\n }\n } else {\n // fixstr (101x xxxx) 0xa0 - 0xbf\n const byteLength = headByte - 0xa0;\n object = this.decodeUtf8String(byteLength, 0);\n }\n } else if (headByte === 0xc0) {\n // nil\n object = null;\n } else if (headByte === 0xc2) {\n // false\n object = false;\n } else if (headByte === 0xc3) {\n // true\n object = true;\n } else if (headByte === 0xca) {\n // float 32\n object = this.readF32();\n } else if (headByte === 0xcb) {\n // float 64\n object = this.readF64();\n } else if (headByte === 0xcc) {\n // uint 8\n object = this.readU8();\n } else if (headByte === 0xcd) {\n // uint 16\n object = this.readU16();\n } else if (headByte === 0xce) {\n // uint 32\n object = this.readU32();\n } else if (headByte === 0xcf) {\n // uint 64\n object = this.readU64();\n } else if (headByte === 0xd0) {\n // int 8\n object = this.readI8();\n } else if (headByte === 0xd1) {\n // int 16\n object = this.readI16();\n } else if (headByte === 0xd2) {\n // int 32\n object = this.readI32();\n } else if (headByte === 0xd3) {\n // int 64\n object = this.readI64();\n } else if (headByte === 0xd9) {\n // str 8\n const byteLength = this.lookU8();\n object = this.decodeUtf8String(byteLength, 1);\n } else if (headByte === 0xda) {\n // str 16\n const byteLength = this.lookU16();\n object = this.decodeUtf8String(byteLength, 2);\n } else if (headByte === 0xdb) {\n // str 32\n const byteLength = this.lookU32();\n object = this.decodeUtf8String(byteLength, 4);\n } else if (headByte === 0xdc) {\n // array 16\n const size = this.readU16();\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n } else {\n object = [];\n }\n } else if (headByte === 0xdd) {\n // array 32\n const size = this.readU32();\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n } else {\n object = [];\n }\n } else if (headByte === 0xde) {\n // map 16\n const size = this.readU16();\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n } else {\n object = {};\n }\n } else if (headByte === 0xdf) {\n // map 32\n const size = this.readU32();\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n } else {\n object = {};\n }\n } else if (headByte === 0xc4) {\n // bin 8\n const size = this.lookU8();\n object = this.decodeBinary(size, 1);\n } else if (headByte === 0xc5) {\n // bin 16\n const size = this.lookU16();\n object = this.decodeBinary(size, 2);\n } else if (headByte === 0xc6) {\n // bin 32\n const size = this.lookU32();\n object = this.decodeBinary(size, 4);\n } else if (headByte === 0xd4) {\n // fixext 1\n object = this.decodeExtension(1, 0);\n } else if (headByte === 0xd5) {\n // fixext 2\n object = this.decodeExtension(2, 0);\n } else if (headByte === 0xd6) {\n // fixext 4\n object = this.decodeExtension(4, 0);\n } else if (headByte === 0xd7) {\n // fixext 8\n object = this.decodeExtension(8, 0);\n } else if (headByte === 0xd8) {\n // fixext 16\n object = this.decodeExtension(16, 0);\n } else if (headByte === 0xc7) {\n // ext 8\n const size = this.lookU8();\n object = this.decodeExtension(size, 1);\n } else if (headByte === 0xc8) {\n // ext 16\n const size = this.lookU16();\n object = this.decodeExtension(size, 2);\n } else if (headByte === 0xc9) {\n // ext 32\n const size = this.lookU32();\n object = this.decodeExtension(size, 4);\n } else {\n throw new DecodeError(`Unrecognized type byte: ${prettyByte(headByte)}`);\n }\n\n this.complete();\n\n const stack = this.stack;\n while (stack.length > 0) {\n // arrays and maps\n const state = stack[stack.length - 1]!;\n if (state.type === State.ARRAY) {\n state.array[state.position] = object;\n state.position++;\n if (state.position === state.size) {\n stack.pop();\n object = state.array;\n } else {\n continue DECODE;\n }\n } else if (state.type === State.MAP_KEY) {\n if (!isValidMapKeyType(object)) {\n throw new DecodeError(\"The type of key must be string or number but \" + typeof object);\n }\n if (object === \"__proto__\") {\n throw new DecodeError(\"The key __proto__ is not allowed\");\n }\n\n state.key = object;\n state.type = State.MAP_VALUE;\n continue DECODE;\n } else {\n // it must be `state.type === State.MAP_VALUE` here\n\n state.map[state.key!] = object;\n state.readCount++;\n\n if (state.readCount === state.size) {\n stack.pop();\n object = state.map;\n } else {\n state.key = null;\n state.type = State.MAP_KEY;\n continue DECODE;\n }\n }\n }\n\n return object;\n }\n }\n\n private readHeadByte(): number {\n if (this.headByte === HEAD_BYTE_REQUIRED) {\n this.headByte = this.readU8();\n // console.log(\"headByte\", prettyByte(this.headByte));\n }\n\n return this.headByte;\n }\n\n private complete(): void {\n this.headByte = HEAD_BYTE_REQUIRED;\n }\n\n private readArraySize(): number {\n const headByte = this.readHeadByte();\n\n switch (headByte) {\n case 0xdc:\n return this.readU16();\n case 0xdd:\n return this.readU32();\n default: {\n if (headByte < 0xa0) {\n return headByte - 0x90;\n } else {\n throw new DecodeError(`Unrecognized array type byte: ${prettyByte(headByte)}`);\n }\n }\n }\n }\n\n private pushMapState(size: number) {\n if (size > this.maxMapLength) {\n throw new DecodeError(`Max length exceeded: map length (${size}) > maxMapLengthLength (${this.maxMapLength})`);\n }\n\n this.stack.push({\n type: State.MAP_KEY,\n size,\n key: null,\n readCount: 0,\n map: {},\n });\n }\n\n private pushArrayState(size: number) {\n if (size > this.maxArrayLength) {\n throw new DecodeError(`Max length exceeded: array length (${size}) > maxArrayLength (${this.maxArrayLength})`);\n }\n\n this.stack.push({\n type: State.ARRAY,\n size,\n array: new Array(size),\n position: 0,\n });\n }\n\n private decodeUtf8String(byteLength: number, headerOffset: number): string {\n if (byteLength > this.maxStrLength) {\n throw new DecodeError(\n `Max length exceeded: UTF-8 byte length (${byteLength}) > maxStrLength (${this.maxStrLength})`,\n );\n }\n\n if (this.bytes.byteLength < this.pos + headerOffset + byteLength) {\n throw MORE_DATA;\n }\n\n const offset = this.pos + headerOffset;\n let object: string;\n if (this.stateIsMapKey() && this.keyDecoder?.canBeCached(byteLength)) {\n object = this.keyDecoder.decode(this.bytes, offset, byteLength);\n } else if (byteLength > TEXT_DECODER_THRESHOLD) {\n object = utf8DecodeTD(this.bytes, offset, byteLength);\n } else {\n object = utf8DecodeJs(this.bytes, offset, byteLength);\n }\n this.pos += headerOffset + byteLength;\n return object;\n }\n\n private stateIsMapKey(): boolean {\n if (this.stack.length > 0) {\n const state = this.stack[this.stack.length - 1]!;\n return state.type === State.MAP_KEY;\n }\n return false;\n }\n\n private decodeBinary(byteLength: number, headOffset: number): Uint8Array {\n if (byteLength > this.maxBinLength) {\n throw new DecodeError(`Max length exceeded: bin length (${byteLength}) > maxBinLength (${this.maxBinLength})`);\n }\n\n if (!this.hasRemaining(byteLength + headOffset)) {\n throw MORE_DATA;\n }\n\n const offset = this.pos + headOffset;\n const object = this.bytes.subarray(offset, offset + byteLength);\n this.pos += headOffset + byteLength;\n return object;\n }\n\n private decodeExtension(size: number, headOffset: number): unknown {\n if (size > this.maxExtLength) {\n throw new DecodeError(`Max length exceeded: ext length (${size}) > maxExtLength (${this.maxExtLength})`);\n }\n\n const extType = this.view.getInt8(this.pos + headOffset);\n const data = this.decodeBinary(size, headOffset + 1 /* extType */);\n return this.extensionCodec.decode(data, extType, this.context);\n }\n\n private lookU8() {\n return this.view.getUint8(this.pos);\n }\n\n private lookU16() {\n return this.view.getUint16(this.pos);\n }\n\n private lookU32() {\n return this.view.getUint32(this.pos);\n }\n\n private readU8(): number {\n const value = this.view.getUint8(this.pos);\n this.pos++;\n return value;\n }\n\n private readI8(): number {\n const value = this.view.getInt8(this.pos);\n this.pos++;\n return value;\n }\n\n private readU16(): number {\n const value = this.view.getUint16(this.pos);\n this.pos += 2;\n return value;\n }\n\n private readI16(): number {\n const value = this.view.getInt16(this.pos);\n this.pos += 2;\n return value;\n }\n\n private readU32(): number {\n const value = this.view.getUint32(this.pos);\n this.pos += 4;\n return value;\n }\n\n private readI32(): number {\n const value = this.view.getInt32(this.pos);\n this.pos += 4;\n return value;\n }\n\n private readU64(): number {\n const value = getUint64(this.view, this.pos);\n this.pos += 8;\n return value;\n }\n\n private readI64(): number {\n const value = getInt64(this.view, this.pos);\n this.pos += 8;\n return value;\n }\n\n private readF32() {\n const value = this.view.getFloat32(this.pos);\n this.pos += 4;\n return value;\n }\n\n private readF64() {\n const value = this.view.getFloat64(this.pos);\n this.pos += 8;\n return value;\n }\n}\n","import { Decoder } from \"./Decoder\";\nimport type { ExtensionCodecType } from \"./ExtensionCodec\";\nimport type { ContextOf, SplitUndefined } from \"./context\";\n\nexport type DecodeOptions = Readonly<\n Partial<{\n extensionCodec: ExtensionCodecType;\n\n /**\n * Maximum string length.\n *\n * Defaults to 4_294_967_295 (UINT32_MAX).\n */\n maxStrLength: number;\n /**\n * Maximum binary length.\n *\n * Defaults to 4_294_967_295 (UINT32_MAX).\n */\n maxBinLength: number;\n /**\n * Maximum array length.\n *\n * Defaults to 4_294_967_295 (UINT32_MAX).\n */\n maxArrayLength: number;\n /**\n * Maximum map length.\n *\n * Defaults to 4_294_967_295 (UINT32_MAX).\n */\n maxMapLength: number;\n /**\n * Maximum extension length.\n *\n * Defaults to 4_294_967_295 (UINT32_MAX).\n */\n maxExtLength: number;\n }>\n> &\n ContextOf;\n\nexport const defaultDecodeOptions: DecodeOptions = {};\n\n/**\n * It decodes a single MessagePack object in a buffer.\n *\n * This is a synchronous decoding function.\n * See other variants for asynchronous decoding: {@link decodeAsync()}, {@link decodeStream()}, or {@link decodeArrayStream()}.\n *\n * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty.\n * @throws {@link DecodeError} if the buffer contains invalid data.\n */\nexport function decode(\n buffer: ArrayLike | BufferSource,\n options: DecodeOptions> = defaultDecodeOptions as any,\n): unknown {\n const decoder = new Decoder(\n options.extensionCodec,\n (options as typeof options & { context: any }).context,\n options.maxStrLength,\n options.maxBinLength,\n options.maxArrayLength,\n options.maxMapLength,\n options.maxExtLength,\n );\n return decoder.decode(buffer);\n}\n\n/**\n * It decodes multiple MessagePack objects in a buffer.\n * This is corresponding to {@link decodeMultiStream()}.\n *\n * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty.\n * @throws {@link DecodeError} if the buffer contains invalid data.\n */\nexport function decodeMulti(\n buffer: ArrayLike | BufferSource,\n options: DecodeOptions> = defaultDecodeOptions as any,\n): Generator {\n const decoder = new Decoder(\n options.extensionCodec,\n (options as typeof options & { context: any }).context,\n options.maxStrLength,\n options.maxBinLength,\n options.maxArrayLength,\n options.maxMapLength,\n options.maxExtLength,\n );\n return decoder.decodeMulti(buffer);\n}\n","// utility for whatwg streams\n\n// The living standard of whatwg streams says\n// ReadableStream is also AsyncIterable, but\n// as of June 2019, no browser implements it.\n// See https://streams.spec.whatwg.org/ for details\nexport type ReadableStreamLike = AsyncIterable | ReadableStream;\n\nexport function isAsyncIterable(object: ReadableStreamLike): object is AsyncIterable {\n return (object as any)[Symbol.asyncIterator] != null;\n}\n\nfunction assertNonNull(value: T | null | undefined): asserts value is T {\n if (value == null) {\n throw new Error(\"Assertion Failure: value must not be null nor undefined\");\n }\n}\n\nexport async function* asyncIterableFromStream(stream: ReadableStream): AsyncIterable {\n const reader = stream.getReader();\n\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n return;\n }\n assertNonNull(value);\n yield value;\n }\n } finally {\n reader.releaseLock();\n }\n}\n\nexport function ensureAsyncIterable(streamLike: ReadableStreamLike): AsyncIterable {\n if (isAsyncIterable(streamLike)) {\n return streamLike;\n } else {\n return asyncIterableFromStream(streamLike);\n }\n}\n","import { Decoder } from \"./Decoder\";\nimport { ensureAsyncIterable } from \"./utils/stream\";\nimport { defaultDecodeOptions } from \"./decode\";\nimport type { ReadableStreamLike } from \"./utils/stream\";\nimport type { DecodeOptions } from \"./decode\";\nimport type { SplitUndefined } from \"./context\";\n\n/**\n * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty.\n * @throws {@link DecodeError} if the buffer contains invalid data.\n */\n export async function decodeAsync(\n streamLike: ReadableStreamLike | BufferSource>,\n options: DecodeOptions> = defaultDecodeOptions as any,\n): Promise {\n const stream = ensureAsyncIterable(streamLike);\n\n const decoder = new Decoder(\n options.extensionCodec,\n (options as typeof options & { context: any }).context,\n options.maxStrLength,\n options.maxBinLength,\n options.maxArrayLength,\n options.maxMapLength,\n options.maxExtLength,\n );\n return decoder.decodeAsync(stream);\n}\n\n/**\n * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty.\n * @throws {@link DecodeError} if the buffer contains invalid data.\n */\n export function decodeArrayStream(\n streamLike: ReadableStreamLike | BufferSource>,\n options: DecodeOptions> = defaultDecodeOptions as any,\n): AsyncGenerator {\n const stream = ensureAsyncIterable(streamLike);\n\n const decoder = new Decoder(\n options.extensionCodec,\n (options as typeof options & { context: any }).context,\n options.maxStrLength,\n options.maxBinLength,\n options.maxArrayLength,\n options.maxMapLength,\n options.maxExtLength,\n );\n\n return decoder.decodeArrayStream(stream);\n}\n\n/**\n * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty.\n * @throws {@link DecodeError} if the buffer contains invalid data.\n */\nexport function decodeMultiStream(\n streamLike: ReadableStreamLike | BufferSource>,\n options: DecodeOptions> = defaultDecodeOptions as any,\n): AsyncGenerator {\n const stream = ensureAsyncIterable(streamLike);\n\n const decoder = new Decoder(\n options.extensionCodec,\n (options as typeof options & { context: any }).context,\n options.maxStrLength,\n options.maxBinLength,\n options.maxArrayLength,\n options.maxMapLength,\n options.maxExtLength,\n );\n\n return decoder.decodeStream(stream);\n}\n\n/**\n * @deprecated Use {@link decodeMultiStream()} instead.\n */\nexport function decodeStream(\n streamLike: ReadableStreamLike | BufferSource>,\n options: DecodeOptions> = defaultDecodeOptions as any,\n): AsyncGenerator {\n return decodeMultiStream(streamLike, options);\n}\n","// Main Functions:\n\nimport { encode } from \"./encode\";\nexport { encode };\nimport type { EncodeOptions } from \"./encode\";\nexport type { EncodeOptions };\n\nimport { decode, decodeMulti } from \"./decode\";\nexport { decode, decodeMulti };\nimport type { DecodeOptions } from \"./decode\";\nexport { DecodeOptions };\n\nimport { decodeAsync, decodeArrayStream, decodeMultiStream, decodeStream } from \"./decodeAsync\";\nexport { decodeAsync, decodeArrayStream, decodeMultiStream, decodeStream };\n\nimport { Decoder, DataViewIndexOutOfBoundsError } from \"./Decoder\";\nimport { DecodeError } from \"./DecodeError\";\nexport { Decoder, DecodeError, DataViewIndexOutOfBoundsError };\n\nimport { Encoder } from \"./Encoder\";\nexport { Encoder };\n\n// Utilitiies for Extension Types:\n\nimport { ExtensionCodec } from \"./ExtensionCodec\";\nexport { ExtensionCodec };\nimport type { ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType } from \"./ExtensionCodec\";\nexport type { ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType };\nimport { ExtData } from \"./ExtData\";\nexport { ExtData };\n\nimport {\n EXT_TIMESTAMP,\n encodeDateToTimeSpec,\n encodeTimeSpecToTimestamp,\n decodeTimestampToTimeSpec,\n encodeTimestampExtension,\n decodeTimestampExtension,\n} from \"./timestamp\";\nexport {\n EXT_TIMESTAMP,\n encodeDateToTimeSpec,\n encodeTimeSpecToTimestamp,\n decodeTimestampToTimeSpec,\n encodeTimestampExtension,\n decodeTimestampExtension,\n};\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist.es5+umd/msgpack.min.js b/node_modules/@msgpack/msgpack/dist.es5+umd/msgpack.min.js deleted file mode 100644 index cbf87a4..0000000 --- a/node_modules/@msgpack/msgpack/dist.es5+umd/msgpack.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MessagePack=t():e.MessagePack=t()}(this,(function(){return function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{DataViewIndexOutOfBoundsError:function(){return K},DecodeError:function(){return m},Decoder:function(){return G},EXT_TIMESTAMP:function(){return U},Encoder:function(){return z},ExtData:function(){return b},ExtensionCodec:function(){return A},decode:function(){return q},decodeArrayStream:function(){return ne},decodeAsync:function(){return te},decodeMulti:function(){return J},decodeMultiStream:function(){return re},decodeStream:function(){return ie},decodeTimestampExtension:function(){return L},decodeTimestampToTimeSpec:function(){return T},encode:function(){return C},encodeDateToTimeSpec:function(){return E},encodeTimeSpecToTimestamp:function(){return S},encodeTimestampExtension:function(){return B}});var n=4294967295;function r(e,t,n){var r=Math.floor(n/4294967296),i=n;e.setUint32(t,r),e.setUint32(t+4,i)}function i(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}var o,s,a,c=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},h=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i=55296&&i<=56319&&r65535&&(l-=65536,o.push(l>>>10&1023|55296),l=56320|1023&l),o.push(l)}else o.push(a);o.length>=4096&&(s+=String.fromCharCode.apply(String,h([],c(o),!1)),o.length=0)}return o.length>0&&(s+=String.fromCharCode.apply(String,h([],c(o),!1))),s}var w,v=u?new TextDecoder:null,g=u?"undefined"!=typeof process&&"force"!==(null===(a=null===process||void 0===process?void 0:process.env)||void 0===a?void 0:a.TEXT_DECODER)?200:0:n,b=function(e,t){this.type=e,this.data=t},x=(w=function(e,t){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},w(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}w(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),m=function(e){function t(n){var r=e.call(this,n)||this,i=Object.create(t.prototype);return Object.setPrototypeOf(r,i),Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,value:t.name}),r}return x(t,e),t}(Error),U=-1;function S(e){var t,n=e.sec,i=e.nsec;if(n>=0&&i>=0&&n<=17179869183){if(0===i&&n<=4294967295){var o=new Uint8Array(4);return(t=new DataView(o.buffer)).setUint32(0,n),o}var s=n/4294967296,a=4294967295&n;return o=new Uint8Array(8),(t=new DataView(o.buffer)).setUint32(0,i<<2|3&s),t.setUint32(4,a),o}return o=new Uint8Array(12),(t=new DataView(o.buffer)).setUint32(0,i),r(t,4,n),o}function E(e){var t=e.getTime(),n=Math.floor(t/1e3),r=1e6*(t-1e3*n),i=Math.floor(r/1e9);return{sec:n+i,nsec:r-1e9*i}}function B(e){return e instanceof Date?S(E(e)):null}function T(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:var n=t.getUint32(0);return{sec:4294967296*(3&n)+t.getUint32(4),nsec:n>>>2};case 12:return{sec:i(t,4),nsec:t.getUint32(0)};default:throw new m("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}function L(e){var t=T(e);return new Date(1e3*t.sec+t.nsec/1e6)}var I={type:U,encode:B,decode:L},A=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(I)}return e.prototype.register=function(e){var t=e.type,n=e.encode,r=e.decode;if(t>=0)this.encoders[t]=n,this.decoders[t]=r;else{var i=1+t;this.builtInEncoders[i]=n,this.builtInDecoders[i]=r}},e.prototype.tryToEncode=function(e,t){for(var n=0;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},z=function(){function e(e,t,n,r,i,o,s,a){void 0===e&&(e=A.defaultCodec),void 0===t&&(t=void 0),void 0===n&&(n=100),void 0===r&&(r=2048),void 0===i&&(i=!1),void 0===o&&(o=!1),void 0===s&&(s=!1),void 0===a&&(a=!1),this.extensionCodec=e,this.context=t,this.maxDepth=n,this.initialBufferSize=r,this.sortKeys=i,this.forceFloat32=o,this.ignoreUndefined=s,this.forceIntegerToFloat=a,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return e.prototype.reinitializeState=function(){this.pos=0},e.prototype.encodeSharedRef=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)},e.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)},e.prototype.doEncode=function(e,t){if(t>this.maxDepth)throw new Error("Too deep objects in depth ".concat(t));null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: ".concat(e," bytes in UTF-8"));this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){if(e.length>p){var t=f(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),d(e,this.bytes,this.pos),this.pos+=t}else t=f(e),this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),function(e,t,n){for(var r=e.length,i=n,o=0;o>6&31|192;else{if(s>=55296&&s<=56319&&o>12&15|224,t[i++]=s>>6&63|128):(t[i++]=s>>18&7|240,t[i++]=s>>12&63|128,t[i++]=s>>6&63|128)}t[i++]=63&s|128}else t[i++]=s}}(e,this.bytes,this.pos),this.pos+=t},e.prototype.encodeObject=function(e,t){var n=this.extensionCodec.tryToEncode(e,this.context);if(null!=n)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else{if("object"!=typeof e)throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)));this.encodeMap(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: ".concat(t));this.writeU8(198),this.writeU32(t)}var n=k(e);this.writeU8a(n)},e.prototype.encodeArray=function(e,t){var n,r,i=e.length;if(i<16)this.writeU8(144+i);else if(i<65536)this.writeU8(220),this.writeU16(i);else{if(!(i<4294967296))throw new Error("Too large array: ".concat(i));this.writeU8(221),this.writeU32(i)}try{for(var o=M(e),s=o.next();!s.done;s=o.next()){var a=s.value;this.doEncode(a,t+1)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype.countWithoutUndefined=function(e,t){var n,r,i=0;try{for(var o=M(t),s=o.next();!s.done;s=o.next())void 0!==e[s.value]&&i++}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},e.prototype.encodeMap=function(e,t){var n,r,i=Object.keys(e);this.sortKeys&&i.sort();var o=this.ignoreUndefined?this.countWithoutUndefined(e,i):i.length;if(o<16)this.writeU8(128+o);else if(o<65536)this.writeU8(222),this.writeU16(o);else{if(!(o<4294967296))throw new Error("Too large map object: ".concat(o));this.writeU8(223),this.writeU32(o)}try{for(var s=M(i),a=s.next();!a.done;a=s.next()){var c=a.value,h=e[c];this.ignoreUndefined&&void 0===h||(this.encodeString(c),this.doEncode(h,t+1))}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},e.prototype.encodeExtension=function(e){var t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large extension object: ".concat(t));this.writeU8(201),this.writeU32(t)}this.writeI8(e.type),this.writeU8a(e.data)},e.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},e.prototype.writeU8a=function(e){var t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t},e.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},e.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},e.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},e.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},e.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},e.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},e.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},e.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),function(e,t,n){var r=n/4294967296,i=n;e.setUint32(t,r),e.setUint32(t+4,i)}(this.view,this.pos,e),this.pos+=8},e.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),r(this.view,this.pos,e),this.pos+=8},e}(),D={};function C(e,t){return void 0===t&&(t=D),new z(t.extensionCodec,t.context,t.maxDepth,t.initialBufferSize,t.sortKeys,t.forceFloat32,t.ignoreUndefined,t.forceIntegerToFloat).encodeSharedRef(e)}function P(e){return"".concat(e<0?"-":"","0x").concat(Math.abs(e).toString(16).padStart(2,"0"))}var O=function(){function e(e,t){void 0===e&&(e=16),void 0===t&&(t=16),this.maxKeyLength=e,this.maxLengthPerKey=t,this.hit=0,this.miss=0,this.caches=[];for(var n=0;n0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,n){var r,i,o=this.caches[n-1];try{e:for(var s=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(o),a=s.next();!a.done;a=s.next()){for(var c=a.value,h=c.bytes,u=0;u=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)},e.prototype.decode=function(e,t,n){var r=this.find(e,t,n);if(null!=r)return this.hit++,r;this.miss++;var i=y(e,t,n),o=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(o,i),i},e}(),_=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof F?Promise.resolve(n.value.v).then(c,h):u(o[0][2],n)}catch(e){u(o[0][3],e)}var n}function c(e){a("next",e)}function h(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}},R=new DataView(new ArrayBuffer(0)),V=new Uint8Array(R.buffer),K=function(){try{R.getInt8(0)}catch(e){return e.constructor}throw new Error("never reached")}(),N=new K("Insufficient data"),H=new O,G=function(){function e(e,t,r,i,o,s,a,c){void 0===e&&(e=A.defaultCodec),void 0===t&&(t=void 0),void 0===r&&(r=n),void 0===i&&(i=n),void 0===o&&(o=n),void 0===s&&(s=n),void 0===a&&(a=n),void 0===c&&(c=H),this.extensionCodec=e,this.context=t,this.maxStrLength=r,this.maxBinLength=i,this.maxArrayLength=o,this.maxMapLength=s,this.maxExtLength=a,this.keyDecoder=c,this.totalPos=0,this.pos=0,this.view=R,this.bytes=V,this.headByte=-1,this.stack=[]}return e.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1,this.stack.length=0},e.prototype.setBuffer=function(e){this.bytes=k(e),this.view=function(e){if(e instanceof ArrayBuffer)return new DataView(e);var t=k(e);return new DataView(t.buffer,t.byteOffset,t.byteLength)}(this.bytes),this.pos=0},e.prototype.appendBuffer=function(e){if(-1!==this.headByte||this.hasRemaining(1)){var t=this.bytes.subarray(this.pos),n=k(e),r=new Uint8Array(t.length+n.length);r.set(t),r.set(n,t.length),this.setBuffer(r)}else this.setBuffer(e)},e.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},e.prototype.createExtraByteError=function(e){var t=this.view,n=this.pos;return new RangeError("Extra ".concat(t.byteLength-n," of ").concat(t.byteLength," byte(s) found at buffer[").concat(e,"]"))},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return _(this,(function(t){switch(t.label){case 0:this.reinitializeState(),this.setBuffer(e),t.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return t.sent(),[3,1];case 3:return[2]}}))},e.prototype.decodeAsync=function(e){var t,n,r,i,o,s,a,c;return o=this,s=void 0,c=function(){var o,s,a,c,h,u,f,l;return _(this,(function(p){switch(p.label){case 0:o=!1,p.label=1;case 1:p.trys.push([1,6,7,12]),t=j(e),p.label=2;case 2:return[4,t.next()];case 3:if((n=p.sent()).done)return[3,5];if(a=n.value,o)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{s=this.doDecodeSync(),o=!0}catch(e){if(!(e instanceof K))throw e}this.totalPos+=this.pos,p.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return c=p.sent(),r={error:c},[3,12];case 7:return p.trys.push([7,,10,11]),n&&!n.done&&(i=t.return)?[4,i.call(t)]:[3,9];case 8:p.sent(),p.label=9;case 9:return[3,11];case 10:if(r)throw r.error;return[7];case 11:return[7];case 12:if(o){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,s]}throw u=(h=this).headByte,f=h.pos,l=h.totalPos,new RangeError("Insufficient data in parsing ".concat(P(u)," at ").concat(l," (").concat(f," in the current buffer)"))}}))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{i(c.next(e))}catch(e){t(e)}}function r(e){try{i(c.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}i((c=c.apply(o,s||[])).next())}))},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return W(this,arguments,(function(){var n,r,i,o,s,a,c,h,u;return _(this,(function(f){switch(f.label){case 0:n=t,r=-1,f.label=1;case 1:f.trys.push([1,13,14,19]),i=j(e),f.label=2;case 2:return[4,F(i.next())];case 3:if((o=f.sent()).done)return[3,12];if(s=o.value,t&&0===r)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),n&&(r=this.readArraySize(),n=!1,this.complete()),f.label=4;case 4:f.trys.push([4,9,,10]),f.label=5;case 5:return[4,F(this.doDecodeSync())];case 6:return[4,f.sent()];case 7:return f.sent(),0==--r?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((a=f.sent())instanceof K))throw a;return[3,10];case 10:this.totalPos+=this.pos,f.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return c=f.sent(),h={error:c},[3,19];case 14:return f.trys.push([14,,17,18]),o&&!o.done&&(u=i.return)?[4,F(u.call(i))]:[3,16];case 15:f.sent(),f.label=16;case 16:return[3,18];case 17:if(h)throw h.error;return[7];case 18:return[7];case 19:return[2]}}))}))},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){if(0!=(r=e-128)){this.pushMapState(r),this.complete();continue e}t={}}else if(e<160){if(0!=(r=e-144)){this.pushArrayState(r),this.complete();continue e}t=[]}else{var n=e-160;t=this.decodeUtf8String(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.readI64();else if(217===e)n=this.lookU8(),t=this.decodeUtf8String(n,1);else if(218===e)n=this.lookU16(),t=this.decodeUtf8String(n,2);else if(219===e)n=this.lookU32(),t=this.decodeUtf8String(n,4);else if(220===e){if(0!==(r=this.readU16())){this.pushArrayState(r),this.complete();continue e}t=[]}else if(221===e){if(0!==(r=this.readU32())){this.pushArrayState(r),this.complete();continue e}t=[]}else if(222===e){if(0!==(r=this.readU16())){this.pushMapState(r),this.complete();continue e}t={}}else if(223===e){if(0!==(r=this.readU32())){this.pushMapState(r),this.complete();continue e}t={}}else if(196===e){var r=this.lookU8();t=this.decodeBinary(r,1)}else if(197===e)r=this.lookU16(),t=this.decodeBinary(r,2);else if(198===e)r=this.lookU32(),t=this.decodeBinary(r,4);else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e)r=this.lookU8(),t=this.decodeExtension(r,1);else if(200===e)r=this.lookU16(),t=this.decodeExtension(r,2);else{if(201!==e)throw new m("Unrecognized type byte: ".concat(P(e)));r=this.lookU32(),t=this.decodeExtension(r,4)}this.complete();for(var i=this.stack;i.length>0;){var o=i[i.length-1];if(0===o.type){if(o.array[o.position]=t,o.position++,o.position!==o.size)continue e;i.pop(),t=o.array}else{if(1===o.type){if(void 0,"string"!=(s=typeof t)&&"number"!==s)throw new m("The type of key must be string or number but "+typeof t);if("__proto__"===t)throw new m("The key __proto__ is not allowed");o.key=t,o.type=2;continue e}if(o.map[o.key]=t,o.readCount++,o.readCount!==o.size){o.key=null,o.type=1;continue e}i.pop(),t=o.map}}return t}var s},e.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new m("Unrecognized array type byte: ".concat(P(e)))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new m("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:1,size:e,key:null,readCount:0,map:{}})},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new m("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:0,size:e,array:new Array(e),position:0})},e.prototype.decodeUtf8String=function(e,t){var n;if(e>this.maxStrLength)throw new m("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLengthg?function(e,t,n){var r=e.subarray(t,t+n);return v.decode(r)}(this.bytes,i,e):y(this.bytes,i,e),this.pos+=t+e,r},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&1===this.stack[this.stack.length-1].type},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new m("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw N;var n=this.pos+t,r=this.bytes.subarray(n,n+e);return this.pos+=t+e,r},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw new m("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var n=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,n,this.context)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e,t,n=(e=this.view,t=this.pos,4294967296*e.getUint32(t)+e.getUint32(t+4));return this.pos+=8,n},e.prototype.readI64=function(){var e=i(this.view,this.pos);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},e}(),X={};function q(e,t){return void 0===t&&(t=X),new G(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decode(e)}function J(e,t){return void 0===t&&(t=X),new G(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeMulti(e)}var Q=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof Y?Promise.resolve(n.value.v).then(c,h):u(o[0][2],n)}catch(e){u(o[0][3],e)}var n}function c(e){a("next",e)}function h(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}};function $(e){if(null==e)throw new Error("Assertion Failure: value must not be null nor undefined")}function ee(e){return null!=e[Symbol.asyncIterator]?e:function(e){return Z(this,arguments,(function(){var t,n,r,i;return Q(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Y(t.read())];case 3:return n=o.sent(),r=n.done,i=n.value,r?[4,Y(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return $(i),[4,Y(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}(e)}function te(e,t){return void 0===t&&(t=X),n=this,r=void 0,o=function(){var n;return function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]= 0xd800 && value <= 0xdbff) {\n // high surrogate\n if (pos < strLength) {\n const extra = str.charCodeAt(pos);\n if ((extra & 0xfc00) === 0xdc00) {\n ++pos;\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n }\n }\n\n if ((value & 0xffff0000) === 0) {\n // 3-byte\n byteLength += 3;\n } else {\n // 4-byte\n byteLength += 4;\n }\n }\n }\n return byteLength;\n}\n\nexport function utf8EncodeJs(str: string, output: Uint8Array, outputOffset: number): void {\n const strLength = str.length;\n let offset = outputOffset;\n let pos = 0;\n while (pos < strLength) {\n let value = str.charCodeAt(pos++);\n\n if ((value & 0xffffff80) === 0) {\n // 1-byte\n output[offset++] = value;\n continue;\n } else if ((value & 0xfffff800) === 0) {\n // 2-bytes\n output[offset++] = ((value >> 6) & 0x1f) | 0xc0;\n } else {\n // handle surrogate pair\n if (value >= 0xd800 && value <= 0xdbff) {\n // high surrogate\n if (pos < strLength) {\n const extra = str.charCodeAt(pos);\n if ((extra & 0xfc00) === 0xdc00) {\n ++pos;\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n }\n }\n\n if ((value & 0xffff0000) === 0) {\n // 3-byte\n output[offset++] = ((value >> 12) & 0x0f) | 0xe0;\n output[offset++] = ((value >> 6) & 0x3f) | 0x80;\n } else {\n // 4-byte\n output[offset++] = ((value >> 18) & 0x07) | 0xf0;\n output[offset++] = ((value >> 12) & 0x3f) | 0x80;\n output[offset++] = ((value >> 6) & 0x3f) | 0x80;\n }\n }\n\n output[offset++] = (value & 0x3f) | 0x80;\n }\n}\n\nconst sharedTextEncoder = TEXT_ENCODING_AVAILABLE ? new TextEncoder() : undefined;\nexport const TEXT_ENCODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE\n ? UINT32_MAX\n : typeof process !== \"undefined\" && process?.env?.[\"TEXT_ENCODING\"] !== \"force\"\n ? 200\n : 0;\n\nfunction utf8EncodeTEencode(str: string, output: Uint8Array, outputOffset: number): void {\n output.set(sharedTextEncoder!.encode(str), outputOffset);\n}\n\nfunction utf8EncodeTEencodeInto(str: string, output: Uint8Array, outputOffset: number): void {\n sharedTextEncoder!.encodeInto(str, output.subarray(outputOffset));\n}\n\nexport const utf8EncodeTE = sharedTextEncoder?.encodeInto ? utf8EncodeTEencodeInto : utf8EncodeTEencode;\n\nconst CHUNK_SIZE = 0x1_000;\n\nexport function utf8DecodeJs(bytes: Uint8Array, inputOffset: number, byteLength: number): string {\n let offset = inputOffset;\n const end = offset + byteLength;\n\n const units: Array = [];\n let result = \"\";\n while (offset < end) {\n const byte1 = bytes[offset++]!;\n if ((byte1 & 0x80) === 0) {\n // 1 byte\n units.push(byte1);\n } else if ((byte1 & 0xe0) === 0xc0) {\n // 2 bytes\n const byte2 = bytes[offset++]! & 0x3f;\n units.push(((byte1 & 0x1f) << 6) | byte2);\n } else if ((byte1 & 0xf0) === 0xe0) {\n // 3 bytes\n const byte2 = bytes[offset++]! & 0x3f;\n const byte3 = bytes[offset++]! & 0x3f;\n units.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3);\n } else if ((byte1 & 0xf8) === 0xf0) {\n // 4 bytes\n const byte2 = bytes[offset++]! & 0x3f;\n const byte3 = bytes[offset++]! & 0x3f;\n const byte4 = bytes[offset++]! & 0x3f;\n let unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4;\n if (unit > 0xffff) {\n unit -= 0x10000;\n units.push(((unit >>> 10) & 0x3ff) | 0xd800);\n unit = 0xdc00 | (unit & 0x3ff);\n }\n units.push(unit);\n } else {\n units.push(byte1);\n }\n\n if (units.length >= CHUNK_SIZE) {\n result += String.fromCharCode(...units);\n units.length = 0;\n }\n }\n\n if (units.length > 0) {\n result += String.fromCharCode(...units);\n }\n\n return result;\n}\n\nconst sharedTextDecoder = TEXT_ENCODING_AVAILABLE ? new TextDecoder() : null;\nexport const TEXT_DECODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE\n ? UINT32_MAX\n : typeof process !== \"undefined\" && process?.env?.[\"TEXT_DECODER\"] !== \"force\"\n ? 200\n : 0;\n\nexport function utf8DecodeTD(bytes: Uint8Array, inputOffset: number, byteLength: number): string {\n const stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength);\n return sharedTextDecoder!.decode(stringBytes);\n}\n","/**\n * ExtData is used to handle Extension Types that are not registered to ExtensionCodec.\n */\nexport class ExtData {\n constructor(readonly type: number, readonly data: Uint8Array) {}\n}\n","export class DecodeError extends Error {\n constructor(message: string) {\n super(message);\n\n // fix the prototype chain in a cross-platform way\n const proto: typeof DecodeError.prototype = Object.create(DecodeError.prototype);\n Object.setPrototypeOf(this, proto);\n\n Object.defineProperty(this, \"name\", {\n configurable: true,\n enumerable: false,\n value: DecodeError.name,\n });\n }\n}\n","// https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type\nimport { DecodeError } from \"./DecodeError\";\nimport { getInt64, setInt64 } from \"./utils/int\";\n\nexport const EXT_TIMESTAMP = -1;\n\nexport type TimeSpec = {\n sec: number;\n nsec: number;\n};\n\nconst TIMESTAMP32_MAX_SEC = 0x100000000 - 1; // 32-bit unsigned int\nconst TIMESTAMP64_MAX_SEC = 0x400000000 - 1; // 34-bit unsigned int\n\nexport function encodeTimeSpecToTimestamp({ sec, nsec }: TimeSpec): Uint8Array {\n if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {\n // Here sec >= 0 && nsec >= 0\n if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {\n // timestamp 32 = { sec32 (unsigned) }\n const rv = new Uint8Array(4);\n const view = new DataView(rv.buffer);\n view.setUint32(0, sec);\n return rv;\n } else {\n // timestamp 64 = { nsec30 (unsigned), sec34 (unsigned) }\n const secHigh = sec / 0x100000000;\n const secLow = sec & 0xffffffff;\n const rv = new Uint8Array(8);\n const view = new DataView(rv.buffer);\n // nsec30 | secHigh2\n view.setUint32(0, (nsec << 2) | (secHigh & 0x3));\n // secLow32\n view.setUint32(4, secLow);\n return rv;\n }\n } else {\n // timestamp 96 = { nsec32 (unsigned), sec64 (signed) }\n const rv = new Uint8Array(12);\n const view = new DataView(rv.buffer);\n view.setUint32(0, nsec);\n setInt64(view, 4, sec);\n return rv;\n }\n}\n\nexport function encodeDateToTimeSpec(date: Date): TimeSpec {\n const msec = date.getTime();\n const sec = Math.floor(msec / 1e3);\n const nsec = (msec - sec * 1e3) * 1e6;\n\n // Normalizes { sec, nsec } to ensure nsec is unsigned.\n const nsecInSec = Math.floor(nsec / 1e9);\n return {\n sec: sec + nsecInSec,\n nsec: nsec - nsecInSec * 1e9,\n };\n}\n\nexport function encodeTimestampExtension(object: unknown): Uint8Array | null {\n if (object instanceof Date) {\n const timeSpec = encodeDateToTimeSpec(object);\n return encodeTimeSpecToTimestamp(timeSpec);\n } else {\n return null;\n }\n}\n\nexport function decodeTimestampToTimeSpec(data: Uint8Array): TimeSpec {\n const view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n\n // data may be 32, 64, or 96 bits\n switch (data.byteLength) {\n case 4: {\n // timestamp 32 = { sec32 }\n const sec = view.getUint32(0);\n const nsec = 0;\n return { sec, nsec };\n }\n case 8: {\n // timestamp 64 = { nsec30, sec34 }\n const nsec30AndSecHigh2 = view.getUint32(0);\n const secLow32 = view.getUint32(4);\n const sec = (nsec30AndSecHigh2 & 0x3) * 0x100000000 + secLow32;\n const nsec = nsec30AndSecHigh2 >>> 2;\n return { sec, nsec };\n }\n case 12: {\n // timestamp 96 = { nsec32 (unsigned), sec64 (signed) }\n\n const sec = getInt64(view, 4);\n const nsec = view.getUint32(0);\n return { sec, nsec };\n }\n default:\n throw new DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${data.length}`);\n }\n}\n\nexport function decodeTimestampExtension(data: Uint8Array): Date {\n const timeSpec = decodeTimestampToTimeSpec(data);\n return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6);\n}\n\nexport const timestampExtension = {\n type: EXT_TIMESTAMP,\n encode: encodeTimestampExtension,\n decode: decodeTimestampExtension,\n};\n","// ExtensionCodec to handle MessagePack extensions\n\nimport { ExtData } from \"./ExtData\";\nimport { timestampExtension } from \"./timestamp\";\n\nexport type ExtensionDecoderType = (\n data: Uint8Array,\n extensionType: number,\n context: ContextType,\n) => unknown;\n\nexport type ExtensionEncoderType = (input: unknown, context: ContextType) => Uint8Array | null;\n\n// immutable interface to ExtensionCodec\nexport type ExtensionCodecType = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n __brand?: ContextType;\n tryToEncode(object: unknown, context: ContextType): ExtData | null;\n decode(data: Uint8Array, extType: number, context: ContextType): unknown;\n};\n\nexport class ExtensionCodec implements ExtensionCodecType {\n public static readonly defaultCodec: ExtensionCodecType = new ExtensionCodec();\n\n // ensures ExtensionCodecType matches ExtensionCodec\n // this will make type errors a lot more clear\n // eslint-disable-next-line @typescript-eslint/naming-convention\n __brand?: ContextType;\n\n // built-in extensions\n private readonly builtInEncoders: Array | undefined | null> = [];\n private readonly builtInDecoders: Array | undefined | null> = [];\n\n // custom extensions\n private readonly encoders: Array | undefined | null> = [];\n private readonly decoders: Array | undefined | null> = [];\n\n public constructor() {\n this.register(timestampExtension);\n }\n\n public register({\n type,\n encode,\n decode,\n }: {\n type: number;\n encode: ExtensionEncoderType;\n decode: ExtensionDecoderType;\n }): void {\n if (type >= 0) {\n // custom extensions\n this.encoders[type] = encode;\n this.decoders[type] = decode;\n } else {\n // built-in extensions\n const index = 1 + type;\n this.builtInEncoders[index] = encode;\n this.builtInDecoders[index] = decode;\n }\n }\n\n public tryToEncode(object: unknown, context: ContextType): ExtData | null {\n // built-in extensions\n for (let i = 0; i < this.builtInEncoders.length; i++) {\n const encodeExt = this.builtInEncoders[i];\n if (encodeExt != null) {\n const data = encodeExt(object, context);\n if (data != null) {\n const type = -1 - i;\n return new ExtData(type, data);\n }\n }\n }\n\n // custom extensions\n for (let i = 0; i < this.encoders.length; i++) {\n const encodeExt = this.encoders[i];\n if (encodeExt != null) {\n const data = encodeExt(object, context);\n if (data != null) {\n const type = i;\n return new ExtData(type, data);\n }\n }\n }\n\n if (object instanceof ExtData) {\n // to keep ExtData as is\n return object;\n }\n return null;\n }\n\n public decode(data: Uint8Array, type: number, context: ContextType): unknown {\n const decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type];\n if (decodeExt) {\n return decodeExt(data, type, context);\n } else {\n // decode() does not fail, returns ExtData instead.\n return new ExtData(type, data);\n }\n }\n}\n","export function ensureUint8Array(buffer: ArrayLike | Uint8Array | ArrayBufferView | ArrayBuffer): Uint8Array {\n if (buffer instanceof Uint8Array) {\n return buffer;\n } else if (ArrayBuffer.isView(buffer)) {\n return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n } else if (buffer instanceof ArrayBuffer) {\n return new Uint8Array(buffer);\n } else {\n // ArrayLike\n return Uint8Array.from(buffer);\n }\n}\n\nexport function createDataView(buffer: ArrayLike | ArrayBufferView | ArrayBuffer): DataView {\n if (buffer instanceof ArrayBuffer) {\n return new DataView(buffer);\n }\n\n const bufferView = ensureUint8Array(buffer);\n return new DataView(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\n}\n","import { utf8EncodeJs, utf8Count, TEXT_ENCODER_THRESHOLD, utf8EncodeTE } from \"./utils/utf8\";\nimport { ExtensionCodec, ExtensionCodecType } from \"./ExtensionCodec\";\nimport { setInt64, setUint64 } from \"./utils/int\";\nimport { ensureUint8Array } from \"./utils/typedArrays\";\nimport type { ExtData } from \"./ExtData\";\n\nexport const DEFAULT_MAX_DEPTH = 100;\nexport const DEFAULT_INITIAL_BUFFER_SIZE = 2048;\n\nexport class Encoder {\n private pos = 0;\n private view = new DataView(new ArrayBuffer(this.initialBufferSize));\n private bytes = new Uint8Array(this.view.buffer);\n\n public constructor(\n private readonly extensionCodec: ExtensionCodecType = ExtensionCodec.defaultCodec as any,\n private readonly context: ContextType = undefined as any,\n private readonly maxDepth = DEFAULT_MAX_DEPTH,\n private readonly initialBufferSize = DEFAULT_INITIAL_BUFFER_SIZE,\n private readonly sortKeys = false,\n private readonly forceFloat32 = false,\n private readonly ignoreUndefined = false,\n private readonly forceIntegerToFloat = false,\n ) {}\n\n private reinitializeState() {\n this.pos = 0;\n }\n\n /**\n * This is almost equivalent to {@link Encoder#encode}, but it returns an reference of the encoder's internal buffer and thus much faster than {@link Encoder#encode}.\n *\n * @returns Encodes the object and returns a shared reference the encoder's internal buffer.\n */\n public encodeSharedRef(object: unknown): Uint8Array {\n this.reinitializeState();\n this.doEncode(object, 1);\n return this.bytes.subarray(0, this.pos);\n }\n\n /**\n * @returns Encodes the object and returns a copy of the encoder's internal buffer.\n */\n public encode(object: unknown): Uint8Array {\n this.reinitializeState();\n this.doEncode(object, 1);\n return this.bytes.slice(0, this.pos);\n }\n\n private doEncode(object: unknown, depth: number): void {\n if (depth > this.maxDepth) {\n throw new Error(`Too deep objects in depth ${depth}`);\n }\n\n if (object == null) {\n this.encodeNil();\n } else if (typeof object === \"boolean\") {\n this.encodeBoolean(object);\n } else if (typeof object === \"number\") {\n this.encodeNumber(object);\n } else if (typeof object === \"string\") {\n this.encodeString(object);\n } else {\n this.encodeObject(object, depth);\n }\n }\n\n private ensureBufferSizeToWrite(sizeToWrite: number) {\n const requiredSize = this.pos + sizeToWrite;\n\n if (this.view.byteLength < requiredSize) {\n this.resizeBuffer(requiredSize * 2);\n }\n }\n\n private resizeBuffer(newSize: number) {\n const newBuffer = new ArrayBuffer(newSize);\n const newBytes = new Uint8Array(newBuffer);\n const newView = new DataView(newBuffer);\n\n newBytes.set(this.bytes);\n\n this.view = newView;\n this.bytes = newBytes;\n }\n\n private encodeNil() {\n this.writeU8(0xc0);\n }\n\n private encodeBoolean(object: boolean) {\n if (object === false) {\n this.writeU8(0xc2);\n } else {\n this.writeU8(0xc3);\n }\n }\n private encodeNumber(object: number) {\n if (Number.isSafeInteger(object) && !this.forceIntegerToFloat) {\n if (object >= 0) {\n if (object < 0x80) {\n // positive fixint\n this.writeU8(object);\n } else if (object < 0x100) {\n // uint 8\n this.writeU8(0xcc);\n this.writeU8(object);\n } else if (object < 0x10000) {\n // uint 16\n this.writeU8(0xcd);\n this.writeU16(object);\n } else if (object < 0x100000000) {\n // uint 32\n this.writeU8(0xce);\n this.writeU32(object);\n } else {\n // uint 64\n this.writeU8(0xcf);\n this.writeU64(object);\n }\n } else {\n if (object >= -0x20) {\n // negative fixint\n this.writeU8(0xe0 | (object + 0x20));\n } else if (object >= -0x80) {\n // int 8\n this.writeU8(0xd0);\n this.writeI8(object);\n } else if (object >= -0x8000) {\n // int 16\n this.writeU8(0xd1);\n this.writeI16(object);\n } else if (object >= -0x80000000) {\n // int 32\n this.writeU8(0xd2);\n this.writeI32(object);\n } else {\n // int 64\n this.writeU8(0xd3);\n this.writeI64(object);\n }\n }\n } else {\n // non-integer numbers\n if (this.forceFloat32) {\n // float 32\n this.writeU8(0xca);\n this.writeF32(object);\n } else {\n // float 64\n this.writeU8(0xcb);\n this.writeF64(object);\n }\n }\n }\n\n private writeStringHeader(byteLength: number) {\n if (byteLength < 32) {\n // fixstr\n this.writeU8(0xa0 + byteLength);\n } else if (byteLength < 0x100) {\n // str 8\n this.writeU8(0xd9);\n this.writeU8(byteLength);\n } else if (byteLength < 0x10000) {\n // str 16\n this.writeU8(0xda);\n this.writeU16(byteLength);\n } else if (byteLength < 0x100000000) {\n // str 32\n this.writeU8(0xdb);\n this.writeU32(byteLength);\n } else {\n throw new Error(`Too long string: ${byteLength} bytes in UTF-8`);\n }\n }\n\n private encodeString(object: string) {\n const maxHeaderSize = 1 + 4;\n const strLength = object.length;\n\n if (strLength > TEXT_ENCODER_THRESHOLD) {\n const byteLength = utf8Count(object);\n this.ensureBufferSizeToWrite(maxHeaderSize + byteLength);\n this.writeStringHeader(byteLength);\n utf8EncodeTE(object, this.bytes, this.pos);\n this.pos += byteLength;\n } else {\n const byteLength = utf8Count(object);\n this.ensureBufferSizeToWrite(maxHeaderSize + byteLength);\n this.writeStringHeader(byteLength);\n utf8EncodeJs(object, this.bytes, this.pos);\n this.pos += byteLength;\n }\n }\n\n private encodeObject(object: unknown, depth: number) {\n // try to encode objects with custom codec first of non-primitives\n const ext = this.extensionCodec.tryToEncode(object, this.context);\n if (ext != null) {\n this.encodeExtension(ext);\n } else if (Array.isArray(object)) {\n this.encodeArray(object, depth);\n } else if (ArrayBuffer.isView(object)) {\n this.encodeBinary(object);\n } else if (typeof object === \"object\") {\n this.encodeMap(object as Record, depth);\n } else {\n // symbol, function and other special object come here unless extensionCodec handles them.\n throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(object)}`);\n }\n }\n\n private encodeBinary(object: ArrayBufferView) {\n const size = object.byteLength;\n if (size < 0x100) {\n // bin 8\n this.writeU8(0xc4);\n this.writeU8(size);\n } else if (size < 0x10000) {\n // bin 16\n this.writeU8(0xc5);\n this.writeU16(size);\n } else if (size < 0x100000000) {\n // bin 32\n this.writeU8(0xc6);\n this.writeU32(size);\n } else {\n throw new Error(`Too large binary: ${size}`);\n }\n const bytes = ensureUint8Array(object);\n this.writeU8a(bytes);\n }\n\n private encodeArray(object: Array, depth: number) {\n const size = object.length;\n if (size < 16) {\n // fixarray\n this.writeU8(0x90 + size);\n } else if (size < 0x10000) {\n // array 16\n this.writeU8(0xdc);\n this.writeU16(size);\n } else if (size < 0x100000000) {\n // array 32\n this.writeU8(0xdd);\n this.writeU32(size);\n } else {\n throw new Error(`Too large array: ${size}`);\n }\n for (const item of object) {\n this.doEncode(item, depth + 1);\n }\n }\n\n private countWithoutUndefined(object: Record, keys: ReadonlyArray): number {\n let count = 0;\n\n for (const key of keys) {\n if (object[key] !== undefined) {\n count++;\n }\n }\n\n return count;\n }\n\n private encodeMap(object: Record, depth: number) {\n const keys = Object.keys(object);\n if (this.sortKeys) {\n keys.sort();\n }\n\n const size = this.ignoreUndefined ? this.countWithoutUndefined(object, keys) : keys.length;\n\n if (size < 16) {\n // fixmap\n this.writeU8(0x80 + size);\n } else if (size < 0x10000) {\n // map 16\n this.writeU8(0xde);\n this.writeU16(size);\n } else if (size < 0x100000000) {\n // map 32\n this.writeU8(0xdf);\n this.writeU32(size);\n } else {\n throw new Error(`Too large map object: ${size}`);\n }\n\n for (const key of keys) {\n const value = object[key];\n\n if (!(this.ignoreUndefined && value === undefined)) {\n this.encodeString(key);\n this.doEncode(value, depth + 1);\n }\n }\n }\n\n private encodeExtension(ext: ExtData) {\n const size = ext.data.length;\n if (size === 1) {\n // fixext 1\n this.writeU8(0xd4);\n } else if (size === 2) {\n // fixext 2\n this.writeU8(0xd5);\n } else if (size === 4) {\n // fixext 4\n this.writeU8(0xd6);\n } else if (size === 8) {\n // fixext 8\n this.writeU8(0xd7);\n } else if (size === 16) {\n // fixext 16\n this.writeU8(0xd8);\n } else if (size < 0x100) {\n // ext 8\n this.writeU8(0xc7);\n this.writeU8(size);\n } else if (size < 0x10000) {\n // ext 16\n this.writeU8(0xc8);\n this.writeU16(size);\n } else if (size < 0x100000000) {\n // ext 32\n this.writeU8(0xc9);\n this.writeU32(size);\n } else {\n throw new Error(`Too large extension object: ${size}`);\n }\n this.writeI8(ext.type);\n this.writeU8a(ext.data);\n }\n\n private writeU8(value: number) {\n this.ensureBufferSizeToWrite(1);\n\n this.view.setUint8(this.pos, value);\n this.pos++;\n }\n\n private writeU8a(values: ArrayLike) {\n const size = values.length;\n this.ensureBufferSizeToWrite(size);\n\n this.bytes.set(values, this.pos);\n this.pos += size;\n }\n\n private writeI8(value: number) {\n this.ensureBufferSizeToWrite(1);\n\n this.view.setInt8(this.pos, value);\n this.pos++;\n }\n\n private writeU16(value: number) {\n this.ensureBufferSizeToWrite(2);\n\n this.view.setUint16(this.pos, value);\n this.pos += 2;\n }\n\n private writeI16(value: number) {\n this.ensureBufferSizeToWrite(2);\n\n this.view.setInt16(this.pos, value);\n this.pos += 2;\n }\n\n private writeU32(value: number) {\n this.ensureBufferSizeToWrite(4);\n\n this.view.setUint32(this.pos, value);\n this.pos += 4;\n }\n\n private writeI32(value: number) {\n this.ensureBufferSizeToWrite(4);\n\n this.view.setInt32(this.pos, value);\n this.pos += 4;\n }\n\n private writeF32(value: number) {\n this.ensureBufferSizeToWrite(4);\n this.view.setFloat32(this.pos, value);\n this.pos += 4;\n }\n\n private writeF64(value: number) {\n this.ensureBufferSizeToWrite(8);\n this.view.setFloat64(this.pos, value);\n this.pos += 8;\n }\n\n private writeU64(value: number) {\n this.ensureBufferSizeToWrite(8);\n\n setUint64(this.view, this.pos, value);\n this.pos += 8;\n }\n\n private writeI64(value: number) {\n this.ensureBufferSizeToWrite(8);\n\n setInt64(this.view, this.pos, value);\n this.pos += 8;\n }\n}\n","import { Encoder } from \"./Encoder\";\nimport type { ExtensionCodecType } from \"./ExtensionCodec\";\nimport type { ContextOf, SplitUndefined } from \"./context\";\n\nexport type EncodeOptions = Partial<\n Readonly<{\n extensionCodec: ExtensionCodecType;\n\n /**\n * The maximum depth in nested objects and arrays.\n *\n * Defaults to 100.\n */\n maxDepth: number;\n\n /**\n * The initial size of the internal buffer.\n *\n * Defaults to 2048.\n */\n initialBufferSize: number;\n\n /**\n * If `true`, the keys of an object is sorted. In other words, the encoded\n * binary is canonical and thus comparable to another encoded binary.\n *\n * Defaults to `false`. If enabled, it spends more time in encoding objects.\n */\n sortKeys: boolean;\n /**\n * If `true`, non-integer numbers are encoded in float32, not in float64 (the default).\n *\n * Only use it if precisions don't matter.\n *\n * Defaults to `false`.\n */\n forceFloat32: boolean;\n\n /**\n * If `true`, an object property with `undefined` value are ignored.\n * e.g. `{ foo: undefined }` will be encoded as `{}`, as `JSON.stringify()` does.\n *\n * Defaults to `false`. If enabled, it spends more time in encoding objects.\n */\n ignoreUndefined: boolean;\n\n /**\n * If `true`, integer numbers are encoded as floating point numbers,\n * with the `forceFloat32` option taken into account.\n *\n * Defaults to `false`.\n */\n forceIntegerToFloat: boolean;\n }>\n> &\n ContextOf;\n\nconst defaultEncodeOptions: EncodeOptions = {};\n\n/**\n * It encodes `value` in the MessagePack format and\n * returns a byte buffer.\n *\n * The returned buffer is a slice of a larger `ArrayBuffer`, so you have to use its `#byteOffset` and `#byteLength` in order to convert it to another typed arrays including NodeJS `Buffer`.\n */\nexport function encode(\n value: unknown,\n options: EncodeOptions> = defaultEncodeOptions as any,\n): Uint8Array {\n const encoder = new Encoder(\n options.extensionCodec,\n (options as typeof options & { context: any }).context,\n options.maxDepth,\n options.initialBufferSize,\n options.sortKeys,\n options.forceFloat32,\n options.ignoreUndefined,\n options.forceIntegerToFloat,\n );\n return encoder.encodeSharedRef(value);\n}\n","export function prettyByte(byte: number): string {\n return `${byte < 0 ? \"-\" : \"\"}0x${Math.abs(byte).toString(16).padStart(2, \"0\")}`;\n}\n","import { utf8DecodeJs } from \"./utils/utf8\";\n\nconst DEFAULT_MAX_KEY_LENGTH = 16;\nconst DEFAULT_MAX_LENGTH_PER_KEY = 16;\n\nexport interface KeyDecoder {\n canBeCached(byteLength: number): boolean;\n decode(bytes: Uint8Array, inputOffset: number, byteLength: number): string;\n}\ninterface KeyCacheRecord {\n readonly bytes: Uint8Array;\n readonly str: string;\n}\n\nexport class CachedKeyDecoder implements KeyDecoder {\n hit = 0;\n miss = 0;\n private readonly caches: Array>;\n\n constructor(readonly maxKeyLength = DEFAULT_MAX_KEY_LENGTH, readonly maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY) {\n // avoid `new Array(N)`, which makes a sparse array,\n // because a sparse array is typically slower than a non-sparse array.\n this.caches = [];\n for (let i = 0; i < this.maxKeyLength; i++) {\n this.caches.push([]);\n }\n }\n\n public canBeCached(byteLength: number): boolean {\n return byteLength > 0 && byteLength <= this.maxKeyLength;\n }\n\n private find(bytes: Uint8Array, inputOffset: number, byteLength: number): string | null {\n const records = this.caches[byteLength - 1]!;\n\n FIND_CHUNK: for (const record of records) {\n const recordBytes = record.bytes;\n\n for (let j = 0; j < byteLength; j++) {\n if (recordBytes[j] !== bytes[inputOffset + j]) {\n continue FIND_CHUNK;\n }\n }\n return record.str;\n }\n return null;\n }\n\n private store(bytes: Uint8Array, value: string) {\n const records = this.caches[bytes.length - 1]!;\n const record: KeyCacheRecord = { bytes, str: value };\n\n if (records.length >= this.maxLengthPerKey) {\n // `records` are full!\n // Set `record` to an arbitrary position.\n records[(Math.random() * records.length) | 0] = record;\n } else {\n records.push(record);\n }\n }\n\n public decode(bytes: Uint8Array, inputOffset: number, byteLength: number): string {\n const cachedValue = this.find(bytes, inputOffset, byteLength);\n if (cachedValue != null) {\n this.hit++;\n return cachedValue;\n }\n this.miss++;\n\n const str = utf8DecodeJs(bytes, inputOffset, byteLength);\n // Ensure to copy a slice of bytes because the byte may be NodeJS Buffer and Buffer#slice() returns a reference to its internal ArrayBuffer.\n const slicedCopyOfBytes = Uint8Array.prototype.slice.call(bytes, inputOffset, inputOffset + byteLength);\n this.store(slicedCopyOfBytes, str);\n return str;\n }\n}\n","import { prettyByte } from \"./utils/prettyByte\";\nimport { ExtensionCodec, ExtensionCodecType } from \"./ExtensionCodec\";\nimport { getInt64, getUint64, UINT32_MAX } from \"./utils/int\";\nimport { utf8DecodeJs, TEXT_DECODER_THRESHOLD, utf8DecodeTD } from \"./utils/utf8\";\nimport { createDataView, ensureUint8Array } from \"./utils/typedArrays\";\nimport { CachedKeyDecoder, KeyDecoder } from \"./CachedKeyDecoder\";\nimport { DecodeError } from \"./DecodeError\";\n\nconst enum State {\n ARRAY,\n MAP_KEY,\n MAP_VALUE,\n}\n\ntype MapKeyType = string | number;\n\nconst isValidMapKeyType = (key: unknown): key is MapKeyType => {\n const keyType = typeof key;\n\n return keyType === \"string\" || keyType === \"number\";\n};\n\ntype StackMapState = {\n type: State.MAP_KEY | State.MAP_VALUE;\n size: number;\n key: MapKeyType | null;\n readCount: number;\n map: Record;\n};\n\ntype StackArrayState = {\n type: State.ARRAY;\n size: number;\n array: Array;\n position: number;\n};\n\ntype StackState = StackArrayState | StackMapState;\n\nconst HEAD_BYTE_REQUIRED = -1;\n\nconst EMPTY_VIEW = new DataView(new ArrayBuffer(0));\nconst EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer);\n\n// IE11: Hack to support IE11.\n// IE11: Drop this hack and just use RangeError when IE11 is obsolete.\nexport const DataViewIndexOutOfBoundsError: typeof Error = (() => {\n try {\n // IE11: The spec says it should throw RangeError,\n // IE11: but in IE11 it throws TypeError.\n EMPTY_VIEW.getInt8(0);\n } catch (e: any) {\n return e.constructor;\n }\n throw new Error(\"never reached\");\n})();\n\nconst MORE_DATA = new DataViewIndexOutOfBoundsError(\"Insufficient data\");\n\nconst sharedCachedKeyDecoder = new CachedKeyDecoder();\n\nexport class Decoder {\n private totalPos = 0;\n private pos = 0;\n\n private view = EMPTY_VIEW;\n private bytes = EMPTY_BYTES;\n private headByte = HEAD_BYTE_REQUIRED;\n private readonly stack: Array = [];\n\n public constructor(\n private readonly extensionCodec: ExtensionCodecType = ExtensionCodec.defaultCodec as any,\n private readonly context: ContextType = undefined as any,\n private readonly maxStrLength = UINT32_MAX,\n private readonly maxBinLength = UINT32_MAX,\n private readonly maxArrayLength = UINT32_MAX,\n private readonly maxMapLength = UINT32_MAX,\n private readonly maxExtLength = UINT32_MAX,\n private readonly keyDecoder: KeyDecoder | null = sharedCachedKeyDecoder,\n ) {}\n\n private reinitializeState() {\n this.totalPos = 0;\n this.headByte = HEAD_BYTE_REQUIRED;\n this.stack.length = 0;\n\n // view, bytes, and pos will be re-initialized in setBuffer()\n }\n\n private setBuffer(buffer: ArrayLike | BufferSource): void {\n this.bytes = ensureUint8Array(buffer);\n this.view = createDataView(this.bytes);\n this.pos = 0;\n }\n\n private appendBuffer(buffer: ArrayLike | BufferSource) {\n if (this.headByte === HEAD_BYTE_REQUIRED && !this.hasRemaining(1)) {\n this.setBuffer(buffer);\n } else {\n const remainingData = this.bytes.subarray(this.pos);\n const newData = ensureUint8Array(buffer);\n\n // concat remainingData + newData\n const newBuffer = new Uint8Array(remainingData.length + newData.length);\n newBuffer.set(remainingData);\n newBuffer.set(newData, remainingData.length);\n this.setBuffer(newBuffer);\n }\n }\n\n private hasRemaining(size: number) {\n return this.view.byteLength - this.pos >= size;\n }\n\n private createExtraByteError(posToShow: number): Error {\n const { view, pos } = this;\n return new RangeError(`Extra ${view.byteLength - pos} of ${view.byteLength} byte(s) found at buffer[${posToShow}]`);\n }\n\n /**\n * @throws {@link DecodeError}\n * @throws {@link RangeError}\n */\n public decode(buffer: ArrayLike | BufferSource): unknown {\n this.reinitializeState();\n this.setBuffer(buffer);\n\n const object = this.doDecodeSync();\n if (this.hasRemaining(1)) {\n throw this.createExtraByteError(this.pos);\n }\n return object;\n }\n\n public *decodeMulti(buffer: ArrayLike | BufferSource): Generator {\n this.reinitializeState();\n this.setBuffer(buffer);\n\n while (this.hasRemaining(1)) {\n yield this.doDecodeSync();\n }\n }\n\n public async decodeAsync(stream: AsyncIterable | BufferSource>): Promise {\n let decoded = false;\n let object: unknown;\n for await (const buffer of stream) {\n if (decoded) {\n throw this.createExtraByteError(this.totalPos);\n }\n\n this.appendBuffer(buffer);\n\n try {\n object = this.doDecodeSync();\n decoded = true;\n } catch (e) {\n if (!(e instanceof DataViewIndexOutOfBoundsError)) {\n throw e; // rethrow\n }\n // fallthrough\n }\n this.totalPos += this.pos;\n }\n\n if (decoded) {\n if (this.hasRemaining(1)) {\n throw this.createExtraByteError(this.totalPos);\n }\n return object;\n }\n\n const { headByte, pos, totalPos } = this;\n throw new RangeError(\n `Insufficient data in parsing ${prettyByte(headByte)} at ${totalPos} (${pos} in the current buffer)`,\n );\n }\n\n public decodeArrayStream(\n stream: AsyncIterable | BufferSource>,\n ): AsyncGenerator {\n return this.decodeMultiAsync(stream, true);\n }\n\n public decodeStream(stream: AsyncIterable | BufferSource>): AsyncGenerator {\n return this.decodeMultiAsync(stream, false);\n }\n\n private async *decodeMultiAsync(stream: AsyncIterable | BufferSource>, isArray: boolean) {\n let isArrayHeaderRequired = isArray;\n let arrayItemsLeft = -1;\n\n for await (const buffer of stream) {\n if (isArray && arrayItemsLeft === 0) {\n throw this.createExtraByteError(this.totalPos);\n }\n\n this.appendBuffer(buffer);\n\n if (isArrayHeaderRequired) {\n arrayItemsLeft = this.readArraySize();\n isArrayHeaderRequired = false;\n this.complete();\n }\n\n try {\n while (true) {\n yield this.doDecodeSync();\n if (--arrayItemsLeft === 0) {\n break;\n }\n }\n } catch (e) {\n if (!(e instanceof DataViewIndexOutOfBoundsError)) {\n throw e; // rethrow\n }\n // fallthrough\n }\n this.totalPos += this.pos;\n }\n }\n\n private doDecodeSync(): unknown {\n DECODE: while (true) {\n const headByte = this.readHeadByte();\n let object: unknown;\n\n if (headByte >= 0xe0) {\n // negative fixint (111x xxxx) 0xe0 - 0xff\n object = headByte - 0x100;\n } else if (headByte < 0xc0) {\n if (headByte < 0x80) {\n // positive fixint (0xxx xxxx) 0x00 - 0x7f\n object = headByte;\n } else if (headByte < 0x90) {\n // fixmap (1000 xxxx) 0x80 - 0x8f\n const size = headByte - 0x80;\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n } else {\n object = {};\n }\n } else if (headByte < 0xa0) {\n // fixarray (1001 xxxx) 0x90 - 0x9f\n const size = headByte - 0x90;\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n } else {\n object = [];\n }\n } else {\n // fixstr (101x xxxx) 0xa0 - 0xbf\n const byteLength = headByte - 0xa0;\n object = this.decodeUtf8String(byteLength, 0);\n }\n } else if (headByte === 0xc0) {\n // nil\n object = null;\n } else if (headByte === 0xc2) {\n // false\n object = false;\n } else if (headByte === 0xc3) {\n // true\n object = true;\n } else if (headByte === 0xca) {\n // float 32\n object = this.readF32();\n } else if (headByte === 0xcb) {\n // float 64\n object = this.readF64();\n } else if (headByte === 0xcc) {\n // uint 8\n object = this.readU8();\n } else if (headByte === 0xcd) {\n // uint 16\n object = this.readU16();\n } else if (headByte === 0xce) {\n // uint 32\n object = this.readU32();\n } else if (headByte === 0xcf) {\n // uint 64\n object = this.readU64();\n } else if (headByte === 0xd0) {\n // int 8\n object = this.readI8();\n } else if (headByte === 0xd1) {\n // int 16\n object = this.readI16();\n } else if (headByte === 0xd2) {\n // int 32\n object = this.readI32();\n } else if (headByte === 0xd3) {\n // int 64\n object = this.readI64();\n } else if (headByte === 0xd9) {\n // str 8\n const byteLength = this.lookU8();\n object = this.decodeUtf8String(byteLength, 1);\n } else if (headByte === 0xda) {\n // str 16\n const byteLength = this.lookU16();\n object = this.decodeUtf8String(byteLength, 2);\n } else if (headByte === 0xdb) {\n // str 32\n const byteLength = this.lookU32();\n object = this.decodeUtf8String(byteLength, 4);\n } else if (headByte === 0xdc) {\n // array 16\n const size = this.readU16();\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n } else {\n object = [];\n }\n } else if (headByte === 0xdd) {\n // array 32\n const size = this.readU32();\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n } else {\n object = [];\n }\n } else if (headByte === 0xde) {\n // map 16\n const size = this.readU16();\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n } else {\n object = {};\n }\n } else if (headByte === 0xdf) {\n // map 32\n const size = this.readU32();\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n } else {\n object = {};\n }\n } else if (headByte === 0xc4) {\n // bin 8\n const size = this.lookU8();\n object = this.decodeBinary(size, 1);\n } else if (headByte === 0xc5) {\n // bin 16\n const size = this.lookU16();\n object = this.decodeBinary(size, 2);\n } else if (headByte === 0xc6) {\n // bin 32\n const size = this.lookU32();\n object = this.decodeBinary(size, 4);\n } else if (headByte === 0xd4) {\n // fixext 1\n object = this.decodeExtension(1, 0);\n } else if (headByte === 0xd5) {\n // fixext 2\n object = this.decodeExtension(2, 0);\n } else if (headByte === 0xd6) {\n // fixext 4\n object = this.decodeExtension(4, 0);\n } else if (headByte === 0xd7) {\n // fixext 8\n object = this.decodeExtension(8, 0);\n } else if (headByte === 0xd8) {\n // fixext 16\n object = this.decodeExtension(16, 0);\n } else if (headByte === 0xc7) {\n // ext 8\n const size = this.lookU8();\n object = this.decodeExtension(size, 1);\n } else if (headByte === 0xc8) {\n // ext 16\n const size = this.lookU16();\n object = this.decodeExtension(size, 2);\n } else if (headByte === 0xc9) {\n // ext 32\n const size = this.lookU32();\n object = this.decodeExtension(size, 4);\n } else {\n throw new DecodeError(`Unrecognized type byte: ${prettyByte(headByte)}`);\n }\n\n this.complete();\n\n const stack = this.stack;\n while (stack.length > 0) {\n // arrays and maps\n const state = stack[stack.length - 1]!;\n if (state.type === State.ARRAY) {\n state.array[state.position] = object;\n state.position++;\n if (state.position === state.size) {\n stack.pop();\n object = state.array;\n } else {\n continue DECODE;\n }\n } else if (state.type === State.MAP_KEY) {\n if (!isValidMapKeyType(object)) {\n throw new DecodeError(\"The type of key must be string or number but \" + typeof object);\n }\n if (object === \"__proto__\") {\n throw new DecodeError(\"The key __proto__ is not allowed\");\n }\n\n state.key = object;\n state.type = State.MAP_VALUE;\n continue DECODE;\n } else {\n // it must be `state.type === State.MAP_VALUE` here\n\n state.map[state.key!] = object;\n state.readCount++;\n\n if (state.readCount === state.size) {\n stack.pop();\n object = state.map;\n } else {\n state.key = null;\n state.type = State.MAP_KEY;\n continue DECODE;\n }\n }\n }\n\n return object;\n }\n }\n\n private readHeadByte(): number {\n if (this.headByte === HEAD_BYTE_REQUIRED) {\n this.headByte = this.readU8();\n // console.log(\"headByte\", prettyByte(this.headByte));\n }\n\n return this.headByte;\n }\n\n private complete(): void {\n this.headByte = HEAD_BYTE_REQUIRED;\n }\n\n private readArraySize(): number {\n const headByte = this.readHeadByte();\n\n switch (headByte) {\n case 0xdc:\n return this.readU16();\n case 0xdd:\n return this.readU32();\n default: {\n if (headByte < 0xa0) {\n return headByte - 0x90;\n } else {\n throw new DecodeError(`Unrecognized array type byte: ${prettyByte(headByte)}`);\n }\n }\n }\n }\n\n private pushMapState(size: number) {\n if (size > this.maxMapLength) {\n throw new DecodeError(`Max length exceeded: map length (${size}) > maxMapLengthLength (${this.maxMapLength})`);\n }\n\n this.stack.push({\n type: State.MAP_KEY,\n size,\n key: null,\n readCount: 0,\n map: {},\n });\n }\n\n private pushArrayState(size: number) {\n if (size > this.maxArrayLength) {\n throw new DecodeError(`Max length exceeded: array length (${size}) > maxArrayLength (${this.maxArrayLength})`);\n }\n\n this.stack.push({\n type: State.ARRAY,\n size,\n array: new Array(size),\n position: 0,\n });\n }\n\n private decodeUtf8String(byteLength: number, headerOffset: number): string {\n if (byteLength > this.maxStrLength) {\n throw new DecodeError(\n `Max length exceeded: UTF-8 byte length (${byteLength}) > maxStrLength (${this.maxStrLength})`,\n );\n }\n\n if (this.bytes.byteLength < this.pos + headerOffset + byteLength) {\n throw MORE_DATA;\n }\n\n const offset = this.pos + headerOffset;\n let object: string;\n if (this.stateIsMapKey() && this.keyDecoder?.canBeCached(byteLength)) {\n object = this.keyDecoder.decode(this.bytes, offset, byteLength);\n } else if (byteLength > TEXT_DECODER_THRESHOLD) {\n object = utf8DecodeTD(this.bytes, offset, byteLength);\n } else {\n object = utf8DecodeJs(this.bytes, offset, byteLength);\n }\n this.pos += headerOffset + byteLength;\n return object;\n }\n\n private stateIsMapKey(): boolean {\n if (this.stack.length > 0) {\n const state = this.stack[this.stack.length - 1]!;\n return state.type === State.MAP_KEY;\n }\n return false;\n }\n\n private decodeBinary(byteLength: number, headOffset: number): Uint8Array {\n if (byteLength > this.maxBinLength) {\n throw new DecodeError(`Max length exceeded: bin length (${byteLength}) > maxBinLength (${this.maxBinLength})`);\n }\n\n if (!this.hasRemaining(byteLength + headOffset)) {\n throw MORE_DATA;\n }\n\n const offset = this.pos + headOffset;\n const object = this.bytes.subarray(offset, offset + byteLength);\n this.pos += headOffset + byteLength;\n return object;\n }\n\n private decodeExtension(size: number, headOffset: number): unknown {\n if (size > this.maxExtLength) {\n throw new DecodeError(`Max length exceeded: ext length (${size}) > maxExtLength (${this.maxExtLength})`);\n }\n\n const extType = this.view.getInt8(this.pos + headOffset);\n const data = this.decodeBinary(size, headOffset + 1 /* extType */);\n return this.extensionCodec.decode(data, extType, this.context);\n }\n\n private lookU8() {\n return this.view.getUint8(this.pos);\n }\n\n private lookU16() {\n return this.view.getUint16(this.pos);\n }\n\n private lookU32() {\n return this.view.getUint32(this.pos);\n }\n\n private readU8(): number {\n const value = this.view.getUint8(this.pos);\n this.pos++;\n return value;\n }\n\n private readI8(): number {\n const value = this.view.getInt8(this.pos);\n this.pos++;\n return value;\n }\n\n private readU16(): number {\n const value = this.view.getUint16(this.pos);\n this.pos += 2;\n return value;\n }\n\n private readI16(): number {\n const value = this.view.getInt16(this.pos);\n this.pos += 2;\n return value;\n }\n\n private readU32(): number {\n const value = this.view.getUint32(this.pos);\n this.pos += 4;\n return value;\n }\n\n private readI32(): number {\n const value = this.view.getInt32(this.pos);\n this.pos += 4;\n return value;\n }\n\n private readU64(): number {\n const value = getUint64(this.view, this.pos);\n this.pos += 8;\n return value;\n }\n\n private readI64(): number {\n const value = getInt64(this.view, this.pos);\n this.pos += 8;\n return value;\n }\n\n private readF32() {\n const value = this.view.getFloat32(this.pos);\n this.pos += 4;\n return value;\n }\n\n private readF64() {\n const value = this.view.getFloat64(this.pos);\n this.pos += 8;\n return value;\n }\n}\n","import { Decoder } from \"./Decoder\";\nimport type { ExtensionCodecType } from \"./ExtensionCodec\";\nimport type { ContextOf, SplitUndefined } from \"./context\";\n\nexport type DecodeOptions = Readonly<\n Partial<{\n extensionCodec: ExtensionCodecType;\n\n /**\n * Maximum string length.\n *\n * Defaults to 4_294_967_295 (UINT32_MAX).\n */\n maxStrLength: number;\n /**\n * Maximum binary length.\n *\n * Defaults to 4_294_967_295 (UINT32_MAX).\n */\n maxBinLength: number;\n /**\n * Maximum array length.\n *\n * Defaults to 4_294_967_295 (UINT32_MAX).\n */\n maxArrayLength: number;\n /**\n * Maximum map length.\n *\n * Defaults to 4_294_967_295 (UINT32_MAX).\n */\n maxMapLength: number;\n /**\n * Maximum extension length.\n *\n * Defaults to 4_294_967_295 (UINT32_MAX).\n */\n maxExtLength: number;\n }>\n> &\n ContextOf;\n\nexport const defaultDecodeOptions: DecodeOptions = {};\n\n/**\n * It decodes a single MessagePack object in a buffer.\n *\n * This is a synchronous decoding function.\n * See other variants for asynchronous decoding: {@link decodeAsync()}, {@link decodeStream()}, or {@link decodeArrayStream()}.\n *\n * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty.\n * @throws {@link DecodeError} if the buffer contains invalid data.\n */\nexport function decode(\n buffer: ArrayLike | BufferSource,\n options: DecodeOptions> = defaultDecodeOptions as any,\n): unknown {\n const decoder = new Decoder(\n options.extensionCodec,\n (options as typeof options & { context: any }).context,\n options.maxStrLength,\n options.maxBinLength,\n options.maxArrayLength,\n options.maxMapLength,\n options.maxExtLength,\n );\n return decoder.decode(buffer);\n}\n\n/**\n * It decodes multiple MessagePack objects in a buffer.\n * This is corresponding to {@link decodeMultiStream()}.\n *\n * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty.\n * @throws {@link DecodeError} if the buffer contains invalid data.\n */\nexport function decodeMulti(\n buffer: ArrayLike | BufferSource,\n options: DecodeOptions> = defaultDecodeOptions as any,\n): Generator {\n const decoder = new Decoder(\n options.extensionCodec,\n (options as typeof options & { context: any }).context,\n options.maxStrLength,\n options.maxBinLength,\n options.maxArrayLength,\n options.maxMapLength,\n options.maxExtLength,\n );\n return decoder.decodeMulti(buffer);\n}\n","// utility for whatwg streams\n\n// The living standard of whatwg streams says\n// ReadableStream is also AsyncIterable, but\n// as of June 2019, no browser implements it.\n// See https://streams.spec.whatwg.org/ for details\nexport type ReadableStreamLike = AsyncIterable | ReadableStream;\n\nexport function isAsyncIterable(object: ReadableStreamLike): object is AsyncIterable {\n return (object as any)[Symbol.asyncIterator] != null;\n}\n\nfunction assertNonNull(value: T | null | undefined): asserts value is T {\n if (value == null) {\n throw new Error(\"Assertion Failure: value must not be null nor undefined\");\n }\n}\n\nexport async function* asyncIterableFromStream(stream: ReadableStream): AsyncIterable {\n const reader = stream.getReader();\n\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n return;\n }\n assertNonNull(value);\n yield value;\n }\n } finally {\n reader.releaseLock();\n }\n}\n\nexport function ensureAsyncIterable(streamLike: ReadableStreamLike): AsyncIterable {\n if (isAsyncIterable(streamLike)) {\n return streamLike;\n } else {\n return asyncIterableFromStream(streamLike);\n }\n}\n","import { Decoder } from \"./Decoder\";\nimport { ensureAsyncIterable } from \"./utils/stream\";\nimport { defaultDecodeOptions } from \"./decode\";\nimport type { ReadableStreamLike } from \"./utils/stream\";\nimport type { DecodeOptions } from \"./decode\";\nimport type { SplitUndefined } from \"./context\";\n\n/**\n * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty.\n * @throws {@link DecodeError} if the buffer contains invalid data.\n */\n export async function decodeAsync(\n streamLike: ReadableStreamLike | BufferSource>,\n options: DecodeOptions> = defaultDecodeOptions as any,\n): Promise {\n const stream = ensureAsyncIterable(streamLike);\n\n const decoder = new Decoder(\n options.extensionCodec,\n (options as typeof options & { context: any }).context,\n options.maxStrLength,\n options.maxBinLength,\n options.maxArrayLength,\n options.maxMapLength,\n options.maxExtLength,\n );\n return decoder.decodeAsync(stream);\n}\n\n/**\n * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty.\n * @throws {@link DecodeError} if the buffer contains invalid data.\n */\n export function decodeArrayStream(\n streamLike: ReadableStreamLike | BufferSource>,\n options: DecodeOptions> = defaultDecodeOptions as any,\n): AsyncGenerator {\n const stream = ensureAsyncIterable(streamLike);\n\n const decoder = new Decoder(\n options.extensionCodec,\n (options as typeof options & { context: any }).context,\n options.maxStrLength,\n options.maxBinLength,\n options.maxArrayLength,\n options.maxMapLength,\n options.maxExtLength,\n );\n\n return decoder.decodeArrayStream(stream);\n}\n\n/**\n * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty.\n * @throws {@link DecodeError} if the buffer contains invalid data.\n */\nexport function decodeMultiStream(\n streamLike: ReadableStreamLike | BufferSource>,\n options: DecodeOptions> = defaultDecodeOptions as any,\n): AsyncGenerator {\n const stream = ensureAsyncIterable(streamLike);\n\n const decoder = new Decoder(\n options.extensionCodec,\n (options as typeof options & { context: any }).context,\n options.maxStrLength,\n options.maxBinLength,\n options.maxArrayLength,\n options.maxMapLength,\n options.maxExtLength,\n );\n\n return decoder.decodeStream(stream);\n}\n\n/**\n * @deprecated Use {@link decodeMultiStream()} instead.\n */\nexport function decodeStream(\n streamLike: ReadableStreamLike | BufferSource>,\n options: DecodeOptions> = defaultDecodeOptions as any,\n): AsyncGenerator {\n return decodeMultiStream(streamLike, options);\n}\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","UINT32_MAX","setInt64","view","offset","high","Math","floor","low","setUint32","getInt64","getInt32","getUint32","TEXT_ENCODING_AVAILABLE","process","env","TextEncoder","TextDecoder","utf8Count","str","strLength","length","byteLength","pos","charCodeAt","extra","sharedTextEncoder","undefined","TEXT_ENCODER_THRESHOLD","utf8EncodeTE","encodeInto","output","outputOffset","subarray","set","encode","utf8DecodeJs","bytes","inputOffset","end","units","result","byte1","push","byte2","byte3","unit","String","fromCharCode","sharedTextDecoder","TEXT_DECODER_THRESHOLD","type","data","message","proto","create","DecodeError","setPrototypeOf","configurable","name","Error","EXT_TIMESTAMP","encodeTimeSpecToTimestamp","sec","nsec","rv","Uint8Array","DataView","buffer","secHigh","secLow","encodeDateToTimeSpec","date","msec","getTime","nsecInSec","encodeTimestampExtension","object","Date","decodeTimestampToTimeSpec","byteOffset","nsec30AndSecHigh2","decodeTimestampExtension","timeSpec","timestampExtension","decode","builtInEncoders","builtInDecoders","encoders","decoders","register","index","tryToEncode","context","i","encodeExt","ExtData","decodeExt","defaultCodec","ExtensionCodec","ensureUint8Array","ArrayBuffer","isView","from","extensionCodec","maxDepth","initialBufferSize","sortKeys","forceFloat32","ignoreUndefined","forceIntegerToFloat","reinitializeState","encodeSharedRef","doEncode","slice","depth","encodeNil","encodeBoolean","encodeNumber","encodeString","encodeObject","ensureBufferSizeToWrite","sizeToWrite","requiredSize","resizeBuffer","newSize","newBuffer","newBytes","newView","writeU8","Number","isSafeInteger","writeU16","writeU32","writeU64","writeI8","writeI16","writeI32","writeI64","writeF32","writeF64","writeStringHeader","utf8EncodeJs","ext","encodeExtension","Array","isArray","encodeArray","encodeBinary","toString","apply","encodeMap","size","writeU8a","item","countWithoutUndefined","keys","count","sort","setUint8","values","setInt8","setUint16","setInt16","setInt32","setFloat32","setFloat64","setUint64","defaultEncodeOptions","options","Encoder","prettyByte","byte","abs","padStart","maxKeyLength","maxLengthPerKey","hit","miss","caches","canBeCached","find","records","FIND_CHUNK","record","recordBytes","j","store","random","cachedValue","slicedCopyOfBytes","EMPTY_VIEW","EMPTY_BYTES","DataViewIndexOutOfBoundsError","getInt8","e","constructor","MORE_DATA","sharedCachedKeyDecoder","CachedKeyDecoder","maxStrLength","maxBinLength","maxArrayLength","maxMapLength","maxExtLength","keyDecoder","totalPos","headByte","stack","setBuffer","bufferView","createDataView","appendBuffer","hasRemaining","remainingData","newData","createExtraByteError","posToShow","RangeError","doDecodeSync","decodeMulti","decodeAsync","stream","decoded","decodeArrayStream","decodeMultiAsync","decodeStream","isArrayHeaderRequired","arrayItemsLeft","readArraySize","complete","DECODE","readHeadByte","pushMapState","pushArrayState","decodeUtf8String","readF32","readF64","readU8","readU16","readU32","readU64","readI8","readI16","readI32","readI64","lookU8","lookU16","lookU32","decodeBinary","decodeExtension","state","array","position","pop","keyType","map","readCount","headerOffset","stateIsMapKey","stringBytes","utf8DecodeTD","headOffset","extType","getUint8","getUint16","getInt16","getFloat32","getFloat64","defaultDecodeOptions","Decoder","assertNonNull","ensureAsyncIterable","streamLike","asyncIterator","reader","getReader","read","done","releaseLock","asyncIterableFromStream","decodeMultiStream"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/CachedKeyDecoder.d.ts b/node_modules/@msgpack/msgpack/dist/CachedKeyDecoder.d.ts deleted file mode 100644 index 977c98f..0000000 --- a/node_modules/@msgpack/msgpack/dist/CachedKeyDecoder.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface KeyDecoder { - canBeCached(byteLength: number): boolean; - decode(bytes: Uint8Array, inputOffset: number, byteLength: number): string; -} -export declare class CachedKeyDecoder implements KeyDecoder { - readonly maxKeyLength: number; - readonly maxLengthPerKey: number; - hit: number; - miss: number; - private readonly caches; - constructor(maxKeyLength?: number, maxLengthPerKey?: number); - canBeCached(byteLength: number): boolean; - private find; - private store; - decode(bytes: Uint8Array, inputOffset: number, byteLength: number): string; -} diff --git a/node_modules/@msgpack/msgpack/dist/CachedKeyDecoder.js b/node_modules/@msgpack/msgpack/dist/CachedKeyDecoder.js deleted file mode 100644 index 93c09a7..0000000 --- a/node_modules/@msgpack/msgpack/dist/CachedKeyDecoder.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CachedKeyDecoder = void 0; -const utf8_1 = require("./utils/utf8"); -const DEFAULT_MAX_KEY_LENGTH = 16; -const DEFAULT_MAX_LENGTH_PER_KEY = 16; -class CachedKeyDecoder { - constructor(maxKeyLength = DEFAULT_MAX_KEY_LENGTH, maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY) { - this.maxKeyLength = maxKeyLength; - this.maxLengthPerKey = maxLengthPerKey; - this.hit = 0; - this.miss = 0; - // avoid `new Array(N)`, which makes a sparse array, - // because a sparse array is typically slower than a non-sparse array. - this.caches = []; - for (let i = 0; i < this.maxKeyLength; i++) { - this.caches.push([]); - } - } - canBeCached(byteLength) { - return byteLength > 0 && byteLength <= this.maxKeyLength; - } - find(bytes, inputOffset, byteLength) { - const records = this.caches[byteLength - 1]; - FIND_CHUNK: for (const record of records) { - const recordBytes = record.bytes; - for (let j = 0; j < byteLength; j++) { - if (recordBytes[j] !== bytes[inputOffset + j]) { - continue FIND_CHUNK; - } - } - return record.str; - } - return null; - } - store(bytes, value) { - const records = this.caches[bytes.length - 1]; - const record = { bytes, str: value }; - if (records.length >= this.maxLengthPerKey) { - // `records` are full! - // Set `record` to an arbitrary position. - records[(Math.random() * records.length) | 0] = record; - } - else { - records.push(record); - } - } - decode(bytes, inputOffset, byteLength) { - const cachedValue = this.find(bytes, inputOffset, byteLength); - if (cachedValue != null) { - this.hit++; - return cachedValue; - } - this.miss++; - const str = (0, utf8_1.utf8DecodeJs)(bytes, inputOffset, byteLength); - // Ensure to copy a slice of bytes because the byte may be NodeJS Buffer and Buffer#slice() returns a reference to its internal ArrayBuffer. - const slicedCopyOfBytes = Uint8Array.prototype.slice.call(bytes, inputOffset, inputOffset + byteLength); - this.store(slicedCopyOfBytes, str); - return str; - } -} -exports.CachedKeyDecoder = CachedKeyDecoder; -//# sourceMappingURL=CachedKeyDecoder.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/CachedKeyDecoder.js.map b/node_modules/@msgpack/msgpack/dist/CachedKeyDecoder.js.map deleted file mode 100644 index f06ca1a..0000000 --- a/node_modules/@msgpack/msgpack/dist/CachedKeyDecoder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CachedKeyDecoder.js","sourceRoot":"","sources":["../src/CachedKeyDecoder.ts"],"names":[],"mappings":";;;AAAA,uCAA4C;AAE5C,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAWtC,MAAa,gBAAgB;IAK3B,YAAqB,eAAe,sBAAsB,EAAW,kBAAkB,0BAA0B;QAA5F,iBAAY,GAAZ,YAAY,CAAyB;QAAW,oBAAe,GAAf,eAAe,CAA6B;QAJjH,QAAG,GAAG,CAAC,CAAC;QACR,SAAI,GAAG,CAAC,CAAC;QAIP,oDAAoD;QACpD,sEAAsE;QACtE,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,EAAE,EAAE;YAC1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACtB;IACH,CAAC;IAEM,WAAW,CAAC,UAAkB;QACnC,OAAO,UAAU,GAAG,CAAC,IAAI,UAAU,IAAI,IAAI,CAAC,YAAY,CAAC;IAC3D,CAAC;IAEO,IAAI,CAAC,KAAiB,EAAE,WAAmB,EAAE,UAAkB;QACrE,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC,CAAE,CAAC;QAE7C,UAAU,EAAE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YACxC,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC;YAEjC,KAA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AAE,WAAW,GAAG,UAAU,CAAC,CAAC;QACxG,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;QACnC,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AA7DD,4CA6DC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/DecodeError.d.ts b/node_modules/@msgpack/msgpack/dist/DecodeError.d.ts deleted file mode 100644 index 1ce9297..0000000 --- a/node_modules/@msgpack/msgpack/dist/DecodeError.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare class DecodeError extends Error { - constructor(message: string); -} diff --git a/node_modules/@msgpack/msgpack/dist/DecodeError.js b/node_modules/@msgpack/msgpack/dist/DecodeError.js deleted file mode 100644 index 37cde9a..0000000 --- a/node_modules/@msgpack/msgpack/dist/DecodeError.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DecodeError = void 0; -class DecodeError extends Error { - constructor(message) { - super(message); - // fix the prototype chain in a cross-platform way - const proto = Object.create(DecodeError.prototype); - Object.setPrototypeOf(this, proto); - Object.defineProperty(this, "name", { - configurable: true, - enumerable: false, - value: DecodeError.name, - }); - } -} -exports.DecodeError = DecodeError; -//# sourceMappingURL=DecodeError.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/DecodeError.js.map b/node_modules/@msgpack/msgpack/dist/DecodeError.js.map deleted file mode 100644 index 53f0bf5..0000000 --- a/node_modules/@msgpack/msgpack/dist/DecodeError.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DecodeError.js","sourceRoot":"","sources":["../src/DecodeError.ts"],"names":[],"mappings":";;;AAAA,MAAa,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,kDAAkD;QAClD,MAAM,KAAK,GAAiC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACjF,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAEnC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE;YAClC,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,WAAW,CAAC,IAAI;SACxB,CAAC,CAAC;IACL,CAAC;CACF;AAdD,kCAcC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/Decoder.d.ts b/node_modules/@msgpack/msgpack/dist/Decoder.d.ts deleted file mode 100644 index ad3fe55..0000000 --- a/node_modules/@msgpack/msgpack/dist/Decoder.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { ExtensionCodecType } from "./ExtensionCodec"; -import { KeyDecoder } from "./CachedKeyDecoder"; -export declare const DataViewIndexOutOfBoundsError: typeof Error; -export declare class Decoder { - private readonly extensionCodec; - private readonly context; - private readonly maxStrLength; - private readonly maxBinLength; - private readonly maxArrayLength; - private readonly maxMapLength; - private readonly maxExtLength; - private readonly keyDecoder; - private totalPos; - private pos; - private view; - private bytes; - private headByte; - private readonly stack; - constructor(extensionCodec?: ExtensionCodecType, context?: ContextType, maxStrLength?: number, maxBinLength?: number, maxArrayLength?: number, maxMapLength?: number, maxExtLength?: number, keyDecoder?: KeyDecoder | null); - private reinitializeState; - private setBuffer; - private appendBuffer; - private hasRemaining; - private createExtraByteError; - /** - * @throws {@link DecodeError} - * @throws {@link RangeError} - */ - decode(buffer: ArrayLike | BufferSource): unknown; - decodeMulti(buffer: ArrayLike | BufferSource): Generator; - decodeAsync(stream: AsyncIterable | BufferSource>): Promise; - decodeArrayStream(stream: AsyncIterable | BufferSource>): AsyncGenerator; - decodeStream(stream: AsyncIterable | BufferSource>): AsyncGenerator; - private decodeMultiAsync; - private doDecodeSync; - private readHeadByte; - private complete; - private readArraySize; - private pushMapState; - private pushArrayState; - private decodeUtf8String; - private stateIsMapKey; - private decodeBinary; - private decodeExtension; - private lookU8; - private lookU16; - private lookU32; - private readU8; - private readI8; - private readU16; - private readI16; - private readU32; - private readI32; - private readU64; - private readI64; - private readF32; - private readF64; -} diff --git a/node_modules/@msgpack/msgpack/dist/Decoder.js b/node_modules/@msgpack/msgpack/dist/Decoder.js deleted file mode 100644 index ccb865f..0000000 --- a/node_modules/@msgpack/msgpack/dist/Decoder.js +++ /dev/null @@ -1,583 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Decoder = exports.DataViewIndexOutOfBoundsError = void 0; -const prettyByte_1 = require("./utils/prettyByte"); -const ExtensionCodec_1 = require("./ExtensionCodec"); -const int_1 = require("./utils/int"); -const utf8_1 = require("./utils/utf8"); -const typedArrays_1 = require("./utils/typedArrays"); -const CachedKeyDecoder_1 = require("./CachedKeyDecoder"); -const DecodeError_1 = require("./DecodeError"); -const isValidMapKeyType = (key) => { - const keyType = typeof key; - return keyType === "string" || keyType === "number"; -}; -const HEAD_BYTE_REQUIRED = -1; -const EMPTY_VIEW = new DataView(new ArrayBuffer(0)); -const EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer); -// IE11: Hack to support IE11. -// IE11: Drop this hack and just use RangeError when IE11 is obsolete. -exports.DataViewIndexOutOfBoundsError = (() => { - try { - // IE11: The spec says it should throw RangeError, - // IE11: but in IE11 it throws TypeError. - EMPTY_VIEW.getInt8(0); - } - catch (e) { - return e.constructor; - } - throw new Error("never reached"); -})(); -const MORE_DATA = new exports.DataViewIndexOutOfBoundsError("Insufficient data"); -const sharedCachedKeyDecoder = new CachedKeyDecoder_1.CachedKeyDecoder(); -class Decoder { - constructor(extensionCodec = ExtensionCodec_1.ExtensionCodec.defaultCodec, context = undefined, maxStrLength = int_1.UINT32_MAX, maxBinLength = int_1.UINT32_MAX, maxArrayLength = int_1.UINT32_MAX, maxMapLength = int_1.UINT32_MAX, maxExtLength = int_1.UINT32_MAX, keyDecoder = sharedCachedKeyDecoder) { - this.extensionCodec = extensionCodec; - this.context = context; - this.maxStrLength = maxStrLength; - this.maxBinLength = maxBinLength; - this.maxArrayLength = maxArrayLength; - this.maxMapLength = maxMapLength; - this.maxExtLength = maxExtLength; - this.keyDecoder = keyDecoder; - this.totalPos = 0; - this.pos = 0; - this.view = EMPTY_VIEW; - this.bytes = EMPTY_BYTES; - this.headByte = HEAD_BYTE_REQUIRED; - this.stack = []; - } - reinitializeState() { - this.totalPos = 0; - this.headByte = HEAD_BYTE_REQUIRED; - this.stack.length = 0; - // view, bytes, and pos will be re-initialized in setBuffer() - } - setBuffer(buffer) { - this.bytes = (0, typedArrays_1.ensureUint8Array)(buffer); - this.view = (0, typedArrays_1.createDataView)(this.bytes); - this.pos = 0; - } - appendBuffer(buffer) { - if (this.headByte === HEAD_BYTE_REQUIRED && !this.hasRemaining(1)) { - this.setBuffer(buffer); - } - else { - const remainingData = this.bytes.subarray(this.pos); - const newData = (0, typedArrays_1.ensureUint8Array)(buffer); - // concat remainingData + newData - const newBuffer = new Uint8Array(remainingData.length + newData.length); - newBuffer.set(remainingData); - newBuffer.set(newData, remainingData.length); - this.setBuffer(newBuffer); - } - } - hasRemaining(size) { - return this.view.byteLength - this.pos >= size; - } - createExtraByteError(posToShow) { - const { view, pos } = this; - return new RangeError(`Extra ${view.byteLength - pos} of ${view.byteLength} byte(s) found at buffer[${posToShow}]`); - } - /** - * @throws {@link DecodeError} - * @throws {@link RangeError} - */ - decode(buffer) { - this.reinitializeState(); - this.setBuffer(buffer); - const object = this.doDecodeSync(); - if (this.hasRemaining(1)) { - throw this.createExtraByteError(this.pos); - } - return object; - } - *decodeMulti(buffer) { - this.reinitializeState(); - this.setBuffer(buffer); - while (this.hasRemaining(1)) { - yield this.doDecodeSync(); - } - } - async decodeAsync(stream) { - let decoded = false; - let object; - for await (const buffer of stream) { - if (decoded) { - throw this.createExtraByteError(this.totalPos); - } - this.appendBuffer(buffer); - try { - object = this.doDecodeSync(); - decoded = true; - } - catch (e) { - if (!(e instanceof exports.DataViewIndexOutOfBoundsError)) { - throw e; // rethrow - } - // fallthrough - } - this.totalPos += this.pos; - } - if (decoded) { - if (this.hasRemaining(1)) { - throw this.createExtraByteError(this.totalPos); - } - return object; - } - const { headByte, pos, totalPos } = this; - throw new RangeError(`Insufficient data in parsing ${(0, prettyByte_1.prettyByte)(headByte)} at ${totalPos} (${pos} in the current buffer)`); - } - decodeArrayStream(stream) { - return this.decodeMultiAsync(stream, true); - } - decodeStream(stream) { - return this.decodeMultiAsync(stream, false); - } - async *decodeMultiAsync(stream, isArray) { - let isArrayHeaderRequired = isArray; - let arrayItemsLeft = -1; - for await (const buffer of stream) { - if (isArray && arrayItemsLeft === 0) { - throw this.createExtraByteError(this.totalPos); - } - this.appendBuffer(buffer); - if (isArrayHeaderRequired) { - arrayItemsLeft = this.readArraySize(); - isArrayHeaderRequired = false; - this.complete(); - } - try { - while (true) { - yield this.doDecodeSync(); - if (--arrayItemsLeft === 0) { - break; - } - } - } - catch (e) { - if (!(e instanceof exports.DataViewIndexOutOfBoundsError)) { - throw e; // rethrow - } - // fallthrough - } - this.totalPos += this.pos; - } - } - doDecodeSync() { - DECODE: while (true) { - const headByte = this.readHeadByte(); - let object; - if (headByte >= 0xe0) { - // negative fixint (111x xxxx) 0xe0 - 0xff - object = headByte - 0x100; - } - else if (headByte < 0xc0) { - if (headByte < 0x80) { - // positive fixint (0xxx xxxx) 0x00 - 0x7f - object = headByte; - } - else if (headByte < 0x90) { - // fixmap (1000 xxxx) 0x80 - 0x8f - const size = headByte - 0x80; - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } - else { - object = {}; - } - } - else if (headByte < 0xa0) { - // fixarray (1001 xxxx) 0x90 - 0x9f - const size = headByte - 0x90; - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } - else { - object = []; - } - } - else { - // fixstr (101x xxxx) 0xa0 - 0xbf - const byteLength = headByte - 0xa0; - object = this.decodeUtf8String(byteLength, 0); - } - } - else if (headByte === 0xc0) { - // nil - object = null; - } - else if (headByte === 0xc2) { - // false - object = false; - } - else if (headByte === 0xc3) { - // true - object = true; - } - else if (headByte === 0xca) { - // float 32 - object = this.readF32(); - } - else if (headByte === 0xcb) { - // float 64 - object = this.readF64(); - } - else if (headByte === 0xcc) { - // uint 8 - object = this.readU8(); - } - else if (headByte === 0xcd) { - // uint 16 - object = this.readU16(); - } - else if (headByte === 0xce) { - // uint 32 - object = this.readU32(); - } - else if (headByte === 0xcf) { - // uint 64 - object = this.readU64(); - } - else if (headByte === 0xd0) { - // int 8 - object = this.readI8(); - } - else if (headByte === 0xd1) { - // int 16 - object = this.readI16(); - } - else if (headByte === 0xd2) { - // int 32 - object = this.readI32(); - } - else if (headByte === 0xd3) { - // int 64 - object = this.readI64(); - } - else if (headByte === 0xd9) { - // str 8 - const byteLength = this.lookU8(); - object = this.decodeUtf8String(byteLength, 1); - } - else if (headByte === 0xda) { - // str 16 - const byteLength = this.lookU16(); - object = this.decodeUtf8String(byteLength, 2); - } - else if (headByte === 0xdb) { - // str 32 - const byteLength = this.lookU32(); - object = this.decodeUtf8String(byteLength, 4); - } - else if (headByte === 0xdc) { - // array 16 - const size = this.readU16(); - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } - else { - object = []; - } - } - else if (headByte === 0xdd) { - // array 32 - const size = this.readU32(); - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } - else { - object = []; - } - } - else if (headByte === 0xde) { - // map 16 - const size = this.readU16(); - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } - else { - object = {}; - } - } - else if (headByte === 0xdf) { - // map 32 - const size = this.readU32(); - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } - else { - object = {}; - } - } - else if (headByte === 0xc4) { - // bin 8 - const size = this.lookU8(); - object = this.decodeBinary(size, 1); - } - else if (headByte === 0xc5) { - // bin 16 - const size = this.lookU16(); - object = this.decodeBinary(size, 2); - } - else if (headByte === 0xc6) { - // bin 32 - const size = this.lookU32(); - object = this.decodeBinary(size, 4); - } - else if (headByte === 0xd4) { - // fixext 1 - object = this.decodeExtension(1, 0); - } - else if (headByte === 0xd5) { - // fixext 2 - object = this.decodeExtension(2, 0); - } - else if (headByte === 0xd6) { - // fixext 4 - object = this.decodeExtension(4, 0); - } - else if (headByte === 0xd7) { - // fixext 8 - object = this.decodeExtension(8, 0); - } - else if (headByte === 0xd8) { - // fixext 16 - object = this.decodeExtension(16, 0); - } - else if (headByte === 0xc7) { - // ext 8 - const size = this.lookU8(); - object = this.decodeExtension(size, 1); - } - else if (headByte === 0xc8) { - // ext 16 - const size = this.lookU16(); - object = this.decodeExtension(size, 2); - } - else if (headByte === 0xc9) { - // ext 32 - const size = this.lookU32(); - object = this.decodeExtension(size, 4); - } - else { - throw new DecodeError_1.DecodeError(`Unrecognized type byte: ${(0, prettyByte_1.prettyByte)(headByte)}`); - } - this.complete(); - const stack = this.stack; - while (stack.length > 0) { - // arrays and maps - const state = stack[stack.length - 1]; - if (state.type === 0 /* State.ARRAY */) { - state.array[state.position] = object; - state.position++; - if (state.position === state.size) { - stack.pop(); - object = state.array; - } - else { - continue DECODE; - } - } - else if (state.type === 1 /* State.MAP_KEY */) { - if (!isValidMapKeyType(object)) { - throw new DecodeError_1.DecodeError("The type of key must be string or number but " + typeof object); - } - if (object === "__proto__") { - throw new DecodeError_1.DecodeError("The key __proto__ is not allowed"); - } - state.key = object; - state.type = 2 /* State.MAP_VALUE */; - continue DECODE; - } - else { - // it must be `state.type === State.MAP_VALUE` here - state.map[state.key] = object; - state.readCount++; - if (state.readCount === state.size) { - stack.pop(); - object = state.map; - } - else { - state.key = null; - state.type = 1 /* State.MAP_KEY */; - continue DECODE; - } - } - } - return object; - } - } - readHeadByte() { - if (this.headByte === HEAD_BYTE_REQUIRED) { - this.headByte = this.readU8(); - // console.log("headByte", prettyByte(this.headByte)); - } - return this.headByte; - } - complete() { - this.headByte = HEAD_BYTE_REQUIRED; - } - readArraySize() { - const headByte = this.readHeadByte(); - switch (headByte) { - case 0xdc: - return this.readU16(); - case 0xdd: - return this.readU32(); - default: { - if (headByte < 0xa0) { - return headByte - 0x90; - } - else { - throw new DecodeError_1.DecodeError(`Unrecognized array type byte: ${(0, prettyByte_1.prettyByte)(headByte)}`); - } - } - } - } - pushMapState(size) { - if (size > this.maxMapLength) { - throw new DecodeError_1.DecodeError(`Max length exceeded: map length (${size}) > maxMapLengthLength (${this.maxMapLength})`); - } - this.stack.push({ - type: 1 /* State.MAP_KEY */, - size, - key: null, - readCount: 0, - map: {}, - }); - } - pushArrayState(size) { - if (size > this.maxArrayLength) { - throw new DecodeError_1.DecodeError(`Max length exceeded: array length (${size}) > maxArrayLength (${this.maxArrayLength})`); - } - this.stack.push({ - type: 0 /* State.ARRAY */, - size, - array: new Array(size), - position: 0, - }); - } - decodeUtf8String(byteLength, headerOffset) { - var _a; - if (byteLength > this.maxStrLength) { - throw new DecodeError_1.DecodeError(`Max length exceeded: UTF-8 byte length (${byteLength}) > maxStrLength (${this.maxStrLength})`); - } - if (this.bytes.byteLength < this.pos + headerOffset + byteLength) { - throw MORE_DATA; - } - const offset = this.pos + headerOffset; - let object; - if (this.stateIsMapKey() && ((_a = this.keyDecoder) === null || _a === void 0 ? void 0 : _a.canBeCached(byteLength))) { - object = this.keyDecoder.decode(this.bytes, offset, byteLength); - } - else if (byteLength > utf8_1.TEXT_DECODER_THRESHOLD) { - object = (0, utf8_1.utf8DecodeTD)(this.bytes, offset, byteLength); - } - else { - object = (0, utf8_1.utf8DecodeJs)(this.bytes, offset, byteLength); - } - this.pos += headerOffset + byteLength; - return object; - } - stateIsMapKey() { - if (this.stack.length > 0) { - const state = this.stack[this.stack.length - 1]; - return state.type === 1 /* State.MAP_KEY */; - } - return false; - } - decodeBinary(byteLength, headOffset) { - if (byteLength > this.maxBinLength) { - throw new DecodeError_1.DecodeError(`Max length exceeded: bin length (${byteLength}) > maxBinLength (${this.maxBinLength})`); - } - if (!this.hasRemaining(byteLength + headOffset)) { - throw MORE_DATA; - } - const offset = this.pos + headOffset; - const object = this.bytes.subarray(offset, offset + byteLength); - this.pos += headOffset + byteLength; - return object; - } - decodeExtension(size, headOffset) { - if (size > this.maxExtLength) { - throw new DecodeError_1.DecodeError(`Max length exceeded: ext length (${size}) > maxExtLength (${this.maxExtLength})`); - } - const extType = this.view.getInt8(this.pos + headOffset); - const data = this.decodeBinary(size, headOffset + 1 /* extType */); - return this.extensionCodec.decode(data, extType, this.context); - } - lookU8() { - return this.view.getUint8(this.pos); - } - lookU16() { - return this.view.getUint16(this.pos); - } - lookU32() { - return this.view.getUint32(this.pos); - } - readU8() { - const value = this.view.getUint8(this.pos); - this.pos++; - return value; - } - readI8() { - const value = this.view.getInt8(this.pos); - this.pos++; - return value; - } - readU16() { - const value = this.view.getUint16(this.pos); - this.pos += 2; - return value; - } - readI16() { - const value = this.view.getInt16(this.pos); - this.pos += 2; - return value; - } - readU32() { - const value = this.view.getUint32(this.pos); - this.pos += 4; - return value; - } - readI32() { - const value = this.view.getInt32(this.pos); - this.pos += 4; - return value; - } - readU64() { - const value = (0, int_1.getUint64)(this.view, this.pos); - this.pos += 8; - return value; - } - readI64() { - const value = (0, int_1.getInt64)(this.view, this.pos); - this.pos += 8; - return value; - } - readF32() { - const value = this.view.getFloat32(this.pos); - this.pos += 4; - return value; - } - readF64() { - const value = this.view.getFloat64(this.pos); - this.pos += 8; - return value; - } -} -exports.Decoder = Decoder; -//# sourceMappingURL=Decoder.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/Decoder.js.map b/node_modules/@msgpack/msgpack/dist/Decoder.js.map deleted file mode 100644 index 1a99774..0000000 --- a/node_modules/@msgpack/msgpack/dist/Decoder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Decoder.js","sourceRoot":"","sources":["../src/Decoder.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAChD,qDAAsE;AACtE,qCAA8D;AAC9D,uCAAkF;AAClF,qDAAuE;AACvE,yDAAkE;AAClE,+CAA4C;AAU5C,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AC;QAC5C,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,OAAO;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,OAAO;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AArjBD,0BAqjBC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/Encoder.d.ts b/node_modules/@msgpack/msgpack/dist/Encoder.d.ts deleted file mode 100644 index 5e5495c..0000000 --- a/node_modules/@msgpack/msgpack/dist/Encoder.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { ExtensionCodecType } from "./ExtensionCodec"; -export declare const DEFAULT_MAX_DEPTH = 100; -export declare const DEFAULT_INITIAL_BUFFER_SIZE = 2048; -export declare class Encoder { - private readonly extensionCodec; - private readonly context; - private readonly maxDepth; - private readonly initialBufferSize; - private readonly sortKeys; - private readonly forceFloat32; - private readonly ignoreUndefined; - private readonly forceIntegerToFloat; - private pos; - private view; - private bytes; - constructor(extensionCodec?: ExtensionCodecType, context?: ContextType, maxDepth?: number, initialBufferSize?: number, sortKeys?: boolean, forceFloat32?: boolean, ignoreUndefined?: boolean, forceIntegerToFloat?: boolean); - private reinitializeState; - /** - * This is almost equivalent to {@link Encoder#encode}, but it returns an reference of the encoder's internal buffer and thus much faster than {@link Encoder#encode}. - * - * @returns Encodes the object and returns a shared reference the encoder's internal buffer. - */ - encodeSharedRef(object: unknown): Uint8Array; - /** - * @returns Encodes the object and returns a copy of the encoder's internal buffer. - */ - encode(object: unknown): Uint8Array; - private doEncode; - private ensureBufferSizeToWrite; - private resizeBuffer; - private encodeNil; - private encodeBoolean; - private encodeNumber; - private writeStringHeader; - private encodeString; - private encodeObject; - private encodeBinary; - private encodeArray; - private countWithoutUndefined; - private encodeMap; - private encodeExtension; - private writeU8; - private writeU8a; - private writeI8; - private writeU16; - private writeI16; - private writeU32; - private writeI32; - private writeF32; - private writeF64; - private writeU64; - private writeI64; -} diff --git a/node_modules/@msgpack/msgpack/dist/Encoder.js b/node_modules/@msgpack/msgpack/dist/Encoder.js deleted file mode 100644 index 31279ef..0000000 --- a/node_modules/@msgpack/msgpack/dist/Encoder.js +++ /dev/null @@ -1,408 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Encoder = exports.DEFAULT_INITIAL_BUFFER_SIZE = exports.DEFAULT_MAX_DEPTH = void 0; -const utf8_1 = require("./utils/utf8"); -const ExtensionCodec_1 = require("./ExtensionCodec"); -const int_1 = require("./utils/int"); -const typedArrays_1 = require("./utils/typedArrays"); -exports.DEFAULT_MAX_DEPTH = 100; -exports.DEFAULT_INITIAL_BUFFER_SIZE = 2048; -class Encoder { - constructor(extensionCodec = ExtensionCodec_1.ExtensionCodec.defaultCodec, context = undefined, maxDepth = exports.DEFAULT_MAX_DEPTH, initialBufferSize = exports.DEFAULT_INITIAL_BUFFER_SIZE, sortKeys = false, forceFloat32 = false, ignoreUndefined = false, forceIntegerToFloat = false) { - this.extensionCodec = extensionCodec; - this.context = context; - this.maxDepth = maxDepth; - this.initialBufferSize = initialBufferSize; - this.sortKeys = sortKeys; - this.forceFloat32 = forceFloat32; - this.ignoreUndefined = ignoreUndefined; - this.forceIntegerToFloat = forceIntegerToFloat; - this.pos = 0; - this.view = new DataView(new ArrayBuffer(this.initialBufferSize)); - this.bytes = new Uint8Array(this.view.buffer); - } - reinitializeState() { - this.pos = 0; - } - /** - * This is almost equivalent to {@link Encoder#encode}, but it returns an reference of the encoder's internal buffer and thus much faster than {@link Encoder#encode}. - * - * @returns Encodes the object and returns a shared reference the encoder's internal buffer. - */ - encodeSharedRef(object) { - this.reinitializeState(); - this.doEncode(object, 1); - return this.bytes.subarray(0, this.pos); - } - /** - * @returns Encodes the object and returns a copy of the encoder's internal buffer. - */ - encode(object) { - this.reinitializeState(); - this.doEncode(object, 1); - return this.bytes.slice(0, this.pos); - } - doEncode(object, depth) { - if (depth > this.maxDepth) { - throw new Error(`Too deep objects in depth ${depth}`); - } - if (object == null) { - this.encodeNil(); - } - else if (typeof object === "boolean") { - this.encodeBoolean(object); - } - else if (typeof object === "number") { - this.encodeNumber(object); - } - else if (typeof object === "string") { - this.encodeString(object); - } - else { - this.encodeObject(object, depth); - } - } - ensureBufferSizeToWrite(sizeToWrite) { - const requiredSize = this.pos + sizeToWrite; - if (this.view.byteLength < requiredSize) { - this.resizeBuffer(requiredSize * 2); - } - } - resizeBuffer(newSize) { - const newBuffer = new ArrayBuffer(newSize); - const newBytes = new Uint8Array(newBuffer); - const newView = new DataView(newBuffer); - newBytes.set(this.bytes); - this.view = newView; - this.bytes = newBytes; - } - encodeNil() { - this.writeU8(0xc0); - } - encodeBoolean(object) { - if (object === false) { - this.writeU8(0xc2); - } - else { - this.writeU8(0xc3); - } - } - encodeNumber(object) { - if (Number.isSafeInteger(object) && !this.forceIntegerToFloat) { - if (object >= 0) { - if (object < 0x80) { - // positive fixint - this.writeU8(object); - } - else if (object < 0x100) { - // uint 8 - this.writeU8(0xcc); - this.writeU8(object); - } - else if (object < 0x10000) { - // uint 16 - this.writeU8(0xcd); - this.writeU16(object); - } - else if (object < 0x100000000) { - // uint 32 - this.writeU8(0xce); - this.writeU32(object); - } - else { - // uint 64 - this.writeU8(0xcf); - this.writeU64(object); - } - } - else { - if (object >= -0x20) { - // negative fixint - this.writeU8(0xe0 | (object + 0x20)); - } - else if (object >= -0x80) { - // int 8 - this.writeU8(0xd0); - this.writeI8(object); - } - else if (object >= -0x8000) { - // int 16 - this.writeU8(0xd1); - this.writeI16(object); - } - else if (object >= -0x80000000) { - // int 32 - this.writeU8(0xd2); - this.writeI32(object); - } - else { - // int 64 - this.writeU8(0xd3); - this.writeI64(object); - } - } - } - else { - // non-integer numbers - if (this.forceFloat32) { - // float 32 - this.writeU8(0xca); - this.writeF32(object); - } - else { - // float 64 - this.writeU8(0xcb); - this.writeF64(object); - } - } - } - writeStringHeader(byteLength) { - if (byteLength < 32) { - // fixstr - this.writeU8(0xa0 + byteLength); - } - else if (byteLength < 0x100) { - // str 8 - this.writeU8(0xd9); - this.writeU8(byteLength); - } - else if (byteLength < 0x10000) { - // str 16 - this.writeU8(0xda); - this.writeU16(byteLength); - } - else if (byteLength < 0x100000000) { - // str 32 - this.writeU8(0xdb); - this.writeU32(byteLength); - } - else { - throw new Error(`Too long string: ${byteLength} bytes in UTF-8`); - } - } - encodeString(object) { - const maxHeaderSize = 1 + 4; - const strLength = object.length; - if (strLength > utf8_1.TEXT_ENCODER_THRESHOLD) { - const byteLength = (0, utf8_1.utf8Count)(object); - this.ensureBufferSizeToWrite(maxHeaderSize + byteLength); - this.writeStringHeader(byteLength); - (0, utf8_1.utf8EncodeTE)(object, this.bytes, this.pos); - this.pos += byteLength; - } - else { - const byteLength = (0, utf8_1.utf8Count)(object); - this.ensureBufferSizeToWrite(maxHeaderSize + byteLength); - this.writeStringHeader(byteLength); - (0, utf8_1.utf8EncodeJs)(object, this.bytes, this.pos); - this.pos += byteLength; - } - } - encodeObject(object, depth) { - // try to encode objects with custom codec first of non-primitives - const ext = this.extensionCodec.tryToEncode(object, this.context); - if (ext != null) { - this.encodeExtension(ext); - } - else if (Array.isArray(object)) { - this.encodeArray(object, depth); - } - else if (ArrayBuffer.isView(object)) { - this.encodeBinary(object); - } - else if (typeof object === "object") { - this.encodeMap(object, depth); - } - else { - // symbol, function and other special object come here unless extensionCodec handles them. - throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(object)}`); - } - } - encodeBinary(object) { - const size = object.byteLength; - if (size < 0x100) { - // bin 8 - this.writeU8(0xc4); - this.writeU8(size); - } - else if (size < 0x10000) { - // bin 16 - this.writeU8(0xc5); - this.writeU16(size); - } - else if (size < 0x100000000) { - // bin 32 - this.writeU8(0xc6); - this.writeU32(size); - } - else { - throw new Error(`Too large binary: ${size}`); - } - const bytes = (0, typedArrays_1.ensureUint8Array)(object); - this.writeU8a(bytes); - } - encodeArray(object, depth) { - const size = object.length; - if (size < 16) { - // fixarray - this.writeU8(0x90 + size); - } - else if (size < 0x10000) { - // array 16 - this.writeU8(0xdc); - this.writeU16(size); - } - else if (size < 0x100000000) { - // array 32 - this.writeU8(0xdd); - this.writeU32(size); - } - else { - throw new Error(`Too large array: ${size}`); - } - for (const item of object) { - this.doEncode(item, depth + 1); - } - } - countWithoutUndefined(object, keys) { - let count = 0; - for (const key of keys) { - if (object[key] !== undefined) { - count++; - } - } - return count; - } - encodeMap(object, depth) { - const keys = Object.keys(object); - if (this.sortKeys) { - keys.sort(); - } - const size = this.ignoreUndefined ? this.countWithoutUndefined(object, keys) : keys.length; - if (size < 16) { - // fixmap - this.writeU8(0x80 + size); - } - else if (size < 0x10000) { - // map 16 - this.writeU8(0xde); - this.writeU16(size); - } - else if (size < 0x100000000) { - // map 32 - this.writeU8(0xdf); - this.writeU32(size); - } - else { - throw new Error(`Too large map object: ${size}`); - } - for (const key of keys) { - const value = object[key]; - if (!(this.ignoreUndefined && value === undefined)) { - this.encodeString(key); - this.doEncode(value, depth + 1); - } - } - } - encodeExtension(ext) { - const size = ext.data.length; - if (size === 1) { - // fixext 1 - this.writeU8(0xd4); - } - else if (size === 2) { - // fixext 2 - this.writeU8(0xd5); - } - else if (size === 4) { - // fixext 4 - this.writeU8(0xd6); - } - else if (size === 8) { - // fixext 8 - this.writeU8(0xd7); - } - else if (size === 16) { - // fixext 16 - this.writeU8(0xd8); - } - else if (size < 0x100) { - // ext 8 - this.writeU8(0xc7); - this.writeU8(size); - } - else if (size < 0x10000) { - // ext 16 - this.writeU8(0xc8); - this.writeU16(size); - } - else if (size < 0x100000000) { - // ext 32 - this.writeU8(0xc9); - this.writeU32(size); - } - else { - throw new Error(`Too large extension object: ${size}`); - } - this.writeI8(ext.type); - this.writeU8a(ext.data); - } - writeU8(value) { - this.ensureBufferSizeToWrite(1); - this.view.setUint8(this.pos, value); - this.pos++; - } - writeU8a(values) { - const size = values.length; - this.ensureBufferSizeToWrite(size); - this.bytes.set(values, this.pos); - this.pos += size; - } - writeI8(value) { - this.ensureBufferSizeToWrite(1); - this.view.setInt8(this.pos, value); - this.pos++; - } - writeU16(value) { - this.ensureBufferSizeToWrite(2); - this.view.setUint16(this.pos, value); - this.pos += 2; - } - writeI16(value) { - this.ensureBufferSizeToWrite(2); - this.view.setInt16(this.pos, value); - this.pos += 2; - } - writeU32(value) { - this.ensureBufferSizeToWrite(4); - this.view.setUint32(this.pos, value); - this.pos += 4; - } - writeI32(value) { - this.ensureBufferSizeToWrite(4); - this.view.setInt32(this.pos, value); - this.pos += 4; - } - writeF32(value) { - this.ensureBufferSizeToWrite(4); - this.view.setFloat32(this.pos, value); - this.pos += 4; - } - writeF64(value) { - this.ensureBufferSizeToWrite(8); - this.view.setFloat64(this.pos, value); - this.pos += 8; - } - writeU64(value) { - this.ensureBufferSizeToWrite(8); - (0, int_1.setUint64)(this.view, this.pos, value); - this.pos += 8; - } - writeI64(value) { - this.ensureBufferSizeToWrite(8); - (0, int_1.setInt64)(this.view, this.pos, value); - this.pos += 8; - } -} -exports.Encoder = Encoder; -//# sourceMappingURL=Encoder.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/Encoder.js.map b/node_modules/@msgpack/msgpack/dist/Encoder.js.map deleted file mode 100644 index 61e5f7d..0000000 --- a/node_modules/@msgpack/msgpack/dist/Encoder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Encoder.js","sourceRoot":"","sources":["../src/Encoder.ts"],"names":[],"mappings":";;;AAAA,uCAA6F;AAC7F,qDAAsE;AACtE,qCAAkD;AAClD,qDAAuD;AAG1C,QAAA,iB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Data.d.ts deleted file mode 100644 index 3014852..0000000 --- a/node_modules/@msgpack/msgpack/dist/ExtData.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * ExtData is used to handle Extension Types that are not registered to ExtensionCodec. - */ -export declare class ExtData { - readonly type: number; - readonly data: Uint8Array; - constructor(type: number, data: Uint8Array); -} diff --git a/node_modules/@msgpack/msgpack/dist/ExtData.js b/node_modules/@msgpack/msgpack/dist/ExtData.js deleted file mode 100644 index 7f9c147..0000000 --- a/node_modules/@msgpack/msgpack/dist/ExtData.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExtData = void 0; -/** - * ExtData is used to handle Extension Types that are not registered to ExtensionCodec. - */ -class ExtData { - constructor(type, data) { - this.type = type; - this.data = data; - } -} -exports.ExtData = ExtData; -//# sourceMappingURL=ExtData.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/ExtData.js.map b/node_modules/@msgpack/msgpack/dist/ExtData.js.map deleted file mode 100644 index 01fce18..0000000 --- a/node_modules/@msgpack/msgpack/dist/ExtData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ExtData.js","sourceRoot":"","sources":["../src/ExtData.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,OAAO;IAClB,YAAqB,IAAY,EAAW,IAAgB;QAAvC,SAAI,GAAJ,IAAI,CAAQ;QAAW,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;CACjE;AAFD,0BAEC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/ExtensionCodec.d.ts b/node_modules/@msgpack/msgpack/dist/ExtensionCodec.d.ts deleted file mode 100644 index 1362cb1..0000000 --- a/node_modules/@msgpack/msgpack/dist/ExtensionCodec.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ExtData } from "./ExtData"; -export declare type ExtensionDecoderType = (data: Uint8Array, extensionType: number, context: ContextType) => unknown; -export declare type ExtensionEncoderType = (input: unknown, context: ContextType) => Uint8Array | null; -export declare type ExtensionCodecType = { - __brand?: ContextType; - tryToEncode(object: unknown, context: ContextType): ExtData | null; - decode(data: Uint8Array, extType: number, context: ContextType): unknown; -}; -export declare class ExtensionCodec implements ExtensionCodecType { - static readonly defaultCodec: ExtensionCodecType; - __brand?: ContextType; - private readonly builtInEncoders; - private readonly builtInDecoders; - private readonly encoders; - private readonly decoders; - constructor(); - register({ type, encode, decode, }: { - type: number; - encode: ExtensionEncoderType; - decode: ExtensionDecoderType; - }): void; - tryToEncode(object: unknown, context: ContextType): ExtData | null; - decode(data: Uint8Array, type: number, context: ContextType): unknown; -} diff --git a/node_modules/@msgpack/msgpack/dist/ExtensionCodec.js b/node_modules/@msgpack/msgpack/dist/ExtensionCodec.js deleted file mode 100644 index 712a655..0000000 --- a/node_modules/@msgpack/msgpack/dist/ExtensionCodec.js +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -// ExtensionCodec to handle MessagePack extensions -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExtensionCodec = void 0; -const ExtData_1 = require("./ExtData"); -const timestamp_1 = require("./timestamp"); -class ExtensionCodec { - constructor() { - // built-in extensions - this.builtInEncoders = []; - this.builtInDecoders = []; - // custom extensions - this.encoders = []; - this.decoders = []; - this.register(timestamp_1.timestampExtension); - } - register({ type, encode, decode, }) { - if (type >= 0) { - // custom extensions - this.encoders[type] = encode; - this.decoders[type] = decode; - } - else { - // built-in extensions - const index = 1 + type; - this.builtInEncoders[index] = encode; - this.builtInDecoders[index] = decode; - } - } - tryToEncode(object, context) { - // built-in extensions - for (let i = 0; i < this.builtInEncoders.length; i++) { - const encodeExt = this.builtInEncoders[i]; - if (encodeExt != null) { - const data = encodeExt(object, context); - if (data != null) { - const type = -1 - i; - return new ExtData_1.ExtData(type, data); - } - } - } - // custom extensions - for (let i = 0; i < this.encoders.length; i++) { - const encodeExt = this.encoders[i]; - if (encodeExt != null) { - const data = encodeExt(object, context); - if (data != null) { - const type = i; - return new ExtData_1.ExtData(type, data); - } - } - } - if (object instanceof ExtData_1.ExtData) { - // to keep ExtData as is - return object; - } - return null; - } - decode(data, type, context) { - const decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type]; - if (decodeExt) { - return decodeExt(data, type, context); - } - else { - // decode() does not fail, returns ExtData instead. - return new ExtData_1.ExtData(type, data); - } - } -} -exports.ExtensionCodec = ExtensionCodec; -ExtensionCodec.defaultCodec = new ExtensionCodec(); -//# sourceMappingURL=ExtensionCodec.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/ExtensionCodec.js.map b/node_modules/@msgpack/msgpack/dist/ExtensionCodec.js.map deleted file mode 100644 index c6a47d9..0000000 --- a/node_modules/@msgpack/msgpack/dist/ExtensionCodec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ExtensionCodec.js","sourceRoot":"","sources":["../src/ExtensionCodec.ts"],"names":[],"mappings":";AAAA,kDAAkD;;;AAElD,uCAAoC;AACpC,2CAAiD;AAkBjD,MAAa,cAAc;IAgBzB;QARA,sBAAsB;QACL,oBAAe,GAAgE,EAAE,CAAC;QAClF,oBAAe,GAAgE,EAAE,CAAC;QAEnG,oBAAoB;QACH,aAAQ,GAAgE,EAAE,CAAC;QAC3E,aAAQ,GAAgE,EAAE,CAAC;QAG1F,IAAI,CAAC,QAAQ,CAAC,8BAAkB,CAAC,CAAC;IACpC,CAAC;IAEM,QAAQ,CAAC,EACd,IAAI,EACJ,MAAM,EACN,MAAM,GAKP;QACC,IAAI,IAAI,IAAI,CAAC,EAAE;YACb,oBAAoB;YACpB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;YAC7B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;SAC9B;aAAM;YACL,sBAAsB;YACtB,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC;YACvB,IAAI,CAAC,eAAe,CAAC,KAAK,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S,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnF,IAAI,SAAS,EAAE;YACb,OAAO,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;SACvC;aAAM;YACL,mDAAmD;YACnD,OAAO,IAAI,iBAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SAChC;IACH,CAAC;;AAjFH,wCAkFC;AAjFwB,2BAAY,GAAkC,IAAI,cAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/context.d.ts b/node_modules/@msgpack/msgpack/dist/context.d.ts deleted file mode 100644 index 6ecbbc3..0000000 --- a/node_modules/@msgpack/msgpack/dist/context.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export declare type SplitTypes = U extends T ? (Exclude extends never ? T : Exclude) : T; -export declare type SplitUndefined = SplitTypes; -export declare type ContextOf = ContextType extends undefined ? {} : { - /** - * Custom user-defined data, read/writable - */ - context: ContextType; -}; diff --git a/node_modules/@msgpack/msgpack/dist/context.js b/node_modules/@msgpack/msgpack/dist/context.js deleted file mode 100644 index 2c4ecb5..0000000 --- a/node_modules/@msgpack/msgpack/dist/context.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; -/* eslint-disable @typescript-eslint/ban-types */ -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=context.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/context.js.map b/node_modules/@msgpack/msgpack/dist/context.js.map deleted file mode 100644 index 1f3e412..0000000 --- a/node_modules/@msgpack/msgpack/dist/context.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";AAAA,iDAAiD"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/decode.d.ts b/node_modules/@msgpack/msgpack/dist/decode.d.ts deleted file mode 100644 index 003fe91..0000000 --- a/node_modules/@msgpack/msgpack/dist/decode.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import type { ExtensionCodecType } from "./ExtensionCodec"; -import type { ContextOf, SplitUndefined } from "./context"; -export declare type DecodeOptions = Readonly; - /** - * Maximum string length. - * - * Defaults to 4_294_967_295 (UINT32_MAX). - */ - maxStrLength: number; - /** - * Maximum binary length. - * - * Defaults to 4_294_967_295 (UINT32_MAX). - */ - maxBinLength: number; - /** - * Maximum array length. - * - * Defaults to 4_294_967_295 (UINT32_MAX). - */ - maxArrayLength: number; - /** - * Maximum map length. - * - * Defaults to 4_294_967_295 (UINT32_MAX). - */ - maxMapLength: number; - /** - * Maximum extension length. - * - * Defaults to 4_294_967_295 (UINT32_MAX). - */ - maxExtLength: number; -}>> & ContextOf; -export declare const defaultDecodeOptions: DecodeOptions; -/** - * It decodes a single MessagePack object in a buffer. - * - * This is a synchronous decoding function. - * See other variants for asynchronous decoding: {@link decodeAsync()}, {@link decodeStream()}, or {@link decodeArrayStream()}. - * - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -export declare function decode(buffer: ArrayLike | BufferSource, options?: DecodeOptions>): unknown; -/** - * It decodes multiple MessagePack objects in a buffer. - * This is corresponding to {@link decodeMultiStream()}. - * - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -export declare function decodeMulti(buffer: ArrayLike | BufferSource, options?: DecodeOptions>): Generator; diff --git a/node_modules/@msgpack/msgpack/dist/decode.js b/node_modules/@msgpack/msgpack/dist/decode.js deleted file mode 100644 index 5a7642f..0000000 --- a/node_modules/@msgpack/msgpack/dist/decode.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeMulti = exports.decode = exports.defaultDecodeOptions = void 0; -const Decoder_1 = require("./Decoder"); -exports.defaultDecodeOptions = {}; -/** - * It decodes a single MessagePack object in a buffer. - * - * This is a synchronous decoding function. - * See other variants for asynchronous decoding: {@link decodeAsync()}, {@link decodeStream()}, or {@link decodeArrayStream()}. - * - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -function decode(buffer, options = exports.defaultDecodeOptions) { - const decoder = new Decoder_1.Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decode(buffer); -} -exports.decode = decode; -/** - * It decodes multiple MessagePack objects in a buffer. - * This is corresponding to {@link decodeMultiStream()}. - * - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -function decodeMulti(buffer, options = exports.defaultDecodeOptions) { - const decoder = new Decoder_1.Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decodeMulti(buffer); -} -exports.decodeMulti = decodeMulti; -//# sourceMappingURL=decode.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/decode.js.map b/node_modules/@msgpack/msgpack/dist/decode.js.map deleted file mode 100644 index efe9d64..0000000 --- a/node_modules/@msgpack/msgpack/dist/decode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode.js","sourceRoot":"","sources":["../src/decode.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AA0CvB,QAAA,oBAAoB,GAAkB,EAAE,CAAC;AAEtD;;;;;;;;GAQG;AACH,SAAgB,MAAM,CACpB,MAAwC,EACxC,UAAsD,4BAA2B;IAEjF,MAAM,OAAO,GAAG,IAAI,iBAAO,CACzB,OAAO,CAAC,cAAc,EACrB,OAA6C,CAAC,OAAO,EACtD,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,CACrB,CAAC;IACF,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAdD,wBAcC;AAED;;;;;;GAMG;AACH,SAAgB,WAAW,CACzB,MAAwC,EACxC,UAAsD,4BAA2B;IAEjF,MAAM,OAAO,GAAG,IAAI,iBAAO,CACzB,OAAO,CAAC,cAAc,EACrB,OAA6C,CAAC,OAAO,EACtD,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,CACrB,CAAC;IACF,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAdD,kCAcC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/decodeAsync.d.ts b/node_modules/@msgpack/msgpack/dist/decodeAsync.d.ts deleted file mode 100644 index d8d9bfe..0000000 --- a/node_modules/@msgpack/msgpack/dist/decodeAsync.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ReadableStreamLike } from "./utils/stream"; -import type { DecodeOptions } from "./decode"; -import type { SplitUndefined } from "./context"; -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -export declare function decodeAsync(streamLike: ReadableStreamLike | BufferSource>, options?: DecodeOptions>): Promise; -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -export declare function decodeArrayStream(streamLike: ReadableStreamLike | BufferSource>, options?: DecodeOptions>): AsyncGenerator; -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -export declare function decodeMultiStream(streamLike: ReadableStreamLike | BufferSource>, options?: DecodeOptions>): AsyncGenerator; -/** - * @deprecated Use {@link decodeMultiStream()} instead. - */ -export declare function decodeStream(streamLike: ReadableStreamLike | BufferSource>, options?: DecodeOptions>): AsyncGenerator; diff --git a/node_modules/@msgpack/msgpack/dist/decodeAsync.js b/node_modules/@msgpack/msgpack/dist/decodeAsync.js deleted file mode 100644 index ed8edb0..0000000 --- a/node_modules/@msgpack/msgpack/dist/decodeAsync.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeStream = exports.decodeMultiStream = exports.decodeArrayStream = exports.decodeAsync = void 0; -const Decoder_1 = require("./Decoder"); -const stream_1 = require("./utils/stream"); -const decode_1 = require("./decode"); -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -async function decodeAsync(streamLike, options = decode_1.defaultDecodeOptions) { - const stream = (0, stream_1.ensureAsyncIterable)(streamLike); - const decoder = new Decoder_1.Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decodeAsync(stream); -} -exports.decodeAsync = decodeAsync; -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -function decodeArrayStream(streamLike, options = decode_1.defaultDecodeOptions) { - const stream = (0, stream_1.ensureAsyncIterable)(streamLike); - const decoder = new Decoder_1.Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decodeArrayStream(stream); -} -exports.decodeArrayStream = decodeArrayStream; -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -function decodeMultiStream(streamLike, options = decode_1.defaultDecodeOptions) { - const stream = (0, stream_1.ensureAsyncIterable)(streamLike); - const decoder = new Decoder_1.Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decodeStream(stream); -} -exports.decodeMultiStream = decodeMultiStream; -/** - * @deprecated Use {@link decodeMultiStream()} instead. - */ -function decodeStream(streamLike, options = decode_1.defaultDecodeOptions) { - return decodeMultiStream(streamLike, options); -} -exports.decodeStream = decodeStream; -//# sourceMappingURL=decodeAsync.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/decodeAsync.js.map b/node_modules/@msgpack/msgpack/dist/decodeAsync.js.map deleted file mode 100644 index 9afa186..0000000 --- a/node_modules/@msgpack/msgpack/dist/decodeAsync.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decodeAsync.js","sourceRoot":"","sources":["../src/decodeAsync.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AACpC,2CAAqD;AACrD,qCAAgD;AAKhD;;;GAGG;AACK,KAAK,UAAU,WAAW,CAChC,UAAgE,EAChE,UAAsD,6BAA2B;IAEjF,MAAM,MAAM,GAAG,IAAA,4BAAmB,EAAC,UAAU,CAAC,CAAC;IAE/C,MAAM,OAAO,GAAG,IAAI,iBAAO,CACzB,OAAO,CAAC,cAAc,EACrB,OAA6C,CAAC,OAAO,EACtD,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,CACrB,CAAC;IACF,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAhBA,kCAgBA;AAED;;;GAGG;AACF,SAAgB,iBAAiB,CAChC,UAAgE,EAChE,UAAsD,6BAA2B;IAEjF,MAAM,MAAM,GAAG,IAAA,4BAAmB,EAAC,UAAU,CAAC,CAAC;IAE/C,MAAM,OAAO,GAAG,IAAI,iBAAO,CACzB,OAAO,CAAC,cAAc,EACrB,OAA6C,CAAC,OAAO,EACtD,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,CACrB,CAAC;IAEF,OAAO,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC;AAjBA,8CAiBA;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAC/B,UAAgE,EAChE,UAAsD,6BAA2B;IAEjF,MAAM,MAAM,GAAG,IAAA,4BAAmB,EAAC,UAAU,CAAC,CAAC;IAE/C,MAAM,OAAO,GAAG,IAAI,iBAAO,CACzB,OAAO,CAAC,cAAc,EACrB,OAA6C,CAAC,OAAO,EACtD,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,YAAY,CACrB,CAAC;IAEF,OAAO,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAjBD,8CAiBC;AAED;;GAEG;AACH,SAAgB,YAAY,CAC1B,UAAgE,EAChE,UAAsD,6BAA2B;IAEjF,OAAO,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AALD,oCAKC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/encode.d.ts b/node_modules/@msgpack/msgpack/dist/encode.d.ts deleted file mode 100644 index e378207..0000000 --- a/node_modules/@msgpack/msgpack/dist/encode.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { ExtensionCodecType } from "./ExtensionCodec"; -import type { ContextOf, SplitUndefined } from "./context"; -export declare type EncodeOptions = Partial; - /** - * The maximum depth in nested objects and arrays. - * - * Defaults to 100. - */ - maxDepth: number; - /** - * The initial size of the internal buffer. - * - * Defaults to 2048. - */ - initialBufferSize: number; - /** - * If `true`, the keys of an object is sorted. In other words, the encoded - * binary is canonical and thus comparable to another encoded binary. - * - * Defaults to `false`. If enabled, it spends more time in encoding objects. - */ - sortKeys: boolean; - /** - * If `true`, non-integer numbers are encoded in float32, not in float64 (the default). - * - * Only use it if precisions don't matter. - * - * Defaults to `false`. - */ - forceFloat32: boolean; - /** - * If `true`, an object property with `undefined` value are ignored. - * e.g. `{ foo: undefined }` will be encoded as `{}`, as `JSON.stringify()` does. - * - * Defaults to `false`. If enabled, it spends more time in encoding objects. - */ - ignoreUndefined: boolean; - /** - * If `true`, integer numbers are encoded as floating point numbers, - * with the `forceFloat32` option taken into account. - * - * Defaults to `false`. - */ - forceIntegerToFloat: boolean; -}>> & ContextOf; -/** - * It encodes `value` in the MessagePack format and - * returns a byte buffer. - * - * The returned buffer is a slice of a larger `ArrayBuffer`, so you have to use its `#byteOffset` and `#byteLength` in order to convert it to another typed arrays including NodeJS `Buffer`. - */ -export declare function encode(value: unknown, options?: EncodeOptions>): Uint8Array; diff --git a/node_modules/@msgpack/msgpack/dist/encode.js b/node_modules/@msgpack/msgpack/dist/encode.js deleted file mode 100644 index 98ceb79..0000000 --- a/node_modules/@msgpack/msgpack/dist/encode.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encode = void 0; -const Encoder_1 = require("./Encoder"); -const defaultEncodeOptions = {}; -/** - * It encodes `value` in the MessagePack format and - * returns a byte buffer. - * - * The returned buffer is a slice of a larger `ArrayBuffer`, so you have to use its `#byteOffset` and `#byteLength` in order to convert it to another typed arrays including NodeJS `Buffer`. - */ -function encode(value, options = defaultEncodeOptions) { - const encoder = new Encoder_1.Encoder(options.extensionCodec, options.context, options.maxDepth, options.initialBufferSize, options.sortKeys, options.forceFloat32, options.ignoreUndefined, options.forceIntegerToFloat); - return encoder.encodeSharedRef(value); -} -exports.encode = encode; -//# sourceMappingURL=encode.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/encode.js.map b/node_modules/@msgpack/msgpack/dist/encode.js.map deleted file mode 100644 index 5d4382f..0000000 --- a/node_modules/@msgpack/msgpack/dist/encode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode.js","sourceRoot":"","sources":["../src/encode.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AAyDpC,MAAM,oBAAoB,GAAkB,EAAE,CAAC;AAE/C;;;;;GAKG;AACH,SAAgB,MAAM,CACpB,KAAc,EACd,UAAsD,oBAA2B;IAEjF,MAAM,OAAO,GAAG,IAAI,iBAAO,CACzB,OAAO,CAAC,cAAc,EACrB,OAA6C,CAAC,OAAO,EACtD,OAAO,CAAC,QAAQ,EAChB,OAAO,CAAC,iBAAiB,EACzB,OAAO,CAAC,QAAQ,EAChB,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,eAAe,EACvB,OAAO,CAAC,mBAAmB,CAC5B,CAAC;IACF,OAAO,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC;AAfD,wBAeC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/index.d.ts b/node_modules/@msgpack/msgpack/dist/index.d.ts deleted file mode 100644 index dd0f9ca..0000000 --- a/node_modules/@msgpack/msgpack/dist/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { encode } from "./encode"; -export { encode }; -import type { EncodeOptions } from "./encode"; -export type { EncodeOptions }; -import { decode, decodeMulti } from "./decode"; -export { decode, decodeMulti }; -import type { DecodeOptions } from "./decode"; -export { DecodeOptions }; -import { decodeAsync, decodeArrayStream, decodeMultiStream, decodeStream } from "./decodeAsync"; -export { decodeAsync, decodeArrayStream, decodeMultiStream, decodeStream }; -import { Decoder, DataViewIndexOutOfBoundsError } from "./Decoder"; -import { DecodeError } from "./DecodeError"; -export { Decoder, DecodeError, DataViewIndexOutOfBoundsError }; -import { Encoder } from "./Encoder"; -export { Encoder }; -import { ExtensionCodec } from "./ExtensionCodec"; -export { ExtensionCodec }; -import type { ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType } from "./ExtensionCodec"; -export type { ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType }; -import { ExtData } from "./ExtData"; -export { ExtData }; -import { EXT_TIMESTAMP, encodeDateToTimeSpec, encodeTimeSpecToTimestamp, decodeTimestampToTimeSpec, encodeTimestampExtension, decodeTimestampExtension } from "./timestamp"; -export { EXT_TIMESTAMP, encodeDateToTimeSpec, encodeTimeSpecToTimestamp, decodeTimestampToTimeSpec, encodeTimestampExtension, decodeTimestampExtension, }; diff --git a/node_modules/@msgpack/msgpack/dist/index.js b/node_modules/@msgpack/msgpack/dist/index.js deleted file mode 100644 index 4cde149..0000000 --- a/node_modules/@msgpack/msgpack/dist/index.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -// Main Functions: -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeTimestampExtension = exports.encodeTimestampExtension = exports.decodeTimestampToTimeSpec = exports.encodeTimeSpecToTimestamp = exports.encodeDateToTimeSpec = exports.EXT_TIMESTAMP = exports.ExtData = exports.ExtensionCodec = exports.Encoder = exports.DataViewIndexOutOfBoundsError = exports.DecodeError = exports.Decoder = exports.decodeStream = exports.decodeMultiStream = exports.decodeArrayStream = exports.decodeAsync = exports.decodeMulti = exports.decode = exports.encode = void 0; -const encode_1 = require("./encode"); -Object.defineProperty(exports, "encode", { enumerable: true, get: function () { return encode_1.encode; } }); -const decode_1 = require("./decode"); -Object.defineProperty(exports, "decode", { enumerable: true, get: function () { return decode_1.decode; } }); -Object.defineProperty(exports, "decodeMulti", { enumerable: true, get: function () { return decode_1.decodeMulti; } }); -const decodeAsync_1 = require("./decodeAsync"); -Object.defineProperty(exports, "decodeAsync", { enumerable: true, get: function () { return decodeAsync_1.decodeAsync; } }); -Object.defineProperty(exports, "decodeArrayStream", { enumerable: true, get: function () { return decodeAsync_1.decodeArrayStream; } }); -Object.defineProperty(exports, "decodeMultiStream", { enumerable: true, get: function () { return decodeAsync_1.decodeMultiStream; } }); -Object.defineProperty(exports, "decodeStream", { enumerable: true, get: function () { return decodeAsync_1.decodeStream; } }); -const Decoder_1 = require("./Decoder"); -Object.defineProperty(exports, "Decoder", { enumerable: true, get: function () { return Decoder_1.Decoder; } }); -Object.defineProperty(exports, "DataViewIndexOutOfBoundsError", { enumerable: true, get: function () { return Decoder_1.DataViewIndexOutOfBoundsError; } }); -const DecodeError_1 = require("./DecodeError"); -Object.defineProperty(exports, "DecodeError", { enumerable: true, get: function () { return DecodeError_1.DecodeError; } }); -const Encoder_1 = require("./Encoder"); -Object.defineProperty(exports, "Encoder", { enumerable: true, get: function () { return Encoder_1.Encoder; } }); -// Utilitiies for Extension Types: -const ExtensionCodec_1 = require("./ExtensionCodec"); -Object.defineProperty(exports, "ExtensionCodec", { enumerable: true, get: function () { return ExtensionCodec_1.ExtensionCodec; } }); -const ExtData_1 = require("./ExtData"); -Object.defineProperty(exports, "ExtData", { enumerable: true, get: function () { return ExtData_1.ExtData; } }); -const timestamp_1 = require("./timestamp"); -Object.defineProperty(exports, "EXT_TIMESTAMP", { enumerable: true, get: function () { return timestamp_1.EXT_TIMESTAMP; } }); -Object.defineProperty(exports, "encodeDateToTimeSpec", { enumerable: true, get: function () { return timestamp_1.encodeDateToTimeSpec; } }); -Object.defineProperty(exports, "encodeTimeSpecToTimestamp", { enumerable: true, get: function () { return timestamp_1.encodeTimeSpecToTimestamp; } }); -Object.defineProperty(exports, "decodeTimestampToTimeSpec", { enumerable: true, get: function () { return timestamp_1.decodeTimestampToTimeSpec; } }); -Object.defineProperty(exports, "encodeTimestampExtension", { enumerable: true, get: function () { return timestamp_1.encodeTimestampExtension; } }); -Object.defineProperty(exports, "decodeTimestampExtension", { enumerable: true, get: function () { return timestamp_1.decodeTimestampExtension; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/index.js.map b/node_modules/@msgpack/msgpack/dist/index.js.map deleted file mode 100644 index 9571089..0000000 --- a/node_modules/@msgpack/msgpack/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAElB,qCAAkC;AACzB,uFADA,eAAM,OACA;AAIf,qCAA+C;AACtC,uFADA,eAAM,OACA;AAAE,4FADA,oBAAW,OACA;AAI5B,+CAAgG;AACvF,4FADA,yBAAW,OACA;AAAE,kGADA,+BAAiB,OACA;AAAE,kGADA,+BAAiB,OACA;AAAE,6FADA,0BAAY,OACA;AAExE,uCAAmE;AAE1D,wFAFA,iBAAO,OAEA;AAAe,8GAFb,uCAA6B,OAEa;AAD5D,+CAA4C;AAC1B,4FADT,yBAAW,OACS;AAE7B,uCAAoC;AAC3B,wFADA,iBAAO,OACA;AAEhB,kCAAkC;AAElC,qDAAkD;AACzC,+FADA,+BAAc,OACA;AAGvB,uCAAoC;AAC3B,wFADA,iBAAO,OACA;AAEhB,2CAOqB;AAEnB,8FARA,yBAAa,OAQA;AACb,qGARA,gCAAoB,OAQA;AACpB,0GARA,qCAAyB,OAQA;AACzB,0GARA,qCAAyB,OAQA;AACzB,yGARA,oCAAwB,OAQA;AACxB,yGARA,oCAAwB,OAQA"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/timestamp.d.ts b/node_modules/@msgpack/msgpack/dist/timestamp.d.ts deleted file mode 100644 index 2ea55a4..0000000 --- a/node_modules/@msgpack/msgpack/dist/timestamp.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export declare const EXT_TIMESTAMP = -1; -export declare type TimeSpec = { - sec: number; - nsec: number; -}; -export declare function encodeTimeSpecToTimestamp({ sec, nsec }: TimeSpec): Uint8Array; -export declare function encodeDateToTimeSpec(date: Date): TimeSpec; -export declare function encodeTimestampExtension(object: unknown): Uint8Array | null; -export declare function decodeTimestampToTimeSpec(data: Uint8Array): TimeSpec; -export declare function decodeTimestampExtension(data: Uint8Array): Date; -export declare const timestampExtension: { - type: number; - encode: typeof encodeTimestampExtension; - decode: typeof decodeTimestampExtension; -}; diff --git a/node_modules/@msgpack/msgpack/dist/timestamp.js b/node_modules/@msgpack/msgpack/dist/timestamp.js deleted file mode 100644 index 4049225..0000000 --- a/node_modules/@msgpack/msgpack/dist/timestamp.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.timestampExtension = exports.decodeTimestampExtension = exports.decodeTimestampToTimeSpec = exports.encodeTimestampExtension = exports.encodeDateToTimeSpec = exports.encodeTimeSpecToTimestamp = exports.EXT_TIMESTAMP = void 0; -// https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type -const DecodeError_1 = require("./DecodeError"); -const int_1 = require("./utils/int"); -exports.EXT_TIMESTAMP = -1; -const TIMESTAMP32_MAX_SEC = 0x100000000 - 1; // 32-bit unsigned int -const TIMESTAMP64_MAX_SEC = 0x400000000 - 1; // 34-bit unsigned int -function encodeTimeSpecToTimestamp({ sec, nsec }) { - if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) { - // Here sec >= 0 && nsec >= 0 - if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) { - // timestamp 32 = { sec32 (unsigned) } - const rv = new Uint8Array(4); - const view = new DataView(rv.buffer); - view.setUint32(0, sec); - return rv; - } - else { - // timestamp 64 = { nsec30 (unsigned), sec34 (unsigned) } - const secHigh = sec / 0x100000000; - const secLow = sec & 0xffffffff; - const rv = new Uint8Array(8); - const view = new DataView(rv.buffer); - // nsec30 | secHigh2 - view.setUint32(0, (nsec << 2) | (secHigh & 0x3)); - // secLow32 - view.setUint32(4, secLow); - return rv; - } - } - else { - // timestamp 96 = { nsec32 (unsigned), sec64 (signed) } - const rv = new Uint8Array(12); - const view = new DataView(rv.buffer); - view.setUint32(0, nsec); - (0, int_1.setInt64)(view, 4, sec); - return rv; - } -} -exports.encodeTimeSpecToTimestamp = encodeTimeSpecToTimestamp; -function encodeDateToTimeSpec(date) { - const msec = date.getTime(); - const sec = Math.floor(msec / 1e3); - const nsec = (msec - sec * 1e3) * 1e6; - // Normalizes { sec, nsec } to ensure nsec is unsigned. - const nsecInSec = Math.floor(nsec / 1e9); - return { - sec: sec + nsecInSec, - nsec: nsec - nsecInSec * 1e9, - }; -} -exports.encodeDateToTimeSpec = encodeDateToTimeSpec; -function encodeTimestampExtension(object) { - if (object instanceof Date) { - const timeSpec = encodeDateToTimeSpec(object); - return encodeTimeSpecToTimestamp(timeSpec); - } - else { - return null; - } -} -exports.encodeTimestampExtension = encodeTimestampExtension; -function decodeTimestampToTimeSpec(data) { - const view = new DataView(data.buffer, data.byteOffset, data.byteLength); - // data may be 32, 64, or 96 bits - switch (data.byteLength) { - case 4: { - // timestamp 32 = { sec32 } - const sec = view.getUint32(0); - const nsec = 0; - return { sec, nsec }; - } - case 8: { - // timestamp 64 = { nsec30, sec34 } - const nsec30AndSecHigh2 = view.getUint32(0); - const secLow32 = view.getUint32(4); - const sec = (nsec30AndSecHigh2 & 0x3) * 0x100000000 + secLow32; - const nsec = nsec30AndSecHigh2 >>> 2; - return { sec, nsec }; - } - case 12: { - // timestamp 96 = { nsec32 (unsigned), sec64 (signed) } - const sec = (0, int_1.getInt64)(view, 4); - const nsec = view.getUint32(0); - return { sec, nsec }; - } - default: - throw new DecodeError_1.DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${data.length}`); - } -} -exports.decodeTimestampToTimeSpec = decodeTimestampToTimeSpec; -function decodeTimestampExtension(data) { - const timeSpec = decodeTimestampToTimeSpec(data); - return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6); -} -exports.decodeTimestampExtension = decodeTimestampExtension; -exports.timestampExtension = { - type: exports.EXT_TIMESTAMP, - encode: encodeTimestampExtension, - decode: decodeTimestampExtension, -}; -//# sourceMappingURL=timestamp.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/timestamp.js.map b/node_modules/@msgpack/msgpack/dist/timestamp.js.map deleted file mode 100644 index 7712628..0000000 --- a/node_modules/@msgpack/msgpack/dist/timestamp.js.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A,kBAAkB,GAAG;IAChC,IAAI,EAAE,qBAAa;IACnB,MAAM,EAAE,wBAAwB;IAChC,MAAM,EAAE,wBAAwB;CACjC,CAAC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/utils/int.d.ts b/node_modules/@msgpack/msgpack/dist/utils/int.d.ts deleted file mode 100644 index f86c13d..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/int.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const UINT32_MAX = 4294967295; -export declare function setUint64(view: DataView, offset: number, value: number): void; -export declare function setInt64(view: DataView, offset: number, value: number): void; -export declare function getInt64(view: DataView, offset: number): number; -export declare function getUint64(view: DataView, offset: number): number; diff --git a/node_modules/@msgpack/msgpack/dist/utils/int.js b/node_modules/@msgpack/msgpack/dist/utils/int.js deleted file mode 100644 index 1d76f7b..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/int.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -// Integer Utility -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getUint64 = exports.getInt64 = exports.setInt64 = exports.setUint64 = exports.UINT32_MAX = void 0; -exports.UINT32_MAX = 4294967295; -// DataView extension to handle int64 / uint64, -// where the actual range is 53-bits integer (a.k.a. safe integer) -function setUint64(view, offset, value) { - const high = value / 4294967296; - const low = value; // high bits are truncated by DataView - view.setUint32(offset, high); - view.setUint32(offset + 4, low); -} -exports.setUint64 = setUint64; -function setInt64(view, offset, value) { - const high = Math.floor(value / 4294967296); - const low = value; // high bits are truncated by DataView - view.setUint32(offset, high); - view.setUint32(offset + 4, low); -} -exports.setInt64 = setInt64; -function getInt64(view, offset) { - const high = view.getInt32(offset); - const low = view.getUint32(offset + 4); - return high * 4294967296 + low; -} -exports.getInt64 = getInt64; -function getUint64(view, offset) { - const high = view.getUint32(offset); - const low = view.getUint32(offset + 4); - return high * 4294967296 + low; -} -exports.getUint64 = getUint64; -//# sourceMappingURL=int.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/utils/int.js.map b/node_modules/@msgpack/msgpack/dist/utils/int.js.map deleted file mode 100644 index cffbaff..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/int.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"int.js","sourceRoot":"","sources":["../../src/utils/int.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAEL,QAAA,UAAU,GAAG,UAAW,CAAC;AAEtC,+CAA+C;AAC/C,kEAAkE;AAElE,SAAgB,SAAS,CAAC,IAAc,EAAE,MAAc,EAAE,KAAa;IACrE,MAAM,IAAI,GAAG,KAAK,GAAG,UAAa,CAAC;IACnC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,sCAAsC;IACzD,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC;AALD,8BAKC;AAED,SAAgB,QAAQ,CAAC,IAAc,EAAE,MAAc,EAAE,KAAa;IACpE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAa,CAAC,CAAC;IAC/C,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,sCAAsC;IACzD,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC;AALD,4BAKC;AAED,SAAgB,QAAQ,CAAC,IAAc,EAAE,MAAc;IACrD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACvC,OAAO,IAAI,GAAG,UAAa,GAAG,GAAG,CAAC;AACpC,CAAC;AAJD,4BAIC;AAED,SAAgB,SAAS,CAAC,IAAc,EAAE,MAAc;IACtD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACvC,OAAO,IAAI,GAAG,UAAa,GAAG,GAAG,CAAC;AACpC,CAAC;AAJD,8BAIC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/utils/prettyByte.d.ts b/node_modules/@msgpack/msgpack/dist/utils/prettyByte.d.ts deleted file mode 100644 index 6d67d28..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/prettyByte.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function prettyByte(byte: number): string; diff --git a/node_modules/@msgpack/msgpack/dist/utils/prettyByte.js b/node_modules/@msgpack/msgpack/dist/utils/prettyByte.js deleted file mode 100644 index 2cf7378..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/prettyByte.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.prettyByte = void 0; -function prettyByte(byte) { - return `${byte < 0 ? "-" : ""}0x${Math.abs(byte).toString(16).padStart(2, "0")}`; -} -exports.prettyByte = prettyByte; -//# sourceMappingURL=prettyByte.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/utils/prettyByte.js.map b/node_modules/@msgpack/msgpack/dist/utils/prettyByte.js.map deleted file mode 100644 index 0f6f0a2..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/prettyByte.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"prettyByte.js","sourceRoot":"","sources":["../../src/utils/prettyByte.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,IAAY;IACrC,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AACnF,CAAC;AAFD,gCAEC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/utils/stream.d.ts b/node_modules/@msgpack/msgpack/dist/utils/stream.d.ts deleted file mode 100644 index d498220..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/stream.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare type ReadableStreamLike = AsyncIterable | ReadableStream; -export declare function isAsyncIterable(object: ReadableStreamLike): object is AsyncIterable; -export declare function asyncIterableFromStream(stream: ReadableStream): AsyncIterable; -export declare function ensureAsyncIterable(streamLike: ReadableStreamLike): AsyncIterable; diff --git a/node_modules/@msgpack/msgpack/dist/utils/stream.js b/node_modules/@msgpack/msgpack/dist/utils/stream.js deleted file mode 100644 index 94014a0..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/stream.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -// utility for whatwg streams -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ensureAsyncIterable = exports.asyncIterableFromStream = exports.isAsyncIterable = void 0; -function isAsyncIterable(object) { - return object[Symbol.asyncIterator] != null; -} -exports.isAsyncIterable = isAsyncIterable; -function assertNonNull(value) { - if (value == null) { - throw new Error("Assertion Failure: value must not be null nor undefined"); - } -} -async function* asyncIterableFromStream(stream) { - const reader = stream.getReader(); - try { - while (true) { - const { done, value } = await reader.read(); - if (done) { - return; - } - assertNonNull(value); - yield value; - } - } - finally { - reader.releaseLock(); - } -} -exports.asyncIterableFromStream = asyncIterableFromStream; -function ensureAsyncIterable(streamLike) { - if (isAsyncIterable(streamLike)) { - return streamLike; - } - else { - return asyncIterableFromStream(streamLike); - } -} -exports.ensureAsyncIterable = ensureAsyncIterable; -//# sourceMappingURL=stream.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/utils/stream.js.map b/node_modules/@msgpack/msgpack/dist/utils/stream.js.map deleted file mode 100644 index 61d13ca..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/stream.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/utils/stream.ts"],"names":[],"mappings":";AAAA,6BAA6B;;;AAQ7B,SAAgB,eAAe,CAAI,MAA6B;IAC9D,OAAQ,MAAc,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC;AACvD,CAAC;AAFD,0CAEC;AAED,SAAS,aAAa,CAAI,KAA2B;IACnD,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;KAC5E;AACH,CAAC;AAEM,KAAK,SAAS,CAAC,CAAC,uBAAuB,CAAI,MAAyB;IACzE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;IAElC,IAAI;QACF,OAAO,IAAI,EAAE;YACX,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YAC5C,IAAI,IAAI,EAAE;gBACR,OAAO;aACR;YACD,aAAa,CAAC,KAAK,CAAC,CAAC;YACrB,MAAM,KAAK,CAAC;SACb;KACF;YAAS;QACR,MAAM,CAAC,WAAW,EAAE,CAAC;KACtB;AACH,CAAC;AAfD,0DAeC;AAED,SAAgB,mBAAmB,CAAI,UAAiC;IACtE,IAAI,eAAe,CAAC,UAAU,CAAC,EAAE;QAC/B,OAAO,UAAU,CAAC;KACnB;SAAM;QACL,OAAO,uBAAuB,CAAC,UAAU,CAAC,CAAC;KAC5C;AACH,CAAC;AAND,kDAMC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/utils/typedArrays.d.ts b/node_modules/@msgpack/msgpack/dist/utils/typedArrays.d.ts deleted file mode 100644 index 8099733..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/typedArrays.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function ensureUint8Array(buffer: ArrayLike | Uint8Array | ArrayBufferView | ArrayBuffer): Uint8Array; -export declare function createDataView(buffer: ArrayLike | ArrayBufferView | ArrayBuffer): DataView; diff --git a/node_modules/@msgpack/msgpack/dist/utils/typedArrays.js b/node_modules/@msgpack/msgpack/dist/utils/typedArrays.js deleted file mode 100644 index 4db1b89..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/typedArrays.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createDataView = exports.ensureUint8Array = void 0; -function ensureUint8Array(buffer) { - if (buffer instanceof Uint8Array) { - return buffer; - } - else if (ArrayBuffer.isView(buffer)) { - return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); - } - else if (buffer instanceof ArrayBuffer) { - return new Uint8Array(buffer); - } - else { - // ArrayLike - return Uint8Array.from(buffer); - } -} -exports.ensureUint8Array = ensureUint8Array; -function createDataView(buffer) { - if (buffer instanceof ArrayBuffer) { - return new DataView(buffer); - } - const bufferView = ensureUint8Array(buffer); - return new DataView(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength); -} -exports.createDataView = createDataView; -//# sourceMappingURL=typedArrays.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/utils/typedArrays.js.map b/node_modules/@msgpack/msgpack/dist/utils/typedArrays.js.map deleted file mode 100644 index 8b5cac3..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/typedArrays.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typedArrays.js","sourceRoot":"","sources":["../../src/utils/typedArrays.ts"],"names":[],"mappings":";;;AAAA,SAAgB,gBAAgB,CAAC,MAAsE;IACrG,IAAI,MAAM,YAAY,UAAU,EAAE;QAChC,OAAO,MAAM,CAAC;KACf;SAAM,IAAI,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;QACrC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;KAC5E;SAAM,IAAI,MAAM,YAAY,WAAW,EAAE;QACxC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;KAC/B;SAAM;QACL,oBAAoB;QACpB,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAChC;AACH,CAAC;AAXD,4CAWC;AAED,SAAgB,cAAc,CAAC,MAAyD;IACtF,IAAI,MAAM,YAAY,WAAW,EAAE;QACjC,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC7B;IAED,MAAM,UAAU,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;AACvF,CAAC;AAPD,wCAOC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/utils/utf8.d.ts b/node_modules/@msgpack/msgpack/dist/utils/utf8.d.ts deleted file mode 100644 index 84f4532..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/utf8.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export declare function utf8Count(str: string): number; -export declare function utf8EncodeJs(str: string, output: Uint8Array, outputOffset: number): void; -export declare const TEXT_ENCODER_THRESHOLD: number; -declare function utf8EncodeTEencodeInto(str: string, output: Uint8Array, outputOffset: number): void; -export declare const utf8EncodeTE: typeof utf8EncodeTEencodeInto; -export declare function utf8DecodeJs(bytes: Uint8Array, inputOffset: number, byteLength: number): string; -export declare const TEXT_DECODER_THRESHOLD: number; -export declare function utf8DecodeTD(bytes: Uint8Array, inputOffset: number, byteLength: number): string; -export {}; diff --git a/node_modules/@msgpack/msgpack/dist/utils/utf8.js b/node_modules/@msgpack/msgpack/dist/utils/utf8.js deleted file mode 100644 index 555c14c..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/utf8.js +++ /dev/null @@ -1,167 +0,0 @@ -"use strict"; -var _a, _b, _c; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.utf8DecodeTD = exports.TEXT_DECODER_THRESHOLD = exports.utf8DecodeJs = exports.utf8EncodeTE = exports.TEXT_ENCODER_THRESHOLD = exports.utf8EncodeJs = exports.utf8Count = void 0; -/* eslint-disable @typescript-eslint/no-unnecessary-condition */ -const int_1 = require("./int"); -const TEXT_ENCODING_AVAILABLE = (typeof process === "undefined" || ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a["TEXT_ENCODING"]) !== "never") && - typeof TextEncoder !== "undefined" && - typeof TextDecoder !== "undefined"; -function utf8Count(str) { - const strLength = str.length; - let byteLength = 0; - let pos = 0; - while (pos < strLength) { - let value = str.charCodeAt(pos++); - if ((value & 0xffffff80) === 0) { - // 1-byte - byteLength++; - continue; - } - else if ((value & 0xfffff800) === 0) { - // 2-bytes - byteLength += 2; - } - else { - // handle surrogate pair - if (value >= 0xd800 && value <= 0xdbff) { - // high surrogate - if (pos < strLength) { - const extra = str.charCodeAt(pos); - if ((extra & 0xfc00) === 0xdc00) { - ++pos; - value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000; - } - } - } - if ((value & 0xffff0000) === 0) { - // 3-byte - byteLength += 3; - } - else { - // 4-byte - byteLength += 4; - } - } - } - return byteLength; -} -exports.utf8Count = utf8Count; -function utf8EncodeJs(str, output, outputOffset) { - const strLength = str.length; - let offset = outputOffset; - let pos = 0; - while (pos < strLength) { - let value = str.charCodeAt(pos++); - if ((value & 0xffffff80) === 0) { - // 1-byte - output[offset++] = value; - continue; - } - else if ((value & 0xfffff800) === 0) { - // 2-bytes - output[offset++] = ((value >> 6) & 0x1f) | 0xc0; - } - else { - // handle surrogate pair - if (value >= 0xd800 && value <= 0xdbff) { - // high surrogate - if (pos < strLength) { - const extra = str.charCodeAt(pos); - if ((extra & 0xfc00) === 0xdc00) { - ++pos; - value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000; - } - } - } - if ((value & 0xffff0000) === 0) { - // 3-byte - output[offset++] = ((value >> 12) & 0x0f) | 0xe0; - output[offset++] = ((value >> 6) & 0x3f) | 0x80; - } - else { - // 4-byte - output[offset++] = ((value >> 18) & 0x07) | 0xf0; - output[offset++] = ((value >> 12) & 0x3f) | 0x80; - output[offset++] = ((value >> 6) & 0x3f) | 0x80; - } - } - output[offset++] = (value & 0x3f) | 0x80; - } -} -exports.utf8EncodeJs = utf8EncodeJs; -const sharedTextEncoder = TEXT_ENCODING_AVAILABLE ? new TextEncoder() : undefined; -exports.TEXT_ENCODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE - ? int_1.UINT32_MAX - : typeof process !== "undefined" && ((_b = process === null || process === void 0 ? void 0 : process.env) === null || _b === void 0 ? void 0 : _b["TEXT_ENCODING"]) !== "force" - ? 200 - : 0; -function utf8EncodeTEencode(str, output, outputOffset) { - output.set(sharedTextEncoder.encode(str), outputOffset); -} -function utf8EncodeTEencodeInto(str, output, outputOffset) { - sharedTextEncoder.encodeInto(str, output.subarray(outputOffset)); -} -exports.utf8EncodeTE = (sharedTextEncoder === null || sharedTextEncoder === void 0 ? void 0 : sharedTextEncoder.encodeInto) ? utf8EncodeTEencodeInto : utf8EncodeTEencode; -const CHUNK_SIZE = 4096; -function utf8DecodeJs(bytes, inputOffset, byteLength) { - let offset = inputOffset; - const end = offset + byteLength; - const units = []; - let result = ""; - while (offset < end) { - const byte1 = bytes[offset++]; - if ((byte1 & 0x80) === 0) { - // 1 byte - units.push(byte1); - } - else if ((byte1 & 0xe0) === 0xc0) { - // 2 bytes - const byte2 = bytes[offset++] & 0x3f; - units.push(((byte1 & 0x1f) << 6) | byte2); - } - else if ((byte1 & 0xf0) === 0xe0) { - // 3 bytes - const byte2 = bytes[offset++] & 0x3f; - const byte3 = bytes[offset++] & 0x3f; - units.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3); - } - else if ((byte1 & 0xf8) === 0xf0) { - // 4 bytes - const byte2 = bytes[offset++] & 0x3f; - const byte3 = bytes[offset++] & 0x3f; - const byte4 = bytes[offset++] & 0x3f; - let unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4; - if (unit > 0xffff) { - unit -= 0x10000; - units.push(((unit >>> 10) & 0x3ff) | 0xd800); - unit = 0xdc00 | (unit & 0x3ff); - } - units.push(unit); - } - else { - units.push(byte1); - } - if (units.length >= CHUNK_SIZE) { - result += String.fromCharCode(...units); - units.length = 0; - } - } - if (units.length > 0) { - result += String.fromCharCode(...units); - } - return result; -} -exports.utf8DecodeJs = utf8DecodeJs; -const sharedTextDecoder = TEXT_ENCODING_AVAILABLE ? new TextDecoder() : null; -exports.TEXT_DECODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE - ? int_1.UINT32_MAX - : typeof process !== "undefined" && ((_c = process === null || process === void 0 ? void 0 : process.env) === null || _c === void 0 ? void 0 : _c["TEXT_DECODER"]) !== "force" - ? 200 - : 0; -function utf8DecodeTD(bytes, inputOffset, byteLength) { - const stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength); - return sharedTextDecoder.decode(stringBytes); -} -exports.utf8DecodeTD = utf8DecodeTD; -//# sourceMappingURL=utf8.js.map \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/dist/utils/utf8.js.map b/node_modules/@msgpack/msgpack/dist/utils/utf8.js.map deleted file mode 100644 index 12e295e..0000000 --- a/node_modules/@msgpack/msgpack/dist/utils/utf8.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utf8.js","sourceRoot":"","sources":["../../src/utils/utf8.ts"],"names":[],"mappings":";;;;AAAA,gEAAgE;AAChE,+BAAmC;AAEnC,MAAM,uBAAuB,GAC3B,CAAC,OAAO,OAAO,KAAK,WAAW,IAAI,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,0CAAG,eAAe,CAAC,MAAK,OAAO,CAAC;IA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AM,iBAAiB,GAAG,uBAAuB,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAChE,QAAA,sBAAsB,GAAG,CAAC,uBAAuB;IAC5D,CAAC,CAAC,gBAAU;IACZ,CAAC,CAAC,OAAO,OAAO,KAAK,WAAW,IAAI,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,0CAAG,cAAc,CAAC,MAAK,OAAO;QAC9E,CAAC,CAAC,GAAG;QACL,CAAC,CAAC,CAAC,CAAC;AAEN,SAAgB,YAAY,CAAC,KAAiB,EAAE,WAAmB,EAAE,UAAkB;IACrF,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;IAC1E,OAAO,iBAAkB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAChD,CAAC;AAHD,oCAGC"} \ No newline at end of file diff --git a/node_modules/@msgpack/msgpack/mod.ts b/node_modules/@msgpack/msgpack/mod.ts deleted file mode 100644 index 47fe56b..0000000 --- a/node_modules/@msgpack/msgpack/mod.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./dist.es5+esm/index.mjs"; diff --git a/node_modules/@msgpack/msgpack/package.json b/node_modules/@msgpack/msgpack/package.json deleted file mode 100644 index ec6eaa9..0000000 --- a/node_modules/@msgpack/msgpack/package.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "name": "@msgpack/msgpack", - "version": "2.8.0", - "description": "MessagePack for ECMA-262/JavaScript/TypeScript", - "author": "The MessagePack community", - "license": "ISC", - "main": "./dist/index.js", - "module": "./dist.es5+esm/index.mjs", - "cdn": "./dist.es5+umd/msgpack.min.js", - "unpkg": "./dist.es5+umd/msgpack.min.js", - "types": "./dist/index.d.ts", - "sideEffects": false, - "scripts": { - "build": "npm publish --dry-run", - "prepare": "npm run clean && webpack --bail && tsc --build tsconfig.dist.json tsconfig.dist.es5+esm.json && ts-node tools/esmify.ts dist.es5+esm/*.js dist.es5+esm/*/*.js", - "prepublishOnly": "run-p 'test:dist:*' && npm run test:browser", - "clean": "rimraf build dist dist.*", - "test": "mocha 'test/**/*.test.ts'", - "test:purejs": "TEXT_ENCODING=never mocha 'test/**/*.test.ts'", - "test:te": "TEXT_ENCODING=force mocha 'test/**/*.test.ts'", - "test:dist:purejs": "TS_NODE_PROJECT=tsconfig.test-dist-es5-purejs.json npm run test:purejs -- --reporter=dot", - "test:cover": "npm run cover:clean && npm-run-all 'test:cover:*' && npm run cover:report", - "test:cover:purejs": "npx nyc --no-clean npm run test:purejs", - "test:cover:te": "npx nyc --no-clean npm run test:te", - "test:deno": "deno test test/deno_test.ts", - "test:fuzz": "npm exec --yes -- jsfuzz@git+https://gitlab.com/gitlab-org/security-products/analyzers/fuzzers/jsfuzz.git --fuzzTime 60 --no-versifier test/decode.jsfuzz.js corpus", - "cover:clean": "rimraf .nyc_output coverage/", - "cover:report": "npx nyc report --reporter=text-summary --reporter=html --reporter=json", - "test:browser": "karma start --single-run", - "test:browser:firefox": "karma start --single-run --browsers FirefoxHeadless", - "test:browser:chrome": "karma start --single-run --browsers ChromeHeadless", - "test:watch:browser": "karma start --browsers ChromeHeadless,FirefoxHeadless", - "test:watch:nodejs": "mocha -w 'test/**/*.test.ts'", - "lint": "eslint --ext .ts src test", - "lint:fix": "prettier --loglevel=warn --write 'src/**/*.ts' 'test/**/*.ts' && eslint --fix --ext .ts src test", - "lint:print-config": "eslint --print-config .eslintrc.js", - "update-dependencies": "npx rimraf node_modules/ package-lock.json ; npm install ; npm audit fix --force ; git restore package.json ; npm install" - }, - "homepage": "https://msgpack.org/", - "repository": { - "type": "git", - "url": "https://github.com/msgpack/msgpack-javascript.git" - }, - "bugs": { - "url": "https://github.com/msgpack/msgpack-javascript/issues" - }, - "keywords": [ - "msgpack", - "MessagePack", - "serialization", - "universal" - ], - "engines": { - "node": ">= 10" - }, - "devDependencies": { - "@bitjourney/check-es-version-webpack-plugin": "latest", - "@types/lodash": "latest", - "@types/mocha": "latest", - "@types/node": "latest", - "@typescript-eslint/eslint-plugin": "latest", - "@typescript-eslint/parser": "latest", - "assert": "latest", - "blob-polyfill": "latest", - "buffer": "latest", - "core-js": "latest", - "eslint": "latest", - "eslint-config-prettier": "latest", - "eslint-plugin-import": "latest", - "eslint-plugin-tsdoc": "latest", - "ieee754": "latest", - "karma": "latest", - "karma-chrome-launcher": "latest", - "karma-cli": "latest", - "karma-firefox-launcher": "latest", - "karma-mocha": "latest", - "karma-sourcemap-loader": "latest", - "karma-webpack": "latest", - "lodash": "latest", - "mocha": "latest", - "msgpack-test-js": "latest", - "npm-run-all": "latest", - "prettier": "latest", - "rimraf": "latest", - "ts-loader": "latest", - "ts-node": "latest", - "tsconfig-paths": "latest", - "typescript": "latest", - "web-streams-polyfill": "latest", - "webpack": "latest", - "webpack-cli": "latest" - }, - "files": [ - "mod.ts", - "src/**/*.*", - "dist/**/*.*", - "dist.es5+umd/**/*.*", - "dist.es5+esm/**/*.*" - ] -} diff --git a/node_modules/@msgpack/msgpack/src/CachedKeyDecoder.ts b/node_modules/@msgpack/msgpack/src/CachedKeyDecoder.ts deleted file mode 100644 index cd21b2d..0000000 --- a/node_modules/@msgpack/msgpack/src/CachedKeyDecoder.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { utf8DecodeJs } from "./utils/utf8"; - -const DEFAULT_MAX_KEY_LENGTH = 16; -const DEFAULT_MAX_LENGTH_PER_KEY = 16; - -export interface KeyDecoder { - canBeCached(byteLength: number): boolean; - decode(bytes: Uint8Array, inputOffset: number, byteLength: number): string; -} -interface KeyCacheRecord { - readonly bytes: Uint8Array; - readonly str: string; -} - -export class CachedKeyDecoder implements KeyDecoder { - hit = 0; - miss = 0; - private readonly caches: Array>; - - constructor(readonly maxKeyLength = DEFAULT_MAX_KEY_LENGTH, readonly maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY) { - // avoid `new Array(N)`, which makes a sparse array, - // because a sparse array is typically slower than a non-sparse array. - this.caches = []; - for (let i = 0; i < this.maxKeyLength; i++) { - this.caches.push([]); - } - } - - public canBeCached(byteLength: number): boolean { - return byteLength > 0 && byteLength <= this.maxKeyLength; - } - - private find(bytes: Uint8Array, inputOffset: number, byteLength: number): string | null { - const records = this.caches[byteLength - 1]!; - - FIND_CHUNK: for (const record of records) { - const recordBytes = record.bytes; - - for (let j = 0; j < byteLength; j++) { - if (recordBytes[j] !== bytes[inputOffset + j]) { - continue FIND_CHUNK; - } - } - return record.str; - } - return null; - } - - private store(bytes: Uint8Array, value: string) { - const records = this.caches[bytes.length - 1]!; - const record: KeyCacheRecord = { bytes, str: value }; - - if (records.length >= this.maxLengthPerKey) { - // `records` are full! - // Set `record` to an arbitrary position. - records[(Math.random() * records.length) | 0] = record; - } else { - records.push(record); - } - } - - public decode(bytes: Uint8Array, inputOffset: number, byteLength: number): string { - const cachedValue = this.find(bytes, inputOffset, byteLength); - if (cachedValue != null) { - this.hit++; - return cachedValue; - } - this.miss++; - - const str = utf8DecodeJs(bytes, inputOffset, byteLength); - // Ensure to copy a slice of bytes because the byte may be NodeJS Buffer and Buffer#slice() returns a reference to its internal ArrayBuffer. - const slicedCopyOfBytes = Uint8Array.prototype.slice.call(bytes, inputOffset, inputOffset + byteLength); - this.store(slicedCopyOfBytes, str); - return str; - } -} diff --git a/node_modules/@msgpack/msgpack/src/DecodeError.ts b/node_modules/@msgpack/msgpack/src/DecodeError.ts deleted file mode 100644 index 203fe1b..0000000 --- a/node_modules/@msgpack/msgpack/src/DecodeError.ts +++ /dev/null @@ -1,15 +0,0 @@ -export class DecodeError extends Error { - constructor(message: string) { - super(message); - - // fix the prototype chain in a cross-platform way - const proto: typeof DecodeError.prototype = Object.create(DecodeError.prototype); - Object.setPrototypeOf(this, proto); - - Object.defineProperty(this, "name", { - configurable: true, - enumerable: false, - value: DecodeError.name, - }); - } -} diff --git a/node_modules/@msgpack/msgpack/src/Decoder.ts b/node_modules/@msgpack/msgpack/src/Decoder.ts deleted file mode 100644 index eb6fa15..0000000 --- a/node_modules/@msgpack/msgpack/src/Decoder.ts +++ /dev/null @@ -1,627 +0,0 @@ -import { prettyByte } from "./utils/prettyByte"; -import { ExtensionCodec, ExtensionCodecType } from "./ExtensionCodec"; -import { getInt64, getUint64, UINT32_MAX } from "./utils/int"; -import { utf8DecodeJs, TEXT_DECODER_THRESHOLD, utf8DecodeTD } from "./utils/utf8"; -import { createDataView, ensureUint8Array } from "./utils/typedArrays"; -import { CachedKeyDecoder, KeyDecoder } from "./CachedKeyDecoder"; -import { DecodeError } from "./DecodeError"; - -const enum State { - ARRAY, - MAP_KEY, - MAP_VALUE, -} - -type MapKeyType = string | number; - -const isValidMapKeyType = (key: unknown): key is MapKeyType => { - const keyType = typeof key; - - return keyType === "string" || keyType === "number"; -}; - -type StackMapState = { - type: State.MAP_KEY | State.MAP_VALUE; - size: number; - key: MapKeyType | null; - readCount: number; - map: Record; -}; - -type StackArrayState = { - type: State.ARRAY; - size: number; - array: Array; - position: number; -}; - -type StackState = StackArrayState | StackMapState; - -const HEAD_BYTE_REQUIRED = -1; - -const EMPTY_VIEW = new DataView(new ArrayBuffer(0)); -const EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer); - -// IE11: Hack to support IE11. -// IE11: Drop this hack and just use RangeError when IE11 is obsolete. -export const DataViewIndexOutOfBoundsError: typeof Error = (() => { - try { - // IE11: The spec says it should throw RangeError, - // IE11: but in IE11 it throws TypeError. - EMPTY_VIEW.getInt8(0); - } catch (e: any) { - return e.constructor; - } - throw new Error("never reached"); -})(); - -const MORE_DATA = new DataViewIndexOutOfBoundsError("Insufficient data"); - -const sharedCachedKeyDecoder = new CachedKeyDecoder(); - -export class Decoder { - private totalPos = 0; - private pos = 0; - - private view = EMPTY_VIEW; - private bytes = EMPTY_BYTES; - private headByte = HEAD_BYTE_REQUIRED; - private readonly stack: Array = []; - - public constructor( - private readonly extensionCodec: ExtensionCodecType = ExtensionCodec.defaultCodec as any, - private readonly context: ContextType = undefined as any, - private readonly maxStrLength = UINT32_MAX, - private readonly maxBinLength = UINT32_MAX, - private readonly maxArrayLength = UINT32_MAX, - private readonly maxMapLength = UINT32_MAX, - private readonly maxExtLength = UINT32_MAX, - private readonly keyDecoder: KeyDecoder | null = sharedCachedKeyDecoder, - ) {} - - private reinitializeState() { - this.totalPos = 0; - this.headByte = HEAD_BYTE_REQUIRED; - this.stack.length = 0; - - // view, bytes, and pos will be re-initialized in setBuffer() - } - - private setBuffer(buffer: ArrayLike | BufferSource): void { - this.bytes = ensureUint8Array(buffer); - this.view = createDataView(this.bytes); - this.pos = 0; - } - - private appendBuffer(buffer: ArrayLike | BufferSource) { - if (this.headByte === HEAD_BYTE_REQUIRED && !this.hasRemaining(1)) { - this.setBuffer(buffer); - } else { - const remainingData = this.bytes.subarray(this.pos); - const newData = ensureUint8Array(buffer); - - // concat remainingData + newData - const newBuffer = new Uint8Array(remainingData.length + newData.length); - newBuffer.set(remainingData); - newBuffer.set(newData, remainingData.length); - this.setBuffer(newBuffer); - } - } - - private hasRemaining(size: number) { - return this.view.byteLength - this.pos >= size; - } - - private createExtraByteError(posToShow: number): Error { - const { view, pos } = this; - return new RangeError(`Extra ${view.byteLength - pos} of ${view.byteLength} byte(s) found at buffer[${posToShow}]`); - } - - /** - * @throws {@link DecodeError} - * @throws {@link RangeError} - */ - public decode(buffer: ArrayLike | BufferSource): unknown { - this.reinitializeState(); - this.setBuffer(buffer); - - const object = this.doDecodeSync(); - if (this.hasRemaining(1)) { - throw this.createExtraByteError(this.pos); - } - return object; - } - - public *decodeMulti(buffer: ArrayLike | BufferSource): Generator { - this.reinitializeState(); - this.setBuffer(buffer); - - while (this.hasRemaining(1)) { - yield this.doDecodeSync(); - } - } - - public async decodeAsync(stream: AsyncIterable | BufferSource>): Promise { - let decoded = false; - let object: unknown; - for await (const buffer of stream) { - if (decoded) { - throw this.createExtraByteError(this.totalPos); - } - - this.appendBuffer(buffer); - - try { - object = this.doDecodeSync(); - decoded = true; - } catch (e) { - if (!(e instanceof DataViewIndexOutOfBoundsError)) { - throw e; // rethrow - } - // fallthrough - } - this.totalPos += this.pos; - } - - if (decoded) { - if (this.hasRemaining(1)) { - throw this.createExtraByteError(this.totalPos); - } - return object; - } - - const { headByte, pos, totalPos } = this; - throw new RangeError( - `Insufficient data in parsing ${prettyByte(headByte)} at ${totalPos} (${pos} in the current buffer)`, - ); - } - - public decodeArrayStream( - stream: AsyncIterable | BufferSource>, - ): AsyncGenerator { - return this.decodeMultiAsync(stream, true); - } - - public decodeStream(stream: AsyncIterable | BufferSource>): AsyncGenerator { - return this.decodeMultiAsync(stream, false); - } - - private async *decodeMultiAsync(stream: AsyncIterable | BufferSource>, isArray: boolean) { - let isArrayHeaderRequired = isArray; - let arrayItemsLeft = -1; - - for await (const buffer of stream) { - if (isArray && arrayItemsLeft === 0) { - throw this.createExtraByteError(this.totalPos); - } - - this.appendBuffer(buffer); - - if (isArrayHeaderRequired) { - arrayItemsLeft = this.readArraySize(); - isArrayHeaderRequired = false; - this.complete(); - } - - try { - while (true) { - yield this.doDecodeSync(); - if (--arrayItemsLeft === 0) { - break; - } - } - } catch (e) { - if (!(e instanceof DataViewIndexOutOfBoundsError)) { - throw e; // rethrow - } - // fallthrough - } - this.totalPos += this.pos; - } - } - - private doDecodeSync(): unknown { - DECODE: while (true) { - const headByte = this.readHeadByte(); - let object: unknown; - - if (headByte >= 0xe0) { - // negative fixint (111x xxxx) 0xe0 - 0xff - object = headByte - 0x100; - } else if (headByte < 0xc0) { - if (headByte < 0x80) { - // positive fixint (0xxx xxxx) 0x00 - 0x7f - object = headByte; - } else if (headByte < 0x90) { - // fixmap (1000 xxxx) 0x80 - 0x8f - const size = headByte - 0x80; - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } else { - object = {}; - } - } else if (headByte < 0xa0) { - // fixarray (1001 xxxx) 0x90 - 0x9f - const size = headByte - 0x90; - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } else { - object = []; - } - } else { - // fixstr (101x xxxx) 0xa0 - 0xbf - const byteLength = headByte - 0xa0; - object = this.decodeUtf8String(byteLength, 0); - } - } else if (headByte === 0xc0) { - // nil - object = null; - } else if (headByte === 0xc2) { - // false - object = false; - } else if (headByte === 0xc3) { - // true - object = true; - } else if (headByte === 0xca) { - // float 32 - object = this.readF32(); - } else if (headByte === 0xcb) { - // float 64 - object = this.readF64(); - } else if (headByte === 0xcc) { - // uint 8 - object = this.readU8(); - } else if (headByte === 0xcd) { - // uint 16 - object = this.readU16(); - } else if (headByte === 0xce) { - // uint 32 - object = this.readU32(); - } else if (headByte === 0xcf) { - // uint 64 - object = this.readU64(); - } else if (headByte === 0xd0) { - // int 8 - object = this.readI8(); - } else if (headByte === 0xd1) { - // int 16 - object = this.readI16(); - } else if (headByte === 0xd2) { - // int 32 - object = this.readI32(); - } else if (headByte === 0xd3) { - // int 64 - object = this.readI64(); - } else if (headByte === 0xd9) { - // str 8 - const byteLength = this.lookU8(); - object = this.decodeUtf8String(byteLength, 1); - } else if (headByte === 0xda) { - // str 16 - const byteLength = this.lookU16(); - object = this.decodeUtf8String(byteLength, 2); - } else if (headByte === 0xdb) { - // str 32 - const byteLength = this.lookU32(); - object = this.decodeUtf8String(byteLength, 4); - } else if (headByte === 0xdc) { - // array 16 - const size = this.readU16(); - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } else { - object = []; - } - } else if (headByte === 0xdd) { - // array 32 - const size = this.readU32(); - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } else { - object = []; - } - } else if (headByte === 0xde) { - // map 16 - const size = this.readU16(); - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } else { - object = {}; - } - } else if (headByte === 0xdf) { - // map 32 - const size = this.readU32(); - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } else { - object = {}; - } - } else if (headByte === 0xc4) { - // bin 8 - const size = this.lookU8(); - object = this.decodeBinary(size, 1); - } else if (headByte === 0xc5) { - // bin 16 - const size = this.lookU16(); - object = this.decodeBinary(size, 2); - } else if (headByte === 0xc6) { - // bin 32 - const size = this.lookU32(); - object = this.decodeBinary(size, 4); - } else if (headByte === 0xd4) { - // fixext 1 - object = this.decodeExtension(1, 0); - } else if (headByte === 0xd5) { - // fixext 2 - object = this.decodeExtension(2, 0); - } else if (headByte === 0xd6) { - // fixext 4 - object = this.decodeExtension(4, 0); - } else if (headByte === 0xd7) { - // fixext 8 - object = this.decodeExtension(8, 0); - } else if (headByte === 0xd8) { - // fixext 16 - object = this.decodeExtension(16, 0); - } else if (headByte === 0xc7) { - // ext 8 - const size = this.lookU8(); - object = this.decodeExtension(size, 1); - } else if (headByte === 0xc8) { - // ext 16 - const size = this.lookU16(); - object = this.decodeExtension(size, 2); - } else if (headByte === 0xc9) { - // ext 32 - const size = this.lookU32(); - object = this.decodeExtension(size, 4); - } else { - throw new DecodeError(`Unrecognized type byte: ${prettyByte(headByte)}`); - } - - this.complete(); - - const stack = this.stack; - while (stack.length > 0) { - // arrays and maps - const state = stack[stack.length - 1]!; - if (state.type === State.ARRAY) { - state.array[state.position] = object; - state.position++; - if (state.position === state.size) { - stack.pop(); - object = state.array; - } else { - continue DECODE; - } - } else if (state.type === State.MAP_KEY) { - if (!isValidMapKeyType(object)) { - throw new DecodeError("The type of key must be string or number but " + typeof object); - } - if (object === "__proto__") { - throw new DecodeError("The key __proto__ is not allowed"); - } - - state.key = object; - state.type = State.MAP_VALUE; - continue DECODE; - } else { - // it must be `state.type === State.MAP_VALUE` here - - state.map[state.key!] = object; - state.readCount++; - - if (state.readCount === state.size) { - stack.pop(); - object = state.map; - } else { - state.key = null; - state.type = State.MAP_KEY; - continue DECODE; - } - } - } - - return object; - } - } - - private readHeadByte(): number { - if (this.headByte === HEAD_BYTE_REQUIRED) { - this.headByte = this.readU8(); - // console.log("headByte", prettyByte(this.headByte)); - } - - return this.headByte; - } - - private complete(): void { - this.headByte = HEAD_BYTE_REQUIRED; - } - - private readArraySize(): number { - const headByte = this.readHeadByte(); - - switch (headByte) { - case 0xdc: - return this.readU16(); - case 0xdd: - return this.readU32(); - default: { - if (headByte < 0xa0) { - return headByte - 0x90; - } else { - throw new DecodeError(`Unrecognized array type byte: ${prettyByte(headByte)}`); - } - } - } - } - - private pushMapState(size: number) { - if (size > this.maxMapLength) { - throw new DecodeError(`Max length exceeded: map length (${size}) > maxMapLengthLength (${this.maxMapLength})`); - } - - this.stack.push({ - type: State.MAP_KEY, - size, - key: null, - readCount: 0, - map: {}, - }); - } - - private pushArrayState(size: number) { - if (size > this.maxArrayLength) { - throw new DecodeError(`Max length exceeded: array length (${size}) > maxArrayLength (${this.maxArrayLength})`); - } - - this.stack.push({ - type: State.ARRAY, - size, - array: new Array(size), - position: 0, - }); - } - - private decodeUtf8String(byteLength: number, headerOffset: number): string { - if (byteLength > this.maxStrLength) { - throw new DecodeError( - `Max length exceeded: UTF-8 byte length (${byteLength}) > maxStrLength (${this.maxStrLength})`, - ); - } - - if (this.bytes.byteLength < this.pos + headerOffset + byteLength) { - throw MORE_DATA; - } - - const offset = this.pos + headerOffset; - let object: string; - if (this.stateIsMapKey() && this.keyDecoder?.canBeCached(byteLength)) { - object = this.keyDecoder.decode(this.bytes, offset, byteLength); - } else if (byteLength > TEXT_DECODER_THRESHOLD) { - object = utf8DecodeTD(this.bytes, offset, byteLength); - } else { - object = utf8DecodeJs(this.bytes, offset, byteLength); - } - this.pos += headerOffset + byteLength; - return object; - } - - private stateIsMapKey(): boolean { - if (this.stack.length > 0) { - const state = this.stack[this.stack.length - 1]!; - return state.type === State.MAP_KEY; - } - return false; - } - - private decodeBinary(byteLength: number, headOffset: number): Uint8Array { - if (byteLength > this.maxBinLength) { - throw new DecodeError(`Max length exceeded: bin length (${byteLength}) > maxBinLength (${this.maxBinLength})`); - } - - if (!this.hasRemaining(byteLength + headOffset)) { - throw MORE_DATA; - } - - const offset = this.pos + headOffset; - const object = this.bytes.subarray(offset, offset + byteLength); - this.pos += headOffset + byteLength; - return object; - } - - private decodeExtension(size: number, headOffset: number): unknown { - if (size > this.maxExtLength) { - throw new DecodeError(`Max length exceeded: ext length (${size}) > maxExtLength (${this.maxExtLength})`); - } - - const extType = this.view.getInt8(this.pos + headOffset); - const data = this.decodeBinary(size, headOffset + 1 /* extType */); - return this.extensionCodec.decode(data, extType, this.context); - } - - private lookU8() { - return this.view.getUint8(this.pos); - } - - private lookU16() { - return this.view.getUint16(this.pos); - } - - private lookU32() { - return this.view.getUint32(this.pos); - } - - private readU8(): number { - const value = this.view.getUint8(this.pos); - this.pos++; - return value; - } - - private readI8(): number { - const value = this.view.getInt8(this.pos); - this.pos++; - return value; - } - - private readU16(): number { - const value = this.view.getUint16(this.pos); - this.pos += 2; - return value; - } - - private readI16(): number { - const value = this.view.getInt16(this.pos); - this.pos += 2; - return value; - } - - private readU32(): number { - const value = this.view.getUint32(this.pos); - this.pos += 4; - return value; - } - - private readI32(): number { - const value = this.view.getInt32(this.pos); - this.pos += 4; - return value; - } - - private readU64(): number { - const value = getUint64(this.view, this.pos); - this.pos += 8; - return value; - } - - private readI64(): number { - const value = getInt64(this.view, this.pos); - this.pos += 8; - return value; - } - - private readF32() { - const value = this.view.getFloat32(this.pos); - this.pos += 4; - return value; - } - - private readF64() { - const value = this.view.getFloat64(this.pos); - this.pos += 8; - return value; - } -} diff --git a/node_modules/@msgpack/msgpack/src/Encoder.ts b/node_modules/@msgpack/msgpack/src/Encoder.ts deleted file mode 100644 index 14a1632..0000000 --- a/node_modules/@msgpack/msgpack/src/Encoder.ts +++ /dev/null @@ -1,412 +0,0 @@ -import { utf8EncodeJs, utf8Count, TEXT_ENCODER_THRESHOLD, utf8EncodeTE } from "./utils/utf8"; -import { ExtensionCodec, ExtensionCodecType } from "./ExtensionCodec"; -import { setInt64, setUint64 } from "./utils/int"; -import { ensureUint8Array } from "./utils/typedArrays"; -import type { ExtData } from "./ExtData"; - -export const DEFAULT_MAX_DEPTH = 100; -export const DEFAULT_INITIAL_BUFFER_SIZE = 2048; - -export class Encoder { - private pos = 0; - private view = new DataView(new ArrayBuffer(this.initialBufferSize)); - private bytes = new Uint8Array(this.view.buffer); - - public constructor( - private readonly extensionCodec: ExtensionCodecType = ExtensionCodec.defaultCodec as any, - private readonly context: ContextType = undefined as any, - private readonly maxDepth = DEFAULT_MAX_DEPTH, - private readonly initialBufferSize = DEFAULT_INITIAL_BUFFER_SIZE, - private readonly sortKeys = false, - private readonly forceFloat32 = false, - private readonly ignoreUndefined = false, - private readonly forceIntegerToFloat = false, - ) {} - - private reinitializeState() { - this.pos = 0; - } - - /** - * This is almost equivalent to {@link Encoder#encode}, but it returns an reference of the encoder's internal buffer and thus much faster than {@link Encoder#encode}. - * - * @returns Encodes the object and returns a shared reference the encoder's internal buffer. - */ - public encodeSharedRef(object: unknown): Uint8Array { - this.reinitializeState(); - this.doEncode(object, 1); - return this.bytes.subarray(0, this.pos); - } - - /** - * @returns Encodes the object and returns a copy of the encoder's internal buffer. - */ - public encode(object: unknown): Uint8Array { - this.reinitializeState(); - this.doEncode(object, 1); - return this.bytes.slice(0, this.pos); - } - - private doEncode(object: unknown, depth: number): void { - if (depth > this.maxDepth) { - throw new Error(`Too deep objects in depth ${depth}`); - } - - if (object == null) { - this.encodeNil(); - } else if (typeof object === "boolean") { - this.encodeBoolean(object); - } else if (typeof object === "number") { - this.encodeNumber(object); - } else if (typeof object === "string") { - this.encodeString(object); - } else { - this.encodeObject(object, depth); - } - } - - private ensureBufferSizeToWrite(sizeToWrite: number) { - const requiredSize = this.pos + sizeToWrite; - - if (this.view.byteLength < requiredSize) { - this.resizeBuffer(requiredSize * 2); - } - } - - private resizeBuffer(newSize: number) { - const newBuffer = new ArrayBuffer(newSize); - const newBytes = new Uint8Array(newBuffer); - const newView = new DataView(newBuffer); - - newBytes.set(this.bytes); - - this.view = newView; - this.bytes = newBytes; - } - - private encodeNil() { - this.writeU8(0xc0); - } - - private encodeBoolean(object: boolean) { - if (object === false) { - this.writeU8(0xc2); - } else { - this.writeU8(0xc3); - } - } - private encodeNumber(object: number) { - if (Number.isSafeInteger(object) && !this.forceIntegerToFloat) { - if (object >= 0) { - if (object < 0x80) { - // positive fixint - this.writeU8(object); - } else if (object < 0x100) { - // uint 8 - this.writeU8(0xcc); - this.writeU8(object); - } else if (object < 0x10000) { - // uint 16 - this.writeU8(0xcd); - this.writeU16(object); - } else if (object < 0x100000000) { - // uint 32 - this.writeU8(0xce); - this.writeU32(object); - } else { - // uint 64 - this.writeU8(0xcf); - this.writeU64(object); - } - } else { - if (object >= -0x20) { - // negative fixint - this.writeU8(0xe0 | (object + 0x20)); - } else if (object >= -0x80) { - // int 8 - this.writeU8(0xd0); - this.writeI8(object); - } else if (object >= -0x8000) { - // int 16 - this.writeU8(0xd1); - this.writeI16(object); - } else if (object >= -0x80000000) { - // int 32 - this.writeU8(0xd2); - this.writeI32(object); - } else { - // int 64 - this.writeU8(0xd3); - this.writeI64(object); - } - } - } else { - // non-integer numbers - if (this.forceFloat32) { - // float 32 - this.writeU8(0xca); - this.writeF32(object); - } else { - // float 64 - this.writeU8(0xcb); - this.writeF64(object); - } - } - } - - private writeStringHeader(byteLength: number) { - if (byteLength < 32) { - // fixstr - this.writeU8(0xa0 + byteLength); - } else if (byteLength < 0x100) { - // str 8 - this.writeU8(0xd9); - this.writeU8(byteLength); - } else if (byteLength < 0x10000) { - // str 16 - this.writeU8(0xda); - this.writeU16(byteLength); - } else if (byteLength < 0x100000000) { - // str 32 - this.writeU8(0xdb); - this.writeU32(byteLength); - } else { - throw new Error(`Too long string: ${byteLength} bytes in UTF-8`); - } - } - - private encodeString(object: string) { - const maxHeaderSize = 1 + 4; - const strLength = object.length; - - if (strLength > TEXT_ENCODER_THRESHOLD) { - const byteLength = utf8Count(object); - this.ensureBufferSizeToWrite(maxHeaderSize + byteLength); - this.writeStringHeader(byteLength); - utf8EncodeTE(object, this.bytes, this.pos); - this.pos += byteLength; - } else { - const byteLength = utf8Count(object); - this.ensureBufferSizeToWrite(maxHeaderSize + byteLength); - this.writeStringHeader(byteLength); - utf8EncodeJs(object, this.bytes, this.pos); - this.pos += byteLength; - } - } - - private encodeObject(object: unknown, depth: number) { - // try to encode objects with custom codec first of non-primitives - const ext = this.extensionCodec.tryToEncode(object, this.context); - if (ext != null) { - this.encodeExtension(ext); - } else if (Array.isArray(object)) { - this.encodeArray(object, depth); - } else if (ArrayBuffer.isView(object)) { - this.encodeBinary(object); - } else if (typeof object === "object") { - this.encodeMap(object as Record, depth); - } else { - // symbol, function and other special object come here unless extensionCodec handles them. - throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(object)}`); - } - } - - private encodeBinary(object: ArrayBufferView) { - const size = object.byteLength; - if (size < 0x100) { - // bin 8 - this.writeU8(0xc4); - this.writeU8(size); - } else if (size < 0x10000) { - // bin 16 - this.writeU8(0xc5); - this.writeU16(size); - } else if (size < 0x100000000) { - // bin 32 - this.writeU8(0xc6); - this.writeU32(size); - } else { - throw new Error(`Too large binary: ${size}`); - } - const bytes = ensureUint8Array(object); - this.writeU8a(bytes); - } - - private encodeArray(object: Array, depth: number) { - const size = object.length; - if (size < 16) { - // fixarray - this.writeU8(0x90 + size); - } else if (size < 0x10000) { - // array 16 - this.writeU8(0xdc); - this.writeU16(size); - } else if (size < 0x100000000) { - // array 32 - this.writeU8(0xdd); - this.writeU32(size); - } else { - throw new Error(`Too large array: ${size}`); - } - for (const item of object) { - this.doEncode(item, depth + 1); - } - } - - private countWithoutUndefined(object: Record, keys: ReadonlyArray): number { - let count = 0; - - for (const key of keys) { - if (object[key] !== undefined) { - count++; - } - } - - return count; - } - - private encodeMap(object: Record, depth: number) { - const keys = Object.keys(object); - if (this.sortKeys) { - keys.sort(); - } - - const size = this.ignoreUndefined ? this.countWithoutUndefined(object, keys) : keys.length; - - if (size < 16) { - // fixmap - this.writeU8(0x80 + size); - } else if (size < 0x10000) { - // map 16 - this.writeU8(0xde); - this.writeU16(size); - } else if (size < 0x100000000) { - // map 32 - this.writeU8(0xdf); - this.writeU32(size); - } else { - throw new Error(`Too large map object: ${size}`); - } - - for (const key of keys) { - const value = object[key]; - - if (!(this.ignoreUndefined && value === undefined)) { - this.encodeString(key); - this.doEncode(value, depth + 1); - } - } - } - - private encodeExtension(ext: ExtData) { - const size = ext.data.length; - if (size === 1) { - // fixext 1 - this.writeU8(0xd4); - } else if (size === 2) { - // fixext 2 - this.writeU8(0xd5); - } else if (size === 4) { - // fixext 4 - this.writeU8(0xd6); - } else if (size === 8) { - // fixext 8 - this.writeU8(0xd7); - } else if (size === 16) { - // fixext 16 - this.writeU8(0xd8); - } else if (size < 0x100) { - // ext 8 - this.writeU8(0xc7); - this.writeU8(size); - } else if (size < 0x10000) { - // ext 16 - this.writeU8(0xc8); - this.writeU16(size); - } else if (size < 0x100000000) { - // ext 32 - this.writeU8(0xc9); - this.writeU32(size); - } else { - throw new Error(`Too large extension object: ${size}`); - } - this.writeI8(ext.type); - this.writeU8a(ext.data); - } - - private writeU8(value: number) { - this.ensureBufferSizeToWrite(1); - - this.view.setUint8(this.pos, value); - this.pos++; - } - - private writeU8a(values: ArrayLike) { - const size = values.length; - this.ensureBufferSizeToWrite(size); - - this.bytes.set(values, this.pos); - this.pos += size; - } - - private writeI8(value: number) { - this.ensureBufferSizeToWrite(1); - - this.view.setInt8(this.pos, value); - this.pos++; - } - - private writeU16(value: number) { - this.ensureBufferSizeToWrite(2); - - this.view.setUint16(this.pos, value); - this.pos += 2; - } - - private writeI16(value: number) { - this.ensureBufferSizeToWrite(2); - - this.view.setInt16(this.pos, value); - this.pos += 2; - } - - private writeU32(value: number) { - this.ensureBufferSizeToWrite(4); - - this.view.setUint32(this.pos, value); - this.pos += 4; - } - - private writeI32(value: number) { - this.ensureBufferSizeToWrite(4); - - this.view.setInt32(this.pos, value); - this.pos += 4; - } - - private writeF32(value: number) { - this.ensureBufferSizeToWrite(4); - this.view.setFloat32(this.pos, value); - this.pos += 4; - } - - private writeF64(value: number) { - this.ensureBufferSizeToWrite(8); - this.view.setFloat64(this.pos, value); - this.pos += 8; - } - - private writeU64(value: number) { - this.ensureBufferSizeToWrite(8); - - setUint64(this.view, this.pos, value); - this.pos += 8; - } - - private writeI64(value: number) { - this.ensureBufferSizeToWrite(8); - - setInt64(this.view, this.pos, value); - this.pos += 8; - } -} diff --git a/node_modules/@msgpack/msgpack/src/ExtData.ts b/node_modules/@msgpack/msgpack/src/ExtData.ts deleted file mode 100644 index f69060e..0000000 --- a/node_modules/@msgpack/msgpack/src/ExtData.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * ExtData is used to handle Extension Types that are not registered to ExtensionCodec. - */ -export class ExtData { - constructor(readonly type: number, readonly data: Uint8Array) {} -} diff --git a/node_modules/@msgpack/msgpack/src/ExtensionCodec.ts b/node_modules/@msgpack/msgpack/src/ExtensionCodec.ts deleted file mode 100644 index 6ca9495..0000000 --- a/node_modules/@msgpack/msgpack/src/ExtensionCodec.ts +++ /dev/null @@ -1,104 +0,0 @@ -// ExtensionCodec to handle MessagePack extensions - -import { ExtData } from "./ExtData"; -import { timestampExtension } from "./timestamp"; - -export type ExtensionDecoderType = ( - data: Uint8Array, - extensionType: number, - context: ContextType, -) => unknown; - -export type ExtensionEncoderType = (input: unknown, context: ContextType) => Uint8Array | null; - -// immutable interface to ExtensionCodec -export type ExtensionCodecType = { - // eslint-disable-next-line @typescript-eslint/naming-convention - __brand?: ContextType; - tryToEncode(object: unknown, context: ContextType): ExtData | null; - decode(data: Uint8Array, extType: number, context: ContextType): unknown; -}; - -export class ExtensionCodec implements ExtensionCodecType { - public static readonly defaultCodec: ExtensionCodecType = new ExtensionCodec(); - - // ensures ExtensionCodecType matches ExtensionCodec - // this will make type errors a lot more clear - // eslint-disable-next-line @typescript-eslint/naming-convention - __brand?: ContextType; - - // built-in extensions - private readonly builtInEncoders: Array | undefined | null> = []; - private readonly builtInDecoders: Array | undefined | null> = []; - - // custom extensions - private readonly encoders: Array | undefined | null> = []; - private readonly decoders: Array | undefined | null> = []; - - public constructor() { - this.register(timestampExtension); - } - - public register({ - type, - encode, - decode, - }: { - type: number; - encode: ExtensionEncoderType; - decode: ExtensionDecoderType; - }): void { - if (type >= 0) { - // custom extensions - this.encoders[type] = encode; - this.decoders[type] = decode; - } else { - // built-in extensions - const index = 1 + type; - this.builtInEncoders[index] = encode; - this.builtInDecoders[index] = decode; - } - } - - public tryToEncode(object: unknown, context: ContextType): ExtData | null { - // built-in extensions - for (let i = 0; i < this.builtInEncoders.length; i++) { - const encodeExt = this.builtInEncoders[i]; - if (encodeExt != null) { - const data = encodeExt(object, context); - if (data != null) { - const type = -1 - i; - return new ExtData(type, data); - } - } - } - - // custom extensions - for (let i = 0; i < this.encoders.length; i++) { - const encodeExt = this.encoders[i]; - if (encodeExt != null) { - const data = encodeExt(object, context); - if (data != null) { - const type = i; - return new ExtData(type, data); - } - } - } - - if (object instanceof ExtData) { - // to keep ExtData as is - return object; - } - return null; - } - - public decode(data: Uint8Array, type: number, context: ContextType): unknown { - const decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type]; - if (decodeExt) { - return decodeExt(data, type, context); - } else { - // decode() does not fail, returns ExtData instead. - return new ExtData(type, data); - } - } -} diff --git a/node_modules/@msgpack/msgpack/src/context.ts b/node_modules/@msgpack/msgpack/src/context.ts deleted file mode 100644 index 68c4c96..0000000 --- a/node_modules/@msgpack/msgpack/src/context.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-types */ - -export type SplitTypes = U extends T ? (Exclude extends never ? T : Exclude) : T; - -export type SplitUndefined = SplitTypes; - -export type ContextOf = ContextType extends undefined - ? {} - : { - /** - * Custom user-defined data, read/writable - */ - context: ContextType; - }; diff --git a/node_modules/@msgpack/msgpack/src/decode.ts b/node_modules/@msgpack/msgpack/src/decode.ts deleted file mode 100644 index 30a88ab..0000000 --- a/node_modules/@msgpack/msgpack/src/decode.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { Decoder } from "./Decoder"; -import type { ExtensionCodecType } from "./ExtensionCodec"; -import type { ContextOf, SplitUndefined } from "./context"; - -export type DecodeOptions = Readonly< - Partial<{ - extensionCodec: ExtensionCodecType; - - /** - * Maximum string length. - * - * Defaults to 4_294_967_295 (UINT32_MAX). - */ - maxStrLength: number; - /** - * Maximum binary length. - * - * Defaults to 4_294_967_295 (UINT32_MAX). - */ - maxBinLength: number; - /** - * Maximum array length. - * - * Defaults to 4_294_967_295 (UINT32_MAX). - */ - maxArrayLength: number; - /** - * Maximum map length. - * - * Defaults to 4_294_967_295 (UINT32_MAX). - */ - maxMapLength: number; - /** - * Maximum extension length. - * - * Defaults to 4_294_967_295 (UINT32_MAX). - */ - maxExtLength: number; - }> -> & - ContextOf; - -export const defaultDecodeOptions: DecodeOptions = {}; - -/** - * It decodes a single MessagePack object in a buffer. - * - * This is a synchronous decoding function. - * See other variants for asynchronous decoding: {@link decodeAsync()}, {@link decodeStream()}, or {@link decodeArrayStream()}. - * - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -export function decode( - buffer: ArrayLike | BufferSource, - options: DecodeOptions> = defaultDecodeOptions as any, -): unknown { - const decoder = new Decoder( - options.extensionCodec, - (options as typeof options & { context: any }).context, - options.maxStrLength, - options.maxBinLength, - options.maxArrayLength, - options.maxMapLength, - options.maxExtLength, - ); - return decoder.decode(buffer); -} - -/** - * It decodes multiple MessagePack objects in a buffer. - * This is corresponding to {@link decodeMultiStream()}. - * - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -export function decodeMulti( - buffer: ArrayLike | BufferSource, - options: DecodeOptions> = defaultDecodeOptions as any, -): Generator { - const decoder = new Decoder( - options.extensionCodec, - (options as typeof options & { context: any }).context, - options.maxStrLength, - options.maxBinLength, - options.maxArrayLength, - options.maxMapLength, - options.maxExtLength, - ); - return decoder.decodeMulti(buffer); -} diff --git a/node_modules/@msgpack/msgpack/src/decodeAsync.ts b/node_modules/@msgpack/msgpack/src/decodeAsync.ts deleted file mode 100644 index ee9922f..0000000 --- a/node_modules/@msgpack/msgpack/src/decodeAsync.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { Decoder } from "./Decoder"; -import { ensureAsyncIterable } from "./utils/stream"; -import { defaultDecodeOptions } from "./decode"; -import type { ReadableStreamLike } from "./utils/stream"; -import type { DecodeOptions } from "./decode"; -import type { SplitUndefined } from "./context"; - -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ - export async function decodeAsync( - streamLike: ReadableStreamLike | BufferSource>, - options: DecodeOptions> = defaultDecodeOptions as any, -): Promise { - const stream = ensureAsyncIterable(streamLike); - - const decoder = new Decoder( - options.extensionCodec, - (options as typeof options & { context: any }).context, - options.maxStrLength, - options.maxBinLength, - options.maxArrayLength, - options.maxMapLength, - options.maxExtLength, - ); - return decoder.decodeAsync(stream); -} - -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ - export function decodeArrayStream( - streamLike: ReadableStreamLike | BufferSource>, - options: DecodeOptions> = defaultDecodeOptions as any, -): AsyncGenerator { - const stream = ensureAsyncIterable(streamLike); - - const decoder = new Decoder( - options.extensionCodec, - (options as typeof options & { context: any }).context, - options.maxStrLength, - options.maxBinLength, - options.maxArrayLength, - options.maxMapLength, - options.maxExtLength, - ); - - return decoder.decodeArrayStream(stream); -} - -/** - * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty. - * @throws {@link DecodeError} if the buffer contains invalid data. - */ -export function decodeMultiStream( - streamLike: ReadableStreamLike | BufferSource>, - options: DecodeOptions> = defaultDecodeOptions as any, -): AsyncGenerator { - const stream = ensureAsyncIterable(streamLike); - - const decoder = new Decoder( - options.extensionCodec, - (options as typeof options & { context: any }).context, - options.maxStrLength, - options.maxBinLength, - options.maxArrayLength, - options.maxMapLength, - options.maxExtLength, - ); - - return decoder.decodeStream(stream); -} - -/** - * @deprecated Use {@link decodeMultiStream()} instead. - */ -export function decodeStream( - streamLike: ReadableStreamLike | BufferSource>, - options: DecodeOptions> = defaultDecodeOptions as any, -): AsyncGenerator { - return decodeMultiStream(streamLike, options); -} diff --git a/node_modules/@msgpack/msgpack/src/encode.ts b/node_modules/@msgpack/msgpack/src/encode.ts deleted file mode 100644 index 7e6a602..0000000 --- a/node_modules/@msgpack/msgpack/src/encode.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { Encoder } from "./Encoder"; -import type { ExtensionCodecType } from "./ExtensionCodec"; -import type { ContextOf, SplitUndefined } from "./context"; - -export type EncodeOptions = Partial< - Readonly<{ - extensionCodec: ExtensionCodecType; - - /** - * The maximum depth in nested objects and arrays. - * - * Defaults to 100. - */ - maxDepth: number; - - /** - * The initial size of the internal buffer. - * - * Defaults to 2048. - */ - initialBufferSize: number; - - /** - * If `true`, the keys of an object is sorted. In other words, the encoded - * binary is canonical and thus comparable to another encoded binary. - * - * Defaults to `false`. If enabled, it spends more time in encoding objects. - */ - sortKeys: boolean; - /** - * If `true`, non-integer numbers are encoded in float32, not in float64 (the default). - * - * Only use it if precisions don't matter. - * - * Defaults to `false`. - */ - forceFloat32: boolean; - - /** - * If `true`, an object property with `undefined` value are ignored. - * e.g. `{ foo: undefined }` will be encoded as `{}`, as `JSON.stringify()` does. - * - * Defaults to `false`. If enabled, it spends more time in encoding objects. - */ - ignoreUndefined: boolean; - - /** - * If `true`, integer numbers are encoded as floating point numbers, - * with the `forceFloat32` option taken into account. - * - * Defaults to `false`. - */ - forceIntegerToFloat: boolean; - }> -> & - ContextOf; - -const defaultEncodeOptions: EncodeOptions = {}; - -/** - * It encodes `value` in the MessagePack format and - * returns a byte buffer. - * - * The returned buffer is a slice of a larger `ArrayBuffer`, so you have to use its `#byteOffset` and `#byteLength` in order to convert it to another typed arrays including NodeJS `Buffer`. - */ -export function encode( - value: unknown, - options: EncodeOptions> = defaultEncodeOptions as any, -): Uint8Array { - const encoder = new Encoder( - options.extensionCodec, - (options as typeof options & { context: any }).context, - options.maxDepth, - options.initialBufferSize, - options.sortKeys, - options.forceFloat32, - options.ignoreUndefined, - options.forceIntegerToFloat, - ); - return encoder.encodeSharedRef(value); -} diff --git a/node_modules/@msgpack/msgpack/src/index.ts b/node_modules/@msgpack/msgpack/src/index.ts deleted file mode 100644 index 28560f1..0000000 --- a/node_modules/@msgpack/msgpack/src/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Main Functions: - -import { encode } from "./encode"; -export { encode }; -import type { EncodeOptions } from "./encode"; -export type { EncodeOptions }; - -import { decode, decodeMulti } from "./decode"; -export { decode, decodeMulti }; -import type { DecodeOptions } from "./decode"; -export { DecodeOptions }; - -import { decodeAsync, decodeArrayStream, decodeMultiStream, decodeStream } from "./decodeAsync"; -export { decodeAsync, decodeArrayStream, decodeMultiStream, decodeStream }; - -import { Decoder, DataViewIndexOutOfBoundsError } from "./Decoder"; -import { DecodeError } from "./DecodeError"; -export { Decoder, DecodeError, DataViewIndexOutOfBoundsError }; - -import { Encoder } from "./Encoder"; -export { Encoder }; - -// Utilitiies for Extension Types: - -import { ExtensionCodec } from "./ExtensionCodec"; -export { ExtensionCodec }; -import type { ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType } from "./ExtensionCodec"; -export type { ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType }; -import { ExtData } from "./ExtData"; -export { ExtData }; - -import { - EXT_TIMESTAMP, - encodeDateToTimeSpec, - encodeTimeSpecToTimestamp, - decodeTimestampToTimeSpec, - encodeTimestampExtension, - decodeTimestampExtension, -} from "./timestamp"; -export { - EXT_TIMESTAMP, - encodeDateToTimeSpec, - encodeTimeSpecToTimestamp, - decodeTimestampToTimeSpec, - encodeTimestampExtension, - decodeTimestampExtension, -}; diff --git a/node_modules/@msgpack/msgpack/src/timestamp.ts b/node_modules/@msgpack/msgpack/src/timestamp.ts deleted file mode 100644 index e3fe015..0000000 --- a/node_modules/@msgpack/msgpack/src/timestamp.ts +++ /dev/null @@ -1,108 +0,0 @@ -// https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type -import { DecodeError } from "./DecodeError"; -import { getInt64, setInt64 } from "./utils/int"; - -export const EXT_TIMESTAMP = -1; - -export type TimeSpec = { - sec: number; - nsec: number; -}; - -const TIMESTAMP32_MAX_SEC = 0x100000000 - 1; // 32-bit unsigned int -const TIMESTAMP64_MAX_SEC = 0x400000000 - 1; // 34-bit unsigned int - -export function encodeTimeSpecToTimestamp({ sec, nsec }: TimeSpec): Uint8Array { - if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) { - // Here sec >= 0 && nsec >= 0 - if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) { - // timestamp 32 = { sec32 (unsigned) } - const rv = new Uint8Array(4); - const view = new DataView(rv.buffer); - view.setUint32(0, sec); - return rv; - } else { - // timestamp 64 = { nsec30 (unsigned), sec34 (unsigned) } - const secHigh = sec / 0x100000000; - const secLow = sec & 0xffffffff; - const rv = new Uint8Array(8); - const view = new DataView(rv.buffer); - // nsec30 | secHigh2 - view.setUint32(0, (nsec << 2) | (secHigh & 0x3)); - // secLow32 - view.setUint32(4, secLow); - return rv; - } - } else { - // timestamp 96 = { nsec32 (unsigned), sec64 (signed) } - const rv = new Uint8Array(12); - const view = new DataView(rv.buffer); - view.setUint32(0, nsec); - setInt64(view, 4, sec); - return rv; - } -} - -export function encodeDateToTimeSpec(date: Date): TimeSpec { - const msec = date.getTime(); - const sec = Math.floor(msec / 1e3); - const nsec = (msec - sec * 1e3) * 1e6; - - // Normalizes { sec, nsec } to ensure nsec is unsigned. - const nsecInSec = Math.floor(nsec / 1e9); - return { - sec: sec + nsecInSec, - nsec: nsec - nsecInSec * 1e9, - }; -} - -export function encodeTimestampExtension(object: unknown): Uint8Array | null { - if (object instanceof Date) { - const timeSpec = encodeDateToTimeSpec(object); - return encodeTimeSpecToTimestamp(timeSpec); - } else { - return null; - } -} - -export function decodeTimestampToTimeSpec(data: Uint8Array): TimeSpec { - const view = new DataView(data.buffer, data.byteOffset, data.byteLength); - - // data may be 32, 64, or 96 bits - switch (data.byteLength) { - case 4: { - // timestamp 32 = { sec32 } - const sec = view.getUint32(0); - const nsec = 0; - return { sec, nsec }; - } - case 8: { - // timestamp 64 = { nsec30, sec34 } - const nsec30AndSecHigh2 = view.getUint32(0); - const secLow32 = view.getUint32(4); - const sec = (nsec30AndSecHigh2 & 0x3) * 0x100000000 + secLow32; - const nsec = nsec30AndSecHigh2 >>> 2; - return { sec, nsec }; - } - case 12: { - // timestamp 96 = { nsec32 (unsigned), sec64 (signed) } - - const sec = getInt64(view, 4); - const nsec = view.getUint32(0); - return { sec, nsec }; - } - default: - throw new DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${data.length}`); - } -} - -export function decodeTimestampExtension(data: Uint8Array): Date { - const timeSpec = decodeTimestampToTimeSpec(data); - return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6); -} - -export const timestampExtension = { - type: EXT_TIMESTAMP, - encode: encodeTimestampExtension, - decode: decodeTimestampExtension, -}; diff --git a/node_modules/@msgpack/msgpack/src/utils/int.ts b/node_modules/@msgpack/msgpack/src/utils/int.ts deleted file mode 100644 index 7fa93fb..0000000 --- a/node_modules/@msgpack/msgpack/src/utils/int.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Integer Utility - -export const UINT32_MAX = 0xffff_ffff; - -// DataView extension to handle int64 / uint64, -// where the actual range is 53-bits integer (a.k.a. safe integer) - -export function setUint64(view: DataView, offset: number, value: number): void { - const high = value / 0x1_0000_0000; - const low = value; // high bits are truncated by DataView - view.setUint32(offset, high); - view.setUint32(offset + 4, low); -} - -export function setInt64(view: DataView, offset: number, value: number): void { - const high = Math.floor(value / 0x1_0000_0000); - const low = value; // high bits are truncated by DataView - view.setUint32(offset, high); - view.setUint32(offset + 4, low); -} - -export function getInt64(view: DataView, offset: number): number { - const high = view.getInt32(offset); - const low = view.getUint32(offset + 4); - return high * 0x1_0000_0000 + low; -} - -export function getUint64(view: DataView, offset: number): number { - const high = view.getUint32(offset); - const low = view.getUint32(offset + 4); - return high * 0x1_0000_0000 + low; -} diff --git a/node_modules/@msgpack/msgpack/src/utils/prettyByte.ts b/node_modules/@msgpack/msgpack/src/utils/prettyByte.ts deleted file mode 100644 index c598138..0000000 --- a/node_modules/@msgpack/msgpack/src/utils/prettyByte.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function prettyByte(byte: number): string { - return `${byte < 0 ? "-" : ""}0x${Math.abs(byte).toString(16).padStart(2, "0")}`; -} diff --git a/node_modules/@msgpack/msgpack/src/utils/stream.ts b/node_modules/@msgpack/msgpack/src/utils/stream.ts deleted file mode 100644 index b7549e1..0000000 --- a/node_modules/@msgpack/msgpack/src/utils/stream.ts +++ /dev/null @@ -1,42 +0,0 @@ -// utility for whatwg streams - -// The living standard of whatwg streams says -// ReadableStream is also AsyncIterable, but -// as of June 2019, no browser implements it. -// See https://streams.spec.whatwg.org/ for details -export type ReadableStreamLike = AsyncIterable | ReadableStream; - -export function isAsyncIterable(object: ReadableStreamLike): object is AsyncIterable { - return (object as any)[Symbol.asyncIterator] != null; -} - -function assertNonNull(value: T | null | undefined): asserts value is T { - if (value == null) { - throw new Error("Assertion Failure: value must not be null nor undefined"); - } -} - -export async function* asyncIterableFromStream(stream: ReadableStream): AsyncIterable { - const reader = stream.getReader(); - - try { - while (true) { - const { done, value } = await reader.read(); - if (done) { - return; - } - assertNonNull(value); - yield value; - } - } finally { - reader.releaseLock(); - } -} - -export function ensureAsyncIterable(streamLike: ReadableStreamLike): AsyncIterable { - if (isAsyncIterable(streamLike)) { - return streamLike; - } else { - return asyncIterableFromStream(streamLike); - } -} diff --git a/node_modules/@msgpack/msgpack/src/utils/typedArrays.ts b/node_modules/@msgpack/msgpack/src/utils/typedArrays.ts deleted file mode 100644 index 6e04c21..0000000 --- a/node_modules/@msgpack/msgpack/src/utils/typedArrays.ts +++ /dev/null @@ -1,21 +0,0 @@ -export function ensureUint8Array(buffer: ArrayLike | Uint8Array | ArrayBufferView | ArrayBuffer): Uint8Array { - if (buffer instanceof Uint8Array) { - return buffer; - } else if (ArrayBuffer.isView(buffer)) { - return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); - } else if (buffer instanceof ArrayBuffer) { - return new Uint8Array(buffer); - } else { - // ArrayLike - return Uint8Array.from(buffer); - } -} - -export function createDataView(buffer: ArrayLike | ArrayBufferView | ArrayBuffer): DataView { - if (buffer instanceof ArrayBuffer) { - return new DataView(buffer); - } - - const bufferView = ensureUint8Array(buffer); - return new DataView(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength); -} diff --git a/node_modules/@msgpack/msgpack/src/utils/utf8.ts b/node_modules/@msgpack/msgpack/src/utils/utf8.ts deleted file mode 100644 index 4d08690..0000000 --- a/node_modules/@msgpack/msgpack/src/utils/utf8.ts +++ /dev/null @@ -1,170 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-condition */ -import { UINT32_MAX } from "./int"; - -const TEXT_ENCODING_AVAILABLE = - (typeof process === "undefined" || process?.env?.["TEXT_ENCODING"] !== "never") && - typeof TextEncoder !== "undefined" && - typeof TextDecoder !== "undefined"; - -export function utf8Count(str: string): number { - const strLength = str.length; - - let byteLength = 0; - let pos = 0; - while (pos < strLength) { - let value = str.charCodeAt(pos++); - - if ((value & 0xffffff80) === 0) { - // 1-byte - byteLength++; - continue; - } else if ((value & 0xfffff800) === 0) { - // 2-bytes - byteLength += 2; - } else { - // handle surrogate pair - if (value >= 0xd800 && value <= 0xdbff) { - // high surrogate - if (pos < strLength) { - const extra = str.charCodeAt(pos); - if ((extra & 0xfc00) === 0xdc00) { - ++pos; - value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000; - } - } - } - - if ((value & 0xffff0000) === 0) { - // 3-byte - byteLength += 3; - } else { - // 4-byte - byteLength += 4; - } - } - } - return byteLength; -} - -export function utf8EncodeJs(str: string, output: Uint8Array, outputOffset: number): void { - const strLength = str.length; - let offset = outputOffset; - let pos = 0; - while (pos < strLength) { - let value = str.charCodeAt(pos++); - - if ((value & 0xffffff80) === 0) { - // 1-byte - output[offset++] = value; - continue; - } else if ((value & 0xfffff800) === 0) { - // 2-bytes - output[offset++] = ((value >> 6) & 0x1f) | 0xc0; - } else { - // handle surrogate pair - if (value >= 0xd800 && value <= 0xdbff) { - // high surrogate - if (pos < strLength) { - const extra = str.charCodeAt(pos); - if ((extra & 0xfc00) === 0xdc00) { - ++pos; - value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000; - } - } - } - - if ((value & 0xffff0000) === 0) { - // 3-byte - output[offset++] = ((value >> 12) & 0x0f) | 0xe0; - output[offset++] = ((value >> 6) & 0x3f) | 0x80; - } else { - // 4-byte - output[offset++] = ((value >> 18) & 0x07) | 0xf0; - output[offset++] = ((value >> 12) & 0x3f) | 0x80; - output[offset++] = ((value >> 6) & 0x3f) | 0x80; - } - } - - output[offset++] = (value & 0x3f) | 0x80; - } -} - -const sharedTextEncoder = TEXT_ENCODING_AVAILABLE ? new TextEncoder() : undefined; -export const TEXT_ENCODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE - ? UINT32_MAX - : typeof process !== "undefined" && process?.env?.["TEXT_ENCODING"] !== "force" - ? 200 - : 0; - -function utf8EncodeTEencode(str: string, output: Uint8Array, outputOffset: number): void { - output.set(sharedTextEncoder!.encode(str), outputOffset); -} - -function utf8EncodeTEencodeInto(str: string, output: Uint8Array, outputOffset: number): void { - sharedTextEncoder!.encodeInto(str, output.subarray(outputOffset)); -} - -export const utf8EncodeTE = sharedTextEncoder?.encodeInto ? utf8EncodeTEencodeInto : utf8EncodeTEencode; - -const CHUNK_SIZE = 0x1_000; - -export function utf8DecodeJs(bytes: Uint8Array, inputOffset: number, byteLength: number): string { - let offset = inputOffset; - const end = offset + byteLength; - - const units: Array = []; - let result = ""; - while (offset < end) { - const byte1 = bytes[offset++]!; - if ((byte1 & 0x80) === 0) { - // 1 byte - units.push(byte1); - } else if ((byte1 & 0xe0) === 0xc0) { - // 2 bytes - const byte2 = bytes[offset++]! & 0x3f; - units.push(((byte1 & 0x1f) << 6) | byte2); - } else if ((byte1 & 0xf0) === 0xe0) { - // 3 bytes - const byte2 = bytes[offset++]! & 0x3f; - const byte3 = bytes[offset++]! & 0x3f; - units.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3); - } else if ((byte1 & 0xf8) === 0xf0) { - // 4 bytes - const byte2 = bytes[offset++]! & 0x3f; - const byte3 = bytes[offset++]! & 0x3f; - const byte4 = bytes[offset++]! & 0x3f; - let unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4; - if (unit > 0xffff) { - unit -= 0x10000; - units.push(((unit >>> 10) & 0x3ff) | 0xd800); - unit = 0xdc00 | (unit & 0x3ff); - } - units.push(unit); - } else { - units.push(byte1); - } - - if (units.length >= CHUNK_SIZE) { - result += String.fromCharCode(...units); - units.length = 0; - } - } - - if (units.length > 0) { - result += String.fromCharCode(...units); - } - - return result; -} - -const sharedTextDecoder = TEXT_ENCODING_AVAILABLE ? new TextDecoder() : null; -export const TEXT_DECODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE - ? UINT32_MAX - : typeof process !== "undefined" && process?.env?.["TEXT_DECODER"] !== "force" - ? 200 - : 0; - -export function utf8DecodeTD(bytes: Uint8Array, inputOffset: number, byteLength: number): string { - const stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength); - return sharedTextDecoder!.decode(stringBytes); -} diff --git a/node_modules/@prisma/client/LICENSE b/node_modules/@prisma/client/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/node_modules/@prisma/client/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/node_modules/@prisma/client/README.md b/node_modules/@prisma/client/README.md deleted file mode 100644 index c67b83c..0000000 --- a/node_modules/@prisma/client/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Prisma Client · [![npm version](https://img.shields.io/npm/v/@prisma/client.svg?style=flat)](https://www.npmjs.com/package/@prisma/client) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/prisma/prisma/blob/main/CONTRIBUTING.md) [![GitHub license](https://img.shields.io/badge/license-Apache%202-blue)](https://github.com/prisma/prisma/blob/main/LICENSE) [![Discord](https://img.shields.io/discord/937751382725886062?label=Discord)](https://pris.ly/discord) - -Prisma Client JS is an **auto-generated query builder** that enables **type-safe** database access and **reduces boilerplate**. You can use it as an alternative to traditional ORMs such as Sequelize, TypeORM or SQL query builders like knex.js. - -It is part of the [Prisma](https://www.prisma.io/) ecosystem. Prisma provides database tools for data access, declarative data modeling, schema migrations and visual data management. Learn more in the main [`prisma`](https://github.com/prisma/prisma/) repository or read the [documentation](https://www.prisma.io/docs/). - -## Getting started - -Follow one of these guides to get started with Prisma Client JS: - -- [Quickstart](https://www.prisma.io/docs/getting-started/quickstart) (5 min) -- [Set up a new project with Prisma (SQL migrations)](https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch-sql) (15 min) -- [Set up a new project with Prisma (Prisma Migrate)](https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch-prisma-migrate) (15 min) -- [Add Prisma to an existing project](https://www.prisma.io/docs/getting-started/setup-prisma/add-to-existing-project) (15 min) - -Alternatively you can explore the ready-to-run [examples](https://github.com/prisma/prisma-examples/) (REST, GraphQL, gRPC, plain JavaScript and TypeScript demos, ...) or watch the [demo videos](https://www.youtube.com/watch?v=0RhtQgIs-TE&list=PLn2e1F9Rfr6k9PnR_figWOcSHgc_erDr5&index=1) (1-2 min per video). - -## Contributing - -Refer to our [contribution guidelines](https://github.com/prisma/prisma/blob/main/CONTRIBUTING.md) and [Code of Conduct for contributors](https://github.com/prisma/prisma/blob/main/CODE_OF_CONDUCT.md). - -## Tests Status - -- Prisma Tests Status: - [![CI](https://github.com/prisma/prisma/actions/workflows/test.yml/badge.svg)](https://github.com/prisma/prisma/actions/workflows/test.yml) -- Ecosystem Tests Status: - [![Actions Status](https://github.com/prisma/ecosystem-tests/workflows/test/badge.svg)](https://github.com/prisma/ecosystem-tests/actions) diff --git a/node_modules/@prisma/client/default.d.ts b/node_modules/@prisma/client/default.d.ts deleted file mode 100644 index bedfdce..0000000 --- a/node_modules/@prisma/client/default.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '.prisma/client/default' diff --git a/node_modules/@prisma/client/default.js b/node_modules/@prisma/client/default.js deleted file mode 100644 index 3c2dafb..0000000 --- a/node_modules/@prisma/client/default.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ...require('.prisma/client/default'), -} diff --git a/node_modules/@prisma/client/edge.d.ts b/node_modules/@prisma/client/edge.d.ts deleted file mode 100644 index b8d190e..0000000 --- a/node_modules/@prisma/client/edge.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '.prisma/client/edge' diff --git a/node_modules/@prisma/client/edge.js b/node_modules/@prisma/client/edge.js deleted file mode 100644 index c4925e8..0000000 --- a/node_modules/@prisma/client/edge.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - // https://github.com/prisma/prisma/pull/12907 - ...require('.prisma/client/edge'), -} diff --git a/node_modules/@prisma/client/extension.d.ts b/node_modules/@prisma/client/extension.d.ts deleted file mode 100644 index 28e3968..0000000 --- a/node_modules/@prisma/client/extension.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './scripts/default-index' diff --git a/node_modules/@prisma/client/extension.js b/node_modules/@prisma/client/extension.js deleted file mode 100644 index 3ab6e46..0000000 --- a/node_modules/@prisma/client/extension.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - // https://github.com/prisma/prisma/pull/12907 - ...require('./scripts/default-index'), -} diff --git a/node_modules/@prisma/client/generator-build/index.js b/node_modules/@prisma/client/generator-build/index.js deleted file mode 100644 index 42eed62..0000000 --- a/node_modules/@prisma/client/generator-build/index.js +++ /dev/null @@ -1,10344 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// ../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/package.json -var require_package = __commonJS({ - "../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/package.json"(exports2, module2) { - module2.exports = { - name: "@prisma/engines-version", - version: "5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36", - main: "index.js", - types: "index.d.ts", - license: "Apache-2.0", - author: "Tim Suchanek ", - prisma: { - enginesVersion: "bf0e5e8a04cada8225617067eaa03d041e2bba36" - }, - repository: { - type: "git", - url: "https://github.com/prisma/engines-wrapper.git", - directory: "packages/engines-version" - }, - devDependencies: { - "@types/node": "18.19.34", - typescript: "4.9.5" - }, - files: [ - "index.js", - "index.d.ts" - ], - scripts: { - build: "tsc -d" - } - }; - } -}); - -// ../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/index.js -var require_engines_version = __commonJS({ - "../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.enginesVersion = void 0; - exports2.enginesVersion = require_package().prisma.enginesVersion; - } -}); - -// ../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js -var require_universalify = __commonJS({ - "../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js"(exports2) { - "use strict"; - exports2.fromCallback = function(fn) { - return Object.defineProperty(function(...args) { - if (typeof args[args.length - 1] === "function") fn.apply(this, args); - else { - return new Promise((resolve, reject) => { - fn.call( - this, - ...args, - (err, res) => err != null ? reject(err) : resolve(res) - ); - }); - } - }, "name", { value: fn.name }); - }; - exports2.fromPromise = function(fn) { - return Object.defineProperty(function(...args) { - const cb = args[args.length - 1]; - if (typeof cb !== "function") return fn.apply(this, args); - else fn.apply(this, args.slice(0, -1)).then((r) => cb(null, r), cb); - }, "name", { value: fn.name }); - }; - } -}); - -// ../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/polyfills.js -var require_polyfills = __commonJS({ - "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/polyfills.js"(exports2, module2) { - "use strict"; - var constants = require("constants"); - var origCwd = process.cwd; - var cwd2 = null; - var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform; - process.cwd = function() { - if (!cwd2) - cwd2 = origCwd.call(process); - return cwd2; - }; - try { - process.cwd(); - } catch (er) { - } - if (typeof process.chdir === "function") { - chdir = process.chdir; - process.chdir = function(d) { - cwd2 = null; - chdir.call(process, d); - }; - if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir); - } - var chdir; - module2.exports = patch; - function patch(fs3) { - if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs3); - } - if (!fs3.lutimes) { - patchLutimes(fs3); - } - fs3.chown = chownFix(fs3.chown); - fs3.fchown = chownFix(fs3.fchown); - fs3.lchown = chownFix(fs3.lchown); - fs3.chmod = chmodFix(fs3.chmod); - fs3.fchmod = chmodFix(fs3.fchmod); - fs3.lchmod = chmodFix(fs3.lchmod); - fs3.chownSync = chownFixSync(fs3.chownSync); - fs3.fchownSync = chownFixSync(fs3.fchownSync); - fs3.lchownSync = chownFixSync(fs3.lchownSync); - fs3.chmodSync = chmodFixSync(fs3.chmodSync); - fs3.fchmodSync = chmodFixSync(fs3.fchmodSync); - fs3.lchmodSync = chmodFixSync(fs3.lchmodSync); - fs3.stat = statFix(fs3.stat); - fs3.fstat = statFix(fs3.fstat); - fs3.lstat = statFix(fs3.lstat); - fs3.statSync = statFixSync(fs3.statSync); - fs3.fstatSync = statFixSync(fs3.fstatSync); - fs3.lstatSync = statFixSync(fs3.lstatSync); - if (fs3.chmod && !fs3.lchmod) { - fs3.lchmod = function(path5, mode, cb) { - if (cb) process.nextTick(cb); - }; - fs3.lchmodSync = function() { - }; - } - if (fs3.chown && !fs3.lchown) { - fs3.lchown = function(path5, uid, gid, cb) { - if (cb) process.nextTick(cb); - }; - fs3.lchownSync = function() { - }; - } - if (platform === "win32") { - fs3.rename = typeof fs3.rename !== "function" ? fs3.rename : function(fs$rename) { - function rename(from, to, cb) { - var start = Date.now(); - var backoff = 0; - fs$rename(from, to, function CB(er) { - if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) { - setTimeout(function() { - fs3.stat(to, function(stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er); - }); - }, backoff); - if (backoff < 100) - backoff += 10; - return; - } - if (cb) cb(er); - }); - } - if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); - return rename; - }(fs3.rename); - } - fs3.read = typeof fs3.read !== "function" ? fs3.read : function(fs$read) { - function read(fd, buffer2, offset, length, position, callback_) { - var callback; - if (callback_ && typeof callback_ === "function") { - var eagCounter = 0; - callback = function(er, _, __) { - if (er && er.code === "EAGAIN" && eagCounter < 10) { - eagCounter++; - return fs$read.call(fs3, fd, buffer2, offset, length, position, callback); - } - callback_.apply(this, arguments); - }; - } - return fs$read.call(fs3, fd, buffer2, offset, length, position, callback); - } - if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); - return read; - }(fs3.read); - fs3.readSync = typeof fs3.readSync !== "function" ? fs3.readSync : /* @__PURE__ */ function(fs$readSync) { - return function(fd, buffer2, offset, length, position) { - var eagCounter = 0; - while (true) { - try { - return fs$readSync.call(fs3, fd, buffer2, offset, length, position); - } catch (er) { - if (er.code === "EAGAIN" && eagCounter < 10) { - eagCounter++; - continue; - } - throw er; - } - } - }; - }(fs3.readSync); - function patchLchmod(fs4) { - fs4.lchmod = function(path5, mode, callback) { - fs4.open( - path5, - constants.O_WRONLY | constants.O_SYMLINK, - mode, - function(err, fd) { - if (err) { - if (callback) callback(err); - return; - } - fs4.fchmod(fd, mode, function(err2) { - fs4.close(fd, function(err22) { - if (callback) callback(err2 || err22); - }); - }); - } - ); - }; - fs4.lchmodSync = function(path5, mode) { - var fd = fs4.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode); - var threw = true; - var ret; - try { - ret = fs4.fchmodSync(fd, mode); - threw = false; - } finally { - if (threw) { - try { - fs4.closeSync(fd); - } catch (er) { - } - } else { - fs4.closeSync(fd); - } - } - return ret; - }; - } - function patchLutimes(fs4) { - if (constants.hasOwnProperty("O_SYMLINK") && fs4.futimes) { - fs4.lutimes = function(path5, at, mt, cb) { - fs4.open(path5, constants.O_SYMLINK, function(er, fd) { - if (er) { - if (cb) cb(er); - return; - } - fs4.futimes(fd, at, mt, function(er2) { - fs4.close(fd, function(er22) { - if (cb) cb(er2 || er22); - }); - }); - }); - }; - fs4.lutimesSync = function(path5, at, mt) { - var fd = fs4.openSync(path5, constants.O_SYMLINK); - var ret; - var threw = true; - try { - ret = fs4.futimesSync(fd, at, mt); - threw = false; - } finally { - if (threw) { - try { - fs4.closeSync(fd); - } catch (er) { - } - } else { - fs4.closeSync(fd); - } - } - return ret; - }; - } else if (fs4.futimes) { - fs4.lutimes = function(_a, _b, _c, cb) { - if (cb) process.nextTick(cb); - }; - fs4.lutimesSync = function() { - }; - } - } - function chmodFix(orig) { - if (!orig) return orig; - return function(target, mode, cb) { - return orig.call(fs3, target, mode, function(er) { - if (chownErOk(er)) er = null; - if (cb) cb.apply(this, arguments); - }); - }; - } - function chmodFixSync(orig) { - if (!orig) return orig; - return function(target, mode) { - try { - return orig.call(fs3, target, mode); - } catch (er) { - if (!chownErOk(er)) throw er; - } - }; - } - function chownFix(orig) { - if (!orig) return orig; - return function(target, uid, gid, cb) { - return orig.call(fs3, target, uid, gid, function(er) { - if (chownErOk(er)) er = null; - if (cb) cb.apply(this, arguments); - }); - }; - } - function chownFixSync(orig) { - if (!orig) return orig; - return function(target, uid, gid) { - try { - return orig.call(fs3, target, uid, gid); - } catch (er) { - if (!chownErOk(er)) throw er; - } - }; - } - function statFix(orig) { - if (!orig) return orig; - return function(target, options, cb) { - if (typeof options === "function") { - cb = options; - options = null; - } - function callback(er, stats) { - if (stats) { - if (stats.uid < 0) stats.uid += 4294967296; - if (stats.gid < 0) stats.gid += 4294967296; - } - if (cb) cb.apply(this, arguments); - } - return options ? orig.call(fs3, target, options, callback) : orig.call(fs3, target, callback); - }; - } - function statFixSync(orig) { - if (!orig) return orig; - return function(target, options) { - var stats = options ? orig.call(fs3, target, options) : orig.call(fs3, target); - if (stats) { - if (stats.uid < 0) stats.uid += 4294967296; - if (stats.gid < 0) stats.gid += 4294967296; - } - return stats; - }; - } - function chownErOk(er) { - if (!er) - return true; - if (er.code === "ENOSYS") - return true; - var nonroot = !process.getuid || process.getuid() !== 0; - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true; - } - return false; - } - } - } -}); - -// ../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/legacy-streams.js -var require_legacy_streams = __commonJS({ - "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/legacy-streams.js"(exports2, module2) { - "use strict"; - var Stream = require("stream").Stream; - module2.exports = legacy; - function legacy(fs3) { - return { - ReadStream, - WriteStream - }; - function ReadStream(path5, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path5, options); - Stream.call(this); - var self = this; - this.path = path5; - this.fd = null; - this.readable = true; - this.paused = false; - this.flags = "r"; - this.mode = 438; - this.bufferSize = 64 * 1024; - options = options || {}; - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - if (this.encoding) this.setEncoding(this.encoding); - if (this.start !== void 0) { - if ("number" !== typeof this.start) { - throw TypeError("start must be a Number"); - } - if (this.end === void 0) { - this.end = Infinity; - } else if ("number" !== typeof this.end) { - throw TypeError("end must be a Number"); - } - if (this.start > this.end) { - throw new Error("start must be <= end"); - } - this.pos = this.start; - } - if (this.fd !== null) { - process.nextTick(function() { - self._read(); - }); - return; - } - fs3.open(this.path, this.flags, this.mode, function(err, fd) { - if (err) { - self.emit("error", err); - self.readable = false; - return; - } - self.fd = fd; - self.emit("open", fd); - self._read(); - }); - } - function WriteStream(path5, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path5, options); - Stream.call(this); - this.path = path5; - this.fd = null; - this.writable = true; - this.flags = "w"; - this.encoding = "binary"; - this.mode = 438; - this.bytesWritten = 0; - options = options || {}; - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - if (this.start !== void 0) { - if ("number" !== typeof this.start) { - throw TypeError("start must be a Number"); - } - if (this.start < 0) { - throw new Error("start must be >= zero"); - } - this.pos = this.start; - } - this.busy = false; - this._queue = []; - if (this.fd === null) { - this._open = fs3.open; - this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); - this.flush(); - } - } - } - } -}); - -// ../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/clone.js -var require_clone = __commonJS({ - "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/clone.js"(exports2, module2) { - "use strict"; - module2.exports = clone; - var getPrototypeOf = Object.getPrototypeOf || function(obj) { - return obj.__proto__; - }; - function clone(obj) { - if (obj === null || typeof obj !== "object") - return obj; - if (obj instanceof Object) - var copy = { __proto__: getPrototypeOf(obj) }; - else - var copy = /* @__PURE__ */ Object.create(null); - Object.getOwnPropertyNames(obj).forEach(function(key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); - }); - return copy; - } - } -}); - -// ../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/graceful-fs.js -var require_graceful_fs = __commonJS({ - "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/graceful-fs.js"(exports2, module2) { - "use strict"; - var fs3 = require("fs"); - var polyfills = require_polyfills(); - var legacy = require_legacy_streams(); - var clone = require_clone(); - var util2 = require("util"); - var gracefulQueue; - var previousSymbol; - if (typeof Symbol === "function" && typeof Symbol.for === "function") { - gracefulQueue = Symbol.for("graceful-fs.queue"); - previousSymbol = Symbol.for("graceful-fs.previous"); - } else { - gracefulQueue = "___graceful-fs.queue"; - previousSymbol = "___graceful-fs.previous"; - } - function noop() { - } - function publishQueue(context, queue2) { - Object.defineProperty(context, gracefulQueue, { - get: function() { - return queue2; - } - }); - } - var debug4 = noop; - if (util2.debuglog) - debug4 = util2.debuglog("gfs4"); - else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) - debug4 = function() { - var m = util2.format.apply(util2, arguments); - m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); - console.error(m); - }; - if (!fs3[gracefulQueue]) { - queue = global[gracefulQueue] || []; - publishQueue(fs3, queue); - fs3.close = function(fs$close) { - function close(fd, cb) { - return fs$close.call(fs3, fd, function(err) { - if (!err) { - resetQueue(); - } - if (typeof cb === "function") - cb.apply(this, arguments); - }); - } - Object.defineProperty(close, previousSymbol, { - value: fs$close - }); - return close; - }(fs3.close); - fs3.closeSync = function(fs$closeSync) { - function closeSync(fd) { - fs$closeSync.apply(fs3, arguments); - resetQueue(); - } - Object.defineProperty(closeSync, previousSymbol, { - value: fs$closeSync - }); - return closeSync; - }(fs3.closeSync); - if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { - process.on("exit", function() { - debug4(fs3[gracefulQueue]); - require("assert").equal(fs3[gracefulQueue].length, 0); - }); - } - } - var queue; - if (!global[gracefulQueue]) { - publishQueue(global, fs3[gracefulQueue]); - } - module2.exports = patch(clone(fs3)); - if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs3.__patched) { - module2.exports = patch(fs3); - fs3.__patched = true; - } - function patch(fs4) { - polyfills(fs4); - fs4.gracefulify = patch; - fs4.createReadStream = createReadStream; - fs4.createWriteStream = createWriteStream; - var fs$readFile = fs4.readFile; - fs4.readFile = readFile; - function readFile(path5, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$readFile(path5, options, cb); - function go$readFile(path6, options2, cb2, startTime) { - return fs$readFile(path6, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$writeFile = fs4.writeFile; - fs4.writeFile = writeFile; - function writeFile(path5, data, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$writeFile(path5, data, options, cb); - function go$writeFile(path6, data2, options2, cb2, startTime) { - return fs$writeFile(path6, data2, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$appendFile = fs4.appendFile; - if (fs$appendFile) - fs4.appendFile = appendFile; - function appendFile(path5, data, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$appendFile(path5, data, options, cb); - function go$appendFile(path6, data2, options2, cb2, startTime) { - return fs$appendFile(path6, data2, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$copyFile = fs4.copyFile; - if (fs$copyFile) - fs4.copyFile = copyFile; - function copyFile(src, dest, flags, cb) { - if (typeof flags === "function") { - cb = flags; - flags = 0; - } - return go$copyFile(src, dest, flags, cb); - function go$copyFile(src2, dest2, flags2, cb2, startTime) { - return fs$copyFile(src2, dest2, flags2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$readdir = fs4.readdir; - fs4.readdir = readdir; - var noReaddirOptionVersions = /^v[0-5]\./; - function readdir(path5, options, cb) { - if (typeof options === "function") - cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) { - return fs$readdir(path6, fs$readdirCallback( - path6, - options2, - cb2, - startTime - )); - } : function go$readdir2(path6, options2, cb2, startTime) { - return fs$readdir(path6, options2, fs$readdirCallback( - path6, - options2, - cb2, - startTime - )); - }; - return go$readdir(path5, options, cb); - function fs$readdirCallback(path6, options2, cb2, startTime) { - return function(err, files) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([ - go$readdir, - [path6, options2, cb2], - err, - startTime || Date.now(), - Date.now() - ]); - else { - if (files && files.sort) - files.sort(); - if (typeof cb2 === "function") - cb2.call(this, err, files); - } - }; - } - } - if (process.version.substr(0, 4) === "v0.8") { - var legStreams = legacy(fs4); - ReadStream = legStreams.ReadStream; - WriteStream = legStreams.WriteStream; - } - var fs$ReadStream = fs4.ReadStream; - if (fs$ReadStream) { - ReadStream.prototype = Object.create(fs$ReadStream.prototype); - ReadStream.prototype.open = ReadStream$open; - } - var fs$WriteStream = fs4.WriteStream; - if (fs$WriteStream) { - WriteStream.prototype = Object.create(fs$WriteStream.prototype); - WriteStream.prototype.open = WriteStream$open; - } - Object.defineProperty(fs4, "ReadStream", { - get: function() { - return ReadStream; - }, - set: function(val) { - ReadStream = val; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(fs4, "WriteStream", { - get: function() { - return WriteStream; - }, - set: function(val) { - WriteStream = val; - }, - enumerable: true, - configurable: true - }); - var FileReadStream = ReadStream; - Object.defineProperty(fs4, "FileReadStream", { - get: function() { - return FileReadStream; - }, - set: function(val) { - FileReadStream = val; - }, - enumerable: true, - configurable: true - }); - var FileWriteStream = WriteStream; - Object.defineProperty(fs4, "FileWriteStream", { - get: function() { - return FileWriteStream; - }, - set: function(val) { - FileWriteStream = val; - }, - enumerable: true, - configurable: true - }); - function ReadStream(path5, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this; - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments); - } - function ReadStream$open() { - var that = this; - open(that.path, that.flags, that.mode, function(err, fd) { - if (err) { - if (that.autoClose) - that.destroy(); - that.emit("error", err); - } else { - that.fd = fd; - that.emit("open", fd); - that.read(); - } - }); - } - function WriteStream(path5, options) { - if (this instanceof WriteStream) - return fs$WriteStream.apply(this, arguments), this; - else - return WriteStream.apply(Object.create(WriteStream.prototype), arguments); - } - function WriteStream$open() { - var that = this; - open(that.path, that.flags, that.mode, function(err, fd) { - if (err) { - that.destroy(); - that.emit("error", err); - } else { - that.fd = fd; - that.emit("open", fd); - } - }); - } - function createReadStream(path5, options) { - return new fs4.ReadStream(path5, options); - } - function createWriteStream(path5, options) { - return new fs4.WriteStream(path5, options); - } - var fs$open = fs4.open; - fs4.open = open; - function open(path5, flags, mode, cb) { - if (typeof mode === "function") - cb = mode, mode = null; - return go$open(path5, flags, mode, cb); - function go$open(path6, flags2, mode2, cb2, startTime) { - return fs$open(path6, flags2, mode2, function(err, fd) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - return fs4; - } - function enqueue(elem) { - debug4("ENQUEUE", elem[0].name, elem[1]); - fs3[gracefulQueue].push(elem); - retry(); - } - var retryTimer; - function resetQueue() { - var now = Date.now(); - for (var i = 0; i < fs3[gracefulQueue].length; ++i) { - if (fs3[gracefulQueue][i].length > 2) { - fs3[gracefulQueue][i][3] = now; - fs3[gracefulQueue][i][4] = now; - } - } - retry(); - } - function retry() { - clearTimeout(retryTimer); - retryTimer = void 0; - if (fs3[gracefulQueue].length === 0) - return; - var elem = fs3[gracefulQueue].shift(); - var fn = elem[0]; - var args = elem[1]; - var err = elem[2]; - var startTime = elem[3]; - var lastTime = elem[4]; - if (startTime === void 0) { - debug4("RETRY", fn.name, args); - fn.apply(null, args); - } else if (Date.now() - startTime >= 6e4) { - debug4("TIMEOUT", fn.name, args); - var cb = args.pop(); - if (typeof cb === "function") - cb.call(null, err); - } else { - var sinceAttempt = Date.now() - lastTime; - var sinceStart = Math.max(lastTime - startTime, 1); - var desiredDelay = Math.min(sinceStart * 1.2, 100); - if (sinceAttempt >= desiredDelay) { - debug4("RETRY", fn.name, args); - fn.apply(null, args.concat([startTime])); - } else { - fs3[gracefulQueue].push(elem); - } - } - if (retryTimer === void 0) { - retryTimer = setTimeout(retry, 0); - } - } - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/fs/index.js -var require_fs = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/fs/index.js"(exports2) { - "use strict"; - var u = require_universalify().fromCallback; - var fs3 = require_graceful_fs(); - var api = [ - "access", - "appendFile", - "chmod", - "chown", - "close", - "copyFile", - "fchmod", - "fchown", - "fdatasync", - "fstat", - "fsync", - "ftruncate", - "futimes", - "lchmod", - "lchown", - "link", - "lstat", - "mkdir", - "mkdtemp", - "open", - "opendir", - "readdir", - "readFile", - "readlink", - "realpath", - "rename", - "rm", - "rmdir", - "stat", - "symlink", - "truncate", - "unlink", - "utimes", - "writeFile" - ].filter((key) => { - return typeof fs3[key] === "function"; - }); - Object.assign(exports2, fs3); - api.forEach((method2) => { - exports2[method2] = u(fs3[method2]); - }); - exports2.exists = function(filename, callback) { - if (typeof callback === "function") { - return fs3.exists(filename, callback); - } - return new Promise((resolve) => { - return fs3.exists(filename, resolve); - }); - }; - exports2.read = function(fd, buffer2, offset, length, position, callback) { - if (typeof callback === "function") { - return fs3.read(fd, buffer2, offset, length, position, callback); - } - return new Promise((resolve, reject) => { - fs3.read(fd, buffer2, offset, length, position, (err, bytesRead, buffer3) => { - if (err) return reject(err); - resolve({ bytesRead, buffer: buffer3 }); - }); - }); - }; - exports2.write = function(fd, buffer2, ...args) { - if (typeof args[args.length - 1] === "function") { - return fs3.write(fd, buffer2, ...args); - } - return new Promise((resolve, reject) => { - fs3.write(fd, buffer2, ...args, (err, bytesWritten, buffer3) => { - if (err) return reject(err); - resolve({ bytesWritten, buffer: buffer3 }); - }); - }); - }; - exports2.readv = function(fd, buffers, ...args) { - if (typeof args[args.length - 1] === "function") { - return fs3.readv(fd, buffers, ...args); - } - return new Promise((resolve, reject) => { - fs3.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => { - if (err) return reject(err); - resolve({ bytesRead, buffers: buffers2 }); - }); - }); - }; - exports2.writev = function(fd, buffers, ...args) { - if (typeof args[args.length - 1] === "function") { - return fs3.writev(fd, buffers, ...args); - } - return new Promise((resolve, reject) => { - fs3.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => { - if (err) return reject(err); - resolve({ bytesWritten, buffers: buffers2 }); - }); - }); - }; - if (typeof fs3.realpath.native === "function") { - exports2.realpath.native = u(fs3.realpath.native); - } else { - process.emitWarning( - "fs.realpath.native is not a function. Is fs being monkey-patched?", - "Warning", - "fs-extra-WARN0003" - ); - } - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/utils.js -var require_utils = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) { - "use strict"; - var path5 = require("path"); - module2.exports.checkPath = function checkPath(pth) { - if (process.platform === "win32") { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path5.parse(pth).root, "")); - if (pathHasInvalidWinCharacters) { - const error = new Error(`Path contains invalid characters: ${pth}`); - error.code = "EINVAL"; - throw error; - } - } - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/make-dir.js -var require_make_dir = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) { - "use strict"; - var fs3 = require_fs(); - var { checkPath } = require_utils(); - var getMode = (options) => { - const defaults = { mode: 511 }; - if (typeof options === "number") return options; - return { ...defaults, ...options }.mode; - }; - module2.exports.makeDir = async (dir, options) => { - checkPath(dir); - return fs3.mkdir(dir, { - mode: getMode(options), - recursive: true - }); - }; - module2.exports.makeDirSync = (dir, options) => { - checkPath(dir); - return fs3.mkdirSync(dir, { - mode: getMode(options), - recursive: true - }); - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/index.js -var require_mkdirs = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - var { makeDir: _makeDir, makeDirSync } = require_make_dir(); - var makeDir = u(_makeDir); - module2.exports = { - mkdirs: makeDir, - mkdirsSync: makeDirSync, - // alias - mkdirp: makeDir, - mkdirpSync: makeDirSync, - ensureDir: makeDir, - ensureDirSync: makeDirSync - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/path-exists/index.js -var require_path_exists = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - var fs3 = require_fs(); - function pathExists2(path5) { - return fs3.access(path5).then(() => true).catch(() => false); - } - module2.exports = { - pathExists: u(pathExists2), - pathExistsSync: fs3.existsSync - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/utimes.js -var require_utimes = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) { - "use strict"; - var fs3 = require_graceful_fs(); - function utimesMillis(path5, atime, mtime, callback) { - fs3.open(path5, "r+", (err, fd) => { - if (err) return callback(err); - fs3.futimes(fd, atime, mtime, (futimesErr) => { - fs3.close(fd, (closeErr) => { - if (callback) callback(futimesErr || closeErr); - }); - }); - }); - } - function utimesMillisSync(path5, atime, mtime) { - const fd = fs3.openSync(path5, "r+"); - fs3.futimesSync(fd, atime, mtime); - return fs3.closeSync(fd); - } - module2.exports = { - utimesMillis, - utimesMillisSync - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/stat.js -var require_stat = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/stat.js"(exports2, module2) { - "use strict"; - var fs3 = require_fs(); - var path5 = require("path"); - var util2 = require("util"); - function getStats(src, dest, opts) { - const statFunc = opts.dereference ? (file2) => fs3.stat(file2, { bigint: true }) : (file2) => fs3.lstat(file2, { bigint: true }); - return Promise.all([ - statFunc(src), - statFunc(dest).catch((err) => { - if (err.code === "ENOENT") return null; - throw err; - }) - ]).then(([srcStat, destStat]) => ({ srcStat, destStat })); - } - function getStatsSync(src, dest, opts) { - let destStat; - const statFunc = opts.dereference ? (file2) => fs3.statSync(file2, { bigint: true }) : (file2) => fs3.lstatSync(file2, { bigint: true }); - const srcStat = statFunc(src); - try { - destStat = statFunc(dest); - } catch (err) { - if (err.code === "ENOENT") return { srcStat, destStat: null }; - throw err; - } - return { srcStat, destStat }; - } - function checkPaths(src, dest, funcName, opts, cb) { - util2.callbackify(getStats)(src, dest, opts, (err, stats) => { - if (err) return cb(err); - const { srcStat, destStat } = stats; - if (destStat) { - if (areIdentical(srcStat, destStat)) { - const srcBaseName = path5.basename(src); - const destBaseName = path5.basename(dest); - if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { - return cb(null, { srcStat, destStat, isChangingCase: true }); - } - return cb(new Error("Source and destination must not be the same.")); - } - if (srcStat.isDirectory() && !destStat.isDirectory()) { - return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)); - } - if (!srcStat.isDirectory() && destStat.isDirectory()) { - return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)); - } - } - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - return cb(new Error(errMsg(src, dest, funcName))); - } - return cb(null, { srcStat, destStat }); - }); - } - function checkPathsSync(src, dest, funcName, opts) { - const { srcStat, destStat } = getStatsSync(src, dest, opts); - if (destStat) { - if (areIdentical(srcStat, destStat)) { - const srcBaseName = path5.basename(src); - const destBaseName = path5.basename(dest); - if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { - return { srcStat, destStat, isChangingCase: true }; - } - throw new Error("Source and destination must not be the same."); - } - if (srcStat.isDirectory() && !destStat.isDirectory()) { - throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`); - } - if (!srcStat.isDirectory() && destStat.isDirectory()) { - throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`); - } - } - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - throw new Error(errMsg(src, dest, funcName)); - } - return { srcStat, destStat }; - } - function checkParentPaths(src, srcStat, dest, funcName, cb) { - const srcParent = path5.resolve(path5.dirname(src)); - const destParent = path5.resolve(path5.dirname(dest)); - if (destParent === srcParent || destParent === path5.parse(destParent).root) return cb(); - fs3.stat(destParent, { bigint: true }, (err, destStat) => { - if (err) { - if (err.code === "ENOENT") return cb(); - return cb(err); - } - if (areIdentical(srcStat, destStat)) { - return cb(new Error(errMsg(src, dest, funcName))); - } - return checkParentPaths(src, srcStat, destParent, funcName, cb); - }); - } - function checkParentPathsSync(src, srcStat, dest, funcName) { - const srcParent = path5.resolve(path5.dirname(src)); - const destParent = path5.resolve(path5.dirname(dest)); - if (destParent === srcParent || destParent === path5.parse(destParent).root) return; - let destStat; - try { - destStat = fs3.statSync(destParent, { bigint: true }); - } catch (err) { - if (err.code === "ENOENT") return; - throw err; - } - if (areIdentical(srcStat, destStat)) { - throw new Error(errMsg(src, dest, funcName)); - } - return checkParentPathsSync(src, srcStat, destParent, funcName); - } - function areIdentical(srcStat, destStat) { - return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev; - } - function isSrcSubdir(src, dest) { - const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i); - const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i); - return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true); - } - function errMsg(src, dest, funcName) { - return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`; - } - module2.exports = { - checkPaths, - checkPathsSync, - checkParentPaths, - checkParentPathsSync, - isSrcSubdir, - areIdentical - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy.js -var require_copy = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) { - "use strict"; - var fs3 = require_graceful_fs(); - var path5 = require("path"); - var mkdirs = require_mkdirs().mkdirs; - var pathExists2 = require_path_exists().pathExists; - var utimesMillis = require_utimes().utimesMillis; - var stat = require_stat(); - function copy(src, dest, opts, cb) { - if (typeof opts === "function" && !cb) { - cb = opts; - opts = {}; - } else if (typeof opts === "function") { - opts = { filter: opts }; - } - cb = cb || function() { - }; - opts = opts || {}; - opts.clobber = "clobber" in opts ? !!opts.clobber : true; - opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber; - if (opts.preserveTimestamps && process.arch === "ia32") { - process.emitWarning( - "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269", - "Warning", - "fs-extra-WARN0001" - ); - } - stat.checkPaths(src, dest, "copy", opts, (err, stats) => { - if (err) return cb(err); - const { srcStat, destStat } = stats; - stat.checkParentPaths(src, srcStat, dest, "copy", (err2) => { - if (err2) return cb(err2); - runFilter(src, dest, opts, (err3, include) => { - if (err3) return cb(err3); - if (!include) return cb(); - checkParentDir(destStat, src, dest, opts, cb); - }); - }); - }); - } - function checkParentDir(destStat, src, dest, opts, cb) { - const destParent = path5.dirname(dest); - pathExists2(destParent, (err, dirExists) => { - if (err) return cb(err); - if (dirExists) return getStats(destStat, src, dest, opts, cb); - mkdirs(destParent, (err2) => { - if (err2) return cb(err2); - return getStats(destStat, src, dest, opts, cb); - }); - }); - } - function runFilter(src, dest, opts, cb) { - if (!opts.filter) return cb(null, true); - Promise.resolve(opts.filter(src, dest)).then((include) => cb(null, include), (error) => cb(error)); - } - function getStats(destStat, src, dest, opts, cb) { - const stat2 = opts.dereference ? fs3.stat : fs3.lstat; - stat2(src, (err, srcStat) => { - if (err) return cb(err); - if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb); - else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb); - else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb); - else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`)); - else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`)); - return cb(new Error(`Unknown file: ${src}`)); - }); - } - function onFile(srcStat, destStat, src, dest, opts, cb) { - if (!destStat) return copyFile(srcStat, src, dest, opts, cb); - return mayCopyFile(srcStat, src, dest, opts, cb); - } - function mayCopyFile(srcStat, src, dest, opts, cb) { - if (opts.overwrite) { - fs3.unlink(dest, (err) => { - if (err) return cb(err); - return copyFile(srcStat, src, dest, opts, cb); - }); - } else if (opts.errorOnExist) { - return cb(new Error(`'${dest}' already exists`)); - } else return cb(); - } - function copyFile(srcStat, src, dest, opts, cb) { - fs3.copyFile(src, dest, (err) => { - if (err) return cb(err); - if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb); - return setDestMode(dest, srcStat.mode, cb); - }); - } - function handleTimestampsAndMode(srcMode, src, dest, cb) { - if (fileIsNotWritable(srcMode)) { - return makeFileWritable(dest, srcMode, (err) => { - if (err) return cb(err); - return setDestTimestampsAndMode(srcMode, src, dest, cb); - }); - } - return setDestTimestampsAndMode(srcMode, src, dest, cb); - } - function fileIsNotWritable(srcMode) { - return (srcMode & 128) === 0; - } - function makeFileWritable(dest, srcMode, cb) { - return setDestMode(dest, srcMode | 128, cb); - } - function setDestTimestampsAndMode(srcMode, src, dest, cb) { - setDestTimestamps(src, dest, (err) => { - if (err) return cb(err); - return setDestMode(dest, srcMode, cb); - }); - } - function setDestMode(dest, srcMode, cb) { - return fs3.chmod(dest, srcMode, cb); - } - function setDestTimestamps(src, dest, cb) { - fs3.stat(src, (err, updatedSrcStat) => { - if (err) return cb(err); - return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb); - }); - } - function onDir(srcStat, destStat, src, dest, opts, cb) { - if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb); - return copyDir(src, dest, opts, cb); - } - function mkDirAndCopy(srcMode, src, dest, opts, cb) { - fs3.mkdir(dest, (err) => { - if (err) return cb(err); - copyDir(src, dest, opts, (err2) => { - if (err2) return cb(err2); - return setDestMode(dest, srcMode, cb); - }); - }); - } - function copyDir(src, dest, opts, cb) { - fs3.readdir(src, (err, items) => { - if (err) return cb(err); - return copyDirItems(items, src, dest, opts, cb); - }); - } - function copyDirItems(items, src, dest, opts, cb) { - const item = items.pop(); - if (!item) return cb(); - return copyDirItem(items, item, src, dest, opts, cb); - } - function copyDirItem(items, item, src, dest, opts, cb) { - const srcItem = path5.join(src, item); - const destItem = path5.join(dest, item); - runFilter(srcItem, destItem, opts, (err, include) => { - if (err) return cb(err); - if (!include) return copyDirItems(items, src, dest, opts, cb); - stat.checkPaths(srcItem, destItem, "copy", opts, (err2, stats) => { - if (err2) return cb(err2); - const { destStat } = stats; - getStats(destStat, srcItem, destItem, opts, (err3) => { - if (err3) return cb(err3); - return copyDirItems(items, src, dest, opts, cb); - }); - }); - }); - } - function onLink(destStat, src, dest, opts, cb) { - fs3.readlink(src, (err, resolvedSrc) => { - if (err) return cb(err); - if (opts.dereference) { - resolvedSrc = path5.resolve(process.cwd(), resolvedSrc); - } - if (!destStat) { - return fs3.symlink(resolvedSrc, dest, cb); - } else { - fs3.readlink(dest, (err2, resolvedDest) => { - if (err2) { - if (err2.code === "EINVAL" || err2.code === "UNKNOWN") return fs3.symlink(resolvedSrc, dest, cb); - return cb(err2); - } - if (opts.dereference) { - resolvedDest = path5.resolve(process.cwd(), resolvedDest); - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)); - } - if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)); - } - return copyLink(resolvedSrc, dest, cb); - }); - } - }); - } - function copyLink(resolvedSrc, dest, cb) { - fs3.unlink(dest, (err) => { - if (err) return cb(err); - return fs3.symlink(resolvedSrc, dest, cb); - }); - } - module2.exports = copy; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy-sync.js -var require_copy_sync = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) { - "use strict"; - var fs3 = require_graceful_fs(); - var path5 = require("path"); - var mkdirsSync = require_mkdirs().mkdirsSync; - var utimesMillisSync = require_utimes().utimesMillisSync; - var stat = require_stat(); - function copySync(src, dest, opts) { - if (typeof opts === "function") { - opts = { filter: opts }; - } - opts = opts || {}; - opts.clobber = "clobber" in opts ? !!opts.clobber : true; - opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber; - if (opts.preserveTimestamps && process.arch === "ia32") { - process.emitWarning( - "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269", - "Warning", - "fs-extra-WARN0002" - ); - } - const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts); - stat.checkParentPathsSync(src, srcStat, dest, "copy"); - if (opts.filter && !opts.filter(src, dest)) return; - const destParent = path5.dirname(dest); - if (!fs3.existsSync(destParent)) mkdirsSync(destParent); - return getStats(destStat, src, dest, opts); - } - function getStats(destStat, src, dest, opts) { - const statSync = opts.dereference ? fs3.statSync : fs3.lstatSync; - const srcStat = statSync(src); - if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts); - else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts); - else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts); - else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`); - else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`); - throw new Error(`Unknown file: ${src}`); - } - function onFile(srcStat, destStat, src, dest, opts) { - if (!destStat) return copyFile(srcStat, src, dest, opts); - return mayCopyFile(srcStat, src, dest, opts); - } - function mayCopyFile(srcStat, src, dest, opts) { - if (opts.overwrite) { - fs3.unlinkSync(dest); - return copyFile(srcStat, src, dest, opts); - } else if (opts.errorOnExist) { - throw new Error(`'${dest}' already exists`); - } - } - function copyFile(srcStat, src, dest, opts) { - fs3.copyFileSync(src, dest); - if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest); - return setDestMode(dest, srcStat.mode); - } - function handleTimestamps(srcMode, src, dest) { - if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode); - return setDestTimestamps(src, dest); - } - function fileIsNotWritable(srcMode) { - return (srcMode & 128) === 0; - } - function makeFileWritable(dest, srcMode) { - return setDestMode(dest, srcMode | 128); - } - function setDestMode(dest, srcMode) { - return fs3.chmodSync(dest, srcMode); - } - function setDestTimestamps(src, dest) { - const updatedSrcStat = fs3.statSync(src); - return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime); - } - function onDir(srcStat, destStat, src, dest, opts) { - if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts); - return copyDir(src, dest, opts); - } - function mkDirAndCopy(srcMode, src, dest, opts) { - fs3.mkdirSync(dest); - copyDir(src, dest, opts); - return setDestMode(dest, srcMode); - } - function copyDir(src, dest, opts) { - fs3.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts)); - } - function copyDirItem(item, src, dest, opts) { - const srcItem = path5.join(src, item); - const destItem = path5.join(dest, item); - if (opts.filter && !opts.filter(srcItem, destItem)) return; - const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts); - return getStats(destStat, srcItem, destItem, opts); - } - function onLink(destStat, src, dest, opts) { - let resolvedSrc = fs3.readlinkSync(src); - if (opts.dereference) { - resolvedSrc = path5.resolve(process.cwd(), resolvedSrc); - } - if (!destStat) { - return fs3.symlinkSync(resolvedSrc, dest); - } else { - let resolvedDest; - try { - resolvedDest = fs3.readlinkSync(dest); - } catch (err) { - if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs3.symlinkSync(resolvedSrc, dest); - throw err; - } - if (opts.dereference) { - resolvedDest = path5.resolve(process.cwd(), resolvedDest); - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`); - } - if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`); - } - return copyLink(resolvedSrc, dest); - } - } - function copyLink(resolvedSrc, dest) { - fs3.unlinkSync(dest); - return fs3.symlinkSync(resolvedSrc, dest); - } - module2.exports = copySync; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/index.js -var require_copy2 = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromCallback; - module2.exports = { - copy: u(require_copy()), - copySync: require_copy_sync() - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/remove/index.js -var require_remove = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/remove/index.js"(exports2, module2) { - "use strict"; - var fs3 = require_graceful_fs(); - var u = require_universalify().fromCallback; - function remove(path5, callback) { - fs3.rm(path5, { recursive: true, force: true }, callback); - } - function removeSync(path5) { - fs3.rmSync(path5, { recursive: true, force: true }); - } - module2.exports = { - remove: u(remove), - removeSync - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/empty/index.js -var require_empty = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/empty/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - var fs3 = require_fs(); - var path5 = require("path"); - var mkdir = require_mkdirs(); - var remove = require_remove(); - var emptyDir = u(async function emptyDir2(dir) { - let items; - try { - items = await fs3.readdir(dir); - } catch { - return mkdir.mkdirs(dir); - } - return Promise.all(items.map((item) => remove.remove(path5.join(dir, item)))); - }); - function emptyDirSync(dir) { - let items; - try { - items = fs3.readdirSync(dir); - } catch { - return mkdir.mkdirsSync(dir); - } - items.forEach((item) => { - item = path5.join(dir, item); - remove.removeSync(item); - }); - } - module2.exports = { - emptyDirSync, - emptydirSync: emptyDirSync, - emptyDir, - emptydir: emptyDir - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/file.js -var require_file = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromCallback; - var path5 = require("path"); - var fs3 = require_graceful_fs(); - var mkdir = require_mkdirs(); - function createFile(file2, callback) { - function makeFile() { - fs3.writeFile(file2, "", (err) => { - if (err) return callback(err); - callback(); - }); - } - fs3.stat(file2, (err, stats) => { - if (!err && stats.isFile()) return callback(); - const dir = path5.dirname(file2); - fs3.stat(dir, (err2, stats2) => { - if (err2) { - if (err2.code === "ENOENT") { - return mkdir.mkdirs(dir, (err3) => { - if (err3) return callback(err3); - makeFile(); - }); - } - return callback(err2); - } - if (stats2.isDirectory()) makeFile(); - else { - fs3.readdir(dir, (err3) => { - if (err3) return callback(err3); - }); - } - }); - }); - } - function createFileSync(file2) { - let stats; - try { - stats = fs3.statSync(file2); - } catch { - } - if (stats && stats.isFile()) return; - const dir = path5.dirname(file2); - try { - if (!fs3.statSync(dir).isDirectory()) { - fs3.readdirSync(dir); - } - } catch (err) { - if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir); - else throw err; - } - fs3.writeFileSync(file2, ""); - } - module2.exports = { - createFile: u(createFile), - createFileSync - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/link.js -var require_link = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromCallback; - var path5 = require("path"); - var fs3 = require_graceful_fs(); - var mkdir = require_mkdirs(); - var pathExists2 = require_path_exists().pathExists; - var { areIdentical } = require_stat(); - function createLink(srcpath, dstpath, callback) { - function makeLink(srcpath2, dstpath2) { - fs3.link(srcpath2, dstpath2, (err) => { - if (err) return callback(err); - callback(null); - }); - } - fs3.lstat(dstpath, (_, dstStat) => { - fs3.lstat(srcpath, (err, srcStat) => { - if (err) { - err.message = err.message.replace("lstat", "ensureLink"); - return callback(err); - } - if (dstStat && areIdentical(srcStat, dstStat)) return callback(null); - const dir = path5.dirname(dstpath); - pathExists2(dir, (err2, dirExists) => { - if (err2) return callback(err2); - if (dirExists) return makeLink(srcpath, dstpath); - mkdir.mkdirs(dir, (err3) => { - if (err3) return callback(err3); - makeLink(srcpath, dstpath); - }); - }); - }); - }); - } - function createLinkSync(srcpath, dstpath) { - let dstStat; - try { - dstStat = fs3.lstatSync(dstpath); - } catch { - } - try { - const srcStat = fs3.lstatSync(srcpath); - if (dstStat && areIdentical(srcStat, dstStat)) return; - } catch (err) { - err.message = err.message.replace("lstat", "ensureLink"); - throw err; - } - const dir = path5.dirname(dstpath); - const dirExists = fs3.existsSync(dir); - if (dirExists) return fs3.linkSync(srcpath, dstpath); - mkdir.mkdirsSync(dir); - return fs3.linkSync(srcpath, dstpath); - } - module2.exports = { - createLink: u(createLink), - createLinkSync - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-paths.js -var require_symlink_paths = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) { - "use strict"; - var path5 = require("path"); - var fs3 = require_graceful_fs(); - var pathExists2 = require_path_exists().pathExists; - function symlinkPaths(srcpath, dstpath, callback) { - if (path5.isAbsolute(srcpath)) { - return fs3.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace("lstat", "ensureSymlink"); - return callback(err); - } - return callback(null, { - toCwd: srcpath, - toDst: srcpath - }); - }); - } else { - const dstdir = path5.dirname(dstpath); - const relativeToDst = path5.join(dstdir, srcpath); - return pathExists2(relativeToDst, (err, exists) => { - if (err) return callback(err); - if (exists) { - return callback(null, { - toCwd: relativeToDst, - toDst: srcpath - }); - } else { - return fs3.lstat(srcpath, (err2) => { - if (err2) { - err2.message = err2.message.replace("lstat", "ensureSymlink"); - return callback(err2); - } - return callback(null, { - toCwd: srcpath, - toDst: path5.relative(dstdir, srcpath) - }); - }); - } - }); - } - } - function symlinkPathsSync(srcpath, dstpath) { - let exists; - if (path5.isAbsolute(srcpath)) { - exists = fs3.existsSync(srcpath); - if (!exists) throw new Error("absolute srcpath does not exist"); - return { - toCwd: srcpath, - toDst: srcpath - }; - } else { - const dstdir = path5.dirname(dstpath); - const relativeToDst = path5.join(dstdir, srcpath); - exists = fs3.existsSync(relativeToDst); - if (exists) { - return { - toCwd: relativeToDst, - toDst: srcpath - }; - } else { - exists = fs3.existsSync(srcpath); - if (!exists) throw new Error("relative srcpath does not exist"); - return { - toCwd: srcpath, - toDst: path5.relative(dstdir, srcpath) - }; - } - } - } - module2.exports = { - symlinkPaths, - symlinkPathsSync - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-type.js -var require_symlink_type = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) { - "use strict"; - var fs3 = require_graceful_fs(); - function symlinkType(srcpath, type, callback) { - callback = typeof type === "function" ? type : callback; - type = typeof type === "function" ? false : type; - if (type) return callback(null, type); - fs3.lstat(srcpath, (err, stats) => { - if (err) return callback(null, "file"); - type = stats && stats.isDirectory() ? "dir" : "file"; - callback(null, type); - }); - } - function symlinkTypeSync(srcpath, type) { - let stats; - if (type) return type; - try { - stats = fs3.lstatSync(srcpath); - } catch { - return "file"; - } - return stats && stats.isDirectory() ? "dir" : "file"; - } - module2.exports = { - symlinkType, - symlinkTypeSync - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink.js -var require_symlink = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromCallback; - var path5 = require("path"); - var fs3 = require_fs(); - var _mkdirs = require_mkdirs(); - var mkdirs = _mkdirs.mkdirs; - var mkdirsSync = _mkdirs.mkdirsSync; - var _symlinkPaths = require_symlink_paths(); - var symlinkPaths = _symlinkPaths.symlinkPaths; - var symlinkPathsSync = _symlinkPaths.symlinkPathsSync; - var _symlinkType = require_symlink_type(); - var symlinkType = _symlinkType.symlinkType; - var symlinkTypeSync = _symlinkType.symlinkTypeSync; - var pathExists2 = require_path_exists().pathExists; - var { areIdentical } = require_stat(); - function createSymlink(srcpath, dstpath, type, callback) { - callback = typeof type === "function" ? type : callback; - type = typeof type === "function" ? false : type; - fs3.lstat(dstpath, (err, stats) => { - if (!err && stats.isSymbolicLink()) { - Promise.all([ - fs3.stat(srcpath), - fs3.stat(dstpath) - ]).then(([srcStat, dstStat]) => { - if (areIdentical(srcStat, dstStat)) return callback(null); - _createSymlink(srcpath, dstpath, type, callback); - }); - } else _createSymlink(srcpath, dstpath, type, callback); - }); - } - function _createSymlink(srcpath, dstpath, type, callback) { - symlinkPaths(srcpath, dstpath, (err, relative) => { - if (err) return callback(err); - srcpath = relative.toDst; - symlinkType(relative.toCwd, type, (err2, type2) => { - if (err2) return callback(err2); - const dir = path5.dirname(dstpath); - pathExists2(dir, (err3, dirExists) => { - if (err3) return callback(err3); - if (dirExists) return fs3.symlink(srcpath, dstpath, type2, callback); - mkdirs(dir, (err4) => { - if (err4) return callback(err4); - fs3.symlink(srcpath, dstpath, type2, callback); - }); - }); - }); - }); - } - function createSymlinkSync(srcpath, dstpath, type) { - let stats; - try { - stats = fs3.lstatSync(dstpath); - } catch { - } - if (stats && stats.isSymbolicLink()) { - const srcStat = fs3.statSync(srcpath); - const dstStat = fs3.statSync(dstpath); - if (areIdentical(srcStat, dstStat)) return; - } - const relative = symlinkPathsSync(srcpath, dstpath); - srcpath = relative.toDst; - type = symlinkTypeSync(relative.toCwd, type); - const dir = path5.dirname(dstpath); - const exists = fs3.existsSync(dir); - if (exists) return fs3.symlinkSync(srcpath, dstpath, type); - mkdirsSync(dir); - return fs3.symlinkSync(srcpath, dstpath, type); - } - module2.exports = { - createSymlink: u(createSymlink), - createSymlinkSync - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/index.js -var require_ensure = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/index.js"(exports2, module2) { - "use strict"; - var { createFile, createFileSync } = require_file(); - var { createLink, createLinkSync } = require_link(); - var { createSymlink, createSymlinkSync } = require_symlink(); - module2.exports = { - // file - createFile, - createFileSync, - ensureFile: createFile, - ensureFileSync: createFileSync, - // link - createLink, - createLinkSync, - ensureLink: createLink, - ensureLinkSync: createLinkSync, - // symlink - createSymlink, - createSymlinkSync, - ensureSymlink: createSymlink, - ensureSymlinkSync: createSymlinkSync - }; - } -}); - -// ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js -var require_utils2 = __commonJS({ - "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports2, module2) { - "use strict"; - function stringify2(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) { - const EOF = finalEOL ? EOL : ""; - const str = JSON.stringify(obj, replacer, spaces); - return str.replace(/\n/g, EOL) + EOF; - } - function stripBom(content) { - if (Buffer.isBuffer(content)) content = content.toString("utf8"); - return content.replace(/^\uFEFF/, ""); - } - module2.exports = { stringify: stringify2, stripBom }; - } -}); - -// ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js -var require_jsonfile = __commonJS({ - "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js"(exports2, module2) { - "use strict"; - var _fs; - try { - _fs = require_graceful_fs(); - } catch (_) { - _fs = require("fs"); - } - var universalify = require_universalify(); - var { stringify: stringify2, stripBom } = require_utils2(); - async function _readFile(file2, options = {}) { - if (typeof options === "string") { - options = { encoding: options }; - } - const fs3 = options.fs || _fs; - const shouldThrow = "throws" in options ? options.throws : true; - let data = await universalify.fromCallback(fs3.readFile)(file2, options); - data = stripBom(data); - let obj; - try { - obj = JSON.parse(data, options ? options.reviver : null); - } catch (err) { - if (shouldThrow) { - err.message = `${file2}: ${err.message}`; - throw err; - } else { - return null; - } - } - return obj; - } - var readFile = universalify.fromPromise(_readFile); - function readFileSync(file2, options = {}) { - if (typeof options === "string") { - options = { encoding: options }; - } - const fs3 = options.fs || _fs; - const shouldThrow = "throws" in options ? options.throws : true; - try { - let content = fs3.readFileSync(file2, options); - content = stripBom(content); - return JSON.parse(content, options.reviver); - } catch (err) { - if (shouldThrow) { - err.message = `${file2}: ${err.message}`; - throw err; - } else { - return null; - } - } - } - async function _writeFile(file2, obj, options = {}) { - const fs3 = options.fs || _fs; - const str = stringify2(obj, options); - await universalify.fromCallback(fs3.writeFile)(file2, str, options); - } - var writeFile = universalify.fromPromise(_writeFile); - function writeFileSync(file2, obj, options = {}) { - const fs3 = options.fs || _fs; - const str = stringify2(obj, options); - return fs3.writeFileSync(file2, str, options); - } - var jsonfile = { - readFile, - readFileSync, - writeFile, - writeFileSync - }; - module2.exports = jsonfile; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/jsonfile.js -var require_jsonfile2 = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/jsonfile.js"(exports2, module2) { - "use strict"; - var jsonFile = require_jsonfile(); - module2.exports = { - // jsonfile exports - readJson: jsonFile.readFile, - readJsonSync: jsonFile.readFileSync, - writeJson: jsonFile.writeFile, - writeJsonSync: jsonFile.writeFileSync - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/output-file/index.js -var require_output_file = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromCallback; - var fs3 = require_graceful_fs(); - var path5 = require("path"); - var mkdir = require_mkdirs(); - var pathExists2 = require_path_exists().pathExists; - function outputFile(file2, data, encoding, callback) { - if (typeof encoding === "function") { - callback = encoding; - encoding = "utf8"; - } - const dir = path5.dirname(file2); - pathExists2(dir, (err, itDoes) => { - if (err) return callback(err); - if (itDoes) return fs3.writeFile(file2, data, encoding, callback); - mkdir.mkdirs(dir, (err2) => { - if (err2) return callback(err2); - fs3.writeFile(file2, data, encoding, callback); - }); - }); - } - function outputFileSync(file2, ...args) { - const dir = path5.dirname(file2); - if (fs3.existsSync(dir)) { - return fs3.writeFileSync(file2, ...args); - } - mkdir.mkdirsSync(dir); - fs3.writeFileSync(file2, ...args); - } - module2.exports = { - outputFile: u(outputFile), - outputFileSync - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json.js -var require_output_json = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json.js"(exports2, module2) { - "use strict"; - var { stringify: stringify2 } = require_utils2(); - var { outputFile } = require_output_file(); - async function outputJson(file2, data, options = {}) { - const str = stringify2(data, options); - await outputFile(file2, str, options); - } - module2.exports = outputJson; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json-sync.js -var require_output_json_sync = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json-sync.js"(exports2, module2) { - "use strict"; - var { stringify: stringify2 } = require_utils2(); - var { outputFileSync } = require_output_file(); - function outputJsonSync(file2, data, options) { - const str = stringify2(data, options); - outputFileSync(file2, str, options); - } - module2.exports = outputJsonSync; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/index.js -var require_json = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - var jsonFile = require_jsonfile2(); - jsonFile.outputJson = u(require_output_json()); - jsonFile.outputJsonSync = require_output_json_sync(); - jsonFile.outputJSON = jsonFile.outputJson; - jsonFile.outputJSONSync = jsonFile.outputJsonSync; - jsonFile.writeJSON = jsonFile.writeJson; - jsonFile.writeJSONSync = jsonFile.writeJsonSync; - jsonFile.readJSON = jsonFile.readJson; - jsonFile.readJSONSync = jsonFile.readJsonSync; - module2.exports = jsonFile; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move.js -var require_move = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move.js"(exports2, module2) { - "use strict"; - var fs3 = require_graceful_fs(); - var path5 = require("path"); - var copy = require_copy2().copy; - var remove = require_remove().remove; - var mkdirp = require_mkdirs().mkdirp; - var pathExists2 = require_path_exists().pathExists; - var stat = require_stat(); - function move(src, dest, opts, cb) { - if (typeof opts === "function") { - cb = opts; - opts = {}; - } - opts = opts || {}; - const overwrite = opts.overwrite || opts.clobber || false; - stat.checkPaths(src, dest, "move", opts, (err, stats) => { - if (err) return cb(err); - const { srcStat, isChangingCase = false } = stats; - stat.checkParentPaths(src, srcStat, dest, "move", (err2) => { - if (err2) return cb(err2); - if (isParentRoot(dest)) return doRename(src, dest, overwrite, isChangingCase, cb); - mkdirp(path5.dirname(dest), (err3) => { - if (err3) return cb(err3); - return doRename(src, dest, overwrite, isChangingCase, cb); - }); - }); - }); - } - function isParentRoot(dest) { - const parent = path5.dirname(dest); - const parsedPath = path5.parse(parent); - return parsedPath.root === parent; - } - function doRename(src, dest, overwrite, isChangingCase, cb) { - if (isChangingCase) return rename(src, dest, overwrite, cb); - if (overwrite) { - return remove(dest, (err) => { - if (err) return cb(err); - return rename(src, dest, overwrite, cb); - }); - } - pathExists2(dest, (err, destExists) => { - if (err) return cb(err); - if (destExists) return cb(new Error("dest already exists.")); - return rename(src, dest, overwrite, cb); - }); - } - function rename(src, dest, overwrite, cb) { - fs3.rename(src, dest, (err) => { - if (!err) return cb(); - if (err.code !== "EXDEV") return cb(err); - return moveAcrossDevice(src, dest, overwrite, cb); - }); - } - function moveAcrossDevice(src, dest, overwrite, cb) { - const opts = { - overwrite, - errorOnExist: true, - preserveTimestamps: true - }; - copy(src, dest, opts, (err) => { - if (err) return cb(err); - return remove(src, cb); - }); - } - module2.exports = move; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move-sync.js -var require_move_sync = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) { - "use strict"; - var fs3 = require_graceful_fs(); - var path5 = require("path"); - var copySync = require_copy2().copySync; - var removeSync = require_remove().removeSync; - var mkdirpSync = require_mkdirs().mkdirpSync; - var stat = require_stat(); - function moveSync(src, dest, opts) { - opts = opts || {}; - const overwrite = opts.overwrite || opts.clobber || false; - const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts); - stat.checkParentPathsSync(src, srcStat, dest, "move"); - if (!isParentRoot(dest)) mkdirpSync(path5.dirname(dest)); - return doRename(src, dest, overwrite, isChangingCase); - } - function isParentRoot(dest) { - const parent = path5.dirname(dest); - const parsedPath = path5.parse(parent); - return parsedPath.root === parent; - } - function doRename(src, dest, overwrite, isChangingCase) { - if (isChangingCase) return rename(src, dest, overwrite); - if (overwrite) { - removeSync(dest); - return rename(src, dest, overwrite); - } - if (fs3.existsSync(dest)) throw new Error("dest already exists."); - return rename(src, dest, overwrite); - } - function rename(src, dest, overwrite) { - try { - fs3.renameSync(src, dest); - } catch (err) { - if (err.code !== "EXDEV") throw err; - return moveAcrossDevice(src, dest, overwrite); - } - } - function moveAcrossDevice(src, dest, overwrite) { - const opts = { - overwrite, - errorOnExist: true, - preserveTimestamps: true - }; - copySync(src, dest, opts); - return removeSync(src); - } - module2.exports = moveSync; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/index.js -var require_move2 = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromCallback; - module2.exports = { - move: u(require_move()), - moveSync: require_move_sync() - }; - } -}); - -// ../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/index.js -var require_lib = __commonJS({ - "../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/index.js"(exports2, module2) { - "use strict"; - module2.exports = { - // Export promiseified graceful-fs: - ...require_fs(), - // Export extra methods: - ...require_copy2(), - ...require_empty(), - ...require_ensure(), - ...require_json(), - ...require_mkdirs(), - ...require_move2(), - ...require_output_file(), - ...require_path_exists(), - ...require_remove() - }; - } -}); - -// ../../node_modules/.pnpm/common-path-prefix@3.0.0/node_modules/common-path-prefix/index.js -var require_common_path_prefix = __commonJS({ - "../../node_modules/.pnpm/common-path-prefix@3.0.0/node_modules/common-path-prefix/index.js"(exports2, module2) { - "use strict"; - var { sep: DEFAULT_SEPARATOR } = require("path"); - var determineSeparator = (paths2) => { - for (const path5 of paths2) { - const match = /(\/|\\)/.exec(path5); - if (match !== null) return match[0]; - } - return DEFAULT_SEPARATOR; - }; - module2.exports = function commonPathPrefix2(paths2, sep = determineSeparator(paths2)) { - const [first = "", ...remaining] = paths2; - if (first === "" || remaining.length === 0) return ""; - const parts = first.split(sep); - let endOfPrefix = parts.length; - for (const path5 of remaining) { - const compare = path5.split(sep); - for (let i = 0; i < endOfPrefix; i++) { - if (compare[i] !== parts[i]) { - endOfPrefix = i; - } - } - if (endOfPrefix === 0) return ""; - } - const prefix = parts.slice(0, endOfPrefix).join(sep); - return prefix.endsWith(sep) ? prefix : prefix + sep; - }; - } -}); - -// ../../node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js -var require_indent_string = __commonJS({ - "../../node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js"(exports2, module2) { - "use strict"; - module2.exports = (string, count = 1, options) => { - options = { - indent: " ", - includeEmptyLines: false, - ...options - }; - if (typeof string !== "string") { - throw new TypeError( - `Expected \`input\` to be a \`string\`, got \`${typeof string}\`` - ); - } - if (typeof count !== "number") { - throw new TypeError( - `Expected \`count\` to be a \`number\`, got \`${typeof count}\`` - ); - } - if (typeof options.indent !== "string") { - throw new TypeError( - `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\`` - ); - } - if (count === 0) { - return string; - } - const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm; - return string.replace(regex, options.indent.repeat(count)); - }; - } -}); - -// ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/identifier.js -var require_identifier = __commonJS({ - "../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/identifier.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - exports2.isIdentifierChar = isIdentifierChar; - exports2.isIdentifierName = isIdentifierName2; - exports2.isIdentifierStart = isIdentifierStart; - var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC"; - var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65"; - var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); - var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); - nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; - var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191]; - var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; - function isInAstralSet(code, set) { - let pos = 65536; - for (let i = 0, length = set.length; i < length; i += 2) { - pos += set[i]; - if (pos > code) return false; - pos += set[i + 1]; - if (pos >= code) return true; - } - return false; - } - function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - if (code <= 65535) { - return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - return isInAstralSet(code, astralIdentifierStartCodes); - } - function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - if (code <= 65535) { - return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code)); - } - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); - } - function isIdentifierName2(name) { - let isFirst = true; - for (let i = 0; i < name.length; i++) { - let cp = name.charCodeAt(i); - if ((cp & 64512) === 55296 && i + 1 < name.length) { - const trail = name.charCodeAt(++i); - if ((trail & 64512) === 56320) { - cp = 65536 + ((cp & 1023) << 10) + (trail & 1023); - } - } - if (isFirst) { - isFirst = false; - if (!isIdentifierStart(cp)) { - return false; - } - } else if (!isIdentifierChar(cp)) { - return false; - } - } - return !isFirst; - } - } -}); - -// ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/keyword.js -var require_keyword = __commonJS({ - "../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/keyword.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - exports2.isKeyword = isKeyword; - exports2.isReservedWord = isReservedWord; - exports2.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; - exports2.isStrictBindReservedWord = isStrictBindReservedWord; - exports2.isStrictReservedWord = isStrictReservedWord; - var reservedWords = { - keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], - strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], - strictBind: ["eval", "arguments"] - }; - var keywords = new Set(reservedWords.keyword); - var reservedWordsStrictSet = new Set(reservedWords.strict); - var reservedWordsStrictBindSet = new Set(reservedWords.strictBind); - function isReservedWord(word, inModule) { - return inModule && word === "await" || word === "enum"; - } - function isStrictReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); - } - function isStrictBindOnlyReservedWord(word) { - return reservedWordsStrictBindSet.has(word); - } - function isStrictBindReservedWord(word, inModule) { - return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); - } - function isKeyword(word) { - return keywords.has(word); - } - } -}); - -// ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/index.js -var require_lib2 = __commonJS({ - "../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - Object.defineProperty(exports2, "isIdentifierChar", { - enumerable: true, - get: function() { - return _identifier.isIdentifierChar; - } - }); - Object.defineProperty(exports2, "isIdentifierName", { - enumerable: true, - get: function() { - return _identifier.isIdentifierName; - } - }); - Object.defineProperty(exports2, "isIdentifierStart", { - enumerable: true, - get: function() { - return _identifier.isIdentifierStart; - } - }); - Object.defineProperty(exports2, "isKeyword", { - enumerable: true, - get: function() { - return _keyword.isKeyword; - } - }); - Object.defineProperty(exports2, "isReservedWord", { - enumerable: true, - get: function() { - return _keyword.isReservedWord; - } - }); - Object.defineProperty(exports2, "isStrictBindOnlyReservedWord", { - enumerable: true, - get: function() { - return _keyword.isStrictBindOnlyReservedWord; - } - }); - Object.defineProperty(exports2, "isStrictBindReservedWord", { - enumerable: true, - get: function() { - return _keyword.isStrictBindReservedWord; - } - }); - Object.defineProperty(exports2, "isStrictReservedWord", { - enumerable: true, - get: function() { - return _keyword.isStrictReservedWord; - } - }); - var _identifier = require_identifier(); - var _keyword = require_keyword(); - } -}); - -// ../../node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.js -var require_pluralize = __commonJS({ - "../../node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.js"(exports2, module2) { - "use strict"; - (function(root, pluralize3) { - if (typeof require === "function" && typeof exports2 === "object" && typeof module2 === "object") { - module2.exports = pluralize3(); - } else if (typeof define === "function" && define.amd) { - define(function() { - return pluralize3(); - }); - } else { - root.pluralize = pluralize3(); - } - })(exports2, function() { - var pluralRules = []; - var singularRules = []; - var uncountables = {}; - var irregularPlurals = {}; - var irregularSingles = {}; - function sanitizeRule(rule) { - if (typeof rule === "string") { - return new RegExp("^" + rule + "$", "i"); - } - return rule; - } - function restoreCase(word, token) { - if (word === token) return token; - if (word === word.toLowerCase()) return token.toLowerCase(); - if (word === word.toUpperCase()) return token.toUpperCase(); - if (word[0] === word[0].toUpperCase()) { - return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase(); - } - return token.toLowerCase(); - } - function interpolate(str, args) { - return str.replace(/\$(\d{1,2})/g, function(match, index) { - return args[index] || ""; - }); - } - function replace(word, rule) { - return word.replace(rule[0], function(match, index) { - var result = interpolate(rule[1], arguments); - if (match === "") { - return restoreCase(word[index - 1], result); - } - return restoreCase(match, result); - }); - } - function sanitizeWord(token, word, rules) { - if (!token.length || uncountables.hasOwnProperty(token)) { - return word; - } - var len = rules.length; - while (len--) { - var rule = rules[len]; - if (rule[0].test(word)) return replace(word, rule); - } - return word; - } - function replaceWord(replaceMap, keepMap, rules) { - return function(word) { - var token = word.toLowerCase(); - if (keepMap.hasOwnProperty(token)) { - return restoreCase(word, token); - } - if (replaceMap.hasOwnProperty(token)) { - return restoreCase(word, replaceMap[token]); - } - return sanitizeWord(token, word, rules); - }; - } - function checkWord(replaceMap, keepMap, rules, bool) { - return function(word) { - var token = word.toLowerCase(); - if (keepMap.hasOwnProperty(token)) return true; - if (replaceMap.hasOwnProperty(token)) return false; - return sanitizeWord(token, token, rules) === token; - }; - } - function pluralize3(word, count, inclusive) { - var pluralized = count === 1 ? pluralize3.singular(word) : pluralize3.plural(word); - return (inclusive ? count + " " : "") + pluralized; - } - pluralize3.plural = replaceWord( - irregularSingles, - irregularPlurals, - pluralRules - ); - pluralize3.isPlural = checkWord( - irregularSingles, - irregularPlurals, - pluralRules - ); - pluralize3.singular = replaceWord( - irregularPlurals, - irregularSingles, - singularRules - ); - pluralize3.isSingular = checkWord( - irregularPlurals, - irregularSingles, - singularRules - ); - pluralize3.addPluralRule = function(rule, replacement) { - pluralRules.push([sanitizeRule(rule), replacement]); - }; - pluralize3.addSingularRule = function(rule, replacement) { - singularRules.push([sanitizeRule(rule), replacement]); - }; - pluralize3.addUncountableRule = function(word) { - if (typeof word === "string") { - uncountables[word.toLowerCase()] = true; - return; - } - pluralize3.addPluralRule(word, "$0"); - pluralize3.addSingularRule(word, "$0"); - }; - pluralize3.addIrregularRule = function(single, plural) { - plural = plural.toLowerCase(); - single = single.toLowerCase(); - irregularSingles[single] = plural; - irregularPlurals[plural] = single; - }; - [ - // Pronouns. - ["I", "we"], - ["me", "us"], - ["he", "they"], - ["she", "they"], - ["them", "them"], - ["myself", "ourselves"], - ["yourself", "yourselves"], - ["itself", "themselves"], - ["herself", "themselves"], - ["himself", "themselves"], - ["themself", "themselves"], - ["is", "are"], - ["was", "were"], - ["has", "have"], - ["this", "these"], - ["that", "those"], - // Words ending in with a consonant and `o`. - ["echo", "echoes"], - ["dingo", "dingoes"], - ["volcano", "volcanoes"], - ["tornado", "tornadoes"], - ["torpedo", "torpedoes"], - // Ends with `us`. - ["genus", "genera"], - ["viscus", "viscera"], - // Ends with `ma`. - ["stigma", "stigmata"], - ["stoma", "stomata"], - ["dogma", "dogmata"], - ["lemma", "lemmata"], - ["schema", "schemata"], - ["anathema", "anathemata"], - // Other irregular rules. - ["ox", "oxen"], - ["axe", "axes"], - ["die", "dice"], - ["yes", "yeses"], - ["foot", "feet"], - ["eave", "eaves"], - ["goose", "geese"], - ["tooth", "teeth"], - ["quiz", "quizzes"], - ["human", "humans"], - ["proof", "proofs"], - ["carve", "carves"], - ["valve", "valves"], - ["looey", "looies"], - ["thief", "thieves"], - ["groove", "grooves"], - ["pickaxe", "pickaxes"], - ["passerby", "passersby"] - ].forEach(function(rule) { - return pluralize3.addIrregularRule(rule[0], rule[1]); - }); - [ - [/s?$/i, "s"], - [/[^\u0000-\u007F]$/i, "$0"], - [/([^aeiou]ese)$/i, "$1"], - [/(ax|test)is$/i, "$1es"], - [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, "$1es"], - [/(e[mn]u)s?$/i, "$1s"], - [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, "$1"], - [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1i"], - [/(alumn|alg|vertebr)(?:a|ae)$/i, "$1ae"], - [/(seraph|cherub)(?:im)?$/i, "$1im"], - [/(her|at|gr)o$/i, "$1oes"], - [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, "$1a"], - [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, "$1a"], - [/sis$/i, "ses"], - [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, "$1$2ves"], - [/([^aeiouy]|qu)y$/i, "$1ies"], - [/([^ch][ieo][ln])ey$/i, "$1ies"], - [/(x|ch|ss|sh|zz)$/i, "$1es"], - [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, "$1ices"], - [/\b((?:tit)?m|l)(?:ice|ouse)$/i, "$1ice"], - [/(pe)(?:rson|ople)$/i, "$1ople"], - [/(child)(?:ren)?$/i, "$1ren"], - [/eaux$/i, "$0"], - [/m[ae]n$/i, "men"], - ["thou", "you"] - ].forEach(function(rule) { - return pluralize3.addPluralRule(rule[0], rule[1]); - }); - [ - [/s$/i, ""], - [/(ss)$/i, "$1"], - [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, "$1fe"], - [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, "$1f"], - [/ies$/i, "y"], - [/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, "$1ie"], - [/\b(mon|smil)ies$/i, "$1ey"], - [/\b((?:tit)?m|l)ice$/i, "$1ouse"], - [/(seraph|cherub)im$/i, "$1"], - [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, "$1"], - [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, "$1sis"], - [/(movie|twelve|abuse|e[mn]u)s$/i, "$1"], - [/(test)(?:is|es)$/i, "$1is"], - [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1us"], - [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, "$1um"], - [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, "$1on"], - [/(alumn|alg|vertebr)ae$/i, "$1a"], - [/(cod|mur|sil|vert|ind)ices$/i, "$1ex"], - [/(matr|append)ices$/i, "$1ix"], - [/(pe)(rson|ople)$/i, "$1rson"], - [/(child)ren$/i, "$1"], - [/(eau)x?$/i, "$1"], - [/men$/i, "man"] - ].forEach(function(rule) { - return pluralize3.addSingularRule(rule[0], rule[1]); - }); - [ - // Singular words with no plurals. - "adulthood", - "advice", - "agenda", - "aid", - "aircraft", - "alcohol", - "ammo", - "analytics", - "anime", - "athletics", - "audio", - "bison", - "blood", - "bream", - "buffalo", - "butter", - "carp", - "cash", - "chassis", - "chess", - "clothing", - "cod", - "commerce", - "cooperation", - "corps", - "debris", - "diabetes", - "digestion", - "elk", - "energy", - "equipment", - "excretion", - "expertise", - "firmware", - "flounder", - "fun", - "gallows", - "garbage", - "graffiti", - "hardware", - "headquarters", - "health", - "herpes", - "highjinks", - "homework", - "housework", - "information", - "jeans", - "justice", - "kudos", - "labour", - "literature", - "machinery", - "mackerel", - "mail", - "media", - "mews", - "moose", - "music", - "mud", - "manga", - "news", - "only", - "personnel", - "pike", - "plankton", - "pliers", - "police", - "pollution", - "premises", - "rain", - "research", - "rice", - "salmon", - "scissors", - "series", - "sewage", - "shambles", - "shrimp", - "software", - "species", - "staff", - "swine", - "tennis", - "traffic", - "transportation", - "trout", - "tuna", - "wealth", - "welfare", - "whiting", - "wildebeest", - "wildlife", - "you", - /pok[eé]mon$/i, - // Regexes. - /[^aeiou]ese$/i, - // "chinese", "japanese" - /deer$/i, - // "deer", "reindeer" - /fish$/i, - // "fish", "blowfish", "angelfish" - /measles$/i, - /o[iu]s$/i, - // "carnivorous" - /pox$/i, - // "chickpox", "smallpox" - /sheep$/i - ].forEach(pluralize3.addUncountableRule); - return pluralize3; - }); - } -}); - -// ../../node_modules/.pnpm/env-paths@2.2.1/node_modules/env-paths/index.js -var require_env_paths = __commonJS({ - "../../node_modules/.pnpm/env-paths@2.2.1/node_modules/env-paths/index.js"(exports2, module2) { - "use strict"; - var path5 = require("path"); - var os = require("os"); - var homedir = os.homedir(); - var tmpdir = os.tmpdir(); - var { env: env2 } = process; - var macos = (name) => { - const library = path5.join(homedir, "Library"); - return { - data: path5.join(library, "Application Support", name), - config: path5.join(library, "Preferences", name), - cache: path5.join(library, "Caches", name), - log: path5.join(library, "Logs", name), - temp: path5.join(tmpdir, name) - }; - }; - var windows = (name) => { - const appData = env2.APPDATA || path5.join(homedir, "AppData", "Roaming"); - const localAppData = env2.LOCALAPPDATA || path5.join(homedir, "AppData", "Local"); - return { - // Data/config/cache/log are invented by me as Windows isn't opinionated about this - data: path5.join(localAppData, name, "Data"), - config: path5.join(appData, name, "Config"), - cache: path5.join(localAppData, name, "Cache"), - log: path5.join(localAppData, name, "Log"), - temp: path5.join(tmpdir, name) - }; - }; - var linux = (name) => { - const username = path5.basename(homedir); - return { - data: path5.join(env2.XDG_DATA_HOME || path5.join(homedir, ".local", "share"), name), - config: path5.join(env2.XDG_CONFIG_HOME || path5.join(homedir, ".config"), name), - cache: path5.join(env2.XDG_CACHE_HOME || path5.join(homedir, ".cache"), name), - // https://wiki.debian.org/XDGBaseDirectorySpecification#state - log: path5.join(env2.XDG_STATE_HOME || path5.join(homedir, ".local", "state"), name), - temp: path5.join(tmpdir, username, name) - }; - }; - var envPaths = (name, options) => { - if (typeof name !== "string") { - throw new TypeError(`Expected string, got ${typeof name}`); - } - options = Object.assign({ suffix: "nodejs" }, options); - if (options.suffix) { - name += `-${options.suffix}`; - } - if (process.platform === "darwin") { - return macos(name); - } - if (process.platform === "win32") { - return windows(name); - } - return linux(name); - }; - module2.exports = envPaths; - module2.exports.default = envPaths; - } -}); - -// ../../node_modules/.pnpm/path-exists@3.0.0/node_modules/path-exists/index.js -var require_path_exists2 = __commonJS({ - "../../node_modules/.pnpm/path-exists@3.0.0/node_modules/path-exists/index.js"(exports2, module2) { - "use strict"; - var fs3 = require("fs"); - module2.exports = (fp) => new Promise((resolve) => { - fs3.access(fp, (err) => { - resolve(!err); - }); - }); - module2.exports.sync = (fp) => { - try { - fs3.accessSync(fp); - return true; - } catch (err) { - return false; - } - }; - } -}); - -// ../../node_modules/.pnpm/p-try@2.2.0/node_modules/p-try/index.js -var require_p_try = __commonJS({ - "../../node_modules/.pnpm/p-try@2.2.0/node_modules/p-try/index.js"(exports2, module2) { - "use strict"; - var pTry = (fn, ...arguments_) => new Promise((resolve) => { - resolve(fn(...arguments_)); - }); - module2.exports = pTry; - module2.exports.default = pTry; - } -}); - -// ../../node_modules/.pnpm/p-limit@2.3.0/node_modules/p-limit/index.js -var require_p_limit = __commonJS({ - "../../node_modules/.pnpm/p-limit@2.3.0/node_modules/p-limit/index.js"(exports2, module2) { - "use strict"; - var pTry = require_p_try(); - var pLimit2 = (concurrency) => { - if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { - return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up")); - } - const queue = []; - let activeCount = 0; - const next = () => { - activeCount--; - if (queue.length > 0) { - queue.shift()(); - } - }; - const run = (fn, resolve, ...args) => { - activeCount++; - const result = pTry(fn, ...args); - resolve(result); - result.then(next, next); - }; - const enqueue = (fn, resolve, ...args) => { - if (activeCount < concurrency) { - run(fn, resolve, ...args); - } else { - queue.push(run.bind(null, fn, resolve, ...args)); - } - }; - const generator = (fn, ...args) => new Promise((resolve) => enqueue(fn, resolve, ...args)); - Object.defineProperties(generator, { - activeCount: { - get: () => activeCount - }, - pendingCount: { - get: () => queue.length - }, - clearQueue: { - value: () => { - queue.length = 0; - } - } - }); - return generator; - }; - module2.exports = pLimit2; - module2.exports.default = pLimit2; - } -}); - -// ../../node_modules/.pnpm/p-locate@3.0.0/node_modules/p-locate/index.js -var require_p_locate = __commonJS({ - "../../node_modules/.pnpm/p-locate@3.0.0/node_modules/p-locate/index.js"(exports2, module2) { - "use strict"; - var pLimit2 = require_p_limit(); - var EndError = class extends Error { - constructor(value) { - super(); - this.value = value; - } - }; - var testElement = (el, tester) => Promise.resolve(el).then(tester); - var finder = (el) => Promise.all(el).then((val) => val[1] === true && Promise.reject(new EndError(val[0]))); - module2.exports = (iterable, tester, opts) => { - opts = Object.assign({ - concurrency: Infinity, - preserveOrder: true - }, opts); - const limit = pLimit2(opts.concurrency); - const items = [...iterable].map((el) => [el, limit(testElement, el, tester)]); - const checkLimit = pLimit2(opts.preserveOrder ? 1 : Infinity); - return Promise.all(items.map((el) => checkLimit(finder, el))).then(() => { - }).catch((err) => err instanceof EndError ? err.value : Promise.reject(err)); - }; - } -}); - -// ../../node_modules/.pnpm/locate-path@3.0.0/node_modules/locate-path/index.js -var require_locate_path = __commonJS({ - "../../node_modules/.pnpm/locate-path@3.0.0/node_modules/locate-path/index.js"(exports2, module2) { - "use strict"; - var path5 = require("path"); - var pathExists2 = require_path_exists2(); - var pLocate2 = require_p_locate(); - module2.exports = (iterable, options) => { - options = Object.assign({ - cwd: process.cwd() - }, options); - return pLocate2(iterable, (el) => pathExists2(path5.resolve(options.cwd, el)), options); - }; - module2.exports.sync = (iterable, options) => { - options = Object.assign({ - cwd: process.cwd() - }, options); - for (const el of iterable) { - if (pathExists2.sync(path5.resolve(options.cwd, el))) { - return el; - } - } - }; - } -}); - -// ../../node_modules/.pnpm/find-up@3.0.0/node_modules/find-up/index.js -var require_find_up = __commonJS({ - "../../node_modules/.pnpm/find-up@3.0.0/node_modules/find-up/index.js"(exports2, module2) { - "use strict"; - var path5 = require("path"); - var locatePath2 = require_locate_path(); - module2.exports = (filename, opts = {}) => { - const startDir = path5.resolve(opts.cwd || ""); - const { root } = path5.parse(startDir); - const filenames = [].concat(filename); - return new Promise((resolve) => { - (function find(dir) { - locatePath2(filenames, { cwd: dir }).then((file2) => { - if (file2) { - resolve(path5.join(dir, file2)); - } else if (dir === root) { - resolve(null); - } else { - find(path5.dirname(dir)); - } - }); - })(startDir); - }); - }; - module2.exports.sync = (filename, opts = {}) => { - let dir = path5.resolve(opts.cwd || ""); - const { root } = path5.parse(dir); - const filenames = [].concat(filename); - while (true) { - const file2 = locatePath2.sync(filenames, { cwd: dir }); - if (file2) { - return path5.join(dir, file2); - } - if (dir === root) { - return null; - } - dir = path5.dirname(dir); - } - }; - } -}); - -// ../../node_modules/.pnpm/pkg-up@3.1.0/node_modules/pkg-up/index.js -var require_pkg_up = __commonJS({ - "../../node_modules/.pnpm/pkg-up@3.1.0/node_modules/pkg-up/index.js"(exports2, module2) { - "use strict"; - var findUp2 = require_find_up(); - module2.exports = async ({ cwd: cwd2 } = {}) => findUp2("package.json", { cwd: cwd2 }); - module2.exports.sync = ({ cwd: cwd2 } = {}) => findUp2.sync("package.json", { cwd: cwd2 }); - } -}); - -// package.json -var require_package2 = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "@prisma/client", - version: "5.21.1", - description: "Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.", - keywords: [ - "ORM", - "Prisma", - "prisma2", - "Prisma Client", - "client", - "query", - "query-builder", - "database", - "db", - "JavaScript", - "JS", - "TypeScript", - "TS", - "SQL", - "SQLite", - "pg", - "Postgres", - "PostgreSQL", - "CockroachDB", - "MySQL", - "MariaDB", - "MSSQL", - "SQL Server", - "SQLServer", - "MongoDB", - "react-native" - ], - main: "default.js", - types: "default.d.ts", - browser: "index-browser.js", - exports: { - "./package.json": "./package.json", - ".": { - require: { - types: "./default.d.ts", - node: "./default.js", - "edge-light": "./default.js", - workerd: "./default.js", - worker: "./default.js", - browser: "./index-browser.js" - }, - import: { - types: "./default.d.ts", - node: "./default.js", - "edge-light": "./default.js", - workerd: "./default.js", - worker: "./default.js", - browser: "./index-browser.js" - }, - default: "./default.js" - }, - "./edge": { - types: "./edge.d.ts", - require: "./edge.js", - import: "./edge.js", - default: "./edge.js" - }, - "./react-native": { - types: "./react-native.d.ts", - require: "./react-native.js", - import: "./react-native.js", - default: "./react-native.js" - }, - "./extension": { - types: "./extension.d.ts", - require: "./extension.js", - import: "./extension.js", - default: "./extension.js" - }, - "./index-browser": { - types: "./index.d.ts", - require: "./index-browser.js", - import: "./index-browser.js", - default: "./index-browser.js" - }, - "./index": { - types: "./index.d.ts", - require: "./index.js", - import: "./index.js", - default: "./index.js" - }, - "./wasm": { - types: "./wasm.d.ts", - require: "./wasm.js", - import: "./wasm.js", - default: "./wasm.js" - }, - "./runtime/library": { - types: "./runtime/library.d.ts", - require: "./runtime/library.js", - import: "./runtime/library.js", - default: "./runtime/library.js" - }, - "./runtime/binary": { - types: "./runtime/binary.d.ts", - require: "./runtime/binary.js", - import: "./runtime/binary.js", - default: "./runtime/binary.js" - }, - "./generator-build": { - require: "./generator-build/index.js", - import: "./generator-build/index.js", - default: "./generator-build/index.js" - }, - "./sql": { - require: { - types: "./sql.d.ts", - node: "./sql.js", - default: "./sql.js" - }, - import: { - types: "./sql.d.ts", - node: "./sql.mjs", - default: "./sql.mjs" - }, - default: "./sql.js" - }, - "./*": "./*" - }, - license: "Apache-2.0", - engines: { - node: ">=16.13" - }, - homepage: "https://www.prisma.io", - repository: { - type: "git", - url: "https://github.com/prisma/prisma.git", - directory: "packages/client" - }, - author: "Tim Suchanek ", - bugs: "https://github.com/prisma/prisma/issues", - scripts: { - dev: "DEV=true tsx helpers/build.ts", - build: "tsx helpers/build.ts", - test: "dotenv -e ../../.db.env -- jest --silent", - "test:e2e": "dotenv -e ../../.db.env -- tsx tests/e2e/_utils/run.ts", - "test:functional": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts", - "test:memory": "dotenv -e ../../.db.env -- tsx helpers/memory-tests.ts", - "test:functional:code": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --no-types", - "test:functional:types": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --types-only", - "test-notypes": "dotenv -e ../../.db.env -- jest --testPathIgnorePatterns src/__tests__/types/types.test.ts", - generate: "node scripts/postinstall.js", - postinstall: "node scripts/postinstall.js", - prepublishOnly: "pnpm run build", - "new-test": "tsx ./helpers/new-test/new-test.ts" - }, - files: [ - "README.md", - "runtime", - "!runtime/*.map", - "scripts", - "generator-build", - "edge.js", - "edge.d.ts", - "wasm.js", - "wasm.d.ts", - "index.js", - "index.d.ts", - "react-native.js", - "react-native.d.ts", - "default.js", - "default.d.ts", - "index-browser.js", - "extension.js", - "extension.d.ts", - "sql.d.ts", - "sql.js", - "sql.mjs" - ], - devDependencies: { - "@cloudflare/workers-types": "4.20240614.0", - "@codspeed/benchmark.js-plugin": "3.1.1", - "@faker-js/faker": "8.4.1", - "@fast-check/jest": "1.8.2", - "@inquirer/prompts": "5.0.5", - "@jest/create-cache-key-function": "29.7.0", - "@jest/globals": "29.7.0", - "@jest/test-sequencer": "29.7.0", - "@libsql/client": "0.8.0", - "@neondatabase/serverless": "0.9.3", - "@opentelemetry/api": "1.9.0", - "@opentelemetry/context-async-hooks": "1.25.1", - "@opentelemetry/instrumentation": "0.52.1", - "@opentelemetry/resources": "1.25.1", - "@opentelemetry/sdk-trace-base": "1.25.1", - "@opentelemetry/semantic-conventions": "1.25.1", - "@planetscale/database": "1.18.0", - "@prisma/adapter-d1": "workspace:*", - "@prisma/adapter-libsql": "workspace:*", - "@prisma/adapter-neon": "workspace:*", - "@prisma/adapter-pg": "workspace:*", - "@prisma/adapter-pg-worker": "workspace:*", - "@prisma/adapter-planetscale": "workspace:*", - "@prisma/debug": "workspace:*", - "@prisma/driver-adapter-utils": "workspace:*", - "@prisma/engines": "workspace:*", - "@prisma/engines-version": "5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36", - "@prisma/fetch-engine": "workspace:*", - "@prisma/generator-helper": "workspace:*", - "@prisma/get-platform": "workspace:*", - "@prisma/instrumentation": "workspace:*", - "@prisma/internals": "workspace:*", - "@prisma/migrate": "workspace:*", - "@prisma/mini-proxy": "0.9.5", - "@prisma/pg-worker": "workspace:*", - "@prisma/query-engine-wasm": "5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36", - "@snaplet/copycat": "0.17.3", - "@swc-node/register": "1.10.9", - "@swc/core": "1.6.13", - "@swc/jest": "0.2.36", - "@timsuchanek/copy": "1.4.5", - "@types/debug": "4.1.12", - "@types/fs-extra": "9.0.13", - "@types/jest": "29.5.12", - "@types/js-levenshtein": "1.1.3", - "@types/mssql": "9.1.5", - "@types/node": "18.19.31", - "@types/pg": "8.11.6", - arg: "5.0.2", - benchmark: "2.1.4", - "ci-info": "4.0.0", - "decimal.js": "10.4.3", - "detect-runtime": "1.0.4", - "env-paths": "2.2.1", - esbuild: "0.23.0", - execa: "5.1.1", - "expect-type": "0.19.0", - "flat-map-polyfill": "0.3.8", - "fs-extra": "11.1.1", - "get-stream": "6.0.1", - globby: "11.1.0", - "indent-string": "4.0.0", - jest: "29.7.0", - "jest-extended": "4.0.2", - "jest-junit": "16.0.0", - "jest-serializer-ansi-escapes": "3.0.0", - "jest-snapshot": "29.7.0", - "js-levenshtein": "1.1.6", - kleur: "4.1.5", - klona: "2.0.6", - mariadb: "3.3.1", - memfs: "4.9.3", - mssql: "11.0.1", - "new-github-issue-url": "0.2.1", - "node-fetch": "3.3.2", - "p-retry": "4.6.2", - pg: "8.11.5", - "pkg-up": "3.1.0", - pluralize: "8.0.0", - resolve: "1.22.8", - rimraf: "3.0.2", - "simple-statistics": "7.8.5", - "sort-keys": "4.2.0", - "source-map-support": "0.5.21", - "sql-template-tag": "5.2.1", - "stacktrace-parser": "0.1.10", - "strip-ansi": "6.0.1", - "strip-indent": "3.0.0", - "ts-node": "10.9.2", - "ts-pattern": "5.2.0", - tsd: "0.31.1", - typescript: "5.4.5", - undici: "5.28.4", - wrangler: "3.62.0", - zx: "7.2.3" - }, - peerDependencies: { - prisma: "*" - }, - peerDependenciesMeta: { - prisma: { - optional: true - } - }, - sideEffects: false - }; - } -}); - -// ../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/array-species-create.js -var require_array_species_create = __commonJS({ - "../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/array-species-create.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { - return typeof obj; - } : function(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - exports2.default = arraySpeciesCreate; - function arraySpeciesCreate(originalArray, length) { - var isArray = Array.isArray(originalArray); - if (!isArray) { - return Array(length); - } - var C = Object.getPrototypeOf(originalArray).constructor; - if (C) { - if ((typeof C === "undefined" ? "undefined" : _typeof(C)) === "object" || typeof C === "function") { - C = C[Symbol.species.toString()]; - C = C !== null ? C : void 0; - } - if (C === void 0) { - return Array(length); - } - if (typeof C !== "function") { - throw TypeError("invalid constructor"); - } - var result = new C(length); - return result; - } - } - } -}); - -// ../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/flatten-into-array.js -var require_flatten_into_array = __commonJS({ - "../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/flatten-into-array.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - exports2.default = flattenIntoArray; - function flattenIntoArray(target, source, start, depth, mapperFunction, thisArg) { - var mapperFunctionProvied = mapperFunction !== void 0; - var targetIndex = start; - var sourceIndex = 0; - var sourceLen = source.length; - while (sourceIndex < sourceLen) { - var p = sourceIndex; - var exists = !!source[p]; - if (exists === true) { - var element = source[p]; - if (element) { - if (mapperFunctionProvied) { - element = mapperFunction.call(thisArg, element, sourceIndex, target); - } - var spreadable = Object.getOwnPropertySymbols(element).includes(Symbol.isConcatSpreadable) || Array.isArray(element); - if (spreadable === true && depth > 0) { - var nextIndex = flattenIntoArray(target, element, targetIndex, depth - 1); - targetIndex = nextIndex; - } else { - if (!Number.isSafeInteger(targetIndex)) { - throw TypeError(); - } - target[targetIndex] = element; - } - } - } - targetIndex += 1; - sourceIndex += 1; - } - return targetIndex; - } - } -}); - -// ../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/flatten.js -var require_flatten = __commonJS({ - "../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/flatten.js"() { - "use strict"; - var _arraySpeciesCreate = require_array_species_create(); - var _arraySpeciesCreate2 = _interopRequireDefault(_arraySpeciesCreate); - var _flattenIntoArray = require_flatten_into_array(); - var _flattenIntoArray2 = _interopRequireDefault(_flattenIntoArray); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - if (!Object.prototype.hasOwnProperty.call(Array.prototype, "flatten")) { - Array.prototype.flatten = function flatten(depth) { - var o = Object(this); - var a = (0, _arraySpeciesCreate2.default)(o, this.length); - var depthNum = depth !== void 0 ? Number(depth) : Infinity; - (0, _flattenIntoArray2.default)(a, o, 0, depthNum); - return a.filter(function(e) { - return e !== void 0; - }); - }; - } - } -}); - -// ../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/flat-map.js -var require_flat_map = __commonJS({ - "../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/flat-map.js"() { - "use strict"; - var _flattenIntoArray = require_flatten_into_array(); - var _flattenIntoArray2 = _interopRequireDefault(_flattenIntoArray); - var _arraySpeciesCreate = require_array_species_create(); - var _arraySpeciesCreate2 = _interopRequireDefault(_arraySpeciesCreate); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - if (!Object.prototype.hasOwnProperty.call(Array.prototype, "flatMap")) { - Array.prototype.flatMap = function flatMap(callbackFn, thisArg) { - var o = Object(this); - if (!callbackFn || typeof callbackFn.call !== "function") { - throw TypeError("callbackFn must be callable."); - } - var t = thisArg !== void 0 ? thisArg : void 0; - var a = (0, _arraySpeciesCreate2.default)(o, o.length); - (0, _flattenIntoArray2.default)( - a, - o, - /*start*/ - 0, - /*depth*/ - 1, - callbackFn, - t - ); - return a.filter(function(x) { - return x !== void 0; - }, a); - }; - } - } -}); - -// src/generation/ts-builders/KeyType.ts -var KeyType_exports = {}; -__export(KeyType_exports, { - KeyType: () => KeyType, - keyType: () => keyType -}); -function keyType(baseType, key) { - return new KeyType(baseType, key); -} -var KeyType; -var init_KeyType = __esm({ - "src/generation/ts-builders/KeyType.ts"() { - "use strict"; - init_TypeBuilder(); - KeyType = class extends TypeBuilder { - constructor(baseType, key) { - super(); - this.baseType = baseType; - this.key = key; - } - write(writer) { - this.baseType.writeIndexed(writer); - writer.write("[").write(`"${this.key}"`).write("]"); - } - }; - } -}); - -// src/generation/ts-builders/TypeBuilder.ts -var TypeBuilder; -var init_TypeBuilder = __esm({ - "src/generation/ts-builders/TypeBuilder.ts"() { - "use strict"; - TypeBuilder = class { - constructor() { - // TODO(@SevInf): this should be replaced with precedence system that would - // automatically add parenthesis where they are needed - this.needsParenthesisWhenIndexed = false; - this.needsParenthesisInKeyof = false; - this.needsParenthesisInUnion = false; - } - subKey(key) { - const { KeyType: KeyType2 } = (init_KeyType(), __toCommonJS(KeyType_exports)); - return new KeyType2(this, key); - } - writeIndexed(writer) { - if (this.needsParenthesisWhenIndexed) { - writer.write("("); - } - writer.write(this); - if (this.needsParenthesisWhenIndexed) { - writer.write(")"); - } - } - }; - } -}); - -// ../../node_modules/.pnpm/ci-info@4.0.0/node_modules/ci-info/vendors.json -var require_vendors = __commonJS({ - "../../node_modules/.pnpm/ci-info@4.0.0/node_modules/ci-info/vendors.json"(exports2, module2) { - module2.exports = [ - { - name: "Agola CI", - constant: "AGOLA", - env: "AGOLA_GIT_REF", - pr: "AGOLA_PULL_REQUEST_ID" - }, - { - name: "Appcircle", - constant: "APPCIRCLE", - env: "AC_APPCIRCLE" - }, - { - name: "AppVeyor", - constant: "APPVEYOR", - env: "APPVEYOR", - pr: "APPVEYOR_PULL_REQUEST_NUMBER" - }, - { - name: "AWS CodeBuild", - constant: "CODEBUILD", - env: "CODEBUILD_BUILD_ARN" - }, - { - name: "Azure Pipelines", - constant: "AZURE_PIPELINES", - env: "TF_BUILD", - pr: { - BUILD_REASON: "PullRequest" - } - }, - { - name: "Bamboo", - constant: "BAMBOO", - env: "bamboo_planKey" - }, - { - name: "Bitbucket Pipelines", - constant: "BITBUCKET", - env: "BITBUCKET_COMMIT", - pr: "BITBUCKET_PR_ID" - }, - { - name: "Bitrise", - constant: "BITRISE", - env: "BITRISE_IO", - pr: "BITRISE_PULL_REQUEST" - }, - { - name: "Buddy", - constant: "BUDDY", - env: "BUDDY_WORKSPACE_ID", - pr: "BUDDY_EXECUTION_PULL_REQUEST_ID" - }, - { - name: "Buildkite", - constant: "BUILDKITE", - env: "BUILDKITE", - pr: { - env: "BUILDKITE_PULL_REQUEST", - ne: "false" - } - }, - { - name: "CircleCI", - constant: "CIRCLE", - env: "CIRCLECI", - pr: "CIRCLE_PULL_REQUEST" - }, - { - name: "Cirrus CI", - constant: "CIRRUS", - env: "CIRRUS_CI", - pr: "CIRRUS_PR" - }, - { - name: "Codefresh", - constant: "CODEFRESH", - env: "CF_BUILD_ID", - pr: { - any: [ - "CF_PULL_REQUEST_NUMBER", - "CF_PULL_REQUEST_ID" - ] - } - }, - { - name: "Codemagic", - constant: "CODEMAGIC", - env: "CM_BUILD_ID", - pr: "CM_PULL_REQUEST" - }, - { - name: "Codeship", - constant: "CODESHIP", - env: { - CI_NAME: "codeship" - } - }, - { - name: "Drone", - constant: "DRONE", - env: "DRONE", - pr: { - DRONE_BUILD_EVENT: "pull_request" - } - }, - { - name: "dsari", - constant: "DSARI", - env: "DSARI" - }, - { - name: "Earthly", - constant: "EARTHLY", - env: "EARTHLY_CI" - }, - { - name: "Expo Application Services", - constant: "EAS", - env: "EAS_BUILD" - }, - { - name: "Gerrit", - constant: "GERRIT", - env: "GERRIT_PROJECT" - }, - { - name: "Gitea Actions", - constant: "GITEA_ACTIONS", - env: "GITEA_ACTIONS" - }, - { - name: "GitHub Actions", - constant: "GITHUB_ACTIONS", - env: "GITHUB_ACTIONS", - pr: { - GITHUB_EVENT_NAME: "pull_request" - } - }, - { - name: "GitLab CI", - constant: "GITLAB", - env: "GITLAB_CI", - pr: "CI_MERGE_REQUEST_ID" - }, - { - name: "GoCD", - constant: "GOCD", - env: "GO_PIPELINE_LABEL" - }, - { - name: "Google Cloud Build", - constant: "GOOGLE_CLOUD_BUILD", - env: "BUILDER_OUTPUT" - }, - { - name: "Harness CI", - constant: "HARNESS", - env: "HARNESS_BUILD_ID" - }, - { - name: "Heroku", - constant: "HEROKU", - env: { - env: "NODE", - includes: "/app/.heroku/node/bin/node" - } - }, - { - name: "Hudson", - constant: "HUDSON", - env: "HUDSON_URL" - }, - { - name: "Jenkins", - constant: "JENKINS", - env: [ - "JENKINS_URL", - "BUILD_ID" - ], - pr: { - any: [ - "ghprbPullId", - "CHANGE_ID" - ] - } - }, - { - name: "LayerCI", - constant: "LAYERCI", - env: "LAYERCI", - pr: "LAYERCI_PULL_REQUEST" - }, - { - name: "Magnum CI", - constant: "MAGNUM", - env: "MAGNUM" - }, - { - name: "Netlify CI", - constant: "NETLIFY", - env: "NETLIFY", - pr: { - env: "PULL_REQUEST", - ne: "false" - } - }, - { - name: "Nevercode", - constant: "NEVERCODE", - env: "NEVERCODE", - pr: { - env: "NEVERCODE_PULL_REQUEST", - ne: "false" - } - }, - { - name: "Prow", - constant: "PROW", - env: "PROW_JOB_ID" - }, - { - name: "ReleaseHub", - constant: "RELEASEHUB", - env: "RELEASE_BUILD_ID" - }, - { - name: "Render", - constant: "RENDER", - env: "RENDER", - pr: { - IS_PULL_REQUEST: "true" - } - }, - { - name: "Sail CI", - constant: "SAIL", - env: "SAILCI", - pr: "SAIL_PULL_REQUEST_NUMBER" - }, - { - name: "Screwdriver", - constant: "SCREWDRIVER", - env: "SCREWDRIVER", - pr: { - env: "SD_PULL_REQUEST", - ne: "false" - } - }, - { - name: "Semaphore", - constant: "SEMAPHORE", - env: "SEMAPHORE", - pr: "PULL_REQUEST_NUMBER" - }, - { - name: "Sourcehut", - constant: "SOURCEHUT", - env: { - CI_NAME: "sourcehut" - } - }, - { - name: "Strider CD", - constant: "STRIDER", - env: "STRIDER" - }, - { - name: "TaskCluster", - constant: "TASKCLUSTER", - env: [ - "TASK_ID", - "RUN_ID" - ] - }, - { - name: "TeamCity", - constant: "TEAMCITY", - env: "TEAMCITY_VERSION" - }, - { - name: "Travis CI", - constant: "TRAVIS", - env: "TRAVIS", - pr: { - env: "TRAVIS_PULL_REQUEST", - ne: "false" - } - }, - { - name: "Vela", - constant: "VELA", - env: "VELA", - pr: { - VELA_PULL_REQUEST: "1" - } - }, - { - name: "Vercel", - constant: "VERCEL", - env: { - any: [ - "NOW_BUILDER", - "VERCEL" - ] - }, - pr: "VERCEL_GIT_PULL_REQUEST_ID" - }, - { - name: "Visual Studio App Center", - constant: "APPCENTER", - env: "APPCENTER_BUILD_ID" - }, - { - name: "Woodpecker", - constant: "WOODPECKER", - env: { - CI: "woodpecker" - }, - pr: { - CI_BUILD_EVENT: "pull_request" - } - }, - { - name: "Xcode Cloud", - constant: "XCODE_CLOUD", - env: "CI_XCODE_PROJECT", - pr: "CI_PULL_REQUEST_NUMBER" - }, - { - name: "Xcode Server", - constant: "XCODE_SERVER", - env: "XCS" - } - ]; - } -}); - -// ../../node_modules/.pnpm/ci-info@4.0.0/node_modules/ci-info/index.js -var require_ci_info = __commonJS({ - "../../node_modules/.pnpm/ci-info@4.0.0/node_modules/ci-info/index.js"(exports2) { - "use strict"; - var vendors = require_vendors(); - var env2 = process.env; - Object.defineProperty(exports2, "_vendors", { - value: vendors.map(function(v) { - return v.constant; - }) - }); - exports2.name = null; - exports2.isPR = null; - vendors.forEach(function(vendor) { - const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env]; - const isCI = envs.every(function(obj) { - return checkEnv(obj); - }); - exports2[vendor.constant] = isCI; - if (!isCI) { - return; - } - exports2.name = vendor.name; - switch (typeof vendor.pr) { - case "string": - exports2.isPR = !!env2[vendor.pr]; - break; - case "object": - if ("env" in vendor.pr) { - exports2.isPR = vendor.pr.env in env2 && env2[vendor.pr.env] !== vendor.pr.ne; - } else if ("any" in vendor.pr) { - exports2.isPR = vendor.pr.any.some(function(key) { - return !!env2[key]; - }); - } else { - exports2.isPR = checkEnv(vendor.pr); - } - break; - default: - exports2.isPR = null; - } - }); - exports2.isCI = !!(env2.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false' - (env2.BUILD_ID || // Jenkins, Cloudbees - env2.BUILD_NUMBER || // Jenkins, TeamCity - env2.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari - env2.CI_APP_ID || // Appflow - env2.CI_BUILD_ID || // Appflow - env2.CI_BUILD_NUMBER || // Appflow - env2.CI_NAME || // Codeship and others - env2.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI - env2.RUN_ID || // TaskCluster, dsari - exports2.name || false)); - function checkEnv(obj) { - if (typeof obj === "string") return !!env2[obj]; - if ("env" in obj) { - return env2[obj.env] && env2[obj.env].includes(obj.includes); - } - if ("any" in obj) { - return obj.any.some(function(k) { - return !!env2[k]; - }); - } - return Object.keys(obj).every(function(k) { - return env2[k] === obj[k]; - }); - } - } -}); - -// src/generation/generator.ts -var generator_exports = {}; -__export(generator_exports, { - dmmfToTypes: () => dmmfToTypes, - externalToInternalDmmf: () => externalToInternalDmmf -}); -module.exports = __toCommonJS(generator_exports); - -// ../../node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs -var colors_exports = {}; -__export(colors_exports, { - $: () => $, - bgBlack: () => bgBlack, - bgBlue: () => bgBlue, - bgCyan: () => bgCyan, - bgGreen: () => bgGreen, - bgMagenta: () => bgMagenta, - bgRed: () => bgRed, - bgWhite: () => bgWhite, - bgYellow: () => bgYellow, - black: () => black, - blue: () => blue, - bold: () => bold, - cyan: () => cyan, - dim: () => dim, - gray: () => gray, - green: () => green, - grey: () => grey, - hidden: () => hidden, - inverse: () => inverse, - italic: () => italic, - magenta: () => magenta, - red: () => red, - reset: () => reset, - strikethrough: () => strikethrough, - underline: () => underline, - white: () => white, - yellow: () => yellow -}); -var FORCE_COLOR; -var NODE_DISABLE_COLORS; -var NO_COLOR; -var TERM; -var isTTY = true; -if (typeof process !== "undefined") { - ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {}); - isTTY = process.stdout && process.stdout.isTTY; -} -var $ = { - enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY) -}; -function init(x, y) { - let rgx = new RegExp(`\\x1b\\[${y}m`, "g"); - let open = `\x1B[${x}m`, close = `\x1B[${y}m`; - return function(txt) { - if (!$.enabled || txt == null) return txt; - return open + (!!~("" + txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close; - }; -} -var reset = init(0, 0); -var bold = init(1, 22); -var dim = init(2, 22); -var italic = init(3, 23); -var underline = init(4, 24); -var inverse = init(7, 27); -var hidden = init(8, 28); -var strikethrough = init(9, 29); -var black = init(30, 39); -var red = init(31, 39); -var green = init(32, 39); -var yellow = init(33, 39); -var blue = init(34, 39); -var magenta = init(35, 39); -var cyan = init(36, 39); -var white = init(37, 39); -var gray = init(90, 39); -var grey = init(90, 39); -var bgBlack = init(40, 49); -var bgRed = init(41, 49); -var bgGreen = init(42, 49); -var bgYellow = init(43, 49); -var bgBlue = init(44, 49); -var bgMagenta = init(45, 49); -var bgCyan = init(46, 49); -var bgWhite = init(47, 49); - -// ../debug/src/index.ts -var MAX_ARGS_HISTORY = 100; -var COLORS = ["green", "yellow", "blue", "magenta", "cyan", "red"]; -var argsHistory = []; -var lastTimestamp = Date.now(); -var lastColor = 0; -var processEnv = typeof process !== "undefined" ? process.env : {}; -globalThis.DEBUG ??= processEnv.DEBUG ?? ""; -globalThis.DEBUG_COLORS ??= processEnv.DEBUG_COLORS ? processEnv.DEBUG_COLORS === "true" : true; -var topProps = { - enable(namespace2) { - if (typeof namespace2 === "string") { - globalThis.DEBUG = namespace2; - } - }, - disable() { - const prev = globalThis.DEBUG; - globalThis.DEBUG = ""; - return prev; - }, - // this is the core logic to check if logging should happen or not - enabled(namespace2) { - const listenedNamespaces = globalThis.DEBUG.split(",").map((s) => { - return s.replace(/[.+?^${}()|[\]\\]/g, "\\$&"); - }); - const isListened = listenedNamespaces.some((listenedNamespace) => { - if (listenedNamespace === "" || listenedNamespace[0] === "-") return false; - return namespace2.match(RegExp(listenedNamespace.split("*").join(".*") + "$")); - }); - const isExcluded = listenedNamespaces.some((listenedNamespace) => { - if (listenedNamespace === "" || listenedNamespace[0] !== "-") return false; - return namespace2.match(RegExp(listenedNamespace.slice(1).split("*").join(".*") + "$")); - }); - return isListened && !isExcluded; - }, - log: (...args) => { - const [namespace2, format, ...rest] = args; - const logWithFormatting = console.warn ?? console.log; - logWithFormatting(`${namespace2} ${format}`, ...rest); - }, - formatters: {} - // not implemented -}; -function debugCreate(namespace2) { - const instanceProps = { - color: COLORS[lastColor++ % COLORS.length], - enabled: topProps.enabled(namespace2), - namespace: namespace2, - log: topProps.log, - extend: () => { - } - // not implemented - }; - const debugCall = (...args) => { - const { enabled, namespace: namespace3, color, log } = instanceProps; - if (args.length !== 0) { - argsHistory.push([namespace3, ...args]); - } - if (argsHistory.length > MAX_ARGS_HISTORY) { - argsHistory.shift(); - } - if (topProps.enabled(namespace3) || enabled) { - const stringArgs = args.map((arg) => { - if (typeof arg === "string") { - return arg; - } - return safeStringify(arg); - }); - const ms = `+${Date.now() - lastTimestamp}ms`; - lastTimestamp = Date.now(); - if (globalThis.DEBUG_COLORS) { - log(colors_exports[color](bold(namespace3)), ...stringArgs, colors_exports[color](ms)); - } else { - log(namespace3, ...stringArgs, ms); - } - } - }; - return new Proxy(debugCall, { - get: (_, prop) => instanceProps[prop], - set: (_, prop, value) => instanceProps[prop] = value - }); -} -var Debug = new Proxy(debugCreate, { - get: (_, prop) => topProps[prop], - set: (_, prop, value) => topProps[prop] = value -}); -function safeStringify(value, indent9 = 2) { - const cache = /* @__PURE__ */ new Set(); - return JSON.stringify( - value, - (key, value2) => { - if (typeof value2 === "object" && value2 !== null) { - if (cache.has(value2)) { - return `[Circular *]`; - } - cache.add(value2); - } else if (typeof value2 === "bigint") { - return value2.toString(); - } - return value2; - }, - indent9 - ); -} -var src_default = Debug; - -// src/generation/generator.ts -var import_engines_version = __toESM(require_engines_version()); - -// ../generator-helper/src/dmmf.ts -var DMMF; -((DMMF2) => { - let ModelAction; - ((ModelAction2) => { - ModelAction2["findUnique"] = "findUnique"; - ModelAction2["findUniqueOrThrow"] = "findUniqueOrThrow"; - ModelAction2["findFirst"] = "findFirst"; - ModelAction2["findFirstOrThrow"] = "findFirstOrThrow"; - ModelAction2["findMany"] = "findMany"; - ModelAction2["create"] = "create"; - ModelAction2["createMany"] = "createMany"; - ModelAction2["createManyAndReturn"] = "createManyAndReturn"; - ModelAction2["update"] = "update"; - ModelAction2["updateMany"] = "updateMany"; - ModelAction2["upsert"] = "upsert"; - ModelAction2["delete"] = "delete"; - ModelAction2["deleteMany"] = "deleteMany"; - ModelAction2["groupBy"] = "groupBy"; - ModelAction2["count"] = "count"; - ModelAction2["aggregate"] = "aggregate"; - ModelAction2["findRaw"] = "findRaw"; - ModelAction2["aggregateRaw"] = "aggregateRaw"; - })(ModelAction = DMMF2.ModelAction || (DMMF2.ModelAction = {})); -})(DMMF || (DMMF = {})); - -// ../generator-helper/src/byline.ts -var import_stream = __toESM(require("stream")); -var import_util = __toESM(require("util")); -function byline(readStream, options) { - return createStream(readStream, options); -} -function createStream(readStream, options) { - if (readStream) { - return createLineStream(readStream, options); - } else { - return new LineStream(options); - } -} -function createLineStream(readStream, options) { - if (!readStream) { - throw new Error("expected readStream"); - } - if (!readStream.readable) { - throw new Error("readStream must be readable"); - } - const ls = new LineStream(options); - readStream.pipe(ls); - return ls; -} -function LineStream(options) { - import_stream.default.Transform.call(this, options); - options = options || {}; - this._readableState.objectMode = true; - this._lineBuffer = []; - this._keepEmptyLines = options.keepEmptyLines || false; - this._lastChunkEndedWithCR = false; - this.on("pipe", function(src) { - if (!this.encoding) { - if (src instanceof import_stream.default.Readable) { - this.encoding = src._readableState.encoding; - } - } - }); -} -import_util.default.inherits(LineStream, import_stream.default.Transform); -LineStream.prototype._transform = function(chunk, encoding, done) { - encoding = encoding || "utf8"; - if (Buffer.isBuffer(chunk)) { - if (encoding == "buffer") { - chunk = chunk.toString(); - encoding = "utf8"; - } else { - chunk = chunk.toString(encoding); - } - } - this._chunkEncoding = encoding; - const lines = chunk.split(/\r\n|\r|\n/g); - if (this._lastChunkEndedWithCR && chunk[0] == "\n") { - lines.shift(); - } - if (this._lineBuffer.length > 0) { - this._lineBuffer[this._lineBuffer.length - 1] += lines[0]; - lines.shift(); - } - this._lastChunkEndedWithCR = chunk[chunk.length - 1] == "\r"; - this._lineBuffer = this._lineBuffer.concat(lines); - this._pushBuffer(encoding, 1, done); -}; -LineStream.prototype._pushBuffer = function(encoding, keep, done) { - while (this._lineBuffer.length > keep) { - const line = this._lineBuffer.shift(); - if (this._keepEmptyLines || line.length > 0) { - if (!this.push(this._reencode(line, encoding))) { - const self = this; - setImmediate(function() { - self._pushBuffer(encoding, keep, done); - }); - return; - } - } - } - done(); -}; -LineStream.prototype._flush = function(done) { - this._pushBuffer(this._chunkEncoding, 0, done); -}; -LineStream.prototype._reencode = function(line, chunkEncoding) { - if (this.encoding && this.encoding != chunkEncoding) { - return Buffer.from(line, chunkEncoding).toString(this.encoding); - } else if (this.encoding) { - return line; - } else { - return Buffer.from(line, chunkEncoding); - } -}; - -// ../generator-helper/src/generatorHandler.ts -function generatorHandler(handler) { - byline(process.stdin).on("data", async (line) => { - const json = JSON.parse(String(line)); - if (json.method === "generate" && json.params) { - try { - const result = await handler.onGenerate(json.params); - respond({ - jsonrpc: "2.0", - result, - id: json.id - }); - } catch (_e) { - const e = _e; - respond({ - jsonrpc: "2.0", - error: { - code: -32e3, - message: e.message, - data: { - stack: e.stack - } - }, - id: json.id - }); - } - } - if (json.method === "getManifest") { - if (handler.onManifest) { - try { - const manifest = handler.onManifest(json.params); - respond({ - jsonrpc: "2.0", - result: { - manifest - }, - id: json.id - }); - } catch (_e) { - const e = _e; - respond({ - jsonrpc: "2.0", - error: { - code: -32e3, - message: e.message, - data: { - stack: e.stack - } - }, - id: json.id - }); - } - } else { - respond({ - jsonrpc: "2.0", - result: { - manifest: null - }, - id: json.id - }); - } - } - }); - process.stdin.resume(); -} -function respond(response) { - console.error(JSON.stringify(response)); -} - -// ../get-platform/src/getNodeAPIName.ts -var NODE_API_QUERY_ENGINE_URL_BASE = "libquery_engine"; -function getNodeAPIName(binaryTarget, type) { - const isUrl = type === "url"; - if (binaryTarget.includes("windows")) { - return isUrl ? `query_engine.dll.node` : `query_engine-${binaryTarget}.dll.node`; - } else if (binaryTarget.includes("darwin")) { - return isUrl ? `${NODE_API_QUERY_ENGINE_URL_BASE}.dylib.node` : `${NODE_API_QUERY_ENGINE_URL_BASE}-${binaryTarget}.dylib.node`; - } else { - return isUrl ? `${NODE_API_QUERY_ENGINE_URL_BASE}.so.node` : `${NODE_API_QUERY_ENGINE_URL_BASE}-${binaryTarget}.so.node`; - } -} - -// ../../node_modules/.pnpm/find-cache-dir@5.0.0/node_modules/find-cache-dir/index.js -var import_node_process = __toESM(require("process"), 1); -var import_common_path_prefix = __toESM(require_common_path_prefix(), 1); - -// ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js -var findUpStop = Symbol("findUpStop"); - -// ../../node_modules/.pnpm/find-cache-dir@5.0.0/node_modules/find-cache-dir/index.js -var { env, cwd } = import_node_process.default; - -// ../fetch-engine/src/utils.ts -var import_fs = __toESM(require("fs")); -var debug = src_default("prisma:fetch-engine:cache-dir"); -async function overwriteFile(sourcePath, targetPath) { - await removeFileIfExists(targetPath); - await import_fs.default.promises.copyFile(sourcePath, targetPath); -} -async function removeFileIfExists(filePath) { - try { - await import_fs.default.promises.unlink(filePath); - } catch (e) { - if (e.code !== "ENOENT") { - throw e; - } - } -} - -// ../internals/src/client/getClientEngineType.ts -var DEFAULT_CLIENT_ENGINE_TYPE = "library" /* Library */; -function getClientEngineType(generatorConfig) { - const engineTypeFromEnvVar = getEngineTypeFromEnvVar(); - if (engineTypeFromEnvVar) return engineTypeFromEnvVar; - if (generatorConfig?.config.engineType === "library" /* Library */) { - return "library" /* Library */; - } else if (generatorConfig?.config.engineType === "binary" /* Binary */) { - return "binary" /* Binary */; - } else { - return DEFAULT_CLIENT_ENGINE_TYPE; - } -} -function getEngineTypeFromEnvVar() { - const engineType = process.env.PRISMA_CLIENT_ENGINE_TYPE; - if (engineType === "library" /* Library */) { - return "library" /* Library */; - } else if (engineType === "binary" /* Binary */) { - return "binary" /* Binary */; - } else { - return void 0; - } -} - -// ../internals/src/utils/parseEnvValue.ts -function parseEnvValue(object) { - if (object.fromEnvVar && object.fromEnvVar != "null") { - const value = process.env[object.fromEnvVar]; - if (!value) { - throw new Error( - `Attempted to load provider value using \`env(${object.fromEnvVar})\` but it was not present. Please ensure that ${dim( - object.fromEnvVar - )} is present in your Environment Variables` - ); - } - return value; - } - return object.value; -} - -// ../internals/src/utils/path.ts -var import_path = __toESM(require("path")); -function pathToPosix(filePath) { - if (import_path.default.sep === import_path.default.posix.sep) { - return filePath; - } - return filePath.split(import_path.default.sep).join(import_path.default.posix.sep); -} - -// ../internals/src/utils/parseAWSNodejsRuntimeEnvVarVersion.ts -function parseAWSNodejsRuntimeEnvVarVersion() { - const runtimeEnvVar = process.env.AWS_LAMBDA_JS_RUNTIME; - if (!runtimeEnvVar || runtimeEnvVar === "") return null; - try { - const runtimeRegex = /^nodejs(\d+).x$/; - const match = runtimeRegex.exec(runtimeEnvVar); - if (match) { - return parseInt(match[1]); - } - } catch (e) { - console.error( - `We could not parse the AWS_LAMBDA_JS_RUNTIME env var with the following value: ${runtimeEnvVar}. This was silently ignored.` - ); - } - return null; -} - -// ../internals/src/utils/assertNever.ts -function assertNever(arg, errorMessage) { - throw new Error(errorMessage); -} - -// ../internals/src/utils/hasOwnProperty.ts -function hasOwnProperty(object, key) { - return Object.prototype.hasOwnProperty.call(object, key); -} - -// ../internals/src/utils/isValidJsIdentifier.ts -var import_helper_validator_identifier = __toESM(require_lib2()); -function isValidJsIdentifier(str) { - return (0, import_helper_validator_identifier.isIdentifierName)(str); -} - -// ../internals/src/utils/setClassName.ts -function setClassName(classObject, name) { - Object.defineProperty(classObject, "name", { - value: name, - configurable: true - }); -} - -// src/runtime/externalToInternalDmmf.ts -var import_pluralize = __toESM(require_pluralize()); - -// src/generation/utils/common.ts -var keyBy = (collection, prop) => { - const acc = {}; - for (const obj of collection) { - const key = obj[prop]; - acc[key] = obj; - } - return acc; -}; -function needsNamespace(field) { - if (field.kind === "object") { - return true; - } - if (field.kind === "scalar") { - return field.type === "Json" || field.type === "Decimal"; - } - return false; -} -var GraphQLScalarToJSTypeTable = { - String: "string", - Int: "number", - Float: "number", - Boolean: "boolean", - Long: "number", - DateTime: ["Date", "string"], - ID: "string", - UUID: "string", - Json: "JsonValue", - Bytes: "Buffer", - Decimal: ["Decimal", "DecimalJsLike", "number", "string"], - BigInt: ["bigint", "number"] -}; -var JSOutputTypeToInputType = { - JsonValue: "InputJsonValue" -}; -function capitalize(str) { - return str[0].toUpperCase() + str.slice(1); -} -function lowerCase(name) { - return name.substring(0, 1).toLowerCase() + name.substring(1); -} - -// src/runtime/externalToInternalDmmf.ts -function externalToInternalDmmf(document) { - return { - ...document, - mappings: getMappings(document.mappings, document.datamodel) - }; -} -function getMappings(mappings, datamodel) { - const modelOperations = mappings.modelOperations.filter((mapping) => { - const model = datamodel.models.find((m) => m.name === mapping.model); - if (!model) { - throw new Error(`Mapping without model ${mapping.model}`); - } - return model.fields.some((f) => f.kind !== "object"); - }).map((mapping) => ({ - model: mapping.model, - plural: (0, import_pluralize.default)(lowerCase(mapping.model)), - // TODO not needed anymore - findUnique: mapping.findUnique || mapping.findSingle, - findUniqueOrThrow: mapping.findUniqueOrThrow, - findFirst: mapping.findFirst, - findFirstOrThrow: mapping.findFirstOrThrow, - findMany: mapping.findMany, - create: mapping.createOne || mapping.createSingle || mapping.create, - createMany: mapping.createMany, - createManyAndReturn: mapping.createManyAndReturn, - delete: mapping.deleteOne || mapping.deleteSingle || mapping.delete, - update: mapping.updateOne || mapping.updateSingle || mapping.update, - deleteMany: mapping.deleteMany, - updateMany: mapping.updateMany, - upsert: mapping.upsertOne || mapping.upsertSingle || mapping.upsert, - aggregate: mapping.aggregate, - groupBy: mapping.groupBy, - findRaw: mapping.findRaw, - aggregateRaw: mapping.aggregateRaw - })); - return { - modelOperations, - otherOperations: mappings.otherOperations - }; -} - -// src/generation/generateClient.ts -var import_crypto2 = require("crypto"); -var import_env_paths = __toESM(require_env_paths()); -var import_fs2 = require("fs"); -var import_promises = __toESM(require("fs/promises")); -var import_fs_extra = __toESM(require_lib()); -var import_path5 = __toESM(require("path")); -var import_pkg_up = __toESM(require_pkg_up()); -var import_package = __toESM(require_package2()); - -// src/generation/getDMMF.ts -function getPrismaClientDMMF(dmmf) { - return externalToInternalDmmf(dmmf); -} - -// ../../node_modules/.pnpm/flat-map-polyfill@0.3.8/node_modules/flat-map-polyfill/dist/cjs/index.js -require_flatten(); -require_flat_map(); - -// src/generation/TSClient/Enum.ts -var import_indent_string = __toESM(require_indent_string()); - -// src/runtime/core/types/exported/ObjectEnums.ts -var objectEnumNames = ["JsonNullValueInput", "NullableJsonNullValueInput", "JsonNullValueFilter"]; -var secret = Symbol(); -var representations = /* @__PURE__ */ new WeakMap(); -var ObjectEnumValue = class { - constructor(arg) { - if (arg === secret) { - representations.set(this, `Prisma.${this._getName()}`); - } else { - representations.set(this, `new Prisma.${this._getNamespace()}.${this._getName()}()`); - } - } - _getName() { - return this.constructor.name; - } - toString() { - return representations.get(this); - } -}; -var NullTypesEnumValue = class extends ObjectEnumValue { - _getNamespace() { - return "NullTypes"; - } -}; -var DbNull = class extends NullTypesEnumValue { -}; -setClassName2(DbNull, "DbNull"); -var JsonNull = class extends NullTypesEnumValue { -}; -setClassName2(JsonNull, "JsonNull"); -var AnyNull = class extends NullTypesEnumValue { -}; -setClassName2(AnyNull, "AnyNull"); -var objectEnumValues = { - classes: { - DbNull, - JsonNull, - AnyNull - }, - instances: { - DbNull: new DbNull(secret), - JsonNull: new JsonNull(secret), - AnyNull: new AnyNull(secret) - } -}; -function setClassName2(classObject, name) { - Object.defineProperty(classObject, "name", { - value: name, - configurable: true - }); -} - -// src/runtime/strictEnum.ts -var strictEnumNames = ["TransactionIsolationLevel"]; - -// src/generation/TSClient/constants.ts -var TAB_SIZE = 2; - -// src/generation/TSClient/Enum.ts -var Enum = class { - constructor(type, useNamespace) { - this.type = type; - this.useNamespace = useNamespace; - } - isObjectEnum() { - return this.useNamespace && objectEnumNames.includes(this.type.name); - } - isStrictEnum() { - return this.useNamespace && strictEnumNames.includes(this.type.name); - } - toJS() { - const { type } = this; - const enumVariants = `{ -${(0, import_indent_string.default)(type.values.map((v) => `${v}: ${this.getValueJS(v)}`).join(",\n"), TAB_SIZE)} -}`; - const enumBody = this.isStrictEnum() ? `makeStrictEnum(${enumVariants})` : enumVariants; - return this.useNamespace ? `exports.Prisma.${type.name} = ${enumBody};` : `exports.${type.name} = exports.$Enums.${type.name} = ${enumBody};`; - } - getValueJS(value) { - return this.isObjectEnum() ? `Prisma.${value}` : `'${value}'`; - } - toTS() { - const { type } = this; - return `export const ${type.name}: { -${(0, import_indent_string.default)(type.values.map((v) => `${v}: ${this.getValueTS(v)}`).join(",\n"), TAB_SIZE)} -}; - -export type ${type.name} = (typeof ${type.name})[keyof typeof ${type.name}] -`; - } - getValueTS(value) { - return this.isObjectEnum() ? `typeof ${value}` : `'${value}'`; - } -}; - -// src/generation/TSClient/Generable.ts -function JS(gen) { - return gen.toJS?.() ?? ""; -} -function BrowserJS(gen) { - return gen.toBrowserJS?.() ?? ""; -} -function TS(gen) { - return gen.toTS(); -} - -// src/generation/TSClient/Input.ts -var import_indent_string2 = __toESM(require_indent_string()); - -// src/runtime/utils/uniqueBy.ts -function uniqueBy(arr, callee) { - const result = {}; - for (const value of arr) { - const hash = callee(value); - if (!result[hash]) { - result[hash] = value; - } - } - return Object.values(result); -} - -// src/generation/ts-builders/ArraySpread.ts -init_TypeBuilder(); -var ArraySpread = class extends TypeBuilder { - constructor(innerType) { - super(); - this.innerType = innerType; - } - write(writer) { - writer.write("[...").write(this.innerType).write("]"); - } -}; -function arraySpread(innerType) { - return new ArraySpread(innerType); -} - -// src/generation/ts-builders/ArrayType.ts -init_TypeBuilder(); -var ArrayType = class extends TypeBuilder { - constructor(elementType) { - super(); - this.elementType = elementType; - } - write(writer) { - this.elementType.writeIndexed(writer); - writer.write("[]"); - } -}; -function array(elementType) { - return new ArrayType(elementType); -} - -// src/generation/ts-builders/ConstDeclaration.ts -var ConstDeclaration = class { - constructor(name, type) { - this.name = name; - this.type = type; - } - setDocComment(docComment2) { - this.docComment = docComment2; - return this; - } - write(writer) { - if (this.docComment) { - writer.write(this.docComment); - } - writer.write("const ").write(this.name).write(": ").write(this.type); - } -}; -function constDeclaration(name, type) { - return new ConstDeclaration(name, type); -} - -// src/generation/ts-builders/DocComment.ts -var DocComment = class { - constructor(startingText) { - this.lines = []; - if (startingText) { - this.addText(startingText); - } - } - addText(text) { - this.lines.push(...text.split("\n")); - return this; - } - write(writer) { - writer.writeLine("/**"); - for (const line of this.lines) { - writer.writeLine(` * ${line}`); - } - writer.writeLine(" */"); - return writer; - } -}; -function docComment(firstParameter, ...args) { - if (typeof firstParameter === "string" || typeof firstParameter === "undefined") { - return new DocComment(firstParameter); - } - return docCommentTag(firstParameter, args); -} -function docCommentTag(strings, args) { - const docComment2 = new DocComment(); - const fullText = strings.flatMap((str, i) => { - if (i < args.length) { - return [str, args[i]]; - } - return [str]; - }).join(""); - const lines = trimEmptyLines(fullText.split("\n")); - if (lines.length === 0) { - return docComment2; - } - const indent9 = getIndent(lines[0]); - for (const line of lines) { - docComment2.addText(line.slice(indent9)); - } - return docComment2; -} -function trimEmptyLines(lines) { - const firstLine = findFirstNonEmptyLine(lines); - const lastLine = findLastNonEmptyLine(lines); - if (firstLine === -1 || lastLine === -1) { - return []; - } - return lines.slice(firstLine, lastLine + 1); -} -function findFirstNonEmptyLine(lines) { - return lines.findIndex((line) => !isEmptyLine(line)); -} -function findLastNonEmptyLine(lines) { - let i = lines.length - 1; - while (i > 0 && isEmptyLine(lines[i])) { - i--; - } - return i; -} -function isEmptyLine(line) { - return line.trim().length === 0; -} -function getIndent(line) { - let indent9 = 0; - while (line[indent9] === " ") { - indent9++; - } - return indent9; -} - -// src/generation/ts-builders/Export.ts -var Export = class { - constructor(declaration) { - this.declaration = declaration; - } - setDocComment(docComment2) { - this.docComment = docComment2; - return this; - } - write(writer) { - if (this.docComment) { - writer.write(this.docComment); - } - writer.write("export ").write(this.declaration); - } -}; -function moduleExport(declaration) { - return new Export(declaration); -} - -// src/generation/ts-builders/ExportFrom.ts -var NamespaceExport = class { - constructor(from, namespace2) { - this.from = from; - this.namespace = namespace2; - } - write(writer) { - writer.write(`export * as ${this.namespace} from '${this.from}'`); - } -}; -var BindingsExport = class { - constructor(from) { - this.from = from; - this.namedExports = []; - } - named(namedExport) { - if (typeof namedExport === "string") { - namedExport = new NamedExport(namedExport); - } - this.namedExports.push(namedExport); - return this; - } - write(writer) { - writer.write("export ").write("{ ").writeJoined(", ", this.namedExports).write(" }").write(` from "${this.from}"`); - } -}; -var NamedExport = class { - constructor(name) { - this.name = name; - } - as(alias) { - this.alias = alias; - return this; - } - write(writer) { - writer.write(this.name); - if (this.alias) { - writer.write(" as ").write(this.alias); - } - } -}; -var ExportAllFrom = class { - constructor(from) { - this.from = from; - } - asNamespace(namespace2) { - return new NamespaceExport(this.from, namespace2); - } - named(binding) { - return new BindingsExport(this.from).named(binding); - } - write(writer) { - writer.write(`export * from "${this.from}"`); - } -}; -function moduleExportFrom(from) { - return new ExportAllFrom(from); -} - -// src/generation/ts-builders/File.ts -var File = class { - constructor() { - this.imports = []; - this.declarations = []; - } - addImport(moduleImport2) { - this.imports.push(moduleImport2); - return this; - } - add(declaration) { - this.declarations.push(declaration); - } - write(writer) { - for (const moduleImport2 of this.imports) { - writer.writeLine(moduleImport2); - } - if (this.imports.length > 0) { - writer.newLine(); - } - for (const [i, declaration] of this.declarations.entries()) { - writer.writeLine(declaration); - if (i < this.declarations.length - 1) { - writer.newLine(); - } - } - } -}; -function file() { - return new File(); -} - -// src/generation/ts-builders/PrimitiveType.ts -init_TypeBuilder(); -var PrimitiveType = class extends TypeBuilder { - constructor(name) { - super(); - this.name = name; - } - write(writer) { - writer.write(this.name); - } -}; -var stringType = new PrimitiveType("string"); -var numberType = new PrimitiveType("number"); -var booleanType = new PrimitiveType("boolean"); -var nullType = new PrimitiveType("null"); -var undefinedType = new PrimitiveType("undefined"); -var bigintType = new PrimitiveType("bigint"); -var unknownType = new PrimitiveType("unknown"); -var anyType = new PrimitiveType("any"); -var voidType = new PrimitiveType("void"); -var thisType = new PrimitiveType("this"); -var neverType = new PrimitiveType("never"); - -// src/generation/ts-builders/FunctionType.ts -init_TypeBuilder(); -var FunctionType = class extends TypeBuilder { - constructor() { - super(...arguments); - this.needsParenthesisWhenIndexed = true; - this.needsParenthesisInKeyof = true; - this.needsParenthesisInUnion = true; - this.returnType = voidType; - this.parameters = []; - this.genericParameters = []; - } - setReturnType(returnType) { - this.returnType = returnType; - return this; - } - addParameter(param) { - this.parameters.push(param); - return this; - } - addGenericParameter(param) { - this.genericParameters.push(param); - return this; - } - write(writer) { - if (this.genericParameters.length > 0) { - writer.write("<").writeJoined(", ", this.genericParameters).write(">"); - } - writer.write("(").writeJoined(", ", this.parameters).write(") => ").write(this.returnType); - } -}; -function functionType() { - return new FunctionType(); -} - -// src/generation/ts-builders/NamedType.ts -init_TypeBuilder(); -var NamedType = class extends TypeBuilder { - constructor(name) { - super(); - this.name = name; - this.genericArguments = []; - } - addGenericArgument(type) { - this.genericArguments.push(type); - return this; - } - write(writer) { - writer.write(this.name); - if (this.genericArguments.length > 0) { - writer.write("<").writeJoined(", ", this.genericArguments).write(">"); - } - } -}; -function namedType(name) { - return new NamedType(name); -} - -// src/generation/ts-builders/GenericParameter.ts -var GenericParameter = class { - constructor(name) { - this.name = name; - } - extends(type) { - this.extendedType = type; - return this; - } - default(type) { - this.defaultType = type; - return this; - } - toArgument() { - return new NamedType(this.name); - } - write(writer) { - writer.write(this.name); - if (this.extendedType) { - writer.write(" extends ").write(this.extendedType); - } - if (this.defaultType) { - writer.write(" = ").write(this.defaultType); - } - } -}; -function genericParameter(name) { - return new GenericParameter(name); -} - -// src/generation/ts-builders/helpers.ts -function omit(type, keyType2) { - return namedType("Omit").addGenericArgument(type).addGenericArgument(keyType2); -} -function promise(resultType) { - return new NamedType("$Utils.JsPromise").addGenericArgument(resultType); -} -function prismaPromise(resultType) { - return new NamedType("Prisma.PrismaPromise").addGenericArgument(resultType); -} -function optional(innerType) { - return new NamedType("$Utils.Optional").addGenericArgument(innerType); -} - -// src/generation/ts-builders/Import.ts -var NamespaceImport = class { - constructor(alias, from) { - this.alias = alias; - this.from = from; - } - write(writer) { - writer.write("import * as ").write(this.alias).write(` from "${this.from}"`); - } -}; -var BindingsImport = class { - constructor(from) { - this.from = from; - this.namedImports = []; - } - default(name) { - this.defaultImport = name; - return this; - } - named(namedImport) { - if (typeof namedImport === "string") { - namedImport = new NamedImport(namedImport); - } - this.namedImports.push(namedImport); - return this; - } - write(writer) { - writer.write("import "); - if (this.defaultImport) { - writer.write(this.defaultImport); - if (this.hasNamedImports()) { - writer.write(", "); - } - } - if (this.hasNamedImports()) { - writer.write("{ ").writeJoined(", ", this.namedImports).write(" }"); - } - writer.write(` from "${this.from}"`); - } - hasNamedImports() { - return this.namedImports.length > 0; - } -}; -var NamedImport = class { - constructor(name) { - this.name = name; - } - as(alias) { - this.alias = alias; - return this; - } - write(writer) { - writer.write(this.name); - if (this.alias) { - writer.write(" as ").write(this.alias); - } - } -}; -var ModuleImport = class { - constructor(from) { - this.from = from; - } - asNamespace(alias) { - return new NamespaceImport(alias, this.from); - } - default(alias) { - return new BindingsImport(this.from).default(alias); - } - named(namedImport) { - return new BindingsImport(this.from).named(namedImport); - } - write(writer) { - writer.write("import ").write(`"${this.from}"`); - } -}; -function moduleImport(from) { - return new ModuleImport(from); -} - -// src/generation/ts-builders/Interface.ts -init_TypeBuilder(); -var InterfaceDeclaration = class extends TypeBuilder { - constructor(name) { - super(); - this.name = name; - this.needsParenthesisWhenIndexed = true; - this.items = []; - this.genericParameters = []; - this.extendedTypes = []; - } - add(item) { - this.items.push(item); - return this; - } - addMultiple(items) { - for (const item of items) { - this.add(item); - } - return this; - } - addGenericParameter(param) { - this.genericParameters.push(param); - return this; - } - extends(type) { - this.extendedTypes.push(type); - return this; - } - write(writer) { - writer.write("interface ").write(this.name); - if (this.genericParameters.length > 0) { - writer.write("<").writeJoined(", ", this.genericParameters).write(">"); - } - if (this.extendedTypes.length > 0) { - writer.write(" extends ").writeJoined(", ", this.extendedTypes); - } - if (this.items.length === 0) { - writer.writeLine(" {}"); - return; - } - writer.writeLine(" {").withIndent(() => { - for (const item of this.items) { - writer.writeLine(item); - } - }).write("}"); - } -}; -function interfaceDeclaration(name) { - return new InterfaceDeclaration(name); -} - -// src/generation/ts-builders/Method.ts -var Method = class { - constructor(name) { - this.name = name; - this.returnType = voidType; - this.parameters = []; - this.genericParameters = []; - } - setDocComment(docComment2) { - this.docComment = docComment2; - return this; - } - setReturnType(returnType) { - this.returnType = returnType; - return this; - } - addParameter(param) { - this.parameters.push(param); - return this; - } - addGenericParameter(param) { - this.genericParameters.push(param); - return this; - } - write(writer) { - if (this.docComment) { - writer.write(this.docComment); - } - writer.write(this.name); - if (this.genericParameters.length > 0) { - writer.write("<").writeJoined(", ", this.genericParameters).write(">"); - } - writer.write("("); - if (this.parameters.length > 0) { - writer.writeJoined(", ", this.parameters); - } - writer.write(")"); - if (this.name !== "constructor") { - writer.write(": ").write(this.returnType); - } - } -}; -function method(name) { - return new Method(name); -} - -// src/generation/ts-builders/NamespaceDeclaration.ts -var NamespaceDeclaration = class { - constructor(name) { - this.name = name; - this.items = []; - } - add(declaration) { - this.items.push(declaration); - } - write(writer) { - writer.writeLine(`namespace ${this.name} {`).withIndent(() => { - for (const item of this.items) { - writer.writeLine(item); - } - }).write("}"); - } -}; -function namespace(name) { - return new NamespaceDeclaration(name); -} - -// src/generation/ts-builders/ObjectType.ts -init_TypeBuilder(); -var ObjectType = class extends TypeBuilder { - constructor() { - super(...arguments); - this.needsParenthesisWhenIndexed = true; - this.items = []; - this.inline = false; - } - add(item) { - this.items.push(item); - return this; - } - addMultiple(items) { - for (const item of items) { - this.add(item); - } - return this; - } - formatInline() { - this.inline = true; - return this; - } - write(writer) { - if (this.items.length === 0) { - writer.write("{}"); - } else if (this.inline) { - this.writeInline(writer); - } else { - this.writeMultiline(writer); - } - } - writeMultiline(writer) { - writer.writeLine("{").withIndent(() => { - for (const item of this.items) { - writer.writeLine(item); - } - }).write("}"); - } - writeInline(writer) { - writer.write("{ ").writeJoined(", ", this.items).write(" }"); - } -}; -function objectType() { - return new ObjectType(); -} - -// src/generation/ts-builders/Parameter.ts -var Parameter = class { - constructor(name, type) { - this.name = name; - this.type = type; - this.isOptional = false; - } - optional() { - this.isOptional = true; - return this; - } - write(writer) { - writer.write(this.name); - if (this.isOptional) { - writer.write("?"); - } - writer.write(": ").write(this.type); - } -}; -function parameter(name, type) { - return new Parameter(name, type); -} - -// src/generation/ts-builders/Property.ts -var Property = class { - constructor(name, type) { - this.name = name; - this.type = type; - this.isOptional = false; - this.isReadonly = false; - } - optional() { - this.isOptional = true; - return this; - } - readonly() { - this.isReadonly = true; - return this; - } - setDocComment(docComment2) { - this.docComment = docComment2; - return this; - } - write(writer) { - if (this.docComment) { - writer.write(this.docComment); - } - if (this.isReadonly) { - writer.write("readonly "); - } - if (typeof this.name === "string") { - if (isValidJsIdentifier(this.name)) { - writer.write(this.name); - } else { - writer.write("[").write(JSON.stringify(this.name)).write("]"); - } - } else { - writer.write("[").write(this.name).write("]"); - } - if (this.isOptional) { - writer.write("?"); - } - writer.write(": ").write(this.type); - } -}; -function property(name, type) { - return new Property(name, type); -} - -// src/generation/ts-builders/Writer.ts -var INDENT_SIZE = 2; -var Writer = class { - constructor(startingIndent = 0, context) { - this.context = context; - this.lines = []; - this.currentLine = ""; - this.currentIndent = 0; - this.currentIndent = startingIndent; - } - /** - * Adds provided value to the current line. Does not end the line. - * - * @param value - * @returns - */ - write(value) { - if (typeof value === "string") { - this.currentLine += value; - } else { - value.write(this); - } - return this; - } - /** - * Adds several `values` to the current line, separated by `separator`. Both values and separator - * can also be `Builder` instances for more advanced formatting. - * - * @param separator - * @param values - * @param writeItem allow to customize how individual item is written - * @returns - */ - writeJoined(separator, values, writeItem = (item, w) => w.write(item)) { - const last = values.length - 1; - for (let i = 0; i < values.length; i++) { - writeItem(values[i], this); - if (i !== last) { - this.write(separator); - } - } - return this; - } - /** - * Adds a string to current line, flushes current line and starts a new line. - * @param line - * @returns - */ - writeLine(line) { - return this.write(line).newLine(); - } - /** - * Flushes current line and starts a new line. New line starts at previously configured indentation level - * @returns - */ - newLine() { - this.lines.push(this.indentedCurrentLine()); - this.currentLine = ""; - this.marginSymbol = void 0; - const afterNextNewLineCallback = this.afterNextNewLineCallback; - this.afterNextNewLineCallback = void 0; - afterNextNewLineCallback?.(); - return this; - } - /** - * Increases indentation level by 1, calls provided callback and then decreases indentation again. - * Could be used for writing indented blocks of text: - * - * @example - * ```ts - * writer - * .writeLine('{') - * .withIndent(() => { - * writer.writeLine('foo: 123'); - * writer.writeLine('bar: 456'); - * }) - * .writeLine('}') - * ``` - * @param callback - * @returns - */ - withIndent(callback) { - this.indent(); - callback(this); - this.unindent(); - return this; - } - /** - * Calls provided callback next time when new line is started. - * Callback is called after old line have already been flushed and a new - * line have been started. Can be used for adding "between the lines" decorations, - * such as underlines. - * - * @param callback - * @returns - */ - afterNextNewline(callback) { - this.afterNextNewLineCallback = callback; - return this; - } - /** - * Increases indentation level of the current line by 1 - * @returns - */ - indent() { - this.currentIndent++; - return this; - } - /** - * Decreases indentation level of the current line by 1, if it is possible - * @returns - */ - unindent() { - if (this.currentIndent > 0) { - this.currentIndent--; - } - return this; - } - /** - * Adds a symbol, that will replace the first character of the current line (including indentation) - * when it is flushed. Can be used for adding markers to the line. - * - * Note: if indentation level of the line is 0, it will replace the first actually printed character - * of the line. Use with caution. - * @param symbol - * @returns - */ - addMarginSymbol(symbol) { - this.marginSymbol = symbol; - return this; - } - toString() { - return this.lines.concat(this.indentedCurrentLine()).join("\n"); - } - getCurrentLineLength() { - return this.currentLine.length; - } - indentedCurrentLine() { - const line = this.currentLine.padStart(this.currentLine.length + INDENT_SIZE * this.currentIndent); - if (this.marginSymbol) { - return this.marginSymbol + line.slice(1); - } - return line; - } -}; - -// src/generation/ts-builders/stringify.ts -function stringify(builder, { indentLevel = 0, newLine = "none" } = {}) { - const str = new Writer(indentLevel, void 0).write(builder).toString(); - switch (newLine) { - case "none": - return str; - case "leading": - return "\n" + str; - case "trailing": - return str + "\n"; - case "both": - return "\n" + str + "\n"; - default: - assertNever(newLine, "Unexpected value"); - } -} - -// src/generation/ts-builders/StringLiteralType.ts -init_TypeBuilder(); -var StringLiteralType = class extends TypeBuilder { - constructor(content) { - super(); - this.content = content; - } - write(writer) { - writer.write(JSON.stringify(this.content)); - } -}; -function stringLiteral(content) { - return new StringLiteralType(content); -} - -// src/generation/ts-builders/TupleType.ts -init_TypeBuilder(); -var TupleItem = class { - constructor(type) { - this.type = type; - } - setName(name) { - this.name = name; - return this; - } - write(writer) { - if (this.name) { - writer.write(this.name).write(": "); - } - writer.write(this.type); - } -}; -var TupleType = class extends TypeBuilder { - constructor() { - super(...arguments); - this.items = []; - } - add(item) { - if (item instanceof TypeBuilder) { - item = new TupleItem(item); - } - this.items.push(item); - return this; - } - write(writer) { - writer.write("[").writeJoined(", ", this.items).write("]"); - } -}; -function tupleType() { - return new TupleType(); -} -function tupleItem(type) { - return new TupleItem(type); -} - -// src/generation/ts-builders/TypeDeclaration.ts -var TypeDeclaration = class { - constructor(name, type) { - this.name = name; - this.type = type; - this.genericParameters = []; - } - addGenericParameter(param) { - this.genericParameters.push(param); - return this; - } - setName(name) { - this.name = name; - return this; - } - setDocComment(docComment2) { - this.docComment = docComment2; - return this; - } - write(writer) { - if (this.docComment) { - writer.write(this.docComment); - } - writer.write("type ").write(this.name); - if (this.genericParameters.length > 0) { - writer.write("<").writeJoined(", ", this.genericParameters).write(">"); - } - writer.write(" = ").write(this.type); - } -}; -function typeDeclaration(name, type) { - return new TypeDeclaration(name, type); -} - -// src/generation/ts-builders/UnionType.ts -init_TypeBuilder(); -var UnionType = class extends TypeBuilder { - constructor(firstType) { - super(); - this.needsParenthesisWhenIndexed = true; - this.needsParenthesisInKeyof = true; - this.variants = [firstType]; - } - addVariant(variant) { - this.variants.push(variant); - return this; - } - addVariants(variants) { - for (const variant of variants) { - this.addVariant(variant); - } - return this; - } - write(writer) { - writer.writeJoined(" | ", this.variants, (variant, writer2) => { - if (variant.needsParenthesisInUnion) { - writer2.write("(").write(variant).write(")"); - } else { - writer2.write(variant); - } - }); - } - mapVariants(callback) { - return unionType(this.variants.map((v) => callback(v))); - } -}; -function unionType(types) { - if (Array.isArray(types)) { - if (types.length === 0) { - throw new TypeError("Union types array can not be empty"); - } - const union = new UnionType(types[0]); - for (let i = 1; i < types.length; i++) { - union.addVariant(types[i]); - } - return union; - } - return new UnionType(types); -} - -// src/generation/ts-builders/WellKnownSymbol.ts -var WellKnownSymbol = class { - constructor(name) { - this.name = name; - } - write(writer) { - writer.write("Symbol.").write(this.name); - } -}; -function wellKnownSymbol(name) { - return new WellKnownSymbol(name); -} -var toStringTag = wellKnownSymbol("toStringTag"); - -// src/generation/utils.ts -function getSelectName(modelName) { - return `${modelName}Select`; -} -function getSelectCreateManyAndReturnName(modelName) { - return `${modelName}SelectCreateManyAndReturn`; -} -function getIncludeName(modelName) { - return `${modelName}Include`; -} -function getIncludeCreateManyAndReturnName(modelName) { - return `${modelName}IncludeCreateManyAndReturn`; -} -function getCreateManyAndReturnOutputType(modelName) { - return `CreateMany${modelName}AndReturnOutputType`; -} -function getOmitName(modelName) { - return `${modelName}Omit`; -} -function getAggregateName(modelName) { - return `Aggregate${capitalize2(modelName)}`; -} -function getGroupByName(modelName) { - return `${capitalize2(modelName)}GroupByOutputType`; -} -function getAvgAggregateName(modelName) { - return `${capitalize2(modelName)}AvgAggregateOutputType`; -} -function getSumAggregateName(modelName) { - return `${capitalize2(modelName)}SumAggregateOutputType`; -} -function getMinAggregateName(modelName) { - return `${capitalize2(modelName)}MinAggregateOutputType`; -} -function getMaxAggregateName(modelName) { - return `${capitalize2(modelName)}MaxAggregateOutputType`; -} -function getCountAggregateInputName(modelName) { - return `${capitalize2(modelName)}CountAggregateInputType`; -} -function getCountAggregateOutputName(modelName) { - return `${capitalize2(modelName)}CountAggregateOutputType`; -} -function getAggregateInputType(aggregateOutputType) { - return aggregateOutputType.replace(/OutputType$/, "InputType"); -} -function getGroupByArgsName(modelName) { - return `${modelName}GroupByArgs`; -} -function getGroupByPayloadName(modelName) { - return `Get${capitalize2(modelName)}GroupByPayload`; -} -function getAggregateArgsName(modelName) { - return `${capitalize2(modelName)}AggregateArgs`; -} -function getAggregateGetName(modelName) { - return `Get${capitalize2(modelName)}AggregateType`; -} -function getFieldArgName(field, modelName) { - if (field.args.length) { - return getModelFieldArgsName(field, modelName); - } - return getModelArgName(field.outputType.type); -} -function getModelFieldArgsName(field, modelName) { - return `${modelName}$${field.name}Args`; -} -function getLegacyModelArgName(modelName) { - return `${modelName}Args`; -} -function getModelArgName(modelName, action) { - if (!action) { - return `${modelName}DefaultArgs`; - } - switch (action) { - case DMMF.ModelAction.findMany: - return `${modelName}FindManyArgs`; - case DMMF.ModelAction.findUnique: - return `${modelName}FindUniqueArgs`; - case DMMF.ModelAction.findUniqueOrThrow: - return `${modelName}FindUniqueOrThrowArgs`; - case DMMF.ModelAction.findFirst: - return `${modelName}FindFirstArgs`; - case DMMF.ModelAction.findFirstOrThrow: - return `${modelName}FindFirstOrThrowArgs`; - case DMMF.ModelAction.upsert: - return `${modelName}UpsertArgs`; - case DMMF.ModelAction.update: - return `${modelName}UpdateArgs`; - case DMMF.ModelAction.updateMany: - return `${modelName}UpdateManyArgs`; - case DMMF.ModelAction.delete: - return `${modelName}DeleteArgs`; - case DMMF.ModelAction.create: - return `${modelName}CreateArgs`; - case DMMF.ModelAction.createMany: - return `${modelName}CreateManyArgs`; - case DMMF.ModelAction.createManyAndReturn: - return `${modelName}CreateManyAndReturnArgs`; - case DMMF.ModelAction.deleteMany: - return `${modelName}DeleteManyArgs`; - case DMMF.ModelAction.groupBy: - return getGroupByArgsName(modelName); - case DMMF.ModelAction.aggregate: - return getAggregateArgsName(modelName); - case DMMF.ModelAction.count: - return `${modelName}CountArgs`; - case DMMF.ModelAction.findRaw: - return `${modelName}FindRawArgs`; - case DMMF.ModelAction.aggregateRaw: - return `${modelName}AggregateRawArgs`; - default: - assertNever(action, `Unknown action: ${action}`); - } -} -function getPayloadName(modelName, namespace2 = true) { - if (namespace2) { - return `Prisma.${getPayloadName(modelName, false)}`; - } - return `$${modelName}Payload`; -} -function getFieldRefsTypeName(name) { - return `${name}FieldRefs`; -} -function capitalize2(str) { - return str[0].toUpperCase() + str.slice(1); -} -function getRefAllowedTypeName(type) { - let typeName = type.type; - if (type.isList) { - typeName += "[]"; - } - return `'${typeName}'`; -} -function appendSkipType(context, type) { - if (context.isPreviewFeatureOn("strictUndefinedChecks")) { - return unionType([type, namedType("$Types.Skip")]); - } - return type; -} -var extArgsParam = genericParameter("ExtArgs").extends(namedType("$Extensions.InternalArgs")).default(namedType("$Extensions.DefaultArgs")); - -// src/generation/TSClient/Input.ts -var InputField = class { - constructor(field, context, source) { - this.field = field; - this.context = context; - this.source = source; - } - toTS() { - const property2 = buildInputField(this.field, this.context, this.source); - return stringify(property2); - } -}; -function buildInputField(field, context, source) { - const tsType = buildAllFieldTypes(field.inputTypes, context, source); - const tsProperty = property(field.name, field.isRequired ? tsType : appendSkipType(context, tsType)); - if (!field.isRequired) { - tsProperty.optional(); - } - const docComment2 = docComment(); - if (field.comment) { - docComment2.addText(field.comment); - } - if (field.deprecation) { - docComment2.addText(`@deprecated since ${field.deprecation.sinceVersion}: ${field.deprecation.reason}`); - } - if (docComment2.lines.length > 0) { - tsProperty.setDocComment(docComment2); - } - return tsProperty; -} -function buildSingleFieldType(t, genericsInfo, source) { - let type; - const scalarType = GraphQLScalarToJSTypeTable[t.type]; - if (t.location === "enumTypes" && t.namespace === "model") { - type = namedType(`$Enums.${t.type}`); - } else if (t.type === "Null") { - return nullType; - } else if (Array.isArray(scalarType)) { - const union = unionType(scalarType.map(namedInputType)); - if (t.isList) { - return union.mapVariants((variant) => array(variant)); - } - return union; - } else { - type = namedInputType(scalarType ?? t.type); - } - if (genericsInfo.typeRefNeedsGenericModelArg(t)) { - if (source) { - type.addGenericArgument(stringLiteral(source)); - } else { - type.addGenericArgument(namedType("$PrismaModel")); - } - } - if (t.isList) { - return array(type); - } - return type; -} -function namedInputType(typeName) { - return namedType(JSOutputTypeToInputType[typeName] ?? typeName); -} -function buildAllFieldTypes(inputTypes, context, source) { - const inputObjectTypes = inputTypes.filter((t) => t.location === "inputObjectTypes" && !t.isList); - const otherTypes = inputTypes.filter((t) => t.location !== "inputObjectTypes" || t.isList); - const tsInputObjectTypes = inputObjectTypes.map((type) => buildSingleFieldType(type, context.genericArgsInfo, source)); - const tsOtherTypes = otherTypes.map((type) => buildSingleFieldType(type, context.genericArgsInfo, source)); - if (tsOtherTypes.length === 0) { - return xorTypes(tsInputObjectTypes); - } - if (tsInputObjectTypes.length === 0) { - return unionType(tsOtherTypes); - } - return unionType(xorTypes(tsInputObjectTypes)).addVariants(tsOtherTypes); -} -function xorTypes(types) { - return types.reduce((prev, curr) => namedType("XOR").addGenericArgument(prev).addGenericArgument(curr)); -} -var InputType = class { - constructor(type, context) { - this.type = type; - this.context = context; - this.generatedName = type.name; - } - toTS() { - const { type } = this; - const source = type.meta?.source; - const fields = uniqueBy(type.fields, (f) => f.name); - const body = `{ -${(0, import_indent_string2.default)( - fields.map((arg) => { - return new InputField(arg, this.context, source).toTS(); - }).join("\n"), - TAB_SIZE - )} -}`; - return ` -export type ${this.getTypeName()} = ${wrapWithAtLeast(body, type)}`; - } - overrideName(name) { - this.generatedName = name; - return this; - } - getTypeName() { - if (this.context.genericArgsInfo.typeNeedsGenericModelArg(this.type)) { - return `${this.generatedName}<$PrismaModel = never>`; - } - return this.generatedName; - } -}; -function wrapWithAtLeast(body, input) { - if (input.constraints?.fields && input.constraints.fields.length > 0) { - const fields = input.constraints.fields.map((f) => `"${f}"`).join(" | "); - return `Prisma.AtLeast<${body}, ${fields}>`; - } - return body; -} - -// src/generation/TSClient/Model.ts -var import_indent_string3 = __toESM(require_indent_string()); - -// ../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs -function klona(x) { - if (typeof x !== "object") return x; - var k, tmp, str = Object.prototype.toString.call(x); - if (str === "[object Object]") { - if (x.constructor !== Object && typeof x.constructor === "function") { - tmp = new x.constructor(); - for (k in x) { - if (x.hasOwnProperty(k) && tmp[k] !== x[k]) { - tmp[k] = klona(x[k]); - } - } - } else { - tmp = {}; - for (k in x) { - if (k === "__proto__") { - Object.defineProperty(tmp, k, { - value: klona(x[k]), - configurable: true, - enumerable: true, - writable: true - }); - } else { - tmp[k] = klona(x[k]); - } - } - } - return tmp; - } - if (str === "[object Array]") { - k = x.length; - for (tmp = Array(k); k--; ) { - tmp[k] = klona(x[k]); - } - return tmp; - } - if (str === "[object Set]") { - tmp = /* @__PURE__ */ new Set(); - x.forEach(function(val) { - tmp.add(klona(val)); - }); - return tmp; - } - if (str === "[object Map]") { - tmp = /* @__PURE__ */ new Map(); - x.forEach(function(val, key) { - tmp.set(klona(key), klona(val)); - }); - return tmp; - } - if (str === "[object Date]") { - return /* @__PURE__ */ new Date(+x); - } - if (str === "[object RegExp]") { - tmp = new RegExp(x.source, x.flags); - tmp.lastIndex = x.lastIndex; - return tmp; - } - if (str === "[object DataView]") { - return new x.constructor(klona(x.buffer)); - } - if (str === "[object ArrayBuffer]") { - return x.slice(0); - } - if (str.slice(-6) === "Array]") { - return new x.constructor(x); - } - return x; -} - -// src/generation/TSClient/helpers.ts -var import_pluralize2 = __toESM(require_pluralize()); - -// src/generation/TSClient/jsdoc.ts -var Docs = { - cursor: `{@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}`, - pagination: `{@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}`, - aggregations: `{@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}`, - distinct: `{@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}`, - sorting: `{@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}` -}; -function addLinkToDocs(comment, docs) { - return `${Docs[docs]} - -${comment}`; -} -function getDeprecationString(since, replacement) { - return `@deprecated since ${since} please use \`${replacement}\``; -} -var undefinedNote = `Note, that providing \`undefined\` is treated as the value not being there. -Read more here: https://pris.ly/d/null-undefined`; -var JSDocFields = { - take: (singular, plural) => addLinkToDocs(`Take \`\xB1n\` ${plural} from the position of the cursor.`, "pagination"), - skip: (singular, plural) => addLinkToDocs(`Skip the first \`n\` ${plural}.`, "pagination"), - _count: (singular, plural) => addLinkToDocs(`Count returned ${plural}`, "aggregations"), - _avg: () => addLinkToDocs(`Select which fields to average`, "aggregations"), - _sum: () => addLinkToDocs(`Select which fields to sum`, "aggregations"), - _min: () => addLinkToDocs(`Select which fields to find the minimum value`, "aggregations"), - _max: () => addLinkToDocs(`Select which fields to find the maximum value`, "aggregations"), - count: () => getDeprecationString("2.23.0", "_count"), - avg: () => getDeprecationString("2.23.0", "_avg"), - sum: () => getDeprecationString("2.23.0", "_sum"), - min: () => getDeprecationString("2.23.0", "_min"), - max: () => getDeprecationString("2.23.0", "_max"), - distinct: (singular, plural) => addLinkToDocs(`Filter by unique combinations of ${plural}.`, "distinct"), - orderBy: (singular, plural) => addLinkToDocs(`Determine the order of ${plural} to fetch.`, "sorting") -}; -var JSDocs = { - groupBy: { - body: (ctx) => `Group by ${ctx.singular}. -${undefinedNote} -@param {${getGroupByArgsName(ctx.model.name)}} args - Group by arguments. -@example -// Group by city, order by createdAt, get count -const result = await prisma.user.groupBy({ - by: ['city', 'createdAt'], - orderBy: { - createdAt: true - }, - _count: { - _all: true - }, -}) -`, - fields: {} - }, - create: { - body: (ctx) => `Create a ${ctx.singular}. -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to create a ${ctx.singular}. -@example -// Create one ${ctx.singular} -const ${ctx.singular} = await ${ctx.method}({ - data: { - // ... data to create a ${ctx.singular} - } -}) -`, - fields: { - data: (singular) => `The data needed to create a ${singular}.` - } - }, - createMany: { - body: (ctx) => `Create many ${ctx.plural}. -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to create many ${ctx.plural}. -@example -// Create many ${ctx.plural} -const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ - data: [ - // ... provide data here - ] -}) - `, - fields: { - data: (singular, plural) => `The data used to create many ${plural}.` - } - }, - createManyAndReturn: { - body: (ctx) => { - const onlySelect = ctx.firstScalar ? ` -// Create many ${ctx.plural} and only return the \`${ctx.firstScalar.name}\` -const ${lowerCase(ctx.mapping.model)}With${capitalize(ctx.firstScalar.name)}Only = await ${ctx.method}({ - select: { ${ctx.firstScalar.name}: true }, - data: [ - // ... provide data here - ] -})` : ""; - return `Create many ${ctx.plural} and returns the data saved in the database. -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to create many ${ctx.plural}. -@example -// Create many ${ctx.plural} -const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ - data: [ - // ... provide data here - ] -}) -${onlySelect} -${undefinedNote} -`; - }, - fields: { - data: (singular, plural) => `The data used to create many ${plural}.` - } - }, - findUnique: { - body: (ctx) => `Find zero or one ${ctx.singular} that matches the filter. -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to find a ${ctx.singular} -@example -// Get one ${ctx.singular} -const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ - where: { - // ... provide filter here - } -})`, - fields: { - where: (singular) => `Filter, which ${singular} to fetch.` - } - }, - findUniqueOrThrow: { - body: (ctx) => `Find one ${ctx.singular} that matches the filter or throw an error with \`error.code='P2025'\` -if no matches were found. -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to find a ${ctx.singular} -@example -// Get one ${ctx.singular} -const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ - where: { - // ... provide filter here - } -})`, - fields: { - where: (singular) => `Filter, which ${singular} to fetch.` - } - }, - findFirst: { - body: (ctx) => `Find the first ${ctx.singular} that matches the filter. -${undefinedNote} -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to find a ${ctx.singular} -@example -// Get one ${ctx.singular} -const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ - where: { - // ... provide filter here - } -})`, - fields: { - where: (singular) => `Filter, which ${singular} to fetch.`, - orderBy: JSDocFields.orderBy, - cursor: (singular, plural) => addLinkToDocs(`Sets the position for searching for ${plural}.`, "cursor"), - take: JSDocFields.take, - skip: JSDocFields.skip, - distinct: JSDocFields.distinct - } - }, - findFirstOrThrow: { - body: (ctx) => `Find the first ${ctx.singular} that matches the filter or -throw \`PrismaKnownClientError\` with \`P2025\` code if no matches were found. -${undefinedNote} -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to find a ${ctx.singular} -@example -// Get one ${ctx.singular} -const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ - where: { - // ... provide filter here - } -})`, - fields: { - where: (singular) => `Filter, which ${singular} to fetch.`, - orderBy: JSDocFields.orderBy, - cursor: (singular, plural) => addLinkToDocs(`Sets the position for searching for ${plural}.`, "cursor"), - take: JSDocFields.take, - skip: JSDocFields.skip, - distinct: JSDocFields.distinct - } - }, - findMany: { - body: (ctx) => { - const onlySelect = ctx.firstScalar ? ` -// Only select the \`${ctx.firstScalar.name}\` -const ${lowerCase(ctx.mapping.model)}With${capitalize(ctx.firstScalar.name)}Only = await ${ctx.method}({ select: { ${ctx.firstScalar.name}: true } })` : ""; - return `Find zero or more ${ctx.plural} that matches the filter. -${undefinedNote} -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to filter and select certain fields only. -@example -// Get all ${ctx.plural} -const ${ctx.mapping.plural} = await ${ctx.method}() - -// Get first 10 ${ctx.plural} -const ${ctx.mapping.plural} = await ${ctx.method}({ take: 10 }) -${onlySelect} -`; - }, - fields: { - where: (singular, plural) => `Filter, which ${plural} to fetch.`, - orderBy: JSDocFields.orderBy, - skip: JSDocFields.skip, - cursor: (singular, plural) => addLinkToDocs(`Sets the position for listing ${plural}.`, "cursor"), - take: JSDocFields.take - } - }, - update: { - body: (ctx) => `Update one ${ctx.singular}. -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to update one ${ctx.singular}. -@example -// Update one ${ctx.singular} -const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ - where: { - // ... provide filter here - }, - data: { - // ... provide data here - } -}) -`, - fields: { - data: (singular) => `The data needed to update a ${singular}.`, - where: (singular) => `Choose, which ${singular} to update.` - } - }, - upsert: { - body: (ctx) => `Create or update one ${ctx.singular}. -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to update or create a ${ctx.singular}. -@example -// Update or create a ${ctx.singular} -const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ - create: { - // ... data to create a ${ctx.singular} - }, - update: { - // ... in case it already exists, update - }, - where: { - // ... the filter for the ${ctx.singular} we want to update - } -})`, - fields: { - where: (singular) => `The filter to search for the ${singular} to update in case it exists.`, - create: (singular) => `In case the ${singular} found by the \`where\` argument doesn't exist, create a new ${singular} with this data.`, - update: (singular) => `In case the ${singular} was found with the provided \`where\` argument, update it with this data.` - } - }, - delete: { - body: (ctx) => `Delete a ${ctx.singular}. -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to delete one ${ctx.singular}. -@example -// Delete one ${ctx.singular} -const ${ctx.singular} = await ${ctx.method}({ - where: { - // ... filter to delete one ${ctx.singular} - } -}) -`, - fields: { - where: (singular) => `Filter which ${singular} to delete.` - } - }, - aggregate: { - body: (ctx) => `Allows you to perform aggregations operations on a ${ctx.singular}. -${undefinedNote} -@param {${getModelArgName( - ctx.model.name, - ctx.action - )}} args - Select which aggregations you would like to apply and on what fields. -@example -// Ordered by age ascending -// Where email contains prisma.io -// Limited to the 10 users -const aggregations = await prisma.user.aggregate({ - _avg: { - age: true, - }, - where: { - email: { - contains: "prisma.io", - }, - }, - orderBy: { - age: "asc", - }, - take: 10, -})`, - fields: { - where: (singular) => `Filter which ${singular} to aggregate.`, - orderBy: JSDocFields.orderBy, - cursor: () => addLinkToDocs(`Sets the start position`, "cursor"), - take: JSDocFields.take, - skip: JSDocFields.skip, - _count: JSDocFields._count, - _avg: JSDocFields._avg, - _sum: JSDocFields._sum, - _min: JSDocFields._min, - _max: JSDocFields._max, - count: JSDocFields.count, - avg: JSDocFields.avg, - sum: JSDocFields.sum, - min: JSDocFields.min, - max: JSDocFields.max - } - }, - count: { - body: (ctx) => `Count the number of ${ctx.plural}. -${undefinedNote} -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to filter ${ctx.plural} to count. -@example -// Count the number of ${ctx.plural} -const count = await ${ctx.method}({ - where: { - // ... the filter for the ${ctx.plural} we want to count - } -})`, - fields: {} - }, - updateMany: { - body: (ctx) => `Update zero or more ${ctx.plural}. -${undefinedNote} -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to update one or more rows. -@example -// Update many ${ctx.plural} -const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ - where: { - // ... provide filter here - }, - data: { - // ... provide data here - } -}) -`, - fields: { - data: (singular, plural) => `The data used to update ${plural}.`, - where: (singular, plural) => `Filter which ${plural} to update` - } - }, - deleteMany: { - body: (ctx) => `Delete zero or more ${ctx.plural}. -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to filter ${ctx.plural} to delete. -@example -// Delete a few ${ctx.plural} -const { count } = await ${ctx.method}({ - where: { - // ... provide filter here - } -}) -`, - fields: { - where: (singular, plural) => `Filter which ${plural} to delete` - } - }, - aggregateRaw: { - body: (ctx) => `Perform aggregation operations on a ${ctx.singular}. -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Select which aggregations you would like to apply. -@example -const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ - pipeline: [ - { $match: { status: "registered" } }, - { $group: { _id: "$country", total: { $sum: 1 } } } - ] -})`, - fields: { - pipeline: () => "An array of aggregation stages to process and transform the document stream via the aggregation pipeline. ${@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline MongoDB Docs}.", - options: () => "Additional options to pass to the `aggregate` command ${@link https://docs.mongodb.com/manual/reference/command/aggregate/#command-fields MongoDB Docs}." - } - }, - findRaw: { - body: (ctx) => `Find zero or more ${ctx.plural} that matches the filter. -@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Select which filters you would like to apply. -@example -const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ - filter: { age: { $gt: 25 } } -})`, - fields: { - filter: () => "The query predicate filter. If unspecified, then all documents in the collection will match the predicate. ${@link https://docs.mongodb.com/manual/reference/operator/query MongoDB Docs}.", - options: () => "Additional options to pass to the `find` command ${@link https://docs.mongodb.com/manual/reference/command/find/#command-fields MongoDB Docs}." - } - } -}; - -// src/generation/TSClient/helpers.ts -function getMethodJSDocBody(action, mapping, model) { - const ctx = { - singular: capitalize(mapping.model), - plural: capitalize(mapping.plural), - firstScalar: model.fields.find((f) => f.kind === "scalar"), - method: `prisma.${lowerCase(mapping.model)}.${action}`, - action, - mapping, - model - }; - const jsdoc = JSDocs[action]?.body(ctx); - return jsdoc ? jsdoc : ""; -} -function getMethodJSDoc(action, mapping, model) { - return wrapComment(getMethodJSDocBody(action, mapping, model)); -} -function wrapComment(str) { - return `/** -${str.split("\n").map((l) => " * " + l).join("\n")} -**/`; -} -function getArgFieldJSDoc(type, action, field) { - if (!field || !action || !type) return; - const fieldName = typeof field === "string" ? field : field.name; - if (JSDocs[action] && JSDocs[action]?.fields[fieldName]) { - const singular = type.name; - const plural = (0, import_pluralize2.default)(type.name); - const comment = JSDocs[action]?.fields[fieldName](singular, plural); - return comment; - } - return void 0; -} -function escapeJson(str) { - return str.replace(/\\n/g, "\\\\n").replace(/\\r/g, "\\\\r").replace(/\\t/g, "\\\\t"); -} - -// src/generation/TSClient/Args.ts -var ArgsTypeBuilder = class { - constructor(type, context, action) { - this.type = type; - this.context = context; - this.action = action; - this.hasDefaultName = true; - this.moduleExport = moduleExport( - typeDeclaration(getModelArgName(type.name, action), objectType()).addGenericParameter(extArgsParam) - ).setDocComment(docComment(`${type.name} ${action ?? "without action"}`)); - } - addProperty(prop) { - this.moduleExport.declaration.type.add(prop); - } - addSchemaArgs(args) { - for (const arg of args) { - const inputField = buildInputField(arg, this.context); - const docComment2 = getArgFieldJSDoc(this.type, this.action, arg); - if (docComment2) { - inputField.setDocComment(docComment(docComment2)); - } - this.addProperty(inputField); - } - return this; - } - addSelectArg(selectTypeName = getSelectName(this.type.name)) { - this.addProperty( - property( - "select", - unionType([namedType(selectTypeName).addGenericArgument(extArgsParam.toArgument()), nullType]) - ).optional().setDocComment(docComment(`Select specific fields to fetch from the ${this.type.name}`)) - ); - return this; - } - addIncludeArgIfHasRelations(includeTypeName = getIncludeName(this.type.name), type = this.type) { - const hasRelationField = type.fields.some((f) => f.outputType.location === "outputObjectTypes"); - if (!hasRelationField) { - return this; - } - this.addProperty( - property( - "include", - unionType([namedType(includeTypeName).addGenericArgument(extArgsParam.toArgument()), nullType]) - ).optional().setDocComment(docComment("Choose, which related nodes to fetch as well")) - ); - return this; - } - addOmitArg() { - if (!this.context.isPreviewFeatureOn("omitApi")) { - return this; - } - this.addProperty( - property( - "omit", - unionType([ - namedType(getOmitName(this.type.name)).addGenericArgument(extArgsParam.toArgument()), - nullType - ]) - ).optional().setDocComment(docComment(`Omit specific fields from the ${this.type.name}`)) - ); - return this; - } - setGeneratedName(name) { - this.hasDefaultName = false; - this.moduleExport.declaration.setName(name); - return this; - } - setComment(comment) { - this.moduleExport.setDocComment(docComment(comment)); - return this; - } - createExport() { - if (!this.action && this.hasDefaultName) { - this.context.defaultArgsAliases.addPossibleAlias( - getModelArgName(this.type.name), - getLegacyModelArgName(this.type.name) - ); - } - this.context.defaultArgsAliases.registerArgName(this.moduleExport.declaration.name); - return this.moduleExport; - } -}; - -// src/generation/TSClient/ModelFieldRefs.ts -var ModelFieldRefs = class { - constructor(outputType) { - this.outputType = outputType; - } - toTS() { - const { name } = this.outputType; - return ` - -/** - * Fields of the ${name} model - */ -interface ${getFieldRefsTypeName(name)} { -${this.stringifyFields()} -} - `; - } - stringifyFields() { - const { name } = this.outputType; - return this.outputType.fields.filter((field) => field.outputType.location !== "outputObjectTypes").map((field) => { - const fieldOutput = field.outputType; - const refTypeName = getRefAllowedTypeName(fieldOutput); - return ` readonly ${field.name}: FieldRef<"${name}", ${refTypeName}>`; - }).join("\n"); - } -}; - -// src/generation/TSClient/Output.ts -function buildModelOutputProperty(field, dmmf) { - let fieldTypeName = hasOwnProperty(GraphQLScalarToJSTypeTable, field.type) ? GraphQLScalarToJSTypeTable[field.type] : field.type; - if (Array.isArray(fieldTypeName)) { - fieldTypeName = fieldTypeName[0]; - } - if (needsNamespace(field)) { - fieldTypeName = `Prisma.${fieldTypeName}`; - } - let fieldType; - if (field.kind === "object") { - const payloadType = namedType(getPayloadName(field.type)); - if (!dmmf.isComposite(field.type)) { - payloadType.addGenericArgument(namedType("ExtArgs")); - } - fieldType = payloadType; - } else if (field.kind === "enum") { - fieldType = namedType(`$Enums.${fieldTypeName}`); - } else { - fieldType = namedType(fieldTypeName); - } - if (field.isList) { - fieldType = array(fieldType); - } else if (!field.isRequired) { - fieldType = unionType(fieldType).addVariant(nullType); - } - const property2 = property(field.name, fieldType); - if (field.documentation) { - property2.setDocComment(docComment(field.documentation)); - } - return property2; -} -function buildOutputType(type) { - return moduleExport(typeDeclaration(type.name, objectType().addMultiple(type.fields.map(buildOutputField)))); -} -function buildOutputField(field) { - let fieldType; - if (field.outputType.location === "enumTypes" && field.outputType.namespace === "model") { - fieldType = namedType(enumTypeName(field.outputType)); - } else { - const typeNames = GraphQLScalarToJSTypeTable[field.outputType.type] ?? field.outputType.type; - fieldType = Array.isArray(typeNames) ? namedType(typeNames[0]) : namedType(typeNames); - } - if (field.outputType.isList) { - fieldType = array(fieldType); - } else if (field.isNullable) { - fieldType = unionType(fieldType).addVariant(nullType); - } - const property2 = property(field.name, fieldType); - if (field.deprecation) { - property2.setDocComment( - docComment(`@deprecated since ${field.deprecation.sinceVersion} because ${field.deprecation.reason}`) - ); - } - return property2; -} -function enumTypeName(ref) { - const name = ref.type; - const namespace2 = ref.namespace === "model" ? "$Enums" : "Prisma"; - return `${namespace2}.${name}`; -} - -// src/generation/TSClient/Payload.ts -function buildModelPayload(model, context) { - const isComposite = context.dmmf.isComposite(model.name); - const objects = objectType(); - const scalars = objectType(); - const composites = objectType(); - for (const field of model.fields) { - if (field.kind === "object") { - if (context.dmmf.isComposite(field.type)) { - composites.add(buildModelOutputProperty(field, context.dmmf)); - } else { - objects.add(buildModelOutputProperty(field, context.dmmf)); - } - } else if (field.kind === "enum" || field.kind === "scalar") { - scalars.add(buildModelOutputProperty(field, context.dmmf)); - } - } - const scalarsType = isComposite ? scalars : namedType("$Extensions.GetPayloadResult").addGenericArgument(scalars).addGenericArgument(namedType("ExtArgs").subKey("result").subKey(lowerCase(model.name))); - const payloadTypeDeclaration = typeDeclaration( - getPayloadName(model.name, false), - objectType().add(property("name", stringLiteral(model.name))).add(property("objects", objects)).add(property("scalars", scalarsType)).add(property("composites", composites)) - ); - if (!isComposite) { - payloadTypeDeclaration.addGenericParameter(extArgsParam); - } - return moduleExport(payloadTypeDeclaration); -} - -// src/generation/TSClient/SelectIncludeOmit.ts -function buildIncludeType({ - modelName, - typeName = getIncludeName(modelName), - context, - fields -}) { - const type = buildSelectOrIncludeObject(modelName, getIncludeFields(fields, context.dmmf), context); - return buildExport(typeName, type); -} -function buildOmitType({ modelName, fields, context }) { - const keysType = unionType( - fields.filter( - (field) => field.outputType.location === "scalar" || field.outputType.location === "enumTypes" || context.dmmf.isComposite(field.outputType.type) - ).map((field) => stringLiteral(field.name)) - ); - const omitType = namedType("$Extensions.GetOmit").addGenericArgument(keysType).addGenericArgument(modelResultExtensionsType(modelName)); - if (context.isPreviewFeatureOn("strictUndefinedChecks")) { - omitType.addGenericArgument(namedType("$Types.Skip")); - } - return buildExport(getOmitName(modelName), omitType); -} -function buildSelectType({ - modelName, - typeName = getSelectName(modelName), - fields, - context -}) { - const objectType2 = buildSelectOrIncludeObject(modelName, fields, context); - const selectType = namedType("$Extensions.GetSelect").addGenericArgument(objectType2).addGenericArgument(modelResultExtensionsType(modelName)); - return buildExport(typeName, selectType); -} -function modelResultExtensionsType(modelName) { - return extArgsParam.toArgument().subKey("result").subKey(lowerCase(modelName)); -} -function buildScalarSelectType({ modelName, fields, context }) { - const object = buildSelectOrIncludeObject( - modelName, - fields.filter((field) => field.outputType.location === "scalar" || field.outputType.location === "enumTypes"), - context - ); - return moduleExport(typeDeclaration(`${getSelectName(modelName)}Scalar`, object)); -} -function buildSelectOrIncludeObject(modelName, fields, context) { - const objectType2 = objectType(); - for (const field of fields) { - const fieldType = unionType(booleanType); - if (field.outputType.location === "outputObjectTypes") { - const subSelectType = namedType(getFieldArgName(field, modelName)); - subSelectType.addGenericArgument(extArgsParam.toArgument()); - fieldType.addVariant(subSelectType); - } - objectType2.add(property(field.name, appendSkipType(context, fieldType)).optional()); - } - return objectType2; -} -function buildExport(typeName, type) { - const declaration = typeDeclaration(typeName, type); - return moduleExport(declaration.addGenericParameter(extArgsParam)); -} -function getIncludeFields(fields, dmmf) { - return fields.filter((field) => { - if (field.outputType.location !== "outputObjectTypes") { - return false; - } - return !dmmf.isComposite(field.outputType.type); - }); -} - -// src/generation/TSClient/utils/getModelActions.ts -function getModelActions(dmmf, name) { - const mapping = dmmf.mappingsMap[name] ?? { model: name, plural: `${name}s` }; - const mappingKeys = Object.keys(mapping).filter( - (key) => key !== "model" && key !== "plural" && mapping[key] - ); - if ("aggregate" in mapping) { - mappingKeys.push("count"); - } - return mappingKeys; -} - -// src/generation/TSClient/Model.ts -var Model = class { - constructor(model, context) { - this.model = model; - this.context = context; - this.dmmf = context.dmmf; - this.type = this.context.dmmf.outputTypeMap.model[model.name]; - this.createManyAndReturnType = this.context.dmmf.outputTypeMap.model[getCreateManyAndReturnOutputType(model.name)]; - this.mapping = this.context.dmmf.mappings.modelOperations.find((m) => m.model === model.name); - } - get argsTypes() { - const argsTypes = []; - for (const action of Object.keys(DMMF.ModelAction)) { - const fieldName = this.rootFieldNameForAction(action); - if (!fieldName) { - continue; - } - const field = this.dmmf.rootFieldMap[fieldName]; - if (!field) { - throw new Error(`Oops this must not happen. Could not find field ${fieldName} on either Query or Mutation`); - } - if (action === "updateMany" || action === "deleteMany" || action === "createMany" || action === "findRaw" || action === "aggregateRaw") { - argsTypes.push( - new ArgsTypeBuilder(this.type, this.context, action).addSchemaArgs(field.args).createExport() - ); - } else if (action === "createManyAndReturn") { - const args = new ArgsTypeBuilder(this.type, this.context, action).addSelectArg(getSelectCreateManyAndReturnName(this.type.name)).addOmitArg().addSchemaArgs(field.args); - if (this.createManyAndReturnType) { - args.addIncludeArgIfHasRelations( - getIncludeCreateManyAndReturnName(this.model.name), - this.createManyAndReturnType - ); - } - argsTypes.push(args.createExport()); - } else if (action !== "groupBy" && action !== "aggregate") { - argsTypes.push( - new ArgsTypeBuilder(this.type, this.context, action).addSelectArg().addOmitArg().addIncludeArgIfHasRelations().addSchemaArgs(field.args).createExport() - ); - } - } - for (const field of this.type.fields) { - if (!field.args.length) { - continue; - } - const fieldOutput = this.dmmf.resolveOutputObjectType(field.outputType); - if (!fieldOutput) { - continue; - } - argsTypes.push( - new ArgsTypeBuilder(fieldOutput, this.context).addSelectArg().addOmitArg().addIncludeArgIfHasRelations().addSchemaArgs(field.args).setGeneratedName(getModelFieldArgsName(field, this.model.name)).setComment(`${this.model.name}.${field.name}`).createExport() - ); - } - argsTypes.push( - new ArgsTypeBuilder(this.type, this.context).addSelectArg().addOmitArg().addIncludeArgIfHasRelations().createExport() - ); - return argsTypes; - } - rootFieldNameForAction(action) { - return this.mapping?.[action]; - } - getGroupByTypes() { - const { model, mapping } = this; - const groupByType = this.dmmf.outputTypeMap.prisma[getGroupByName(model.name)]; - if (!groupByType) { - throw new Error(`Could not get group by type for model ${model.name}`); - } - const groupByRootField = this.dmmf.rootFieldMap[mapping.groupBy]; - if (!groupByRootField) { - throw new Error(`Could not find groupBy root field for model ${model.name}. Mapping: ${mapping?.groupBy}`); - } - const groupByArgsName = getGroupByArgsName(model.name); - this.context.defaultArgsAliases.registerArgName(groupByArgsName); - return ` - - -export type ${groupByArgsName} = { -${(0, import_indent_string3.default)( - groupByRootField.args.map((arg) => { - const updatedArg = { ...arg, comment: getArgFieldJSDoc(this.type, DMMF.ModelAction.groupBy, arg) }; - return new InputField(updatedArg, this.context).toTS(); - }).concat( - groupByType.fields.filter((f) => f.outputType.location === "outputObjectTypes").map((f) => { - if (f.outputType.location === "outputObjectTypes") { - return `${f.name}?: ${getAggregateInputType(f.outputType.type)}${f.name === "_count" ? " | true" : ""}`; - } - return ""; - }) - ).join("\n"), - TAB_SIZE - )} -} - -${stringify(buildOutputType(groupByType))} - -type ${getGroupByPayloadName(model.name)} = Prisma.PrismaPromise< - Array< - PickEnumerable<${groupByType.name}, T['by']> & - { - [P in ((keyof T) & (keyof ${groupByType.name}))]: P extends '_count' - ? T[P] extends boolean - ? number - : GetScalarType - : GetScalarType - } - > - > -`; - } - getAggregationTypes() { - const { model, mapping } = this; - let aggregateType = this.dmmf.outputTypeMap.prisma[getAggregateName(model.name)]; - if (!aggregateType) { - throw new Error(`Could not get aggregate type "${getAggregateName(model.name)}" for "${model.name}"`); - } - aggregateType = klona(aggregateType); - const aggregateRootField = this.dmmf.rootFieldMap[mapping.aggregate]; - if (!aggregateRootField) { - throw new Error(`Could not find aggregate root field for model ${model.name}. Mapping: ${mapping?.aggregate}`); - } - const aggregateTypes = [aggregateType]; - const avgType = this.dmmf.outputTypeMap.prisma[getAvgAggregateName(model.name)]; - const sumType = this.dmmf.outputTypeMap.prisma[getSumAggregateName(model.name)]; - const minType = this.dmmf.outputTypeMap.prisma[getMinAggregateName(model.name)]; - const maxType = this.dmmf.outputTypeMap.prisma[getMaxAggregateName(model.name)]; - const countType = this.dmmf.outputTypeMap.prisma[getCountAggregateOutputName(model.name)]; - if (avgType) { - aggregateTypes.push(avgType); - } - if (sumType) { - aggregateTypes.push(sumType); - } - if (minType) { - aggregateTypes.push(minType); - } - if (maxType) { - aggregateTypes.push(maxType); - } - if (countType) { - aggregateTypes.push(countType); - } - const aggregateArgsName = getAggregateArgsName(model.name); - this.context.defaultArgsAliases.registerArgName(aggregateArgsName); - const aggregateName = getAggregateName(model.name); - return `${aggregateTypes.map(buildOutputType).map((type) => stringify(type)).join("\n\n")} - -${aggregateTypes.length > 1 ? aggregateTypes.slice(1).map((type) => { - const newType = { - name: getAggregateInputType(type.name), - constraints: { - maxNumFields: null, - minNumFields: null - }, - fields: type.fields.map((field) => ({ - ...field, - name: field.name, - isNullable: false, - isRequired: false, - inputTypes: [ - { - isList: false, - location: "scalar", - type: "true" - } - ] - })) - }; - return new InputType(newType, this.context).toTS(); - }).join("\n") : ""} - -export type ${aggregateArgsName} = { -${(0, import_indent_string3.default)( - aggregateRootField.args.map((arg) => { - const updatedArg = { ...arg, comment: getArgFieldJSDoc(this.type, DMMF.ModelAction.aggregate, arg) }; - return new InputField(updatedArg, this.context).toTS(); - }).concat( - aggregateType.fields.map((f) => { - let data = ""; - const comment = getArgFieldJSDoc(this.type, DMMF.ModelAction.aggregate, f.name); - data += comment ? wrapComment(comment) + "\n" : ""; - if (f.name === "_count" || f.name === "count") { - data += `${f.name}?: true | ${getCountAggregateInputName(model.name)}`; - } else { - data += `${f.name}?: ${getAggregateInputType(f.outputType.type)}`; - } - return data; - }) - ).join("\n"), - TAB_SIZE - )} -} - -export type ${getAggregateGetName(model.name)} = { - [P in keyof T & keyof ${aggregateName}]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : GetScalarType - : GetScalarType -}`; - } - toTSWithoutNamespace() { - const { model } = this; - const docLines = model.documentation ?? ""; - const modelLine = `Model ${model.name} -`; - const docs = `${modelLine}${docLines}`; - const modelTypeExport = moduleExport( - typeDeclaration( - model.name, - namedType(`$Result.DefaultSelection`).addGenericArgument(namedType(getPayloadName(model.name))) - ) - ).setDocComment(docComment(docs)); - return stringify(modelTypeExport); - } - toTS() { - const { model } = this; - const isComposite = this.dmmf.isComposite(model.name); - const omitType = this.context.isPreviewFeatureOn("omitApi") ? stringify(buildOmitType({ modelName: this.model.name, context: this.context, fields: this.type.fields }), { - newLine: "leading" - }) : ""; - const hasRelationField = model.fields.some((f) => f.kind === "object"); - const includeType = hasRelationField ? stringify( - buildIncludeType({ modelName: this.model.name, context: this.context, fields: this.type.fields }), - { - newLine: "leading" - } - ) : ""; - const createManyAndReturnIncludeType = hasRelationField && this.createManyAndReturnType ? stringify( - buildIncludeType({ - typeName: getIncludeCreateManyAndReturnName(this.model.name), - modelName: this.model.name, - context: this.context, - fields: this.createManyAndReturnType.fields - }), - { - newLine: "leading" - } - ) : ""; - return ` -/** - * Model ${model.name} - */ - -${!isComposite ? this.getAggregationTypes() : ""} - -${!isComposite ? this.getGroupByTypes() : ""} - -${stringify(buildSelectType({ modelName: this.model.name, fields: this.type.fields, context: this.context }))} -${this.createManyAndReturnType ? stringify( - buildSelectType({ - modelName: this.model.name, - fields: this.createManyAndReturnType.fields, - context: this.context, - typeName: getSelectCreateManyAndReturnName(this.model.name) - }), - { newLine: "leading" } - ) : ""} -${stringify(buildScalarSelectType({ modelName: this.model.name, fields: this.type.fields, context: this.context }), { - newLine: "leading" - })} -${omitType}${includeType}${createManyAndReturnIncludeType} - -${stringify(buildModelPayload(this.model, this.context), { newLine: "none" })} - -type ${model.name}GetPayload = $Result.GetResult<${getPayloadName(model.name)}, S> - -${isComposite ? "" : new ModelDelegate(this.type, this.context).toTS()} - -${new ModelFieldRefs(this.type).toTS()} - -// Custom InputTypes -${this.argsTypes.map((type) => stringify(type)).join("\n\n")} -`; - } -}; -var ModelDelegate = class { - constructor(outputType, context) { - this.outputType = outputType; - this.context = context; - } - /** - * Returns all available non-aggregate or group actions - * Includes both dmmf and client-only actions - * - * @param availableActions - * @returns - */ - getNonAggregateActions(availableActions) { - const actions = availableActions.filter( - (key) => key !== DMMF.ModelAction.aggregate && key !== DMMF.ModelAction.groupBy && key !== DMMF.ModelAction.count - ); - return actions; - } - toTS() { - const { name } = this.outputType; - const { dmmf } = this.context; - const mapping = dmmf.mappingsMap[name] ?? { model: name, plural: `${name}s` }; - const modelOrType = dmmf.typeAndModelMap[name]; - const availableActions = getModelActions(dmmf, name); - const nonAggregateActions = this.getNonAggregateActions(availableActions); - const groupByArgsName = getGroupByArgsName(name); - const countArgsName = getModelArgName(name, DMMF.ModelAction.count); - this.context.defaultArgsAliases.registerArgName(countArgsName); - const genericDelegateParams = [extArgsParam]; - const excludedArgsForCount = ["select", "include", "distinct"]; - if (this.context.isPreviewFeatureOn("omitApi")) { - excludedArgsForCount.push("omit"); - genericDelegateParams.push(genericParameter("ClientOptions").default(objectType())); - } - if (this.context.isPreviewFeatureOn("relationJoins")) { - excludedArgsForCount.push("relationLoadStrategy"); - } - const excludedArgsForCountType = excludedArgsForCount.map((name2) => `'${name2}'`).join(" | "); - return `${availableActions.includes(DMMF.ModelAction.aggregate) ? `type ${countArgsName} = - Omit<${getModelArgName(name, DMMF.ModelAction.findMany)}, ${excludedArgsForCountType}> & { - select?: ${getCountAggregateInputName(name)} | true - } -` : ""} -export interface ${name}Delegate<${genericDelegateParams.map((param) => stringify(param)).join(", ")}> { -${(0, import_indent_string3.default)(`[K: symbol]: { types: Prisma.TypeMap['model']['${name}'], meta: { name: '${name}' } }`, TAB_SIZE)} -${nonAggregateActions.map((action) => { - const method2 = buildModelDelegateMethod(name, action, this.context); - return stringify(method2, { indentLevel: 1, newLine: "trailing" }); - }).join("\n")} - -${availableActions.includes(DMMF.ModelAction.aggregate) ? `${(0, import_indent_string3.default)(getMethodJSDoc(DMMF.ModelAction.count, mapping, modelOrType), TAB_SIZE)} - count( - args?: Subset, - ): Prisma.PrismaPromise< - T extends $Utils.Record<'select', any> - ? T['select'] extends true - ? number - : GetScalarType - : number - > -` : ""} -${availableActions.includes(DMMF.ModelAction.aggregate) ? `${(0, import_indent_string3.default)(getMethodJSDoc(DMMF.ModelAction.aggregate, mapping, modelOrType), TAB_SIZE)} - aggregate(args: Subset): Prisma.PrismaPromise<${getAggregateGetName(name)}> -` : ""} -${availableActions.includes(DMMF.ModelAction.groupBy) ? `${(0, import_indent_string3.default)(getMethodJSDoc(DMMF.ModelAction.groupBy, mapping, modelOrType), TAB_SIZE)} - groupBy< - T extends ${groupByArgsName}, - HasSelectOrTake extends Or< - Extends<'skip', Keys>, - Extends<'take', Keys> - >, - OrderByArg extends True extends HasSelectOrTake - ? { orderBy: ${groupByArgsName}['orderBy'] } - : { orderBy?: ${groupByArgsName}['orderBy'] }, - OrderFields extends ExcludeUnderscoreKeys>>, - ByFields extends MaybeTupleToUnion, - ByValid extends Has, - HavingFields extends GetHavingFields, - HavingValid extends Has, - ByEmpty extends T['by'] extends never[] ? True : False, - InputErrors extends ByEmpty extends True - ? \`Error: "by" must not be empty.\` - : HavingValid extends False - ? { - [P in HavingFields]: P extends ByFields - ? never - : P extends string - ? \`Error: Field "\${P}" used in "having" needs to be provided in "by".\` - : [ - Error, - 'Field ', - P, - \` in "having" needs to be provided in "by"\`, - ] - }[HavingFields] - : 'take' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\` - }[OrderFields] - : 'Error: If you provide "take", you also need to provide "orderBy"' - : 'skip' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\` - }[OrderFields] - : 'Error: If you provide "skip", you also need to provide "orderBy"' - : ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\` - }[OrderFields] - >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? ${getGroupByPayloadName( - name - )} : Prisma.PrismaPromise` : ""} -/** - * Fields of the ${name} model - */ -readonly fields: ${getFieldRefsTypeName(name)}; -} - -${stringify(buildFluentWrapperDefinition(name, this.outputType, this.context))} -`; - } -}; -function buildModelDelegateMethod(modelName, actionName, context) { - const mapping = context.dmmf.mappingsMap[modelName] ?? { model: modelName, plural: `${modelName}s` }; - const modelOrType = context.dmmf.typeAndModelMap[modelName]; - const method2 = method(actionName).setDocComment(docComment(getMethodJSDocBody(actionName, mapping, modelOrType))).addParameter(getNonAggregateMethodArgs(modelName, actionName)).setReturnType(getReturnType({ modelName, actionName, context })); - const generic = getNonAggregateMethodGenericParam(modelName, actionName); - if (generic) { - method2.addGenericParameter(generic); - } - return method2; -} -function getNonAggregateMethodArgs(modelName, actionName) { - getReturnType; - const makeParameter = (type2) => parameter("args", type2); - if (actionName === DMMF.ModelAction.count) { - const type2 = omit( - namedType(getModelArgName(modelName, DMMF.ModelAction.findMany)), - unionType(stringLiteral("select")).addVariant(stringLiteral("include")).addVariant(stringLiteral("distinct")) - ); - return makeParameter(type2).optional(); - } - if (actionName === DMMF.ModelAction.findRaw || actionName === DMMF.ModelAction.aggregateRaw) { - return makeParameter(namedType(getModelArgName(modelName, actionName))).optional(); - } - const type = namedType("SelectSubset").addGenericArgument(namedType("T")).addGenericArgument( - namedType(getModelArgName(modelName, actionName)).addGenericArgument(extArgsParam.toArgument()) - ); - const param = makeParameter(type); - if (actionName === DMMF.ModelAction.findMany || actionName === DMMF.ModelAction.findFirst || actionName === DMMF.ModelAction.deleteMany || actionName === DMMF.ModelAction.createMany || actionName === DMMF.ModelAction.createManyAndReturn || actionName === DMMF.ModelAction.findFirstOrThrow) { - param.optional(); - } - return param; -} -function getNonAggregateMethodGenericParam(modelName, actionName) { - if (actionName === DMMF.ModelAction.count || actionName === DMMF.ModelAction.findRaw || actionName === DMMF.ModelAction.aggregateRaw) { - return null; - } - const arg = genericParameter("T"); - if (actionName === DMMF.ModelAction.aggregate) { - return arg.extends(namedType(getAggregateArgsName(modelName))); - } - return arg.extends(namedType(getModelArgName(modelName, actionName))); -} -function getReturnType({ - modelName, - actionName, - context, - isChaining = false, - isNullable = false -}) { - if (actionName === DMMF.ModelAction.count) { - return promise(numberType); - } - if (actionName === DMMF.ModelAction.aggregate) { - return promise(namedType(getAggregateGetName(modelName)).addGenericArgument(namedType("T"))); - } - if (actionName === DMMF.ModelAction.findRaw || actionName === DMMF.ModelAction.aggregateRaw) { - return prismaPromise(namedType("JsonObject")); - } - if (actionName === DMMF.ModelAction.deleteMany || actionName === DMMF.ModelAction.updateMany || actionName === DMMF.ModelAction.createMany) { - return prismaPromise(namedType("BatchPayload")); - } - const isList = actionName === DMMF.ModelAction.findMany || actionName === DMMF.ModelAction.createManyAndReturn; - if (isList) { - let result = getResultType(modelName, actionName, context); - if (isChaining) { - result = unionType(result).addVariant(namedType("Null")); - } - return prismaPromise(result); - } - if (isChaining && actionName === DMMF.ModelAction.findUniqueOrThrow) { - const nullType2 = isNullable ? nullType : namedType("Null"); - const result = unionType(getResultType(modelName, actionName, context)).addVariant(nullType2); - return getFluentWrapper(modelName, context, result, nullType2); - } - if (actionName === DMMF.ModelAction.findFirst || actionName === DMMF.ModelAction.findUnique) { - const result = unionType(getResultType(modelName, actionName, context)).addVariant(nullType); - return getFluentWrapper(modelName, context, result, nullType); - } - return getFluentWrapper(modelName, context, getResultType(modelName, actionName, context)); -} -function getFluentWrapper(modelName, context, resultType, nullType2 = neverType) { - const result = namedType(fluentWrapperName(modelName)).addGenericArgument(resultType).addGenericArgument(nullType2).addGenericArgument(extArgsParam.toArgument()); - if (context.isPreviewFeatureOn("omitApi")) { - result.addGenericArgument(namedType("ClientOptions")); - } - return result; -} -function getResultType(modelName, actionName, context) { - const result = namedType("$Result.GetResult").addGenericArgument(namedType(getPayloadName(modelName)).addGenericArgument(extArgsParam.toArgument())).addGenericArgument(namedType("T")).addGenericArgument(stringLiteral(actionName)); - if (context.isPreviewFeatureOn("omitApi")) { - result.addGenericArgument(namedType("ClientOptions")); - } - return result; -} -function buildFluentWrapperDefinition(modelName, outputType, context) { - const definition = interfaceDeclaration(fluentWrapperName(modelName)); - definition.addGenericParameter(genericParameter("T")).addGenericParameter(genericParameter("Null").default(neverType)).addGenericParameter(extArgsParam).extends(prismaPromise(namedType("T"))); - if (context.isPreviewFeatureOn("omitApi")) { - definition.addGenericParameter(genericParameter("ClientOptions").default(objectType())); - } - definition.add(property(toStringTag, stringLiteral("PrismaPromise")).readonly()); - definition.addMultiple( - outputType.fields.filter( - (field) => field.outputType.location === "outputObjectTypes" && !context.dmmf.isComposite(field.outputType.type) && field.name !== "_count" - ).map((field) => { - const fieldArgType = namedType(getFieldArgName(field, modelName)).addGenericArgument(extArgsParam.toArgument()); - const argsParam = genericParameter("T").extends(fieldArgType).default(objectType()); - return method(field.name).addGenericParameter(argsParam).addParameter(parameter("args", subset(argsParam.toArgument(), fieldArgType)).optional()).setReturnType( - getReturnType({ - modelName: field.outputType.type, - actionName: field.outputType.isList ? DMMF.ModelAction.findMany : DMMF.ModelAction.findUniqueOrThrow, - isChaining: true, - context, - isNullable: field.isNullable - }) - ); - }) - ); - definition.add( - method("then").setDocComment( - docComment` - Attaches callbacks for the resolution and/or rejection of the Promise. - @param onfulfilled The callback to execute when the Promise is resolved. - @param onrejected The callback to execute when the Promise is rejected. - @returns A Promise for the completion of which ever callback is executed. - ` - ).addGenericParameter(genericParameter("TResult1").default(namedType("T"))).addGenericParameter(genericParameter("TResult2").default(neverType)).addParameter(promiseCallback("onfulfilled", parameter("value", namedType("T")), namedType("TResult1"))).addParameter(promiseCallback("onrejected", parameter("reason", anyType), namedType("TResult2"))).setReturnType(promise(unionType([namedType("TResult1"), namedType("TResult2")]))) - ); - definition.add( - method("catch").setDocComment( - docComment` - Attaches a callback for only the rejection of the Promise. - @param onrejected The callback to execute when the Promise is rejected. - @returns A Promise for the completion of the callback. - ` - ).addGenericParameter(genericParameter("TResult").default(neverType)).addParameter(promiseCallback("onrejected", parameter("reason", anyType), namedType("TResult"))).setReturnType(promise(unionType([namedType("T"), namedType("TResult")]))) - ); - definition.add( - method("finally").setDocComment( - docComment` - Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The - resolved value cannot be modified from the callback. - @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). - @returns A Promise for the completion of the callback. - ` - ).addParameter( - parameter("onfinally", unionType([functionType(), undefinedType, nullType])).optional() - ).setReturnType(promise(namedType("T"))) - ); - return moduleExport(definition).setDocComment(docComment` - The delegate class that acts as a "Promise-like" for ${modelName}. - Why is this prefixed with \`Prisma__\`? - Because we want to prevent naming conflicts as mentioned in - https://github.com/prisma/prisma-client-js/issues/707 - `); -} -function promiseCallback(name, callbackParam, returnType) { - return parameter( - name, - unionType([ - functionType().addParameter(callbackParam).setReturnType(typeOrPromiseLike(returnType)), - undefinedType, - nullType - ]) - ).optional(); -} -function typeOrPromiseLike(type) { - return unionType([type, namedType("PromiseLike").addGenericArgument(type)]); -} -function subset(arg, baseType) { - return namedType("Subset").addGenericArgument(arg).addGenericArgument(baseType); -} -function fluentWrapperName(modelName) { - return `Prisma__${modelName}Client`; -} - -// src/generation/TSClient/TSClient.ts -var import_ci_info = __toESM(require_ci_info()); -var import_crypto = __toESM(require("crypto")); -var import_indent_string8 = __toESM(require_indent_string()); -var import_path4 = __toESM(require("path")); - -// src/generation/dmmf.ts -var DMMFHelper = class { - constructor(document) { - this.document = document; - } - get compositeNames() { - return this._compositeNames ??= new Set(this.datamodel.types.map((t) => t.name)); - } - get inputTypesByName() { - return this._inputTypesByName ??= this.buildInputTypesMap(); - } - get typeAndModelMap() { - return this._typeAndModelMap ??= this.buildTypeModelMap(); - } - get mappingsMap() { - return this._mappingsMap ??= this.buildMappingsMap(); - } - get outputTypeMap() { - return this._outputTypeMap ??= this.buildMergedOutputTypeMap(); - } - get rootFieldMap() { - return this._rootFieldMap ??= this.buildRootFieldMap(); - } - get datamodel() { - return this.document.datamodel; - } - get mappings() { - return this.document.mappings; - } - get schema() { - return this.document.schema; - } - get inputObjectTypes() { - return this.schema.inputObjectTypes; - } - get outputObjectTypes() { - return this.schema.outputObjectTypes; - } - isComposite(modelOrTypeName) { - return this.compositeNames.has(modelOrTypeName); - } - getOtherOperationNames() { - return [ - Object.values(this.mappings.otherOperations.write), - Object.values(this.mappings.otherOperations.read) - ].flat(); - } - hasEnumInNamespace(enumName, namespace2) { - return this.schema.enumTypes[namespace2]?.find((schemaEnum) => schemaEnum.name === enumName) !== void 0; - } - resolveInputObjectType(ref) { - return this.inputTypesByName.get(fullyQualifiedName(ref.type, ref.namespace)); - } - resolveOutputObjectType(ref) { - if (ref.location !== "outputObjectTypes") { - return void 0; - } - return this.outputObjectTypes[ref.namespace ?? "prisma"].find((outputObject) => outputObject.name === ref.type); - } - buildModelMap() { - return keyBy(this.datamodel.models, "name"); - } - buildTypeMap() { - return keyBy(this.datamodel.types, "name"); - } - buildTypeModelMap() { - return { ...this.buildTypeMap(), ...this.buildModelMap() }; - } - buildMappingsMap() { - return keyBy(this.mappings.modelOperations, "model"); - } - buildMergedOutputTypeMap() { - if (!this.schema.outputObjectTypes.prisma) { - return { - model: keyBy(this.schema.outputObjectTypes.model, "name"), - prisma: keyBy([], "name") - }; - } - return { - model: keyBy(this.schema.outputObjectTypes.model, "name"), - prisma: keyBy(this.schema.outputObjectTypes.prisma, "name") - }; - } - buildRootFieldMap() { - return { - ...keyBy(this.outputTypeMap.prisma.Query.fields, "name"), - ...keyBy(this.outputTypeMap.prisma.Mutation.fields, "name") - }; - } - buildInputTypesMap() { - const result = /* @__PURE__ */ new Map(); - for (const type of this.inputObjectTypes.prisma) { - result.set(fullyQualifiedName(type.name, "prisma"), type); - } - if (!this.inputObjectTypes.model) { - return result; - } - for (const type of this.inputObjectTypes.model) { - result.set(fullyQualifiedName(type.name, "model"), type); - } - return result; - } -}; -function fullyQualifiedName(typeName, namespace2) { - if (namespace2) { - return `${namespace2}.${typeName}`; - } - return typeName; -} - -// src/generation/Cache.ts -var Cache = class { - constructor() { - this._map = /* @__PURE__ */ new Map(); - } - get(key) { - return this._map.get(key)?.value; - } - set(key, value) { - this._map.set(key, { value }); - } - getOrCreate(key, create) { - const cached = this._map.get(key); - if (cached) { - return cached.value; - } - const value = create(); - this.set(key, value); - return value; - } -}; - -// src/generation/GenericsArgsInfo.ts -var GenericArgsInfo = class { - constructor(_dmmf) { - this._dmmf = _dmmf; - this._cache = new Cache(); - } - /** - * Determines if arg types need generic <$PrismaModel> argument added. - * Essentially, performs breadth-first search for any fieldRefTypes that - * do not have corresponding `meta.source` defined. - * - * @param type - * @returns - */ - typeNeedsGenericModelArg(topLevelType) { - return this._cache.getOrCreate(topLevelType, () => { - const toVisit = [{ type: topLevelType }]; - const visited = /* @__PURE__ */ new Set(); - let item; - while (item = toVisit.shift()) { - const { type: currentType } = item; - const cached = this._cache.get(currentType); - if (cached === true) { - this._cacheResultsForTree(item); - return true; - } - if (cached === false) { - continue; - } - if (visited.has(currentType)) { - continue; - } - if (currentType.meta?.source) { - this._cache.set(currentType, false); - continue; - } - visited.add(currentType); - for (const field of currentType.fields) { - for (const fieldType of field.inputTypes) { - if (fieldType.location === "fieldRefTypes") { - this._cacheResultsForTree(item); - return true; - } - const inputObject = this._dmmf.resolveInputObjectType(fieldType); - if (inputObject) { - toVisit.push({ type: inputObject, parent: item }); - } - } - } - } - for (const visitedType of visited) { - this._cache.set(visitedType, false); - } - return false; - }); - } - typeRefNeedsGenericModelArg(ref) { - if (ref.location === "fieldRefTypes") { - return true; - } - const inputType = this._dmmf.resolveInputObjectType(ref); - if (!inputType) { - return false; - } - return this.typeNeedsGenericModelArg(inputType); - } - _cacheResultsForTree(item) { - let currentItem = item; - while (currentItem) { - this._cache.set(currentItem.type, true); - currentItem = currentItem.parent; - } - } -}; - -// src/generation/utils/buildInjectableEdgeEnv.ts -function buildInjectableEdgeEnv(edge, datasources) { - if (edge === true) { - return declareInjectableEdgeEnv(datasources); - } - return ``; -} -function declareInjectableEdgeEnv(datasources) { - const injectableEdgeEnv = { parsed: {} }; - const envVarNames = getSelectedEnvVarNames(datasources); - for (const envVarName of envVarNames) { - injectableEdgeEnv.parsed[envVarName] = getRuntimeEdgeEnvVar(envVarName); - } - const injectableEdgeEnvJson = JSON.stringify(injectableEdgeEnv, null, 2); - const injectableEdgeEnvCode = injectableEdgeEnvJson.replace(/"/g, ""); - return ` -config.injectableEdgeEnv = () => (${injectableEdgeEnvCode})`; -} -function getSelectedEnvVarNames(datasources) { - return datasources.reduce((acc, datasource) => { - if (datasource.url.fromEnvVar) { - return [...acc, datasource.url.fromEnvVar]; - } - return acc; - }, []); -} -function getRuntimeEdgeEnvVar(envVarName) { - const cfwEnv = `typeof globalThis !== 'undefined' && globalThis['${envVarName}']`; - const nodeOrVercelEnv = `typeof process !== 'undefined' && process.env && process.env.${envVarName}`; - return `${cfwEnv} || ${nodeOrVercelEnv} || undefined`; -} - -// src/generation/utils/buildDebugInitialization.ts -function buildDebugInitialization(edge) { - if (!edge) { - return ""; - } - const debugVar = getRuntimeEdgeEnvVar("DEBUG"); - return `if (${debugVar}) { - Debug.enable(${debugVar}) -} -`; -} - -// src/generation/utils/buildDirname.ts -function buildDirname(edge, relativeOutdir) { - if (edge === true) { - return buildDirnameDefault(); - } - return buildDirnameFind(relativeOutdir); -} -function buildDirnameFind(relativeOutdir) { - return ` -const fs = require('fs') - -config.dirname = __dirname -if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) { - const alternativePaths = [ - ${JSON.stringify(pathToPosix(relativeOutdir))}, - ${JSON.stringify(pathToPosix(relativeOutdir).split("/").slice(1).join("/"))}, - ] - - const alternativePath = alternativePaths.find((altPath) => { - return fs.existsSync(path.join(process.cwd(), altPath, 'schema.prisma')) - }) ?? alternativePaths[0] - - config.dirname = path.join(process.cwd(), alternativePath) - config.isBundled = true -}`; -} -function buildDirnameDefault() { - return `config.dirname = '/'`; -} - -// src/runtime/core/runtimeDataModel.ts -function dmmfToRuntimeDataModel(dmmfDataModel) { - return { - models: buildMapForRuntime(dmmfDataModel.models), - enums: buildMapForRuntime(dmmfDataModel.enums), - types: buildMapForRuntime(dmmfDataModel.types) - }; -} -function pruneRuntimeDataModel({ models }) { - const prunedModels = {}; - for (const modelName of Object.keys(models)) { - prunedModels[modelName] = { fields: [], dbName: models[modelName].dbName }; - for (const { name, kind, type, relationName, dbName } of models[modelName].fields) { - prunedModels[modelName].fields.push({ name, kind, type, relationName, dbName }); - } - } - return { models: prunedModels, enums: {}, types: {} }; -} -function buildMapForRuntime(list) { - const result = {}; - for (const { name, ...rest } of list) { - result[name] = rest; - } - return result; -} - -// src/generation/utils/buildDMMF.ts -function buildRuntimeDataModel(datamodel, runtimeNameJs) { - const runtimeDataModel = dmmfToRuntimeDataModel(datamodel); - let prunedDataModel; - if (runtimeNameJs === "wasm") { - prunedDataModel = pruneRuntimeDataModel(runtimeDataModel); - } else { - prunedDataModel = runtimeDataModel; - } - const datamodelString = escapeJson(JSON.stringify(prunedDataModel)); - return ` -config.runtimeDataModel = JSON.parse(${JSON.stringify(datamodelString)}) -defineDmmfProperty(exports.Prisma, config.runtimeDataModel)`; -} - -// src/generation/utils/buildGetQueryEngineWasmModule.ts -function buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs) { - if (copyEngine && runtimeNameJs === "library" && process.env.PRISMA_CLIENT_FORCE_WASM) { - return `config.engineWasm = { - getRuntime: () => require('./query_engine_bg.js'), - getQueryEngineWasmModule: async () => { - const queryEngineWasmFilePath = require('path').join(config.dirname, 'query_engine_bg.wasm') - const queryEngineWasmFileBytes = require('fs').readFileSync(queryEngineWasmFilePath) - - return new WebAssembly.Module(queryEngineWasmFileBytes) - } - }`; - } - if (copyEngine && wasm === true) { - return `config.engineWasm = { - getRuntime: () => require('./query_engine_bg.js'), - getQueryEngineWasmModule: async () => { - const loader = (await import('#wasm-engine-loader')).default - const engine = (await loader).default - return engine - } -}`; - } - return `config.engineWasm = undefined`; -} - -// src/generation/utils/buildNFTAnnotations.ts -var import_path3 = __toESM(require("path")); - -// ../../helpers/blaze/map.ts -function mapList(object, mapper) { - const mapped = new Array(object.length); - for (let i = 0; i < object.length; ++i) { - mapped[i] = mapper(object[i], i); - } - return mapped; -} -function mapObject(object, mapper) { - const mapped = {}; - const keys = Object.keys(object); - for (let i = 0; i < keys.length; ++i) { - mapped[i] = mapper(object[keys[i]], keys[i]); - } - return mapped; -} -var map = (object, mapper) => { - return Array.isArray(object) ? mapList(object, mapper) : mapObject(object, mapper); -}; - -// src/generation/utils/buildNFTAnnotations.ts -function buildNFTAnnotations(noEngine, engineType, binaryTargets, relativeOutdir) { - if (noEngine === true) return ""; - if (binaryTargets === void 0) { - return ""; - } - if (process.env.NETLIFY) { - const isNodeMajor20OrUp = parseInt(process.versions.node.split(".")[0]) >= 20; - const awsRuntimeVersion = parseAWSNodejsRuntimeEnvVarVersion(); - const isRuntimeEnvVar20OrUp = awsRuntimeVersion && awsRuntimeVersion >= 20; - const isRuntimeEnvVar18OrDown = awsRuntimeVersion && awsRuntimeVersion <= 18; - if ((isNodeMajor20OrUp || isRuntimeEnvVar20OrUp) && !isRuntimeEnvVar18OrDown) { - binaryTargets = ["rhel-openssl-3.0.x"]; - } else { - binaryTargets = ["rhel-openssl-1.0.x"]; - } - } - const engineAnnotations = map(binaryTargets, (binaryTarget) => { - const engineFilename = getQueryEngineFilename(engineType, binaryTarget); - return engineFilename ? buildNFTAnnotation(engineFilename, relativeOutdir) : ""; - }).join("\n"); - const schemaAnnotations = buildNFTAnnotation("schema.prisma", relativeOutdir); - return `${engineAnnotations}${schemaAnnotations}`; -} -function getQueryEngineFilename(engineType, binaryTarget) { - if (engineType === "library" /* Library */) { - return getNodeAPIName(binaryTarget, "fs"); - } - if (engineType === "binary" /* Binary */) { - return `query-engine-${binaryTarget}`; - } - return void 0; -} -function buildNFTAnnotation(fileName, relativeOutdir) { - const relativeFilePath = import_path3.default.join(relativeOutdir, fileName); - return ` -// file annotations for bundling tools to include these files -path.join(__dirname, ${JSON.stringify(pathToPosix(fileName))}); -path.join(process.cwd(), ${JSON.stringify(pathToPosix(relativeFilePath))})`; -} - -// src/generation/utils/buildRequirePath.ts -function buildRequirePath(edge) { - if (edge === true) return ""; - return ` - const path = require('path')`; -} - -// src/generation/utils/buildWarnEnvConflicts.ts -function buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs) { - if (edge === true) return ""; - return ` -const { warnEnvConflicts } = require('${runtimeBase}/${runtimeNameJs}.js') - -warnEnvConflicts({ - rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.rootEnvPath), - schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.schemaEnvPath) -})`; -} - -// src/generation/TSClient/common.ts -var import_indent_string4 = __toESM(require_indent_string()); -var commonCodeJS = ({ - runtimeBase, - runtimeNameJs, - browser, - clientVersion: clientVersion2, - engineVersion, - generator, - deno -}) => `${deno ? "const exports = {}" : ""} -Object.defineProperty(exports, "__esModule", { value: true }); -${deno ? ` -import { - PrismaClientKnownRequestError, - PrismaClientUnknownRequestError, - PrismaClientRustPanicError, - PrismaClientInitializationError, - PrismaClientValidationError, - NotFoundError, - getPrismaClient, - sqltag, - empty, - join, - raw, - Decimal, - Debug, - objectEnumValues, - makeStrictEnum, - Extensions, - defineDmmfProperty, - Public, - getRuntime, - skip -} from '${runtimeBase}/${runtimeNameJs}.js'` : browser ? ` -const { - Decimal, - objectEnumValues, - makeStrictEnum, - Public, - getRuntime, - skip -} = require('${runtimeBase}/${runtimeNameJs}.js') -` : ` -const { - PrismaClientKnownRequestError, - PrismaClientUnknownRequestError, - PrismaClientRustPanicError, - PrismaClientInitializationError, - PrismaClientValidationError, - NotFoundError, - getPrismaClient, - sqltag, - empty, - join, - raw, - skip, - Decimal, - Debug, - objectEnumValues, - makeStrictEnum, - Extensions, - warnOnce, - defineDmmfProperty, - Public, - getRuntime -} = require('${runtimeBase}/${runtimeNameJs}.js') -`} - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: ${clientVersion2} - * Query Engine version: ${engineVersion} - */ -Prisma.prismaVersion = { - client: "${clientVersion2}", - engine: "${engineVersion}" -} - -Prisma.PrismaClientKnownRequestError = ${notSupportOnBrowser("PrismaClientKnownRequestError", browser)}; -Prisma.PrismaClientUnknownRequestError = ${notSupportOnBrowser("PrismaClientUnknownRequestError", browser)} -Prisma.PrismaClientRustPanicError = ${notSupportOnBrowser("PrismaClientRustPanicError", browser)} -Prisma.PrismaClientInitializationError = ${notSupportOnBrowser("PrismaClientInitializationError", browser)} -Prisma.PrismaClientValidationError = ${notSupportOnBrowser("PrismaClientValidationError", browser)} -Prisma.NotFoundError = ${notSupportOnBrowser("NotFoundError", browser)} -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = ${notSupportOnBrowser("sqltag", browser)} -Prisma.empty = ${notSupportOnBrowser("empty", browser)} -Prisma.join = ${notSupportOnBrowser("join", browser)} -Prisma.raw = ${notSupportOnBrowser("raw", browser)} -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = ${notSupportOnBrowser("Extensions.getExtensionContext", browser)} -Prisma.defineExtension = ${notSupportOnBrowser("Extensions.defineExtension", browser)} - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - -${buildPrismaSkipJs(generator.previewFeatures)} -`; -var notSupportOnBrowser = (fnc, browser) => { - if (browser) { - return `() => { - const runtimeName = getRuntime().prettyName; - throw new Error(\`${fnc} is unable to run in this browser environment, or has been bundled for the browser (running in \${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report\`, -)}`; - } - return fnc; -}; -var commonCodeTS = ({ - runtimeBase, - runtimeNameTs, - clientVersion: clientVersion2, - engineVersion, - generator -}) => ({ - tsWithoutNamespace: () => `import * as runtime from '${runtimeBase}/${runtimeNameTs}'; -import $Types = runtime.Types // general types -import $Public = runtime.Types.Public -import $Utils = runtime.Types.Utils -import $Extensions = runtime.Types.Extensions -import $Result = runtime.Types.Result - -export type PrismaPromise = $Public.PrismaPromise -`, - ts: () => `export import DMMF = runtime.DMMF - -export type PrismaPromise = $Public.PrismaPromise - -/** - * Validator - */ -export import validator = runtime.Public.validator - -/** - * Prisma Errors - */ -export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError -export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError -export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError -export import PrismaClientInitializationError = runtime.PrismaClientInitializationError -export import PrismaClientValidationError = runtime.PrismaClientValidationError -export import NotFoundError = runtime.NotFoundError - -/** - * Re-export of sql-template-tag - */ -export import sql = runtime.sqltag -export import empty = runtime.empty -export import join = runtime.join -export import raw = runtime.raw -export import Sql = runtime.Sql - -${buildPrismaSkipTs(generator.previewFeatures)} - -/** - * Decimal.js - */ -export import Decimal = runtime.Decimal - -export type DecimalJsLike = runtime.DecimalJsLike - -/** - * Metrics - */ -export type Metrics = runtime.Metrics -export type Metric = runtime.Metric -export type MetricHistogram = runtime.MetricHistogram -export type MetricHistogramBucket = runtime.MetricHistogramBucket - -/** -* Extensions -*/ -export import Extension = $Extensions.UserArgs -export import getExtensionContext = runtime.Extensions.getExtensionContext -export import Args = $Public.Args -export import Payload = $Public.Payload -export import Result = $Public.Result -export import Exact = $Public.Exact - -/** - * Prisma Client JS version: ${clientVersion2} - * Query Engine version: ${engineVersion} - */ -export type PrismaVersion = { - client: string -} - -export const prismaVersion: PrismaVersion - -/** - * Utility Types - */ - - -export import JsonObject = runtime.JsonObject -export import JsonArray = runtime.JsonArray -export import JsonValue = runtime.JsonValue -export import InputJsonObject = runtime.InputJsonObject -export import InputJsonArray = runtime.InputJsonArray -export import InputJsonValue = runtime.InputJsonValue - -/** - * Types of the values used to represent different kinds of \`null\` values when working with JSON fields. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ -namespace NullTypes { -${buildNullClass("DbNull")} - -${buildNullClass("JsonNull")} - -${buildNullClass("AnyNull")} -} - -/** - * Helper for filtering JSON entries that have \`null\` on the database (empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ -export const DbNull: NullTypes.DbNull - -/** - * Helper for filtering JSON entries that have JSON \`null\` values (not empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ -export const JsonNull: NullTypes.JsonNull - -/** - * Helper for filtering JSON entries that are \`Prisma.DbNull\` or \`Prisma.JsonNull\` - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ -export const AnyNull: NullTypes.AnyNull - -type SelectAndInclude = { - select: any - include: any -} - -type SelectAndOmit = { - select: any - omit: any -} - -/** - * Get the type of the value, that the Promise holds. - */ -export type PromiseType> = T extends PromiseLike ? U : T; - -/** - * Get the return type of a function which returns a Promise. - */ -export type PromiseReturnType $Utils.JsPromise> = PromiseType> - -/** - * From T, pick a set of properties whose keys are in the union K - */ -type Prisma__Pick = { - [P in K]: T[P]; -}; - - -export type Enumerable = T | Array; - -export type RequiredKeys = { - [K in keyof T]-?: {} extends Prisma__Pick ? never : K -}[keyof T] - -export type TruthyKeys = keyof { - [K in keyof T as T[K] extends false | undefined | null ? never : K]: K -} - -export type TrueKeys = TruthyKeys>> - -/** - * Subset - * @desc From \`T\` pick properties that exist in \`U\`. Simple version of Intersection - */ -export type Subset = { - [key in keyof T]: key extends keyof U ? T[key] : never; -}; - -/** - * SelectSubset - * @desc From \`T\` pick properties that exist in \`U\`. Simple version of Intersection. - * Additionally, it validates, if both select and include are present. If the case, it errors. - */ -export type SelectSubset = { - [key in keyof T]: key extends keyof U ? T[key] : never -} & - (T extends SelectAndInclude - ? 'Please either choose \`select\` or \`include\`.' - : T extends SelectAndOmit - ? 'Please either choose \`select\` or \`omit\`.' - : {}) - -/** - * Subset + Intersection - * @desc From \`T\` pick properties that exist in \`U\` and intersect \`K\` - */ -export type SubsetIntersection = { - [key in keyof T]: key extends keyof U ? T[key] : never -} & - K - -type Without = { [P in Exclude]?: never }; - -/** - * XOR is needed to have a real mutually exclusive union type - * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types - */ -type XOR = - T extends object ? - U extends object ? - (Without & U) | (Without & T) - : U : T - - -/** - * Is T a Record? - */ -type IsObject = T extends Array -? False -: T extends Date -? False -: T extends Uint8Array -? False -: T extends BigInt -? False -: T extends object -? True -: False - - -/** - * If it's T[], return T - */ -export type UnEnumerate = T extends Array ? U : T - -/** - * From ts-toolbelt - */ - -type __Either = Omit & - { - // Merge all but K - [P in K]: Prisma__Pick // With K possibilities - }[K] - -type EitherStrict = Strict<__Either> - -type EitherLoose = ComputeRaw<__Either> - -type _Either< - O extends object, - K extends Key, - strict extends Boolean -> = { - 1: EitherStrict - 0: EitherLoose -}[strict] - -type Either< - O extends object, - K extends Key, - strict extends Boolean = 1 -> = O extends unknown ? _Either : never - -export type Union = any - -type PatchUndefined = { - [K in keyof O]: O[K] extends undefined ? At : O[K] -} & {} - -/** Helper Types for "Merge" **/ -export type IntersectOf = ( - U extends unknown ? (k: U) => void : never -) extends (k: infer I) => void - ? I - : never - -export type Overwrite = { - [K in keyof O]: K extends keyof O1 ? O1[K] : O[K]; -} & {}; - -type _Merge = IntersectOf; -}>>; - -type Key = string | number | symbol; -type AtBasic = K extends keyof O ? O[K] : never; -type AtStrict = O[K & keyof O]; -type AtLoose = O extends unknown ? AtStrict : never; -export type At = { - 1: AtStrict; - 0: AtLoose; -}[strict]; - -export type ComputeRaw = A extends Function ? A : { - [K in keyof A]: A[K]; -} & {}; - -export type OptionalFlat = { - [K in keyof O]?: O[K]; -} & {}; - -type _Record = { - [P in K]: T; -}; - -// cause typescript not to expand types and preserve names -type NoExpand = T extends unknown ? T : never; - -// this type assumes the passed object is entirely optional -type AtLeast = NoExpand< - O extends unknown - ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) - | {[P in keyof O as P extends K ? K : never]-?: O[P]} & O - : never>; - -type _Strict = U extends unknown ? U & OptionalFlat<_Record, keyof U>, never>> : never; - -export type Strict = ComputeRaw<_Strict>; -/** End Helper Types for "Merge" **/ - -export type Merge = ComputeRaw<_Merge>>; - -/** -A [[Boolean]] -*/ -export type Boolean = True | False - -// /** -// 1 -// */ -export type True = 1 - -/** -0 -*/ -export type False = 0 - -export type Not = { - 0: 1 - 1: 0 -}[B] - -export type Extends = [A1] extends [never] - ? 0 // anything \`never\` is false - : A1 extends A2 - ? 1 - : 0 - -export type Has = Not< - Extends, U1> -> - -export type Or = { - 0: { - 0: 0 - 1: 1 - } - 1: { - 0: 1 - 1: 1 - } -}[B1][B2] - -export type Keys = U extends unknown ? keyof U : never - -type Cast = A extends B ? A : B; - -export const type: unique symbol; - - - -/** - * Used by group by - */ - -export type GetScalarType = O extends object ? { - [P in keyof T]: P extends keyof O - ? O[P] - : never -} : never - -type FieldPaths< - T, - U = Omit -> = IsObject extends True ? U : T - -type GetHavingFields = { - [K in keyof T]: Or< - Or, Extends<'AND', K>>, - Extends<'NOT', K> - > extends True - ? // infer is only needed to not hit TS limit - // based on the brilliant idea of Pierre-Antoine Mills - // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437 - T[K] extends infer TK - ? GetHavingFields extends object ? Merge> : never> - : never - : {} extends FieldPaths - ? never - : K -}[keyof T] - -/** - * Convert tuple to union - */ -type _TupleToUnion = T extends (infer E)[] ? E : never -type TupleToUnion = _TupleToUnion -type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T - -/** - * Like \`Pick\`, but additionally can also accept an array of keys - */ -type PickEnumerable | keyof T> = Prisma__Pick> - -/** - * Exclude all keys with underscores - */ -type ExcludeUnderscoreKeys = T extends \`_\${string}\` ? never : T - - -export type FieldRef = runtime.FieldRef - -type FieldRefInputType = Model extends never ? never : FieldRef - -` -}); -function buildNullClass(name) { - const source = `/** -* Type of \`Prisma.${name}\`. -* -* You cannot use other instances of this class. Please use the \`Prisma.${name}\` value. -* -* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field -*/ -class ${name} { - private ${name}: never - private constructor() -}`; - return (0, import_indent_string4.default)(source, TAB_SIZE); -} -function buildPrismaSkipTs(previewFeatures) { - if (previewFeatures.includes("strictUndefinedChecks")) { - return ` -/** - * Prisma.skip - */ -export import skip = runtime.skip -`; - } - return ""; -} -function buildPrismaSkipJs(previewFeatures) { - if (previewFeatures.includes("strictUndefinedChecks")) { - return ` -Prisma.skip = skip -`; - } - return ""; -} - -// src/generation/TSClient/Count.ts -var import_indent_string5 = __toESM(require_indent_string()); -var Count = class { - constructor(type, context) { - this.type = type; - this.context = context; - } - get argsTypes() { - const argsTypes = []; - argsTypes.push( - new ArgsTypeBuilder(this.type, this.context).addSelectArg().addIncludeArgIfHasRelations().createExport() - ); - for (const field of this.type.fields) { - if (field.args.length > 0) { - argsTypes.push( - new ArgsTypeBuilder(this.type, this.context).addSchemaArgs(field.args).setGeneratedName(getCountArgsType(this.type.name, field.name)).createExport() - ); - } - } - return argsTypes; - } - toTS() { - const { type } = this; - const { name } = type; - const outputType = buildOutputType(type); - return ` -/** - * Count Type ${name} - */ - -${stringify(outputType)} - -export type ${getSelectName(name)} = { -${(0, import_indent_string5.default)( - type.fields.map((field) => { - const types = ["boolean"]; - if (field.outputType.location === "outputObjectTypes") { - types.push(getFieldArgName(field, this.type.name)); - } - if (field.args.length > 0) { - types.push(getCountArgsType(name, field.name)); - } - return `${field.name}?: ${types.join(" | ")}`; - }).join("\n"), - TAB_SIZE - )} -} - -// Custom InputTypes -${this.argsTypes.map((typeExport) => stringify(typeExport)).join("\n\n")} -`; - } -}; -function getCountArgsType(typeName, fieldName) { - return `${typeName}Count${capitalize2(fieldName)}Args`; -} - -// src/generation/TSClient/DefaultArgsAliases.ts -var DefaultArgsAliases = class { - constructor() { - this.existingArgTypes = /* @__PURE__ */ new Set(); - this.possibleAliases = []; - } - addPossibleAlias(newName, legacyName) { - this.possibleAliases.push({ newName, legacyName }); - } - registerArgName(name) { - this.existingArgTypes.add(name); - } - generateAliases() { - const aliases = []; - for (const { newName, legacyName } of this.possibleAliases) { - if (this.existingArgTypes.has(legacyName)) { - continue; - } - aliases.push( - stringify( - moduleExport( - typeDeclaration(legacyName, namedType(newName).addGenericArgument(extArgsParam.toArgument())).addGenericParameter(extArgsParam) - ).setDocComment(docComment(`@deprecated Use ${newName} instead`)), - { indentLevel: 1 } - ) - ); - } - return aliases.join("\n"); - } -}; - -// src/generation/TSClient/FieldRefInput.ts -var FieldRefInput = class { - constructor(type) { - this.type = type; - } - toTS() { - const allowedTypes = this.getAllowedTypes(); - return ` -/** - * Reference to a field of type ${allowedTypes} - */ -export type ${this.type.name}<$PrismaModel> = FieldRefInputType<$PrismaModel, ${allowedTypes}> - `; - } - getAllowedTypes() { - return this.type.allowTypes.map(getRefAllowedTypeName).join(" | "); - } -}; - -// src/generation/TSClient/GenerateContext.ts -var GenerateContext = class { - constructor({ dmmf, genericArgsInfo, defaultArgsAliases, generator }) { - this.dmmf = dmmf; - this.genericArgsInfo = genericArgsInfo; - this.defaultArgsAliases = defaultArgsAliases; - this.generator = generator; - } - isPreviewFeatureOn(previewFeature) { - return this.generator?.previewFeatures?.includes(previewFeature) ?? false; - } -}; - -// src/generation/TSClient/PrismaClient.ts -var import_indent_string7 = __toESM(require_indent_string()); - -// src/generation/utils/runtimeImport.ts -function runtimeImport(name) { - return name; -} -function runtimeImportedType(name) { - return namedType(`runtime.${name}`); -} - -// src/generation/TSClient/Datasources.ts -var import_indent_string6 = __toESM(require_indent_string()); -var Datasources = class { - constructor(internalDatasources) { - this.internalDatasources = internalDatasources; - } - toTS() { - const sources = this.internalDatasources; - return `export type Datasources = { -${(0, import_indent_string6.default)(sources.map((s) => `${s.name}?: Datasource`).join("\n"), 2)} -}`; - } -}; - -// src/generation/TSClient/globalOmit.ts -function globalOmitConfig(dmmf) { - const objectType2 = objectType().addMultiple( - dmmf.datamodel.models.map((model) => { - const type = namedType(getOmitName(model.name)); - return property(lowerCase(model.name), type).optional(); - }) - ); - return moduleExport(typeDeclaration("GlobalOmitConfig", objectType2)); -} - -// src/generation/TSClient/PrismaClient.ts -function clientTypeMapModelsDefinition(context) { - const meta = objectType(); - const modelNames = context.dmmf.datamodel.models.map((m) => m.name); - if (modelNames.length === 0) { - meta.add(property("modelProps", neverType)); - } else { - meta.add(property("modelProps", unionType(modelNames.map((name) => stringLiteral(lowerCase(name)))))); - } - const isolationLevel = context.dmmf.hasEnumInNamespace("TransactionIsolationLevel", "prisma") ? namedType("Prisma.TransactionIsolationLevel") : neverType; - meta.add(property("txIsolationLevel", isolationLevel)); - const model = objectType(); - model.addMultiple( - modelNames.map((modelName) => { - const entry = objectType(); - entry.add( - property("payload", namedType(getPayloadName(modelName)).addGenericArgument(extArgsParam.toArgument())) - ); - entry.add(property("fields", namedType(`Prisma.${getFieldRefsTypeName(modelName)}`))); - const actions = getModelActions(context.dmmf, modelName); - const operations = objectType(); - operations.addMultiple( - actions.map((action) => { - const operationType = objectType(); - const argsType = `Prisma.${getModelArgName(modelName, action)}`; - operationType.add(property("args", namedType(argsType).addGenericArgument(extArgsParam.toArgument()))); - operationType.add(property("result", clientTypeMapModelsResultDefinition(modelName, action))); - return property(action, operationType); - }) - ); - entry.add(property("operations", operations)); - return property(modelName, entry); - }) - ); - return objectType().add(property("meta", meta)).add(property("model", model)); -} -function clientTypeMapModelsResultDefinition(modelName, action) { - if (action === "count") - return unionType([optional(namedType(getCountAggregateOutputName(modelName))), numberType]); - if (action === "groupBy") return array(optional(namedType(getGroupByName(modelName)))); - if (action === "aggregate") return optional(namedType(getAggregateName(modelName))); - if (action === "findRaw") return namedType("JsonObject"); - if (action === "aggregateRaw") return namedType("JsonObject"); - if (action === "deleteMany") return namedType("BatchPayload"); - if (action === "createMany") return namedType("BatchPayload"); - if (action === "createManyAndReturn") return array(payloadToResult(modelName)); - if (action === "updateMany") return namedType("BatchPayload"); - if (action === "findMany") return array(payloadToResult(modelName)); - if (action === "findFirst") return unionType([payloadToResult(modelName), nullType]); - if (action === "findUnique") return unionType([payloadToResult(modelName), nullType]); - if (action === "findFirstOrThrow") return payloadToResult(modelName); - if (action === "findUniqueOrThrow") return payloadToResult(modelName); - if (action === "create") return payloadToResult(modelName); - if (action === "update") return payloadToResult(modelName); - if (action === "upsert") return payloadToResult(modelName); - if (action === "delete") return payloadToResult(modelName); - assertNever(action, `Unknown action: ${action}`); -} -function payloadToResult(modelName) { - return namedType("$Utils.PayloadToResult").addGenericArgument(namedType(getPayloadName(modelName))); -} -function clientTypeMapOthersDefinition(context) { - const otherOperationsNames = context.dmmf.getOtherOperationNames().flatMap((name) => { - const results = [`$${name}`]; - if (name === "executeRaw" || name === "queryRaw") { - results.push(`$${name}Unsafe`); - } - if (name === "queryRaw" && context.isPreviewFeatureOn("typedSql")) { - results.push(`$queryRawTyped`); - } - return results; - }); - const argsResultMap = { - $executeRaw: { args: "[query: TemplateStringsArray | Prisma.Sql, ...values: any[]]", result: "any" }, - $queryRaw: { args: "[query: TemplateStringsArray | Prisma.Sql, ...values: any[]]", result: "any" }, - $executeRawUnsafe: { args: "[query: string, ...values: any[]]", result: "any" }, - $queryRawUnsafe: { args: "[query: string, ...values: any[]]", result: "any" }, - $runCommandRaw: { args: "Prisma.InputJsonObject", result: "Prisma.JsonObject" }, - $queryRawTyped: { args: "runtime.UnknownTypedSql", result: "Prisma.JsonObject" } - }; - return `{ - other: { - payload: any - operations: {${otherOperationsNames.reduce((acc, action) => { - return `${acc} - ${action}: { - args: ${argsResultMap[action].args}, - result: ${argsResultMap[action].result} - }`; - }, "")} - } - } -}`; -} -function clientTypeMapDefinition(context) { - const typeMap = `${stringify(clientTypeMapModelsDefinition(context))} & ${clientTypeMapOthersDefinition(context)}`; - return ` -interface TypeMapCb extends $Utils.Fn<{extArgs: $Extensions.InternalArgs, clientOptions: PrismaClientOptions }, $Utils.Record> { - returns: Prisma.TypeMap -} - -export type TypeMap = ${typeMap}`; -} -function clientExtensionsDefinitions(context) { - const typeMap = clientTypeMapDefinition(context); - const define2 = moduleExport( - constDeclaration( - "defineExtension", - namedType("$Extensions.ExtendsHook").addGenericArgument(stringLiteral("define")).addGenericArgument(namedType("Prisma.TypeMapCb")).addGenericArgument(namedType("$Extensions.DefaultArgs")) - ) - ); - return [typeMap, stringify(define2)].join("\n"); -} -function extendsPropertyDefinition(context) { - const extendsDefinition = namedType("$Extensions.ExtendsHook").addGenericArgument(stringLiteral("extends")).addGenericArgument(namedType("Prisma.TypeMapCb")).addGenericArgument(namedType("ExtArgs")); - if (context.isPreviewFeatureOn("omitApi")) { - extendsDefinition.addGenericArgument( - namedType("$Utils.Call").addGenericArgument(namedType("Prisma.TypeMapCb")).addGenericArgument(objectType().add(property("extArgs", namedType("ExtArgs")))) - ).addGenericArgument(namedType("ClientOptions")); - } - return stringify(property("$extends", extendsDefinition), { indentLevel: 1 }); -} -function batchingTransactionDefinition(context) { - const method2 = method("$transaction").setDocComment( - docComment` - Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole. - @example - \`\`\` - const [george, bob, alice] = await prisma.$transaction([ - prisma.user.create({ data: { name: 'George' } }), - prisma.user.create({ data: { name: 'Bob' } }), - prisma.user.create({ data: { name: 'Alice' } }), - ]) - \`\`\` - - Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client/transactions). - ` - ).addGenericParameter(genericParameter("P").extends(array(prismaPromise(anyType)))).addParameter(parameter("arg", arraySpread(namedType("P")))).setReturnType(promise(namedType("runtime.Types.Utils.UnwrapTuple").addGenericArgument(namedType("P")))); - if (context.dmmf.hasEnumInNamespace("TransactionIsolationLevel", "prisma")) { - const options = objectType().formatInline().add(property("isolationLevel", namedType("Prisma.TransactionIsolationLevel")).optional()); - method2.addParameter(parameter("options", options).optional()); - } - return stringify(method2, { indentLevel: 1, newLine: "leading" }); -} -function interactiveTransactionDefinition(context) { - const options = objectType().formatInline().add(property("maxWait", numberType).optional()).add(property("timeout", numberType).optional()); - if (context.dmmf.hasEnumInNamespace("TransactionIsolationLevel", "prisma")) { - const isolationLevel = property("isolationLevel", namedType("Prisma.TransactionIsolationLevel")).optional(); - options.add(isolationLevel); - } - const returnType = promise(namedType("R")); - const callbackType = functionType().addParameter( - parameter("prisma", omit(namedType("PrismaClient"), namedType("runtime.ITXClientDenyList"))) - ).setReturnType(returnType); - const method2 = method("$transaction").addGenericParameter(genericParameter("R")).addParameter(parameter("fn", callbackType)).addParameter(parameter("options", options).optional()).setReturnType(returnType); - return stringify(method2, { indentLevel: 1, newLine: "leading" }); -} -function queryRawDefinition(context) { - if (!context.dmmf.mappings.otherOperations.write.includes("queryRaw")) { - return ""; - } - return ` - /** - * Performs a prepared raw query and returns the \`SELECT\` data. - * @example - * \`\`\` - * const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\` - * \`\`\` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; - - /** - * Performs a raw query and returns the \`SELECT\` data. - * Susceptible to SQL injections, see documentation. - * @example - * \`\`\` - * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com') - * \`\`\` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise;`; -} -function executeRawDefinition(context) { - if (!context.dmmf.mappings.otherOperations.write.includes("executeRaw")) { - return ""; - } - return ` - /** - * Executes a prepared raw query and returns the number of affected rows. - * @example - * \`\`\` - * const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\` - * \`\`\` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; - - /** - * Executes a raw query and returns the number of affected rows. - * Susceptible to SQL injections, see documentation. - * @example - * \`\`\` - * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com') - * \`\`\` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise;`; -} -function queryRawTypedDefinition(context) { - if (!context.isPreviewFeatureOn("typedSql")) { - return ""; - } - if (!context.dmmf.mappings.otherOperations.write.includes("queryRaw")) { - return ""; - } - const param = genericParameter("T"); - const method2 = method("$queryRawTyped").setDocComment( - docComment` - Executes a typed SQL query and returns a typed result - @example - \`\`\` - import { myQuery } from '@prisma/client/sql' - - const result = await prisma.$queryRawTyped(myQuery()) - \`\`\` - ` - ).addGenericParameter(param).addParameter( - parameter( - "typedSql", - runtimeImportedType("TypedSql").addGenericArgument(array(unknownType)).addGenericArgument(param.toArgument()) - ) - ).setReturnType(prismaPromise(array(param.toArgument()))); - return stringify(method2, { indentLevel: 1, newLine: "leading" }); -} -function metricDefinition(context) { - if (!context.isPreviewFeatureOn("metrics")) { - return ""; - } - const property2 = property("$metrics", namedType(`runtime.${runtimeImport("MetricsClient")}`)).setDocComment( - docComment` - Gives access to the client metrics in json or prometheus format. - - @example - \`\`\` - const metrics = await prisma.$metrics.json() - // or - const metrics = await prisma.$metrics.prometheus() - \`\`\` - ` - ).readonly(); - return stringify(property2, { indentLevel: 1, newLine: "leading" }); -} -function runCommandRawDefinition(context) { - if (!context.dmmf.mappings.otherOperations.write.includes("runCommandRaw")) { - return ""; - } - const method2 = method("$runCommandRaw").addParameter(parameter("command", namedType("Prisma.InputJsonObject"))).setReturnType(prismaPromise(namedType("Prisma.JsonObject"))).setDocComment(docComment` - Executes a raw MongoDB command and returns the result of it. - @example - \`\`\` - const user = await prisma.$runCommandRaw({ - aggregate: 'User', - pipeline: [{ $match: { name: 'Bob' } }, { $project: { email: true, _id: false } }], - explain: false, - }) - \`\`\` - - Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - `); - return stringify(method2, { indentLevel: 1, newLine: "leading" }); -} -function applyPendingMigrationsDefinition() { - if (this.runtimeNameTs !== "react-native") { - return null; - } - const method2 = method("$applyPendingMigrations").setReturnType(promise(voidType)).setDocComment( - docComment`Tries to apply pending migrations one by one. If a migration fails to apply, the function will stop and throw an error. You are responsible for informing the user and possibly blocking the app as we cannot guarantee the state of the database.` - ); - return stringify(method2, { indentLevel: 1, newLine: "leading" }); -} -function eventRegistrationMethodDeclaration(runtimeNameTs) { - if (runtimeNameTs === "binary.js") { - return `$on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : V extends 'beforeExit' ? () => $Utils.JsPromise : Prisma.LogEvent) => void): void;`; - } else { - return `$on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): void;`; - } -} -var PrismaClientClass = class { - constructor(context, internalDatasources, outputDir, runtimeNameTs, browser) { - this.context = context; - this.internalDatasources = internalDatasources; - this.outputDir = outputDir; - this.runtimeNameTs = runtimeNameTs; - this.browser = browser; - } - get jsDoc() { - const { dmmf } = this.context; - let example; - if (dmmf.mappings.modelOperations.length) { - example = dmmf.mappings.modelOperations[0]; - } else { - example = { - model: "User", - plural: "users" - }; - } - return `/** - * ## Prisma Client \u02B2\u02E2 - * - * Type-safe database client for TypeScript & Node.js - * @example - * \`\`\` - * const prisma = new PrismaClient() - * // Fetch zero or more ${capitalize2(example.plural)} - * const ${lowerCase(example.plural)} = await prisma.${lowerCase(example.model)}.findMany() - * \`\`\` - * - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). - */`; - } - toTSWithoutNamespace() { - const { dmmf } = this.context; - return `${this.jsDoc} -export class PrismaClient< - ClientOptions extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, - U = 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array ? Prisma.GetEvents : never : never, - ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs -> { - [K: symbol]: { types: Prisma.TypeMap['other'] } - - ${(0, import_indent_string7.default)(this.jsDoc, TAB_SIZE)} - - constructor(optionsArg ?: Prisma.Subset); - ${eventRegistrationMethodDeclaration(this.runtimeNameTs)} - - /** - * Connect with the database - */ - $connect(): $Utils.JsPromise; - - /** - * Disconnect from the database - */ - $disconnect(): $Utils.JsPromise; - - /** - * Add a middleware - * @deprecated since 4.16.0. For new code, prefer client extensions instead. - * @see https://pris.ly/d/extensions - */ - $use(cb: Prisma.Middleware): void - -${[ - executeRawDefinition(this.context), - queryRawDefinition(this.context), - queryRawTypedDefinition(this.context), - batchingTransactionDefinition(this.context), - interactiveTransactionDefinition(this.context), - runCommandRawDefinition(this.context), - metricDefinition(this.context), - applyPendingMigrationsDefinition.bind(this)(), - extendsPropertyDefinition(this.context) - ].filter((d) => d !== null).join("\n").trim()} - - ${(0, import_indent_string7.default)( - dmmf.mappings.modelOperations.filter((m) => m.findMany).map((m) => { - let methodName = lowerCase(m.model); - if (methodName === "constructor") { - methodName = '["constructor"]'; - } - const generics = ["ExtArgs"]; - if (this.context.isPreviewFeatureOn("omitApi")) { - generics.push("ClientOptions"); - } - return `/** - * \`prisma.${methodName}\`: Exposes CRUD operations for the **${m.model}** model. - * Example usage: - * \`\`\`ts - * // Fetch zero or more ${capitalize2(m.plural)} - * const ${lowerCase(m.plural)} = await prisma.${methodName}.findMany() - * \`\`\` - */ -get ${methodName}(): Prisma.${m.model}Delegate<${generics.join(", ")}>;`; - }).join("\n\n"), - 2 - )} -}`; - } - toTS() { - const clientOptions = this.buildClientOptions(); - const isOmitEnabled = this.context.isPreviewFeatureOn("omitApi"); - return `${new Datasources(this.internalDatasources).toTS()} -${clientExtensionsDefinitions(this.context)} -export type DefaultPrismaClient = PrismaClient -export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' -${stringify(moduleExport(clientOptions))} -${isOmitEnabled ? stringify(globalOmitConfig(this.context.dmmf)) : ""} - -/* Types for Logging */ -export type LogLevel = 'info' | 'query' | 'warn' | 'error' -export type LogDefinition = { - level: LogLevel - emit: 'stdout' | 'event' -} - -export type GetLogType = T extends LogDefinition ? T['emit'] extends 'event' ? T['level'] : never : never -export type GetEvents = T extends Array ? - GetLogType | GetLogType | GetLogType | GetLogType - : never - -export type QueryEvent = { - timestamp: Date - query: string - params: string - duration: number - target: string -} - -export type LogEvent = { - timestamp: Date - message: string - target: string -} -/* End Types for Logging */ - - -export type PrismaAction = - | 'findUnique' - | 'findUniqueOrThrow' - | 'findMany' - | 'findFirst' - | 'findFirstOrThrow' - | 'create' - | 'createMany' - | 'createManyAndReturn' - | 'update' - | 'updateMany' - | 'upsert' - | 'delete' - | 'deleteMany' - | 'executeRaw' - | 'queryRaw' - | 'aggregate' - | 'count' - | 'runCommandRaw' - | 'findRaw' - | 'groupBy' - -/** - * These options are being passed into the middleware as "params" - */ -export type MiddlewareParams = { - model?: ModelName - action: PrismaAction - args: any - dataPath: string[] - runInTransaction: boolean -} - -/** - * The \`T\` type makes sure, that the \`return proceed\` is not forgotten in the middleware implementation - */ -export type Middleware = ( - params: MiddlewareParams, - next: (params: MiddlewareParams) => $Utils.JsPromise, -) => $Utils.JsPromise - -// tested in getLogLevel.test.ts -export function getLogLevel(log: Array): LogLevel | undefined; - -/** - * \`PrismaClient\` proxy available in interactive transactions. - */ -export type TransactionClient = Omit -`; - } - buildClientOptions() { - const clientOptions = interfaceDeclaration("PrismaClientOptions").add( - property("datasources", namedType("Datasources")).optional().setDocComment(docComment("Overwrites the datasource url from your schema.prisma file")) - ).add( - property("datasourceUrl", stringType).optional().setDocComment(docComment("Overwrites the datasource url from your schema.prisma file")) - ).add( - property("errorFormat", namedType("ErrorFormat")).optional().setDocComment(docComment('@default "colorless"')) - ).add( - property("log", array(unionType([namedType("LogLevel"), namedType("LogDefinition")]))).optional().setDocComment(docComment` - @example - \`\`\` - // Defaults to stdout - log: ['query', 'info', 'warn', 'error'] - - // Emit as events - log: [ - { emit: 'stdout', level: 'query' }, - { emit: 'stdout', level: 'info' }, - { emit: 'stdout', level: 'warn' } - { emit: 'stdout', level: 'error' } - ] - \`\`\` - Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). - `) - ); - const transactionOptions = objectType().add(property("maxWait", numberType).optional()).add(property("timeout", numberType).optional()); - if (this.context.dmmf.hasEnumInNamespace("TransactionIsolationLevel", "prisma")) { - transactionOptions.add(property("isolationLevel", namedType("Prisma.TransactionIsolationLevel")).optional()); - } - clientOptions.add( - property("transactionOptions", transactionOptions).optional().setDocComment(docComment` - The default values for transactionOptions - maxWait ?= 2000 - timeout ?= 5000 - `) - ); - if (this.runtimeNameTs === "library.js" && this.context.isPreviewFeatureOn("driverAdapters")) { - clientOptions.add( - property("adapter", unionType([namedType("runtime.DriverAdapter"), namedType("null")])).optional().setDocComment( - docComment("Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`") - ) - ); - } - if (this.context.isPreviewFeatureOn("omitApi")) { - clientOptions.add( - property("omit", namedType("Prisma.GlobalOmitConfig")).optional().setDocComment(docComment` - Global configuration for omitting model fields by default. - - @example - \`\`\` - const prisma = new PrismaClient({ - omit: { - user: { - password: true - } - } - }) - \`\`\` - `) - ); - } - return clientOptions; - } -}; - -// src/generation/TSClient/TSClient.ts -var TSClient = class { - constructor(options) { - this.options = options; - this.dmmf = new DMMFHelper(options.dmmf); - this.genericsInfo = new GenericArgsInfo(this.dmmf); - } - toJS() { - const { - edge, - wasm, - binaryPaths, - generator, - outputDir, - datamodel: inlineSchema, - runtimeBase, - runtimeNameJs, - datasources, - deno, - copyEngine = true, - reusedJs, - envPaths - } = this.options; - if (reusedJs) { - return `module.exports = { ...require('${reusedJs}') }`; - } - const relativeEnvPaths = { - rootEnvPath: envPaths.rootEnvPath && pathToPosix(import_path4.default.relative(outputDir, envPaths.rootEnvPath)), - schemaEnvPath: envPaths.schemaEnvPath && pathToPosix(import_path4.default.relative(outputDir, envPaths.schemaEnvPath)) - }; - const clientEngineType = getClientEngineType(generator); - generator.config.engineType = clientEngineType; - const binaryTargets = clientEngineType === "library" /* Library */ ? Object.keys(binaryPaths.libqueryEngine ?? {}) : Object.keys(binaryPaths.queryEngine ?? {}); - const inlineSchemaHash = import_crypto.default.createHash("sha256").update(Buffer.from(inlineSchema, "utf8").toString("base64")).digest("hex"); - const datasourceFilePath = datasources[0].sourceFilePath; - const config = { - generator, - relativeEnvPaths, - relativePath: pathToPosix(import_path4.default.relative(outputDir, import_path4.default.dirname(datasourceFilePath))), - clientVersion: this.options.clientVersion, - engineVersion: this.options.engineVersion, - datasourceNames: datasources.map((d) => d.name), - activeProvider: this.options.activeProvider, - postinstall: this.options.postinstall, - ciName: import_ci_info.default.name ?? void 0, - inlineDatasources: datasources.reduce((acc, ds) => { - return acc[ds.name] = { url: ds.url }, acc; - }, {}), - inlineSchema, - inlineSchemaHash, - copyEngine - }; - const relativeOutdir = import_path4.default.relative(process.cwd(), outputDir); - const code = `${commonCodeJS({ ...this.options, browser: false })} -${buildRequirePath(edge)} - -/** - * Enums - */ -${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toJS()).join("\n\n")} -${this.dmmf.schema.enumTypes.model?.map((type) => new Enum(type, false).toJS()).join("\n\n") ?? ""} - -${new Enum( - { - name: "ModelName", - values: this.dmmf.mappings.modelOperations.map((m) => m.model) - }, - true - ).toJS()} -/** - * Create the Client - */ -const config = ${JSON.stringify(config, null, 2)} -${buildDirname(edge, relativeOutdir)} -${buildRuntimeDataModel(this.dmmf.datamodel, runtimeNameJs)} -${buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs)} -${buildInjectableEdgeEnv(edge, datasources)} -${buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs)} -${buildDebugInitialization(edge)} -const PrismaClient = getPrismaClient(config) -exports.PrismaClient = PrismaClient -Object.assign(exports, Prisma)${deno ? "\nexport { exports as default, Prisma, PrismaClient }" : ""} -${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, relativeOutdir)} -`; - return code; - } - toTS() { - const { reusedTs } = this.options; - if (reusedTs) { - const topExports = moduleExportFrom(`./${reusedTs}`); - return stringify(topExports); - } - const context = new GenerateContext({ - dmmf: this.dmmf, - genericArgsInfo: this.genericsInfo, - generator: this.options.generator, - defaultArgsAliases: new DefaultArgsAliases() - }); - const prismaClientClass = new PrismaClientClass( - context, - this.options.datasources, - this.options.outputDir, - this.options.runtimeNameTs, - this.options.browser - ); - const commonCode = commonCodeTS(this.options); - const modelAndTypes = Object.values(this.dmmf.typeAndModelMap).reduce((acc, modelOrType) => { - if (this.dmmf.outputTypeMap.model[modelOrType.name]) { - acc.push(new Model(modelOrType, context)); - } - return acc; - }, []); - const prismaEnums = this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toTS()); - const modelEnums = []; - const modelEnumsAliases = []; - for (const enumType of this.dmmf.schema.enumTypes.model ?? []) { - modelEnums.push(new Enum(enumType, false).toTS()); - modelEnumsAliases.push( - stringify(moduleExport(typeDeclaration(enumType.name, namedType(`$Enums.${enumType.name}`)))), - stringify( - moduleExport(constDeclaration(enumType.name, namedType(`typeof $Enums.${enumType.name}`))) - ) - ); - } - const fieldRefs = this.dmmf.schema.fieldRefTypes.prisma?.map((type) => new FieldRefInput(type).toTS()) ?? []; - const countTypes = this.dmmf.schema.outputObjectTypes.prisma?.filter((t) => t.name.endsWith("CountOutputType")).map((t) => new Count(t, context)); - const code = ` -/** - * Client -**/ - -${commonCode.tsWithoutNamespace()} - -${modelAndTypes.map((m) => m.toTSWithoutNamespace()).join("\n")} -${modelEnums.length > 0 ? ` -/** - * Enums - */ -export namespace $Enums { - ${modelEnums.join("\n\n")} -} - -${modelEnumsAliases.join("\n\n")} -` : ""} -${prismaClientClass.toTSWithoutNamespace()} - -export namespace Prisma { -${(0, import_indent_string8.default)( - `${commonCode.ts()} -${new Enum( - { - name: "ModelName", - values: this.dmmf.mappings.modelOperations.map((m) => m.model) - }, - true - ).toTS()} - -${prismaClientClass.toTS()} -export type Datasource = { - url?: string -} - -/** - * Count Types - */ - -${countTypes.map((t) => t.toTS()).join("\n")} - -/** - * Models - */ -${modelAndTypes.map((model) => model.toTS()).join("\n")} - -/** - * Enums - */ - -${prismaEnums?.join("\n\n")} -${fieldRefs.length > 0 ? ` -/** - * Field references - */ - -${fieldRefs.join("\n\n")}` : ""} -/** - * Deep Input Types - */ - -${this.dmmf.inputObjectTypes.prisma?.reduce((acc, inputType) => { - if (inputType.name.includes("Json") && inputType.name.includes("Filter")) { - const needsGeneric = this.genericsInfo.typeNeedsGenericModelArg(inputType); - const innerName = needsGeneric ? `${inputType.name}Base<$PrismaModel>` : `${inputType.name}Base`; - const typeName = needsGeneric ? `${inputType.name}<$PrismaModel = never>` : inputType.name; - const baseName = `Required<${innerName}>`; - acc.push(`export type ${typeName} = - | PatchUndefined< - Either<${baseName}, Exclude>, - ${baseName} - > - | OptionalFlat>`); - acc.push(new InputType(inputType, context).overrideName(`${inputType.name}Base`).toTS()); - } else { - acc.push(new InputType(inputType, context).toTS()); - } - return acc; - }, []).join("\n")} - -${this.dmmf.inputObjectTypes.model?.map((inputType) => new InputType(inputType, context).toTS()).join("\n") ?? ""} - -/** - * Aliases for legacy arg types - */ -${context.defaultArgsAliases.generateAliases()} - -/** - * Batch Payload for updateMany & deleteMany & createMany - */ - -export type BatchPayload = { - count: number -} - -/** - * DMMF - */ -export const dmmf: runtime.BaseDMMF -`, - 2 - )}}`; - return code; - } - toBrowserJS() { - const code = `${commonCodeJS({ - ...this.options, - runtimeNameJs: "index-browser", - browser: true - })} -/** - * Enums - */ - -${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toJS()).join("\n\n")} -${this.dmmf.schema.enumTypes.model?.map((type) => new Enum(type, false).toJS()).join("\n\n") ?? ""} - -${new Enum( - { - name: "ModelName", - values: this.dmmf.mappings.modelOperations.map((m) => m.model) - }, - true - ).toJS()} - -/** - * This is a stub Prisma Client that will error at runtime if called. - */ -class PrismaClient { - constructor() { - return new Proxy(this, { - get(target, prop) { - let message - const runtime = getRuntime() - if (runtime.isEdge) { - message = \`PrismaClient is not configured to run in \${runtime.prettyName}. In order to run Prisma Client on edge runtime, either: -- Use Prisma Accelerate: https://pris.ly/d/accelerate -- Use Driver Adapters: https://pris.ly/d/driver-adapters -\`; - } else { - message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime.prettyName + '\`).' - } - - message += \` -If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report\` - - throw new Error(message) - } - }) - } -} - -exports.PrismaClient = PrismaClient - -Object.assign(exports, Prisma) -`; - return code; - } -}; - -// src/generation/typedSql/buildDbEnums.ts -var DbEnumsList = class { - constructor(enums) { - this.enums = enums.map((dmmfEnum) => ({ - name: dmmfEnum.dbName ?? dmmfEnum.name, - values: dmmfEnum.values.map((dmmfValue) => dmmfValue.dbName ?? dmmfValue.name) - })); - } - isEmpty() { - return this.enums.length === 0; - } - hasEnum(name) { - return Boolean(this.enums.find((dbEnum) => dbEnum.name === name)); - } - *validJsIdentifiers() { - for (const dbEnum of this.enums) { - if (isValidJsIdentifier(dbEnum.name)) { - yield dbEnum; - } - } - } - *invalidJsIdentifiers() { - for (const dbEnum of this.enums) { - if (!isValidJsIdentifier(dbEnum.name)) { - yield dbEnum; - } - } - } -}; -function buildDbEnums(list) { - const file2 = file(); - file2.add(buildInvalidIdentifierEnums(list)); - file2.add(buildValidIdentifierEnums(list)); - return stringify(file2); -} -function buildValidIdentifierEnums(list) { - const namespace2 = namespace("$DbEnums"); - for (const dbEnum of list.validJsIdentifiers()) { - namespace2.add(typeDeclaration(dbEnum.name, enumToUnion(dbEnum))); - } - return moduleExport(namespace2); -} -function buildInvalidIdentifierEnums(list) { - const iface = interfaceDeclaration("$DbEnums"); - for (const dbEnum of list.invalidJsIdentifiers()) { - iface.add(property(dbEnum.name, enumToUnion(dbEnum))); - } - return moduleExport(iface); -} -function enumToUnion(dbEnum) { - return unionType(dbEnum.values.map(stringLiteral)); -} -function queryUsesEnums(query, enums) { - if (enums.isEmpty()) { - return false; - } - return query.parameters.some((param) => enums.hasEnum(param.typ)) || query.resultColumns.some((column) => enums.hasEnum(column.typ)); -} - -// src/generation/typedSql/buildIndex.ts -function buildIndexTs(queries, enums) { - const file2 = file(); - if (!enums.isEmpty()) { - file2.add(moduleExportFrom("./$DbEnums").named("$DbEnums")); - } - for (const query of queries) { - file2.add(moduleExportFrom(`./${query.name}`)); - } - return stringify(file2); -} -function buildIndexCjs(queries, edgeRuntimeSuffix) { - const writer = new Writer(0, void 0); - writer.writeLine('"use strict"'); - for (const { name } of queries) { - const fileName = edgeRuntimeSuffix ? `${name}.${edgeRuntimeSuffix}` : name; - writer.writeLine(`exports.${name} = require("./${fileName}.js").${name}`); - } - return writer.toString(); -} -function buildIndexEsm(queries, edgeRuntimeSuffix) { - const writer = new Writer(0, void 0); - for (const { name } of queries) { - const fileName = edgeRuntimeSuffix ? `${name}.${edgeRuntimeSuffix}` : name; - writer.writeLine(`export * from "./${fileName}.mjs"`); - } - return writer.toString(); -} - -// src/generation/typedSql/mapTypes.ts -var decimal = namedType("$runtime.Decimal"); -var buffer = namedType("Buffer"); -var date = namedType("Date"); -var inputJsonValue = namedType("$runtime.InputJsonObject"); -var jsonValue = namedType("$runtime.JsonValue"); -var bigintIn = unionType([numberType, bigintType]); -var decimalIn = unionType([numberType, decimal]); -var typeMappings = { - unknown: unknownType, - string: stringType, - int: numberType, - bigint: { - in: bigintIn, - out: bigintType - }, - decimal: { - in: decimalIn, - out: decimal - }, - float: numberType, - double: numberType, - enum: stringType, - // TODO: - bytes: buffer, - bool: booleanType, - char: stringType, - json: { - in: inputJsonValue, - out: jsonValue - }, - xml: stringType, - uuid: stringType, - date, - datetime: date, - time: date, - null: nullType, - "int-array": array(numberType), - "string-array": array(stringType), - "json-array": { - in: array(inputJsonValue), - out: array(jsonValue) - }, - "uuid-array": array(stringType), - "xml-array": array(stringType), - "bigint-array": { - in: array(bigintIn), - out: array(bigintType) - }, - "float-array": array(numberType), - "double-array": array(numberType), - "char-array": array(stringType), - "bytes-array": array(buffer), - "bool-array": array(booleanType), - "date-array": array(date), - "time-array": array(date), - "datetime-array": array(date), - "decimal-array": { - in: array(decimalIn), - out: array(decimal) - } -}; -function getInputType(introspectionType, nullable, enums) { - const inn = getMappingConfig(introspectionType, enums).in; - if (!nullable) { - return inn; - } else { - return new UnionType(inn).addVariant(nullType); - } -} -function getOutputType(introspectionType, nullable, enums) { - const out = getMappingConfig(introspectionType, enums).out; - if (!nullable) { - return out; - } else { - return new UnionType(out).addVariant(nullType); - } -} -function getMappingConfig(introspectionType, enums) { - const config = typeMappings[introspectionType]; - if (!config) { - if (enums.hasEnum(introspectionType)) { - const type = getEnumType(introspectionType); - return { in: type, out: type }; - } - throw new Error("Unknown type"); - } - if (config instanceof TypeBuilder) { - return { in: config, out: config }; - } - return config; -} -function getEnumType(name) { - if (isValidJsIdentifier(name)) { - return namedType(`$DbEnums.${name}`); - } - return namedType("$DbEnums").subKey(name); -} - -// src/generation/typedSql/buildTypedQuery.ts -function buildTypedQueryTs({ query, runtimeBase, runtimeName, enums }) { - const file2 = file(); - file2.addImport(moduleImport(`${runtimeBase}/${runtimeName}`).asNamespace("$runtime")); - if (queryUsesEnums(query, enums)) { - file2.addImport(moduleImport("./$DbEnums").named("$DbEnums")); - } - const doc = docComment(query.documentation ?? void 0); - const factoryType = functionType(); - const parametersType = tupleType(); - for (const param of query.parameters) { - const paramType = getInputType(param.typ, param.nullable, enums); - factoryType.addParameter(parameter(param.name, paramType)); - parametersType.add(tupleItem(paramType).setName(param.name)); - if (param.documentation) { - doc.addText(`@param ${param.name} ${param.documentation}`); - } else { - doc.addText(`@param ${param.name}`); - } - } - factoryType.setReturnType( - namedType("$runtime.TypedSql").addGenericArgument(namedType(`${query.name}.Parameters`)).addGenericArgument(namedType(`${query.name}.Result`)) - ); - file2.add(moduleExport(constDeclaration(query.name, factoryType)).setDocComment(doc)); - const namespace2 = namespace(query.name); - namespace2.add(moduleExport(typeDeclaration("Parameters", parametersType))); - namespace2.add(buildResultType(query, enums)); - file2.add(moduleExport(namespace2)); - return stringify(file2); -} -function buildResultType(query, enums) { - const type = objectType().addMultiple( - query.resultColumns.map((column) => property(column.name, getOutputType(column.typ, column.nullable, enums))) - ); - return moduleExport(typeDeclaration("Result", type)); -} -function buildTypedQueryCjs({ query, runtimeBase, runtimeName }) { - const writer = new Writer(0, void 0); - writer.writeLine('"use strict"'); - writer.writeLine(`const { makeTypedQueryFactory: $mkFactory } = require("${runtimeBase}/${runtimeName}")`); - writer.writeLine(`exports.${query.name} = /*#__PURE__*/ $mkFactory(${JSON.stringify(query.source)})`); - return writer.toString(); -} -function buildTypedQueryEsm({ query, runtimeBase, runtimeName }) { - const writer = new Writer(0, void 0); - writer.writeLine(`import { makeTypedQueryFactory as $mkFactory } from "${runtimeBase}/${runtimeName}"`); - writer.writeLine(`export const ${query.name} = /*#__PURE__*/ $mkFactory(${JSON.stringify(query.source)})`); - return writer.toString(); -} - -// src/generation/typedSql/typedSql.ts -function buildTypedSql({ - queries, - runtimeBase, - edgeRuntimeName, - mainRuntimeName, - dmmf -}) { - const fileMap = {}; - const enums = new DbEnumsList(dmmf.datamodel.enums); - if (!enums.isEmpty()) { - fileMap["$DbEnums.d.ts"] = buildDbEnums(enums); - } - for (const query of queries) { - const options = { query, runtimeBase, runtimeName: mainRuntimeName, enums }; - const edgeOptions = { ...options, runtimeName: `${edgeRuntimeName}.js` }; - fileMap[`${query.name}.d.ts`] = buildTypedQueryTs(options); - fileMap[`${query.name}.js`] = buildTypedQueryCjs(options); - fileMap[`${query.name}.${edgeRuntimeName}.js`] = buildTypedQueryCjs(edgeOptions); - fileMap[`${query.name}.mjs`] = buildTypedQueryEsm(options); - fileMap[`${query.name}.edge.mjs`] = buildTypedQueryEsm(edgeOptions); - } - fileMap["index.d.ts"] = buildIndexTs(queries, enums); - fileMap["index.js"] = buildIndexCjs(queries); - fileMap["index.mjs"] = buildIndexEsm(queries); - fileMap[`index.${edgeRuntimeName}.mjs`] = buildIndexEsm(queries, edgeRuntimeName); - fileMap[`index.${edgeRuntimeName}.js`] = buildIndexCjs(queries, edgeRuntimeName); - return fileMap; -} - -// src/generation/generateClient.ts -var debug2 = src_default("prisma:client:generateClient"); -var DenylistError = class extends Error { - constructor(message) { - super(message); - this.stack = void 0; - } -}; -setClassName(DenylistError, "DenylistError"); -async function buildClient({ - schemaPath, - runtimeBase, - datamodel, - binaryPaths, - outputDir, - generator, - dmmf, - datasources, - engineVersion, - clientVersion: clientVersion2, - activeProvider, - postinstall, - copyEngine, - envPaths, - typedSql -}) { - const clientEngineType = getClientEngineType(generator); - const baseClientOptions = { - dmmf: getPrismaClientDMMF(dmmf), - envPaths: envPaths ?? { rootEnvPath: null, schemaEnvPath: void 0 }, - datasources, - generator, - binaryPaths, - schemaPath, - outputDir, - runtimeBase, - clientVersion: clientVersion2, - engineVersion, - activeProvider, - postinstall, - copyEngine, - datamodel, - browser: false, - deno: false, - edge: false, - wasm: false - }; - const nodeClientOptions = { - ...baseClientOptions, - runtimeNameJs: getNodeRuntimeName(clientEngineType), - runtimeNameTs: `${getNodeRuntimeName(clientEngineType)}.js` - }; - const nodeClient = new TSClient(nodeClientOptions); - const defaultClient = new TSClient({ - ...nodeClientOptions, - reusedTs: "index", - reusedJs: "." - }); - const edgeClient = new TSClient({ - ...baseClientOptions, - runtimeNameJs: "edge", - runtimeNameTs: "library.js", - reusedTs: "default", - edge: true - }); - const rnTsClient = new TSClient({ - ...baseClientOptions, - runtimeNameJs: "react-native", - runtimeNameTs: "react-native", - edge: true - }); - const trampolineTsClient = new TSClient({ - ...nodeClientOptions, - reusedTs: "index", - reusedJs: "#main-entry-point" - }); - const exportsMapBase = { - node: "./index.js", - "edge-light": "./wasm.js", - workerd: "./wasm.js", - worker: "./wasm.js", - browser: "./index-browser.js", - default: "./index.js" - }; - const exportsMapDefault = { - require: exportsMapBase, - import: exportsMapBase, - default: exportsMapBase.default - }; - const pkgJson = { - name: getUniquePackageName(datamodel), - main: "index.js", - types: "index.d.ts", - browser: "index-browser.js", - exports: { - ...import_package.default.exports, - // TODO: remove on DA ga - ...{ ".": exportsMapDefault } - }, - version: clientVersion2, - sideEffects: false - }; - const fileMap = {}; - fileMap["index.js"] = JS(nodeClient); - fileMap["index.d.ts"] = TS(nodeClient); - fileMap["default.js"] = JS(defaultClient); - fileMap["default.d.ts"] = TS(defaultClient); - fileMap["index-browser.js"] = BrowserJS(nodeClient); - fileMap["edge.js"] = JS(edgeClient); - fileMap["edge.d.ts"] = TS(edgeClient); - if (generator.previewFeatures.includes("reactNative")) { - fileMap["react-native.js"] = JS(rnTsClient); - fileMap["react-native.d.ts"] = TS(rnTsClient); - } - const usesWasmRuntime = generator.previewFeatures.includes("driverAdapters"); - if (usesWasmRuntime) { - fileMap["default.js"] = JS(trampolineTsClient); - fileMap["default.d.ts"] = TS(trampolineTsClient); - fileMap["wasm-worker-loader.mjs"] = `export default import('./query_engine_bg.wasm')`; - fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_engine_bg.wasm?module')`; - pkgJson["browser"] = "default.js"; - pkgJson["imports"] = { - // when `import('#wasm-engine-loader')` is called, it will be resolved to the correct file - "#wasm-engine-loader": { - // Keys reference: https://runtime-keys.proposal.wintercg.org/#keys - /** - * Vercel Edge Functions / Next.js Middlewares - */ - "edge-light": "./wasm-edge-light-loader.mjs", - /** - * Cloudflare Workers, Cloudflare Pages - */ - workerd: "./wasm-worker-loader.mjs", - /** - * (Old) Cloudflare Workers - * @millsp It's a fallback, in case both other keys didn't work because we could be on a different edge platform. It's a hypothetical case rather than anything actually tested. - */ - worker: "./wasm-worker-loader.mjs", - /** - * Fallback for every other JavaScript runtime - */ - default: "./wasm-worker-loader.mjs" - }, - // when `require('#main-entry-point')` is called, it will be resolved to the correct file - "#main-entry-point": exportsMapDefault - }; - const wasmClient = new TSClient({ - ...baseClientOptions, - runtimeNameJs: "wasm", - runtimeNameTs: "library.js", - reusedTs: "default", - edge: true, - wasm: true - }); - fileMap["wasm.js"] = JS(wasmClient); - fileMap["wasm.d.ts"] = TS(wasmClient); - } else { - fileMap["wasm.js"] = fileMap["index-browser.js"]; - fileMap["wasm.d.ts"] = fileMap["default.d.ts"]; - } - if (generator.previewFeatures.includes("deno") && !!globalThis.Deno) { - const denoEdgeClient = new TSClient({ - ...baseClientOptions, - runtimeBase: `../${runtimeBase}`, - runtimeNameJs: "edge-esm", - runtimeNameTs: "library.d.ts", - deno: true, - edge: true - }); - fileMap["deno/edge.js"] = JS(denoEdgeClient); - fileMap["deno/index.d.ts"] = TS(denoEdgeClient); - fileMap["deno/edge.ts"] = ` -import './polyfill.js' -// @deno-types="./index.d.ts" -export * from './edge.js'`; - fileMap["deno/polyfill.js"] = "globalThis.process = { env: Deno.env.toObject() }; globalThis.global = globalThis"; - } - if (typedSql && typedSql.length > 0) { - const edgeRuntimeName = usesWasmRuntime ? "wasm" : "edge"; - const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`; - const esmEdgeIndex = `./sql/index.${edgeRuntimeName}.mjs`; - pkgJson.exports["./sql"] = { - require: { - types: "./sql/index.d.ts", - "edge-light": cjsEdgeIndex, - workerd: cjsEdgeIndex, - worker: cjsEdgeIndex, - node: "./sql/index.js", - default: "./sql/index.js" - }, - import: { - types: "./sql/index.d.ts", - "edge-light": esmEdgeIndex, - workerd: esmEdgeIndex, - worker: esmEdgeIndex, - node: "./sql/index.mjs", - default: "./sql/index.mjs" - }, - default: "./sql/index.js" - }; - fileMap["sql"] = buildTypedSql({ - dmmf, - runtimeBase: getTypedSqlRuntimeBase(runtimeBase), - mainRuntimeName: getNodeRuntimeName(clientEngineType), - queries: typedSql, - edgeRuntimeName - }); - } - fileMap["package.json"] = JSON.stringify(pkgJson, null, 2); - return { - fileMap, - // a map of file names to their contents - prismaClientDmmf: dmmf - // the DMMF document - }; -} -function getTypedSqlRuntimeBase(runtimeBase) { - if (!runtimeBase.startsWith(".")) { - return runtimeBase; - } - if (runtimeBase.startsWith("./")) { - return `.${runtimeBase}`; - } - return `../${runtimeBase}`; -} -async function getDefaultOutdir(outputDir) { - if (outputDir.endsWith("node_modules/@prisma/client")) { - return import_path5.default.join(outputDir, "../../.prisma/client"); - } - if (process.env.INIT_CWD && process.env.npm_lifecycle_event === "postinstall" && !process.env.PWD?.includes(".pnpm")) { - if ((0, import_fs2.existsSync)(import_path5.default.join(process.env.INIT_CWD, "package.json"))) { - return import_path5.default.join(process.env.INIT_CWD, "node_modules/.prisma/client"); - } - const packagePath = await (0, import_pkg_up.default)({ cwd: process.env.INIT_CWD }); - if (packagePath) { - return import_path5.default.join(import_path5.default.dirname(packagePath), "node_modules/.prisma/client"); - } - } - return import_path5.default.join(outputDir, "../../.prisma/client"); -} -async function generateClient(options) { - const { - datamodel, - schemaPath, - generator, - dmmf, - datasources, - binaryPaths, - testMode, - copyRuntime, - copyRuntimeSourceMaps = false, - clientVersion: clientVersion2, - engineVersion, - activeProvider, - postinstall, - envPaths, - copyEngine = true, - typedSql - } = options; - const clientEngineType = getClientEngineType(generator); - const { runtimeBase, outputDir } = await getGenerationDirs(options); - const { prismaClientDmmf, fileMap } = await buildClient({ - datamodel, - schemaPath, - runtimeBase, - outputDir, - generator, - dmmf, - datasources, - binaryPaths, - clientVersion: clientVersion2, - engineVersion, - activeProvider, - postinstall, - copyEngine, - testMode, - envPaths, - typedSql - }); - const provider = datasources[0].provider; - const denylistsErrors = validateDmmfAgainstDenylists(prismaClientDmmf); - if (denylistsErrors) { - let message = `${bold( - red("Error: ") - )}The schema at "${schemaPath}" contains reserved keywords. - Rename the following items:`; - for (const error of denylistsErrors) { - message += "\n - " + error.message; - } - message += ` -To learn more about how to rename models, check out https://pris.ly/d/naming-models`; - throw new DenylistError(message); - } - if (!copyEngine) { - await deleteOutputDir(outputDir); - } - await (0, import_fs_extra.ensureDir)(outputDir); - if (generator.previewFeatures.includes("deno") && !!globalThis.Deno) { - await (0, import_fs_extra.ensureDir)(import_path5.default.join(outputDir, "deno")); - } - await writeFileMap(outputDir, fileMap); - const runtimeDir = import_path5.default.join(__dirname, `${testMode ? "../" : ""}../runtime`); - if (copyRuntime || generator.isCustomOutput === true) { - const copiedRuntimeDir = import_path5.default.join(outputDir, "runtime"); - await (0, import_fs_extra.ensureDir)(copiedRuntimeDir); - await copyRuntimeFiles({ - from: runtimeDir, - to: copiedRuntimeDir, - sourceMaps: copyRuntimeSourceMaps, - runtimeName: getNodeRuntimeName(clientEngineType) - }); - } - const enginePath = clientEngineType === "library" /* Library */ ? binaryPaths.libqueryEngine : binaryPaths.queryEngine; - if (!enginePath) { - throw new Error( - `Prisma Client needs \`${clientEngineType === "library" /* Library */ ? "libqueryEngine" : "queryEngine"}\` in the \`binaryPaths\` object.` - ); - } - if (copyEngine) { - if (process.env.NETLIFY) { - await (0, import_fs_extra.ensureDir)("/tmp/prisma-engines"); - } - for (const [binaryTarget, filePath] of Object.entries(enginePath)) { - const fileName = import_path5.default.basename(filePath); - let target; - if (process.env.NETLIFY && !["rhel-openssl-1.0.x", "rhel-openssl-3.0.x"].includes(binaryTarget)) { - target = import_path5.default.join("/tmp/prisma-engines", fileName); - } else { - target = import_path5.default.join(outputDir, fileName); - } - await overwriteFile(filePath, target); - } - } - const schemaTargetPath = import_path5.default.join(outputDir, "schema.prisma"); - await import_promises.default.writeFile(schemaTargetPath, datamodel, { encoding: "utf-8" }); - if (generator.previewFeatures.includes("driverAdapters") && isWasmEngineSupported(provider) && copyEngine && !testMode) { - const suffix = provider === "postgres" ? "postgresql" : provider; - await import_promises.default.copyFile( - import_path5.default.join(runtimeDir, `query_engine_bg.${suffix}.wasm`), - import_path5.default.join(outputDir, `query_engine_bg.wasm`) - ); - await import_promises.default.copyFile(import_path5.default.join(runtimeDir, `query_engine_bg.${suffix}.js`), import_path5.default.join(outputDir, `query_engine_bg.js`)); - } - try { - const prismaCache = (0, import_env_paths.default)("prisma").cache; - const signalsPath = import_path5.default.join(prismaCache, "last-generate"); - await import_promises.default.mkdir(prismaCache, { recursive: true }); - await import_promises.default.writeFile(signalsPath, Date.now().toString()); - } catch { - } -} -function writeFileMap(outputDir, fileMap) { - return Promise.all( - Object.entries(fileMap).map(async ([fileName, content]) => { - const absolutePath = import_path5.default.join(outputDir, fileName); - await import_promises.default.rm(absolutePath, { recursive: true, force: true }); - if (typeof content === "string") { - await import_promises.default.writeFile(absolutePath, content); - } else { - await import_promises.default.mkdir(absolutePath); - await writeFileMap(absolutePath, content); - } - }) - ); -} -function isWasmEngineSupported(provider) { - return provider === "postgresql" || provider === "postgres" || provider === "mysql" || provider === "sqlite"; -} -function validateDmmfAgainstDenylists(prismaClientDmmf) { - const errorArray = []; - const denylists = { - // A copy of this list is also in prisma-engines. Any edit should be done in both places. - // https://github.com/prisma/prisma-engines/blob/main/psl/parser-database/src/names/reserved_model_names.rs - models: [ - // Reserved Prisma keywords - "PrismaClient", - "Prisma", - // JavaScript keywords - "break", - "case", - "catch", - "class", - "const", - "continue", - "debugger", - "default", - "delete", - "do", - "else", - "enum", - "export", - "extends", - "false", - "finally", - "for", - "function", - "if", - "implements", - "import", - "in", - "instanceof", - "interface", - "let", - "new", - "null", - "package", - "private", - "protected", - "public", - "return", - "super", - "switch", - "this", - "throw", - "true", - "try", - "typeof", - "var", - "void", - "while", - "with", - "yield" - ], - fields: ["AND", "OR", "NOT"], - dynamic: [] - }; - if (prismaClientDmmf.datamodel.enums) { - for (const it of prismaClientDmmf.datamodel.enums) { - if (denylists.models.includes(it.name) || denylists.fields.includes(it.name)) { - errorArray.push(Error(`"enum ${it.name}"`)); - } - } - } - if (prismaClientDmmf.datamodel.models) { - for (const it of prismaClientDmmf.datamodel.models) { - if (denylists.models.includes(it.name) || denylists.fields.includes(it.name)) { - errorArray.push(Error(`"model ${it.name}"`)); - } - } - } - return errorArray.length > 0 ? errorArray : null; -} -async function getGenerationDirs({ - runtimeBase, - generator, - outputDir, - datamodel, - schemaPath, - testMode -}) { - const isCustomOutput = generator.isCustomOutput === true; - let userRuntimeImport = isCustomOutput ? "./runtime" : "@prisma/client/runtime"; - let userOutputDir = isCustomOutput ? outputDir : await getDefaultOutdir(outputDir); - if (testMode && runtimeBase) { - userOutputDir = outputDir; - userRuntimeImport = pathToPosix(runtimeBase); - } - if (isCustomOutput) { - await verifyOutputDirectory(userOutputDir, datamodel, schemaPath); - } - const userPackageRoot = await (0, import_pkg_up.default)({ cwd: import_path5.default.dirname(userOutputDir) }); - const userProjectRoot = userPackageRoot ? import_path5.default.dirname(userPackageRoot) : process.cwd(); - return { - runtimeBase: userRuntimeImport, - outputDir: userOutputDir, - projectRoot: userProjectRoot - }; -} -async function verifyOutputDirectory(directory, datamodel, schemaPath) { - let content; - try { - content = await import_promises.default.readFile(import_path5.default.join(directory, "package.json"), "utf8"); - } catch (e) { - if (e.code === "ENOENT") { - return; - } - throw e; - } - const { name } = JSON.parse(content); - if (name === import_package.default.name) { - const message = [`Generating client into ${bold(directory)} is not allowed.`]; - message.push("This package is used by `prisma generate` and overwriting its content is dangerous."); - message.push(""); - message.push("Suggestion:"); - const outputDeclaration = findOutputPathDeclaration(datamodel); - if (outputDeclaration && outputDeclaration.content.includes(import_package.default.name)) { - const outputLine = outputDeclaration.content; - message.push(`In ${bold(schemaPath)} replace:`); - message.push(""); - message.push(`${dim(outputDeclaration.lineNumber)} ${replacePackageName(outputLine, red(import_package.default.name))}`); - message.push("with"); - message.push(`${dim(outputDeclaration.lineNumber)} ${replacePackageName(outputLine, green(".prisma/client"))}`); - } else { - message.push(`Generate client into ${bold(replacePackageName(directory, green(".prisma/client")))} instead`); - } - message.push(""); - message.push("You won't need to change your imports."); - message.push("Imports from `@prisma/client` will be automatically forwarded to `.prisma/client`"); - const error = new Error(message.join("\n")); - throw error; - } -} -function replacePackageName(directoryPath, replacement) { - return directoryPath.replace(import_package.default.name, replacement); -} -function findOutputPathDeclaration(datamodel) { - const lines = datamodel.split(/\r?\n/); - for (const [i, line] of lines.entries()) { - if (/output\s*=/.test(line)) { - return { lineNumber: i + 1, content: line.trim() }; - } - } - return null; -} -function getNodeRuntimeName(engineType) { - if (engineType === "binary" /* Binary */) { - return "binary"; - } - if (engineType === "library" /* Library */) { - return "library"; - } - assertNever(engineType, "Unknown engine type"); -} -async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) { - const files = [ - // library.d.ts is always included, as it contains the actual runtime type - // definitions. Rest of the `runtime.d.ts` files just re-export everything - // from `library.d.ts` - "library.d.ts", - "index-browser.js", - "index-browser.d.ts", - "edge.js", - "edge-esm.js", - "react-native.js", - "wasm.js" - ]; - files.push(`${runtimeName}.js`); - if (runtimeName !== "library") { - files.push(`${runtimeName}.d.ts`); - } - if (sourceMaps) { - files.push(...files.filter((file2) => file2.endsWith(".js")).map((file2) => `${file2}.map`)); - } - await Promise.all(files.map((file2) => import_promises.default.copyFile(import_path5.default.join(from, file2), import_path5.default.join(to, file2)))); -} -async function deleteOutputDir(outputDir) { - try { - debug2(`attempting to delete ${outputDir} recursively`); - if (require(`${outputDir}/package.json`).name?.startsWith(GENERATED_PACKAGE_NAME_PREFIX)) { - await import_promises.default.rmdir(outputDir, { recursive: true }).catch(() => { - debug2(`failed to delete ${outputDir} recursively`); - }); - } - } catch { - debug2(`failed to delete ${outputDir} recursively, not found`); - } -} -function getUniquePackageName(datamodel) { - const hash = (0, import_crypto2.createHash)("sha256"); - hash.write(datamodel); - return `${GENERATED_PACKAGE_NAME_PREFIX}${hash.digest().toString("hex")}`; -} -var GENERATED_PACKAGE_NAME_PREFIX = "prisma-client-"; - -// src/generation/utils/types/dmmfToTypes.ts -function dmmfToTypes(dmmf) { - return new TSClient({ - dmmf, - datasources: [], - clientVersion: "", - engineVersion: "", - runtimeBase: "@prisma/client", - runtimeNameJs: "library", - runtimeNameTs: "library", - schemaPath: "", - outputDir: "", - activeProvider: "", - binaryPaths: {}, - generator: { - binaryTargets: [], - config: {}, - name: "prisma-client-js", - output: null, - provider: { value: "prisma-client-js", fromEnvVar: null }, - previewFeatures: [], - isCustomOutput: false, - sourceFilePath: "schema.prisma" - }, - datamodel: "", - browser: false, - deno: false, - edge: false, - wasm: false, - envPaths: { - rootEnvPath: null, - schemaEnvPath: void 0 - } - }).toTS(); -} - -// src/generation/generator.ts -var debug3 = src_default("prisma:client:generator"); -var pkg = require_package2(); -var clientVersion = pkg.version; -if (process.argv[1] === __filename) { - generatorHandler({ - onManifest(config) { - const requiredEngine = getClientEngineType(config) === "library" /* Library */ ? "libqueryEngine" : "queryEngine"; - debug3(`requiredEngine: ${requiredEngine}`); - return { - defaultOutput: ".prisma/client", - // the value here doesn't matter, as it's resolved in https://github.com/prisma/prisma/blob/88fe98a09092d8e53e51f11b730c7672c19d1bd4/packages/sdk/src/get-generators/getGenerators.ts - prettyName: "Prisma Client", - requiresEngines: [requiredEngine], - version: clientVersion, - requiresEngineVersion: import_engines_version.enginesVersion - }; - }, - async onGenerate(options) { - const outputDir = parseEnvValue(options.generator.output); - return generateClient({ - datamodel: options.datamodel, - schemaPath: options.schemaPath, - binaryPaths: options.binaryPaths, - datasources: options.datasources, - envPaths: options.envPaths, - outputDir, - copyRuntime: Boolean(options.generator.config.copyRuntime), - // TODO: is this needed/valid? - copyRuntimeSourceMaps: Boolean(process.env.PRISMA_COPY_RUNTIME_SOURCEMAPS), - dmmf: options.dmmf, - generator: options.generator, - engineVersion: options.version, - clientVersion, - activeProvider: options.datasources[0]?.activeProvider, - postinstall: options.postinstall, - copyEngine: !options.noEngine, - typedSql: options.typedSql - }); - } - }); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - dmmfToTypes, - externalToInternalDmmf -}); diff --git a/node_modules/@prisma/client/index-browser.js b/node_modules/@prisma/client/index-browser.js deleted file mode 100644 index 3ea8d77..0000000 --- a/node_modules/@prisma/client/index-browser.js +++ /dev/null @@ -1,3 +0,0 @@ -const prisma = require('.prisma/client/index-browser') - -module.exports = prisma diff --git a/node_modules/@prisma/client/index.d.ts b/node_modules/@prisma/client/index.d.ts deleted file mode 100644 index bedfdce..0000000 --- a/node_modules/@prisma/client/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '.prisma/client/default' diff --git a/node_modules/@prisma/client/index.js b/node_modules/@prisma/client/index.js deleted file mode 100644 index 1be37eb..0000000 --- a/node_modules/@prisma/client/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - // https://github.com/prisma/prisma/pull/12907 - ...require('.prisma/client/default'), -} diff --git a/node_modules/@prisma/client/package.json b/node_modules/@prisma/client/package.json deleted file mode 100644 index 711e868..0000000 --- a/node_modules/@prisma/client/package.json +++ /dev/null @@ -1,280 +0,0 @@ -{ - "name": "@prisma/client", - "version": "5.21.1", - "description": "Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.", - "keywords": [ - "ORM", - "Prisma", - "prisma2", - "Prisma Client", - "client", - "query", - "query-builder", - "database", - "db", - "JavaScript", - "JS", - "TypeScript", - "TS", - "SQL", - "SQLite", - "pg", - "Postgres", - "PostgreSQL", - "CockroachDB", - "MySQL", - "MariaDB", - "MSSQL", - "SQL Server", - "SQLServer", - "MongoDB", - "react-native" - ], - "main": "default.js", - "types": "default.d.ts", - "browser": "index-browser.js", - "exports": { - "./package.json": "./package.json", - ".": { - "require": { - "types": "./default.d.ts", - "node": "./default.js", - "edge-light": "./default.js", - "workerd": "./default.js", - "worker": "./default.js", - "browser": "./index-browser.js" - }, - "import": { - "types": "./default.d.ts", - "node": "./default.js", - "edge-light": "./default.js", - "workerd": "./default.js", - "worker": "./default.js", - "browser": "./index-browser.js" - }, - "default": "./default.js" - }, - "./edge": { - "types": "./edge.d.ts", - "require": "./edge.js", - "import": "./edge.js", - "default": "./edge.js" - }, - "./react-native": { - "types": "./react-native.d.ts", - "require": "./react-native.js", - "import": "./react-native.js", - "default": "./react-native.js" - }, - "./extension": { - "types": "./extension.d.ts", - "require": "./extension.js", - "import": "./extension.js", - "default": "./extension.js" - }, - "./index-browser": { - "types": "./index.d.ts", - "require": "./index-browser.js", - "import": "./index-browser.js", - "default": "./index-browser.js" - }, - "./index": { - "types": "./index.d.ts", - "require": "./index.js", - "import": "./index.js", - "default": "./index.js" - }, - "./wasm": { - "types": "./wasm.d.ts", - "require": "./wasm.js", - "import": "./wasm.js", - "default": "./wasm.js" - }, - "./runtime/library": { - "types": "./runtime/library.d.ts", - "require": "./runtime/library.js", - "import": "./runtime/library.js", - "default": "./runtime/library.js" - }, - "./runtime/binary": { - "types": "./runtime/binary.d.ts", - "require": "./runtime/binary.js", - "import": "./runtime/binary.js", - "default": "./runtime/binary.js" - }, - "./generator-build": { - "require": "./generator-build/index.js", - "import": "./generator-build/index.js", - "default": "./generator-build/index.js" - }, - "./sql": { - "require": { - "types": "./sql.d.ts", - "node": "./sql.js", - "default": "./sql.js" - }, - "import": { - "types": "./sql.d.ts", - "node": "./sql.mjs", - "default": "./sql.mjs" - }, - "default": "./sql.js" - }, - "./*": "./*" - }, - "license": "Apache-2.0", - "engines": { - "node": ">=16.13" - }, - "homepage": "https://www.prisma.io", - "repository": { - "type": "git", - "url": "https://github.com/prisma/prisma.git", - "directory": "packages/client" - }, - "author": "Tim Suchanek ", - "bugs": "https://github.com/prisma/prisma/issues", - "files": [ - "README.md", - "runtime", - "!runtime/*.map", - "scripts", - "generator-build", - "edge.js", - "edge.d.ts", - "wasm.js", - "wasm.d.ts", - "index.js", - "index.d.ts", - "react-native.js", - "react-native.d.ts", - "default.js", - "default.d.ts", - "index-browser.js", - "extension.js", - "extension.d.ts", - "sql.d.ts", - "sql.js", - "sql.mjs" - ], - "devDependencies": { - "@cloudflare/workers-types": "4.20240614.0", - "@codspeed/benchmark.js-plugin": "3.1.1", - "@faker-js/faker": "8.4.1", - "@fast-check/jest": "1.8.2", - "@inquirer/prompts": "5.0.5", - "@jest/create-cache-key-function": "29.7.0", - "@jest/globals": "29.7.0", - "@jest/test-sequencer": "29.7.0", - "@libsql/client": "0.8.0", - "@neondatabase/serverless": "0.9.3", - "@opentelemetry/api": "1.9.0", - "@opentelemetry/context-async-hooks": "1.25.1", - "@opentelemetry/instrumentation": "0.52.1", - "@opentelemetry/resources": "1.25.1", - "@opentelemetry/sdk-trace-base": "1.25.1", - "@opentelemetry/semantic-conventions": "1.25.1", - "@planetscale/database": "1.18.0", - "@prisma/engines-version": "5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36", - "@prisma/mini-proxy": "0.9.5", - "@prisma/query-engine-wasm": "5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36", - "@snaplet/copycat": "0.17.3", - "@swc-node/register": "1.10.9", - "@swc/core": "1.6.13", - "@swc/jest": "0.2.36", - "@timsuchanek/copy": "1.4.5", - "@types/debug": "4.1.12", - "@types/fs-extra": "9.0.13", - "@types/jest": "29.5.12", - "@types/js-levenshtein": "1.1.3", - "@types/mssql": "9.1.5", - "@types/node": "18.19.31", - "@types/pg": "8.11.6", - "arg": "5.0.2", - "benchmark": "2.1.4", - "ci-info": "4.0.0", - "decimal.js": "10.4.3", - "detect-runtime": "1.0.4", - "env-paths": "2.2.1", - "esbuild": "0.23.0", - "execa": "5.1.1", - "expect-type": "0.19.0", - "flat-map-polyfill": "0.3.8", - "fs-extra": "11.1.1", - "get-stream": "6.0.1", - "globby": "11.1.0", - "indent-string": "4.0.0", - "jest": "29.7.0", - "jest-extended": "4.0.2", - "jest-junit": "16.0.0", - "jest-serializer-ansi-escapes": "3.0.0", - "jest-snapshot": "29.7.0", - "js-levenshtein": "1.1.6", - "kleur": "4.1.5", - "klona": "2.0.6", - "mariadb": "3.3.1", - "memfs": "4.9.3", - "mssql": "11.0.1", - "new-github-issue-url": "0.2.1", - "node-fetch": "3.3.2", - "p-retry": "4.6.2", - "pg": "8.11.5", - "pkg-up": "3.1.0", - "pluralize": "8.0.0", - "resolve": "1.22.8", - "rimraf": "3.0.2", - "simple-statistics": "7.8.5", - "sort-keys": "4.2.0", - "source-map-support": "0.5.21", - "sql-template-tag": "5.2.1", - "stacktrace-parser": "0.1.10", - "strip-ansi": "6.0.1", - "strip-indent": "3.0.0", - "ts-node": "10.9.2", - "ts-pattern": "5.2.0", - "tsd": "0.31.1", - "typescript": "5.4.5", - "undici": "5.28.4", - "wrangler": "3.62.0", - "zx": "7.2.3", - "@prisma/adapter-d1": "5.21.1", - "@prisma/adapter-libsql": "5.21.1", - "@prisma/adapter-pg": "5.21.1", - "@prisma/adapter-pg-worker": "5.21.1", - "@prisma/adapter-neon": "5.21.1", - "@prisma/adapter-planetscale": "5.21.1", - "@prisma/debug": "5.21.1", - "@prisma/driver-adapter-utils": "5.21.1", - "@prisma/engines": "5.21.1", - "@prisma/fetch-engine": "5.21.1", - "@prisma/generator-helper": "5.21.1", - "@prisma/get-platform": "5.21.1", - "@prisma/internals": "5.21.1", - "@prisma/instrumentation": "5.21.1", - "@prisma/migrate": "5.21.1", - "@prisma/pg-worker": "5.21.1" - }, - "peerDependencies": { - "prisma": "*" - }, - "peerDependenciesMeta": { - "prisma": { - "optional": true - } - }, - "sideEffects": false, - "scripts": { - "dev": "DEV=true tsx helpers/build.ts", - "build": "tsx helpers/build.ts", - "test": "dotenv -e ../../.db.env -- jest --silent", - "test:e2e": "dotenv -e ../../.db.env -- tsx tests/e2e/_utils/run.ts", - "test:functional": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts", - "test:memory": "dotenv -e ../../.db.env -- tsx helpers/memory-tests.ts", - "test:functional:code": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --no-types", - "test:functional:types": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --types-only", - "test-notypes": "dotenv -e ../../.db.env -- jest --testPathIgnorePatterns src/__tests__/types/types.test.ts", - "generate": "node scripts/postinstall.js", - "postinstall": "node scripts/postinstall.js", - "new-test": "tsx ./helpers/new-test/new-test.ts" - } -} \ No newline at end of file diff --git a/node_modules/@prisma/client/react-native.d.ts b/node_modules/@prisma/client/react-native.d.ts deleted file mode 100644 index bfcd706..0000000 --- a/node_modules/@prisma/client/react-native.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '.prisma/client/react-native' diff --git a/node_modules/@prisma/client/react-native.js b/node_modules/@prisma/client/react-native.js deleted file mode 100644 index 12b76d3..0000000 --- a/node_modules/@prisma/client/react-native.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ...require('.prisma/client/react-native'), -} diff --git a/node_modules/@prisma/client/runtime/binary.d.ts b/node_modules/@prisma/client/runtime/binary.d.ts deleted file mode 100644 index b935a73..0000000 --- a/node_modules/@prisma/client/runtime/binary.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./library" diff --git a/node_modules/@prisma/client/runtime/binary.js b/node_modules/@prisma/client/runtime/binary.js deleted file mode 100644 index 4768c1d..0000000 --- a/node_modules/@prisma/client/runtime/binary.js +++ /dev/null @@ -1,210 +0,0 @@ -"use strict";var DD=Object.create;var qi=Object.defineProperty;var bD=Object.getOwnPropertyDescriptor;var kD=Object.getOwnPropertyNames;var SD=Object.getPrototypeOf,FD=Object.prototype.hasOwnProperty;var pd=e=>{throw TypeError(e)};var ND=(e,A,t)=>A in e?qi(e,A,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[A]=t;var Q=(e,A)=>()=>(A||e((A={exports:{}}).exports,A),A.exports),Oi=(e,A)=>{for(var t in A)qi(e,t,{get:A[t],enumerable:!0})},md=(e,A,t,r)=>{if(A&&typeof A=="object"||typeof A=="function")for(let n of kD(A))!FD.call(e,n)&&n!==t&&qi(e,n,{get:()=>A[n],enumerable:!(r=bD(A,n))||r.enumerable});return e};var Z=(e,A,t)=>(t=e!=null?DD(SD(e)):{},md(A||!e||!e.__esModule?qi(t,"default",{value:e,enumerable:!0}):t,e)),xD=e=>md(qi({},"__esModule",{value:!0}),e);var yd=(e,A,t)=>ND(e,typeof A!="symbol"?A+"":A,t),Og=(e,A,t)=>A.has(e)||pd("Cannot "+t);var f=(e,A,t)=>(Og(e,A,"read from private field"),t?t.call(e):A.get(e)),Ne=(e,A,t)=>A.has(e)?pd("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(e):A.set(e,t),Ae=(e,A,t,r)=>(Og(e,A,"write to private field"),r?r.call(e,t):A.set(e,t),t),MA=(e,A,t)=>(Og(e,A,"access private method"),t);var jd=Q((SV,_d)=>{"use strict";_d.exports=Wd;Wd.sync=Ib;var Od=require("fs");function fb(e,A){var t=A.pathExt!==void 0?A.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var r=0;r{"use strict";zd.exports=Zd;Zd.sync=Bb;var Kd=require("fs");function Zd(e,A,t){Kd.stat(e,function(r,n){t(r,r?!1:Xd(n,A))})}function Bb(e,A){return Xd(Kd.statSync(e),A)}function Xd(e,A){return e.isFile()&&pb(e,A)}function pb(e,A){var t=e.mode,r=e.uid,n=e.gid,i=A.uid!==void 0?A.uid:process.getuid&&process.getuid(),s=A.gid!==void 0?A.gid:process.getgid&&process.getgid(),o=parseInt("100",8),a=parseInt("010",8),c=parseInt("001",8),g=o|a,l=t&c||t&a&&n===s||t&o&&r===i||t&g&&i===0;return l}});var AQ=Q((xV,eQ)=>{"use strict";var NV=require("fs"),Wo;process.platform==="win32"||global.TESTING_WINDOWS?Wo=jd():Wo=$d();eQ.exports=Al;Al.sync=mb;function Al(e,A,t){if(typeof A=="function"&&(t=A,A={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,n){Al(e,A||{},function(i,s){i?n(i):r(s)})})}Wo(e,A||{},function(r,n){r&&(r.code==="EACCES"||A&&A.ignoreErrors)&&(r=null,n=!1),t(r,n)})}function mb(e,A){try{return Wo.sync(e,A||{})}catch(t){if(A&&A.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var aQ=Q((LV,oQ)=>{"use strict";var Cn=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",tQ=require("path"),yb=Cn?";":":",rQ=AQ(),nQ=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),iQ=(e,A)=>{let t=A.colon||yb,r=e.match(/\//)||Cn&&e.match(/\\/)?[""]:[...Cn?[process.cwd()]:[],...(A.path||process.env.PATH||"").split(t)],n=Cn?A.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=Cn?n.split(t):[""];return Cn&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:n}},sQ=(e,A,t)=>{typeof A=="function"&&(t=A,A={}),A||(A={});let{pathEnv:r,pathExt:n,pathExtExe:i}=iQ(e,A),s=[],o=c=>new Promise((g,l)=>{if(c===r.length)return A.all&&s.length?g(s):l(nQ(e));let u=r[c],E=/^".*"$/.test(u)?u.slice(1,-1):u,h=tQ.join(E,e),d=!E&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;g(a(d,c,0))}),a=(c,g,l)=>new Promise((u,E)=>{if(l===n.length)return u(o(g+1));let h=n[l];rQ(c+h,{pathExt:i},(d,C)=>{if(!d&&C)if(A.all)s.push(c+h);else return u(c+h);return u(a(c,g,l+1))})});return t?o(0).then(c=>t(null,c),t):o(0)},wb=(e,A)=>{A=A||{};let{pathEnv:t,pathExt:r,pathExtExe:n}=iQ(e,A),i=[];for(let s=0;s{"use strict";var cQ=(e={})=>{let A=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(A).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};tl.exports=cQ;tl.exports.default=cQ});var EQ=Q((TV,uQ)=>{"use strict";var gQ=require("path"),Rb=aQ(),Db=rl();function lQ(e,A){let t=e.options.env||process.env,r=process.cwd(),n=e.options.cwd!=null,i=n&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=Rb.sync(e.command,{path:t[Db({env:t})],pathExt:A?gQ.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return s&&(s=gQ.resolve(n?e.options.cwd:"",s)),s}function bb(e){return lQ(e)||lQ(e,!0)}uQ.exports=bb});var hQ=Q((MV,il)=>{"use strict";var nl=/([()\][%!^"`<>&|;, *?])/g;function kb(e){return e=e.replace(nl,"^$1"),e}function Sb(e,A){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(nl,"^$1"),A&&(e=e.replace(nl,"^$1")),e}il.exports.command=kb;il.exports.argument=Sb});var QQ=Q((vV,dQ)=>{"use strict";dQ.exports=/^#!(.*)/});var fQ=Q((PV,CQ)=>{"use strict";var Fb=QQ();CQ.exports=(e="")=>{let A=e.match(Fb);if(!A)return null;let[t,r]=A[0].replace(/#! ?/,"").split(" "),n=t.split("/").pop();return n==="env"?r:r?`${n} ${r}`:n}});var BQ=Q((GV,IQ)=>{"use strict";var sl=require("fs"),Nb=fQ();function xb(e){let t=Buffer.alloc(150),r;try{r=sl.openSync(e,"r"),sl.readSync(r,t,0,150,0),sl.closeSync(r)}catch{}return Nb(t.toString())}IQ.exports=xb});var wQ=Q((JV,yQ)=>{"use strict";var Lb=require("path"),pQ=EQ(),mQ=hQ(),Ub=BQ(),Tb=process.platform==="win32",Mb=/\.(?:com|exe)$/i,vb=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Pb(e){e.file=pQ(e);let A=e.file&&Ub(e.file);return A?(e.args.unshift(e.file),e.command=A,pQ(e)):e.file}function Gb(e){if(!Tb)return e;let A=Pb(e),t=!Mb.test(A);if(e.options.forceShell||t){let r=vb.test(A);e.command=Lb.normalize(e.command),e.command=mQ.command(e.command),e.args=e.args.map(i=>mQ.argument(i,r));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Jb(e,A,t){A&&!Array.isArray(A)&&(t=A,A=null),A=A?A.slice(0):[],t=Object.assign({},t);let r={command:e,args:A,options:t,file:void 0,original:{command:e,args:A}};return t.shell?r:Gb(r)}yQ.exports=Jb});var bQ=Q((YV,DQ)=>{"use strict";var ol=process.platform==="win32";function al(e,A){return Object.assign(new Error(`${A} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${A} ${e.command}`,path:e.command,spawnargs:e.args})}function Yb(e,A){if(!ol)return;let t=e.emit;e.emit=function(r,n){if(r==="exit"){let i=RQ(n,A,"spawn");if(i)return t.call(e,"error",i)}return t.apply(e,arguments)}}function RQ(e,A){return ol&&e===1&&!A.file?al(A.original,"spawn"):null}function Vb(e,A){return ol&&e===1&&!A.file?al(A.original,"spawnSync"):null}DQ.exports={hookChildProcess:Yb,verifyENOENT:RQ,verifyENOENTSync:Vb,notFoundError:al}});var FQ=Q((VV,fn)=>{"use strict";var kQ=require("child_process"),cl=wQ(),gl=bQ();function SQ(e,A,t){let r=cl(e,A,t),n=kQ.spawn(r.command,r.args,r.options);return gl.hookChildProcess(n,r),n}function qb(e,A,t){let r=cl(e,A,t),n=kQ.spawnSync(r.command,r.args,r.options);return n.error=n.error||gl.verifyENOENTSync(n.status,r),n}fn.exports=SQ;fn.exports.spawn=SQ;fn.exports.sync=qb;fn.exports._parse=cl;fn.exports._enoent=gl});var xQ=Q((qV,NQ)=>{"use strict";NQ.exports=e=>{let A=typeof e=="string"?` -`:10,t=typeof e=="string"?"\r":13;return e[e.length-1]===A&&(e=e.slice(0,e.length-1)),e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e}});var TQ=Q((OV,Zi)=>{"use strict";var Ki=require("path"),LQ=rl(),UQ=e=>{e={cwd:process.cwd(),path:process.env[LQ()],execPath:process.execPath,...e};let A,t=Ki.resolve(e.cwd),r=[];for(;A!==t;)r.push(Ki.join(t,"node_modules/.bin")),A=t,t=Ki.resolve(t,"..");let n=Ki.resolve(e.cwd,e.execPath,"..");return r.push(n),r.concat(e.path).join(Ki.delimiter)};Zi.exports=UQ;Zi.exports.default=UQ;Zi.exports.env=e=>{e={env:process.env,...e};let A={...e.env},t=LQ({env:A});return e.path=A[t],A[t]=Zi.exports(e),A}});var vQ=Q((HV,ll)=>{"use strict";var MQ=(e,A)=>{for(let t of Reflect.ownKeys(A))Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t));return e};ll.exports=MQ;ll.exports.default=MQ});var GQ=Q((WV,jo)=>{"use strict";var Ob=vQ(),_o=new WeakMap,PQ=(e,A={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let t,r=0,n=e.displayName||e.name||"",i=function(...s){if(_o.set(i,++r),r===1)t=e.apply(this,s),e=null;else if(A.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return t};return Ob(i,e),_o.set(i,r),i};jo.exports=PQ;jo.exports.default=PQ;jo.exports.callCount=e=>{if(!_o.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return _o.get(e)}});var JQ=Q(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.SIGNALS=void 0;var Hb=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];Ko.SIGNALS=Hb});var ul=Q(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.SIGRTMAX=In.getRealtimeSignals=void 0;var Wb=function(){let e=VQ-YQ+1;return Array.from({length:e},_b)};In.getRealtimeSignals=Wb;var _b=function(e,A){return{name:`SIGRT${A+1}`,number:YQ+A,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},YQ=34,VQ=64;In.SIGRTMAX=VQ});var qQ=Q(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.getSignals=void 0;var jb=require("os"),Kb=JQ(),Zb=ul(),Xb=function(){let e=(0,Zb.getRealtimeSignals)();return[...Kb.SIGNALS,...e].map(zb)};Zo.getSignals=Xb;var zb=function({name:e,number:A,description:t,action:r,forced:n=!1,standard:i}){let{signals:{[e]:s}}=jb.constants,o=s!==void 0;return{name:e,number:o?s:A,description:t,supported:o,action:r,forced:n,standard:i}}});var HQ=Q(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.signalsByNumber=Bn.signalsByName=void 0;var $b=require("os"),OQ=qQ(),ek=ul(),Ak=function(){return(0,OQ.getSignals)().reduce(tk,{})},tk=function(e,{name:A,number:t,description:r,supported:n,action:i,forced:s,standard:o}){return{...e,[A]:{name:A,number:t,description:r,supported:n,action:i,forced:s,standard:o}}},rk=Ak();Bn.signalsByName=rk;var nk=function(){let e=(0,OQ.getSignals)(),A=ek.SIGRTMAX+1,t=Array.from({length:A},(r,n)=>ik(n,e));return Object.assign({},...t)},ik=function(e,A){let t=sk(e,A);if(t===void 0)return{};let{name:r,description:n,supported:i,action:s,forced:o,standard:a}=t;return{[e]:{name:r,number:e,description:n,supported:i,action:s,forced:o,standard:a}}},sk=function(e,A){let t=A.find(({name:r})=>$b.constants.signals[r]===e);return t!==void 0?t:A.find(r=>r.number===e)},ok=nk();Bn.signalsByNumber=ok});var _Q=Q((XV,WQ)=>{"use strict";var{signalsByName:ak}=HQ(),ck=({timedOut:e,timeout:A,errorCode:t,signal:r,signalDescription:n,exitCode:i,isCanceled:s})=>e?`timed out after ${A} milliseconds`:s?"was canceled":t!==void 0?`failed with ${t}`:r!==void 0?`was killed with ${r} (${n})`:i!==void 0?`failed with exit code ${i}`:"failed",gk=({stdout:e,stderr:A,all:t,error:r,signal:n,exitCode:i,command:s,escapedCommand:o,timedOut:a,isCanceled:c,killed:g,parsed:{options:{timeout:l}}})=>{i=i===null?void 0:i,n=n===null?void 0:n;let u=n===void 0?void 0:ak[n].description,E=r&&r.code,d=`Command ${ck({timedOut:a,timeout:l,errorCode:E,signal:n,signalDescription:u,exitCode:i,isCanceled:c})}: ${s}`,C=Object.prototype.toString.call(r)==="[object Error]",I=C?`${d} -${r.message}`:d,p=[I,A,e].filter(Boolean).join(` -`);return C?(r.originalMessage=r.message,r.message=p):r=new Error(p),r.shortMessage=I,r.command=s,r.escapedCommand=o,r.exitCode=i,r.signal=n,r.signalDescription=u,r.stdout=e,r.stderr=A,t!==void 0&&(r.all=t),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!a,r.isCanceled=c,r.killed=g&&!a,r};WQ.exports=gk});var KQ=Q((zV,El)=>{"use strict";var Xo=["stdin","stdout","stderr"],lk=e=>Xo.some(A=>e[A]!==void 0),jQ=e=>{if(!e)return;let{stdio:A}=e;if(A===void 0)return Xo.map(r=>e[r]);if(lk(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Xo.map(r=>`\`${r}\``).join(", ")}`);if(typeof A=="string")return A;if(!Array.isArray(A))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof A}\``);let t=Math.max(A.length,Xo.length);return Array.from({length:t},(r,n)=>A[n])};El.exports=jQ;El.exports.node=e=>{let A=jQ(e);return A==="ipc"?"ipc":A===void 0||typeof A=="string"?[A,A,A,"ipc"]:A.includes("ipc")?A:[...A,"ipc"]}});var ZQ=Q(($V,zo)=>{"use strict";zo.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&zo.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&zo.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var AC=Q((eq,yn)=>{"use strict";var we=global.process,Mr=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};Mr(we)?(XQ=require("assert"),pn=ZQ(),zQ=/^win/i.test(we.platform),Xi=require("events"),typeof Xi!="function"&&(Xi=Xi.EventEmitter),we.__signal_exit_emitter__?qe=we.__signal_exit_emitter__:(qe=we.__signal_exit_emitter__=new Xi,qe.count=0,qe.emitted={}),qe.infinite||(qe.setMaxListeners(1/0),qe.infinite=!0),yn.exports=function(e,A){if(!Mr(global.process))return function(){};XQ.equal(typeof e,"function","a callback must be provided for exit handler"),mn===!1&&hl();var t="exit";A&&A.alwaysLast&&(t="afterexit");var r=function(){qe.removeListener(t,e),qe.listeners("exit").length===0&&qe.listeners("afterexit").length===0&&$o()};return qe.on(t,e),r},$o=function(){!mn||!Mr(global.process)||(mn=!1,pn.forEach(function(A){try{we.removeListener(A,ea[A])}catch{}}),we.emit=Aa,we.reallyExit=dl,qe.count-=1)},yn.exports.unload=$o,vr=function(A,t,r){qe.emitted[A]||(qe.emitted[A]=!0,qe.emit(A,t,r))},ea={},pn.forEach(function(e){ea[e]=function(){if(Mr(global.process)){var t=we.listeners(e);t.length===qe.count&&($o(),vr("exit",null,e),vr("afterexit",null,e),zQ&&e==="SIGHUP"&&(e="SIGINT"),we.kill(we.pid,e))}}}),yn.exports.signals=function(){return pn},mn=!1,hl=function(){mn||!Mr(global.process)||(mn=!0,qe.count+=1,pn=pn.filter(function(A){try{return we.on(A,ea[A]),!0}catch{return!1}}),we.emit=eC,we.reallyExit=$Q)},yn.exports.load=hl,dl=we.reallyExit,$Q=function(A){Mr(global.process)&&(we.exitCode=A||0,vr("exit",we.exitCode,null),vr("afterexit",we.exitCode,null),dl.call(we,we.exitCode))},Aa=we.emit,eC=function(A,t){if(A==="exit"&&Mr(global.process)){t!==void 0&&(we.exitCode=t);var r=Aa.apply(this,arguments);return vr("exit",we.exitCode,null),vr("afterexit",we.exitCode,null),r}else return Aa.apply(this,arguments)}):yn.exports=function(){return function(){}};var XQ,pn,zQ,Xi,qe,$o,vr,ea,mn,hl,dl,$Q,Aa,eC});var rC=Q((Aq,tC)=>{"use strict";var uk=require("os"),Ek=AC(),hk=1e3*5,dk=(e,A="SIGTERM",t={})=>{let r=e(A);return Qk(e,A,t,r),r},Qk=(e,A,t,r)=>{if(!Ck(A,t,r))return;let n=Ik(t),i=setTimeout(()=>{e("SIGKILL")},n);i.unref&&i.unref()},Ck=(e,{forceKillAfterTimeout:A},t)=>fk(e)&&A!==!1&&t,fk=e=>e===uk.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Ik=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return hk;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Bk=(e,A)=>{e.kill()&&(A.isCanceled=!0)},pk=(e,A,t)=>{e.kill(A),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:A}))},mk=(e,{timeout:A,killSignal:t="SIGTERM"},r)=>{if(A===0||A===void 0)return r;let n,i=new Promise((o,a)=>{n=setTimeout(()=>{pk(e,t,a)},A)}),s=r.finally(()=>{clearTimeout(n)});return Promise.race([i,s])},yk=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},wk=async(e,{cleanup:A,detached:t},r)=>{if(!A||t)return r;let n=Ek(()=>{e.kill()});return r.finally(()=>{n()})};tC.exports={spawnedKill:dk,spawnedCancel:Bk,setupTimeout:mk,validateTimeout:yk,setExitHandler:wk}});var iC=Q((tq,nC)=>{"use strict";var gt=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";gt.writable=e=>gt(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";gt.readable=e=>gt(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";gt.duplex=e=>gt.writable(e)&>.readable(e);gt.transform=e=>gt.duplex(e)&&typeof e._transform=="function";nC.exports=gt});var oC=Q((rq,sC)=>{"use strict";var{PassThrough:Rk}=require("stream");sC.exports=e=>{e={...e};let{array:A}=e,{encoding:t}=e,r=t==="buffer",n=!1;A?n=!(t||r):t=t||"utf8",r&&(t=null);let i=new Rk({objectMode:n});t&&i.setEncoding(t);let s=0,o=[];return i.on("data",a=>{o.push(a),n?s=o.length:s+=a.length}),i.getBufferedValue=()=>A?o:r?Buffer.concat(o,s):o.join(""),i.getBufferedLength=()=>s,i}});var Cl=Q((nq,zi)=>{"use strict";var{constants:Dk}=require("buffer"),bk=require("stream"),{promisify:kk}=require("util"),Sk=oC(),Fk=kk(bk.pipeline),ta=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Ql(e,A){if(!e)throw new Error("Expected a stream");A={maxBuffer:1/0,...A};let{maxBuffer:t}=A,r=Sk(A);return await new Promise((n,i)=>{let s=o=>{o&&r.getBufferedLength()<=Dk.MAX_LENGTH&&(o.bufferedData=r.getBufferedValue()),i(o)};(async()=>{try{await Fk(e,r),n()}catch(o){s(o)}})(),r.on("data",()=>{r.getBufferedLength()>t&&s(new ta)})}),r.getBufferedValue()}zi.exports=Ql;zi.exports.buffer=(e,A)=>Ql(e,{...A,encoding:"buffer"});zi.exports.array=(e,A)=>Ql(e,{...A,array:!0});zi.exports.MaxBufferError=ta});var cC=Q((iq,aC)=>{"use strict";var{PassThrough:Nk}=require("stream");aC.exports=function(){var e=[],A=new Nk({objectMode:!0});return A.setMaxListeners(0),A.add=t,A.isEmpty=r,A.on("unpipe",n),Array.prototype.slice.call(arguments).forEach(t),A;function t(i){return Array.isArray(i)?(i.forEach(t),this):(e.push(i),i.once("end",n.bind(null,i)),i.once("error",A.emit.bind(A,"error")),i.pipe(A,{end:!1}),this)}function r(){return e.length==0}function n(i){e=e.filter(function(s){return s!==i}),!e.length&&A.readable&&A.end()}}});var EC=Q((sq,uC)=>{"use strict";var lC=iC(),gC=Cl(),xk=cC(),Lk=(e,A)=>{A===void 0||e.stdin===void 0||(lC(A)?A.pipe(e.stdin):e.stdin.end(A))},Uk=(e,{all:A})=>{if(!A||!e.stdout&&!e.stderr)return;let t=xk();return e.stdout&&t.add(e.stdout),e.stderr&&t.add(e.stderr),t},fl=async(e,A)=>{if(e){e.destroy();try{return await A}catch(t){return t.bufferedData}}},Il=(e,{encoding:A,buffer:t,maxBuffer:r})=>{if(!(!e||!t))return A?gC(e,{encoding:A,maxBuffer:r}):gC.buffer(e,{maxBuffer:r})},Tk=async({stdout:e,stderr:A,all:t},{encoding:r,buffer:n,maxBuffer:i},s)=>{let o=Il(e,{encoding:r,buffer:n,maxBuffer:i}),a=Il(A,{encoding:r,buffer:n,maxBuffer:i}),c=Il(t,{encoding:r,buffer:n,maxBuffer:i*2});try{return await Promise.all([s,o,a,c])}catch(g){return Promise.all([{error:g,signal:g.signal,timedOut:g.timedOut},fl(e,o),fl(A,a),fl(t,c)])}},Mk=({input:e})=>{if(lC(e))throw new TypeError("The `input` option cannot be a stream in sync mode")};uC.exports={handleInput:Lk,makeAllStream:Uk,getSpawnedResult:Tk,validateInputSync:Mk}});var dC=Q((oq,hC)=>{"use strict";var vk=(async()=>{})().constructor.prototype,Pk=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(vk,e)]),Gk=(e,A)=>{for(let[t,r]of Pk){let n=typeof A=="function"?(...i)=>Reflect.apply(r.value,A(),i):r.value.bind(A);Reflect.defineProperty(e,t,{...r,value:n})}return e},Jk=e=>new Promise((A,t)=>{e.on("exit",(r,n)=>{A({exitCode:r,signal:n})}),e.on("error",r=>{t(r)}),e.stdin&&e.stdin.on("error",r=>{t(r)})});hC.exports={mergePromise:Gk,getSpawnedPromise:Jk}});var fC=Q((aq,CC)=>{"use strict";var QC=(e,A=[])=>Array.isArray(A)?[e,...A]:[e],Yk=/^[\w.-]+$/,Vk=/"/g,qk=e=>typeof e!="string"||Yk.test(e)?e:`"${e.replace(Vk,'\\"')}"`,Ok=(e,A)=>QC(e,A).join(" "),Hk=(e,A)=>QC(e,A).map(t=>qk(t)).join(" "),Wk=/ +/g,_k=e=>{let A=[];for(let t of e.trim().split(Wk)){let r=A[A.length-1];r&&r.endsWith("\\")?A[A.length-1]=`${r.slice(0,-1)} ${t}`:A.push(t)}return A};CC.exports={joinCommand:Ok,getEscapedCommand:Hk,parseCommand:_k}});var RC=Q((cq,wn)=>{"use strict";var jk=require("path"),Bl=require("child_process"),Kk=FQ(),Zk=xQ(),Xk=TQ(),zk=GQ(),ra=_Q(),BC=KQ(),{spawnedKill:$k,spawnedCancel:eS,setupTimeout:AS,validateTimeout:tS,setExitHandler:rS}=rC(),{handleInput:nS,getSpawnedResult:iS,makeAllStream:sS,validateInputSync:oS}=EC(),{mergePromise:IC,getSpawnedPromise:aS}=dC(),{joinCommand:pC,parseCommand:mC,getEscapedCommand:yC}=fC(),cS=1e3*1e3*100,gS=({env:e,extendEnv:A,preferLocal:t,localDir:r,execPath:n})=>{let i=A?{...process.env,...e}:e;return t?Xk.env({env:i,cwd:r,execPath:n}):i},wC=(e,A,t={})=>{let r=Kk._parse(e,A,t);return e=r.command,A=r.args,t=r.options,t={maxBuffer:cS,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...t},t.env=gS(t),t.stdio=BC(t),process.platform==="win32"&&jk.basename(e,".exe")==="cmd"&&A.unshift("/q"),{file:e,args:A,options:t,parsed:r}},$i=(e,A,t)=>typeof A!="string"&&!Buffer.isBuffer(A)?t===void 0?void 0:"":e.stripFinalNewline?Zk(A):A,na=(e,A,t)=>{let r=wC(e,A,t),n=pC(e,A),i=yC(e,A);tS(r.options);let s;try{s=Bl.spawn(r.file,r.args,r.options)}catch(E){let h=new Bl.ChildProcess,d=Promise.reject(ra({error:E,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return IC(h,d)}let o=aS(s),a=AS(s,r.options,o),c=rS(s,r.options,a),g={isCanceled:!1};s.kill=$k.bind(null,s.kill.bind(s)),s.cancel=eS.bind(null,s,g);let u=zk(async()=>{let[{error:E,exitCode:h,signal:d,timedOut:C},I,p,w]=await iS(s,r.options,c),m=$i(r.options,I),K=$i(r.options,p),H=$i(r.options,w);if(E||h!==0||d!==null){let ne=ra({error:E,exitCode:h,signal:d,stdout:m,stderr:K,all:H,command:n,escapedCommand:i,parsed:r,timedOut:C,isCanceled:g.isCanceled,killed:s.killed});if(!r.options.reject)return ne;throw ne}return{command:n,escapedCommand:i,exitCode:0,stdout:m,stderr:K,all:H,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return nS(s,r.options.input),s.all=sS(s,r.options),IC(s,u)};wn.exports=na;wn.exports.sync=(e,A,t)=>{let r=wC(e,A,t),n=pC(e,A),i=yC(e,A);oS(r.options);let s;try{s=Bl.spawnSync(r.file,r.args,r.options)}catch(c){throw ra({error:c,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let o=$i(r.options,s.stdout,s.error),a=$i(r.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){let c=ra({stdout:o,stderr:a,error:s.error,signal:s.signal,exitCode:s.status,command:n,escapedCommand:i,parsed:r,timedOut:s.error&&s.error.code==="ETIMEDOUT",isCanceled:!1,killed:s.signal!==null});if(!r.options.reject)return c;throw c}return{command:n,escapedCommand:i,exitCode:0,stdout:o,stderr:a,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};wn.exports.command=(e,A)=>{let[t,...r]=mC(e);return na(t,r,A)};wn.exports.commandSync=(e,A)=>{let[t,...r]=mC(e);return na.sync(t,r,A)};wn.exports.node=(e,A,t={})=>{A&&!Array.isArray(A)&&typeof A=="object"&&(t=A,A=[]);let r=BC.node(t),n=process.execArgv.filter(o=>!o.startsWith("--inspect")),{nodePath:i=process.execPath,nodeOptions:s=n}=t;return na(i,[...s,e,...Array.isArray(A)?A:[]],{...t,stdin:void 0,stdout:void 0,stderr:void 0,stdio:r,shell:!1})}});var pl=Q((Qq,lS)=>{lS.exports={name:"@prisma/engines-version",version:"5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"bf0e5e8a04cada8225617067eaa03d041e2bba36"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.34",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var ml=Q(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.enginesVersion=void 0;ia.enginesVersion=pl().prisma.enginesVersion});var bC=Q((fq,DC)=>{"use strict";function GA(e,A){typeof A=="boolean"&&(A={forever:A}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=A||{},this._maxRetryTime=A&&A.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}DC.exports=GA;GA.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};GA.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};GA.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var A=new Date().getTime();if(e&&A-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};GA.prototype.attempt=function(e,A){this._fn=e,A&&(A.timeout&&(this._operationTimeout=A.timeout),A.cb&&(this._operationTimeoutCb=A.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};GA.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};GA.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};GA.prototype.start=GA.prototype.try;GA.prototype.errors=function(){return this._errors};GA.prototype.attempts=function(){return this._attempts};GA.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},A=null,t=0,r=0;r=t&&(A=n,t=s)}return A}});var kC=Q(Pr=>{"use strict";var uS=bC();Pr.operation=function(e){var A=Pr.timeouts(e);return new uS(A,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};Pr.timeouts=function(e){if(e instanceof Array)return[].concat(e);var A={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in e)A[t]=e[t];if(A.minTimeout>A.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],n=0;n{"use strict";SC.exports=kC()});var xC=Q((pq,oa)=>{"use strict";var ES=FC(),hS=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],sa=class extends Error{constructor(A){super(),A instanceof Error?(this.originalError=A,{message:A}=A):(this.originalError=new Error(A),this.originalError.stack=this.stack),this.name="AbortError",this.message=A}},dS=(e,A,t)=>{let r=t.retries-(A-1);return e.attemptNumber=A,e.retriesLeft=r,e},QS=e=>hS.includes(e),NC=(e,A)=>new Promise((t,r)=>{A={onFailedAttempt:()=>{},retries:10,...A};let n=ES.operation(A);n.attempt(async i=>{try{t(await e(i))}catch(s){if(!(s instanceof Error)){r(new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`));return}if(s instanceof sa)n.stop(),r(s.originalError);else if(s instanceof TypeError&&!QS(s.message))n.stop(),r(s);else{dS(s,i,A);try{await A.onFailedAttempt(s)}catch(o){r(o);return}n.retry(s)||r(n.mainError())}}})});oa.exports=NC;oa.exports.default=NC;oa.exports.AbortError=sa});var TC=Q((Tq,IS)=>{IS.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var vC=Q((Mq,ca)=>{"use strict";var BS=require("fs"),MC=require("path"),pS=require("os"),mS=TC(),yS=mS.version,wS=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function RS(e){let A={},t=e.toString();t=t.replace(/\r\n?/mg,` -`);let r;for(;(r=wS.exec(t))!=null;){let n=r[1],i=r[2]||"";i=i.trim();let s=i[0];i=i.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(i=i.replace(/\\n/g,` -`),i=i.replace(/\\r/g,"\r")),A[n]=i}return A}function Rl(e){console.log(`[dotenv@${yS}][DEBUG] ${e}`)}function DS(e){return e[0]==="~"?MC.join(pS.homedir(),e.slice(1)):e}function bS(e){let A=MC.resolve(process.cwd(),".env"),t="utf8",r=!!(e&&e.debug),n=!!(e&&e.override);e&&(e.path!=null&&(A=DS(e.path)),e.encoding!=null&&(t=e.encoding));try{let i=aa.parse(BS.readFileSync(A,{encoding:t}));return Object.keys(i).forEach(function(s){Object.prototype.hasOwnProperty.call(process.env,s)?(n===!0&&(process.env[s]=i[s]),r&&Rl(n===!0?`"${s}" is already defined in \`process.env\` and WAS overwritten`:`"${s}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[s]=i[s]}),{parsed:i}}catch(i){return r&&Rl(`Failed to load ${A} ${i.message}`),{error:i}}}var aa={config:bS,parse:RS};ca.exports.config=aa.config;ca.exports.parse=aa.parse;ca.exports=aa});var qC=Q((qq,VC)=>{"use strict";VC.exports=e=>{let A=e.match(/^[ \t]*(?=\S)/gm);return A?A.reduce((t,r)=>Math.min(t,r.length),1/0):0}});var HC=Q((Oq,OC)=>{"use strict";var NS=qC();OC.exports=e=>{let A=NS(e);if(A===0)return e;let t=new RegExp(`^[ \\t]{${A}}`,"gm");return e.replace(t,"")}});var Sl=Q((Zq,WC)=>{"use strict";WC.exports=(e,A=1,t)=>{if(t={indent:" ",includeEmptyLines:!1,...t},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof A!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof A}\``);if(typeof t.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``);if(A===0)return e;let r=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(r,t.indent.repeat(A))}});var ZC=Q(($q,KC)=>{"use strict";KC.exports=({onlyFirst:e=!1}={})=>{let A=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(A,e?void 0:"g")}});var Ll=Q((eO,XC)=>{"use strict";var GS=ZC();XC.exports=e=>typeof e=="string"?e.replace(GS(),""):e});var $C=Q((rO,ua)=>{"use strict";ua.exports=(e={})=>{let A;if(e.repoUrl)A=e.repoUrl;else if(e.user&&e.repo)A=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let t=new URL(`${A}/issues/new`),r=["body","title","labels","template","milestone","assignee","projects"];for(let n of r){let i=e[n];if(i!==void 0){if(n==="labels"||n==="projects"){if(!Array.isArray(i))throw new TypeError(`The \`${n}\` option should be an array`);i=i.join(",")}t.searchParams.set(n,i)}}return t.toString()};ua.exports.default=ua.exports});var de=Q((o4,kI)=>{"use strict";kI.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kHeadersList:Symbol("headers list"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kHTTP2BuildRequest:Symbol("http2 build request"),kHTTP1BuildRequest:Symbol("http1 build request"),kHTTP2CopyHeaders:Symbol("http2 copy headers"),kHTTPConnVersion:Symbol("http connection version"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable")}});var le=Q((a4,SI)=>{"use strict";var Le=class extends Error{constructor(A){super(A),this.name="UndiciError",this.code="UND_ERR"}},ou=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="ConnectTimeoutError",this.message=A||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}},au=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="HeadersTimeoutError",this.message=A||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}},cu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="HeadersOverflowError",this.message=A||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}},gu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="BodyTimeoutError",this.message=A||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}},lu=class e extends Le{constructor(A,t,r,n){super(A),Error.captureStackTrace(this,e),this.name="ResponseStatusCodeError",this.message=A||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=n,this.status=t,this.statusCode=t,this.headers=r}},uu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="InvalidArgumentError",this.message=A||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}},Eu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="InvalidReturnValueError",this.message=A||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}},hu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="AbortError",this.message=A||"Request aborted",this.code="UND_ERR_ABORTED"}},du=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="InformationalError",this.message=A||"Request information",this.code="UND_ERR_INFO"}},Qu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="RequestContentLengthMismatchError",this.message=A||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}},Cu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="ResponseContentLengthMismatchError",this.message=A||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}},fu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="ClientDestroyedError",this.message=A||"The client is destroyed",this.code="UND_ERR_DESTROYED"}},Iu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="ClientClosedError",this.message=A||"The client is closed",this.code="UND_ERR_CLOSED"}},Bu=class e extends Le{constructor(A,t){super(A),Error.captureStackTrace(this,e),this.name="SocketError",this.message=A||"Socket error",this.code="UND_ERR_SOCKET",this.socket=t}},Ya=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="NotSupportedError",this.message=A||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}},pu=class extends Le{constructor(A){super(A),Error.captureStackTrace(this,Ya),this.name="MissingUpstreamError",this.message=A||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}},mu=class e extends Error{constructor(A,t,r){super(A),Error.captureStackTrace(this,e),this.name="HTTPParserError",this.code=t?`HPE_${t}`:void 0,this.data=r?r.toString():void 0}},yu=class e extends Le{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="ResponseExceededMaxSizeError",this.message=A||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}},wu=class e extends Le{constructor(A,t,{headers:r,data:n}){super(A),Error.captureStackTrace(this,e),this.name="RequestRetryError",this.message=A||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=t,this.data=n,this.headers=r}};SI.exports={HTTPParserError:mu,UndiciError:Le,HeadersTimeoutError:au,HeadersOverflowError:cu,BodyTimeoutError:gu,RequestContentLengthMismatchError:Qu,ConnectTimeoutError:ou,ResponseStatusCodeError:lu,InvalidArgumentError:uu,InvalidReturnValueError:Eu,RequestAbortedError:hu,ClientDestroyedError:fu,ClientClosedError:Iu,InformationalError:du,SocketError:Bu,NotSupportedError:Ya,ResponseContentLengthMismatchError:Cu,BalancedPoolMissingUpstreamError:pu,ResponseExceededMaxSizeError:yu,RequestRetryError:wu}});var NI=Q((c4,FI)=>{"use strict";var Va={},Ru=["Accept","Accept-Encoding","Accept-Language","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","Downlink","ECT","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","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"];for(let e=0;e{"use strict";var TI=require("assert"),{kDestroyed:MI,kBodyUsed:xI}=de(),{IncomingMessage:ON}=require("http"),qn=require("stream"),HN=require("net"),{InvalidArgumentError:je}=le(),{Blob:LI}=require("buffer"),qa=require("util"),{stringify:WN}=require("querystring"),{headerNameLowerCasedRecord:_N}=NI(),[Du,UI]=process.versions.node.split(".").map(e=>Number(e));function jN(){}function bu(e){return e&&typeof e=="object"&&typeof e.pipe=="function"&&typeof e.on=="function"}function vI(e){return LI&&e instanceof LI||e&&typeof e=="object"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function KN(e,A){if(e.includes("?")||e.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let t=WN(A);return t&&(e+="?"+t),e}function PI(e){if(typeof e=="string"){if(e=new URL(e),!/^https?:/.test(e.origin||e.protocol))throw new je("Invalid URL protocol: the URL must start with `http:` or `https:`.");return e}if(!e||typeof e!="object")throw new je("Invalid URL: The URL argument must be a non-null object.");if(!/^https?:/.test(e.origin||e.protocol))throw new je("Invalid URL protocol: the URL must start with `http:` or `https:`.");if(!(e instanceof URL)){if(e.port!=null&&e.port!==""&&!Number.isFinite(parseInt(e.port)))throw new je("Invalid URL: port must be a valid integer or a string representation of an integer.");if(e.path!=null&&typeof e.path!="string")throw new je("Invalid URL path: the path must be a string or null/undefined.");if(e.pathname!=null&&typeof e.pathname!="string")throw new je("Invalid URL pathname: the pathname must be a string or null/undefined.");if(e.hostname!=null&&typeof e.hostname!="string")throw new je("Invalid URL hostname: the hostname must be a string or null/undefined.");if(e.origin!=null&&typeof e.origin!="string")throw new je("Invalid URL origin: the origin must be a string or null/undefined.");let A=e.port!=null?e.port:e.protocol==="https:"?443:80,t=e.origin!=null?e.origin:`${e.protocol}//${e.hostname}:${A}`,r=e.path!=null?e.path:`${e.pathname||""}${e.search||""}`;t.endsWith("/")&&(t=t.substring(0,t.length-1)),r&&!r.startsWith("/")&&(r=`/${r}`),e=new URL(t+r)}return e}function ZN(e){if(e=PI(e),e.pathname!=="/"||e.search||e.hash)throw new je("invalid url");return e}function XN(e){if(e[0]==="["){let t=e.indexOf("]");return TI(t!==-1),e.substring(1,t)}let A=e.indexOf(":");return A===-1?e:e.substring(0,A)}function zN(e){if(!e)return null;TI.strictEqual(typeof e,"string");let A=XN(e);return HN.isIP(A)?"":A}function $N(e){return JSON.parse(JSON.stringify(e))}function ex(e){return e!=null&&typeof e[Symbol.asyncIterator]=="function"}function Ax(e){return e!=null&&(typeof e[Symbol.iterator]=="function"||typeof e[Symbol.asyncIterator]=="function")}function tx(e){if(e==null)return 0;if(bu(e)){let A=e._readableState;return A&&A.objectMode===!1&&A.ended===!0&&Number.isFinite(A.length)?A.length:null}else{if(vI(e))return e.size!=null?e.size:null;if(JI(e))return e.byteLength}return null}function ku(e){return!e||!!(e.destroyed||e[MI])}function GI(e){let A=e&&e._readableState;return ku(e)&&A&&!A.endEmitted}function rx(e,A){e==null||!bu(e)||ku(e)||(typeof e.destroy=="function"?(Object.getPrototypeOf(e).constructor===ON&&(e.socket=null),e.destroy(A)):A&&process.nextTick((t,r)=>{t.emit("error",r)},e,A),e.destroyed!==!0&&(e[MI]=!0))}var nx=/timeout=(\d+)/;function ix(e){let A=e.toString().match(nx);return A?parseInt(A[1],10)*1e3:null}function sx(e){return _N[e]||e.toLowerCase()}function ox(e,A={}){if(!Array.isArray(e))return e;for(let t=0;ti.toString("utf8")):A[r]=e[t+1].toString("utf8")}return"content-length"in A&&"content-disposition"in A&&(A["content-disposition"]=Buffer.from(A["content-disposition"]).toString("latin1")),A}function ax(e){let A=[],t=!1,r=-1;for(let n=0;n{t.close()});else{let i=Buffer.isBuffer(n)?n:Buffer.from(n);t.enqueue(new Uint8Array(i))}return t.desiredSize>0},async cancel(t){await A.return()}},0)}function Qx(e){return e&&typeof e=="object"&&typeof e.append=="function"&&typeof e.delete=="function"&&typeof e.get=="function"&&typeof e.getAll=="function"&&typeof e.has=="function"&&typeof e.set=="function"&&e[Symbol.toStringTag]==="FormData"}function Cx(e){if(e){if(typeof e.throwIfAborted=="function")e.throwIfAborted();else if(e.aborted){let A=new Error("The operation was aborted");throw A.name="AbortError",A}}}function fx(e,A){return"addEventListener"in e?(e.addEventListener("abort",A,{once:!0}),()=>e.removeEventListener("abort",A)):(e.addListener("abort",A),()=>e.removeListener("abort",A))}var Ix=!!String.prototype.toWellFormed;function Bx(e){return Ix?`${e}`.toWellFormed():qa.toUSVString?qa.toUSVString(e):`${e}`}function px(e){if(e==null||e==="")return{start:0,end:null,size:null};let A=e?e.match(/^bytes (\d+)-(\d+)\/(\d+)?$/):null;return A?{start:parseInt(A[1]),end:A[2]?parseInt(A[2]):null,size:A[3]?parseInt(A[3]):null}:null}var YI=Object.create(null);YI.enumerable=!0;VI.exports={kEnumerableProperty:YI,nop:jN,isDisturbed:gx,isErrored:lx,isReadable:ux,toUSVString:Bx,isReadableAborted:GI,isBlobLike:vI,parseOrigin:ZN,parseURL:PI,getServerName:zN,isStream:bu,isIterable:Ax,isAsyncIterable:ex,isDestroyed:ku,headerNameToString:sx,parseRawHeaders:ax,parseHeaders:ox,parseKeepAliveTimeout:ix,destroy:rx,bodyLength:tx,deepClone:$N,ReadableStreamFrom:dx,isBuffer:JI,validateHandler:cx,getSocketInfo:Ex,isFormDataLike:Qx,buildURL:KN,throwIfAborted:Cx,addAbortListener:fx,parseRangeHeader:px,nodeMajor:Du,nodeMinor:UI,nodeHasAutoSelectFamily:Du>18||Du===18&&UI>=13,safeHTTPMethods:["GET","HEAD","OPTIONS","TRACE"]}});var HI=Q((l4,OI)=>{"use strict";var Su=Date.now(),Br,pr=[];function mx(){Su=Date.now();let e=pr.length,A=0;for(;A0&&Su>=t.state&&(t.state=-1,t.callback(t.opaque)),t.state===-1?(t.state=-2,A!==e-1?pr[A]=pr.pop():pr.pop(),e-=1):A+=1}pr.length>0&&qI()}function qI(){Br&&Br.refresh?Br.refresh():(clearTimeout(Br),Br=setTimeout(mx,1e3),Br.unref&&Br.unref())}var Oa=class{constructor(A,t,r){this.callback=A,this.delay=t,this.opaque=r,this.state=-2,this.refresh()}refresh(){this.state===-2&&(pr.push(this),(!Br||pr.length===1)&&qI()),this.state=0}clear(){this.state=-1}};OI.exports={setTimeout(e,A,t){return A<1e3?setTimeout(e,A,t):new Oa(e,A,t)},clearTimeout(e){e instanceof Oa?e.clear():clearTimeout(e)}}});var Fu=Q((u4,WI)=>{"use strict";var yx=require("events").EventEmitter,wx=require("util").inherits;function Vr(e){if(typeof e=="string"&&(e=Buffer.from(e)),!Buffer.isBuffer(e))throw new TypeError("The needle has to be a String or a Buffer.");let A=e.length;if(A===0)throw new Error("The needle cannot be an empty String/Buffer.");if(A>256)throw new Error("The needle cannot have a length bigger than 256.");this.maxMatches=1/0,this.matches=0,this._occ=new Array(256).fill(A),this._lookbehind_size=0,this._needle=e,this._bufpos=0,this._lookbehind=Buffer.alloc(A);for(var t=0;t=0)this.emit("info",!1,this._lookbehind,0,this._lookbehind_size),this._lookbehind_size=0;else{let o=this._lookbehind_size+i;return o>0&&this.emit("info",!1,this._lookbehind,0,o),this._lookbehind.copy(this._lookbehind,0,o,this._lookbehind_size-o),this._lookbehind_size-=o,e.copy(this._lookbehind,this._lookbehind_size),this._lookbehind_size+=A,this._bufpos=A,A}}if(i+=(i>=0)*this._bufpos,e.indexOf(t,i)!==-1)return i=e.indexOf(t,i),++this.matches,i>0?this.emit("info",!0,e,this._bufpos,i):this.emit("info",!0),this._bufpos=i+r;for(i=A-r;i0&&this.emit("info",!1,e,this._bufpos,i{"use strict";var Rx=require("util").inherits,_I=require("stream").Readable;function Nu(e){_I.call(this,e)}Rx(Nu,_I);Nu.prototype._read=function(e){};jI.exports=Nu});var Ha=Q((h4,ZI)=>{"use strict";ZI.exports=function(A,t,r){if(!A||A[t]===void 0||A[t]===null)return r;if(typeof A[t]!="number"||isNaN(A[t]))throw new TypeError("Limit "+t+" is not a valid number");return A[t]}});var eB=Q((d4,$I)=>{"use strict";var zI=require("events").EventEmitter,Dx=require("util").inherits,XI=Ha(),bx=Fu(),kx=Buffer.from(`\r -\r -`),Sx=/\r\n/g,Fx=/^([^:]+):[ \t]?([\x00-\xFF]+)?$/;function On(e){zI.call(this),e=e||{};let A=this;this.nread=0,this.maxed=!1,this.npairs=0,this.maxHeaderPairs=XI(e,"maxHeaderPairs",2e3),this.maxHeaderSize=XI(e,"maxHeaderSize",80*1024),this.buffer="",this.header={},this.finished=!1,this.ss=new bx(kx),this.ss.on("info",function(t,r,n,i){r&&!A.maxed&&(A.nread+i-n>=A.maxHeaderSize?(i=A.maxHeaderSize-A.nread+n,A.nread=A.maxHeaderSize,A.maxed=!0):A.nread+=i-n,A.buffer+=r.toString("binary",n,i)),t&&A._finish()})}Dx(On,zI);On.prototype.push=function(e){let A=this.ss.push(e);if(this.finished)return A};On.prototype.reset=function(){this.finished=!1,this.buffer="",this.header={},this.ss.reset()};On.prototype._finish=function(){this.buffer&&this._parseHeader(),this.ss.matches=this.ss.maxMatches;let e=this.header;this.header={},this.buffer="",this.finished=!0,this.nread=this.npairs=0,this.maxed=!1,this.emit("header",e)};On.prototype._parseHeader=function(){if(this.npairs===this.maxHeaderPairs)return;let e=this.buffer.split(Sx),A=e.length,t,r;for(var n=0;n{"use strict";var xu=require("stream").Writable,Nx=require("util").inherits,xx=Fu(),AB=KI(),Lx=eB(),Ux=45,Tx=Buffer.from("-"),Mx=Buffer.from(`\r -`),vx=function(){};function zA(e){if(!(this instanceof zA))return new zA(e);if(xu.call(this,e),!e||!e.headerFirst&&typeof e.boundary!="string")throw new TypeError("Boundary required");typeof e.boundary=="string"?this.setBoundary(e.boundary):this._bparser=void 0,this._headerFirst=e.headerFirst,this._dashes=0,this._parts=0,this._finished=!1,this._realFinish=!1,this._isPreamble=!0,this._justMatched=!1,this._firstWrite=!0,this._inHeader=!0,this._part=void 0,this._cb=void 0,this._ignoreData=!1,this._partOpts={highWaterMark:e.partHwm},this._pause=!1;let A=this;this._hparser=new Lx(e),this._hparser.on("header",function(t){A._inHeader=!1,A._part.emit("header",t)})}Nx(zA,xu);zA.prototype.emit=function(e){if(e==="finish"&&!this._realFinish){if(!this._finished){let A=this;process.nextTick(function(){if(A.emit("error",new Error("Unexpected end of multipart data")),A._part&&!A._ignoreData){let t=A._isPreamble?"Preamble":"Part";A._part.emit("error",new Error(t+" terminated early due to unexpected end of multipart data")),A._part.push(null),process.nextTick(function(){A._realFinish=!0,A.emit("finish"),A._realFinish=!1});return}A._realFinish=!0,A.emit("finish"),A._realFinish=!1})}}else xu.prototype.emit.apply(this,arguments)};zA.prototype._write=function(e,A,t){if(!this._hparser&&!this._bparser)return t();if(this._headerFirst&&this._isPreamble){this._part||(this._part=new AB(this._partOpts),this._events.preamble?this.emit("preamble",this._part):this._ignore());let r=this._hparser.push(e);if(!this._inHeader&&r!==void 0&&r{"use strict";var rB=new TextDecoder("utf-8"),Wa=new Map([["utf-8",rB],["utf8",rB]]);function Px(e,A,t){if(e)if(Wa.has(t))try{return Wa.get(t).decode(Buffer.from(e,A))}catch{}else try{return Wa.set(t,new TextDecoder(t)),Wa.get(t).decode(Buffer.from(e,A))}catch{}return e}nB.exports=Px});var Uu=Q((f4,oB)=>{"use strict";var ja=_a(),iB=/%([a-fA-F0-9]{2})/g;function sB(e,A){return String.fromCharCode(parseInt(A,16))}function Gx(e){let A=[],t="key",r="",n=!1,i=!1,s=0,o="";for(var a=0,c=e.length;a{"use strict";aB.exports=function(A){if(typeof A!="string")return"";for(var t=A.length-1;t>=0;--t)switch(A.charCodeAt(t)){case 47:case 92:return A=A.slice(t+1),A===".."||A==="."?"":A}return A===".."||A==="."?"":A}});var EB=Q((B4,uB)=>{"use strict";var{Readable:lB}=require("stream"),{inherits:Jx}=require("util"),Yx=Lu(),gB=Uu(),Vx=_a(),qx=cB(),qr=Ha(),Ox=/^boundary$/i,Hx=/^form-data$/i,Wx=/^charset$/i,_x=/^filename$/i,jx=/^name$/i;Ka.detect=/^multipart\/form-data/i;function Ka(e,A){let t,r,n=this,i,s=A.limits,o=A.isPartAFile||((ee,Y,ce)=>Y==="application/octet-stream"||ce!==void 0),a=A.parsedConType||[],c=A.defCharset||"utf8",g=A.preservePath,l={highWaterMark:A.fileHwm};for(t=0,r=a.length;tI)return n.parser.removeListener("part",ee),n.parser.on("part",Hn),e.hitPartsLimit=!0,e.emit("partsLimit"),Hn(Y);if(q){let ce=q;ce.emit("end"),ce.removeAllListeners("end")}Y.on("header",function(ce){let Je,fe,P,Uo,To,Yi,Vi=0;if(ce["content-type"]&&(P=gB(ce["content-type"][0]),P[0])){for(Je=P[0].toLowerCase(),t=0,r=P.length;th){let xt=h-Vi+st.length;xt>0&&Ye.push(st.slice(0,xt)),Ye.truncated=!0,Ye.bytesRead=h,Y.removeAllListeners("data"),Ye.emit("limit");return}else Ye.push(st)||(n._pause=!0);Ye.bytesRead=Vi},qg=function(){ne=void 0,Ye.push(null)}}else{if(K===C)return e.hitFieldsLimit||(e.hitFieldsLimit=!0,e.emit("fieldsLimit")),Hn(Y);++K,++H;let Ye="",st=!1;q=Y,Vg=function(xt){if((Vi+=xt.length)>E){let RD=E-(Vi-xt.length);Ye+=xt.toString("binary",0,RD),st=!0,Y.removeAllListeners("data")}else Ye+=xt.toString("binary")},qg=function(){q=void 0,Ye.length&&(Ye=Vx(Ye,"binary",Uo)),e.emit("field",fe,Ye,!1,st,To,Je),--H,u()}}Y._readableState.sync=!1,Y.on("data",Vg),Y.on("end",qg)}).on("error",function(ce){ne&&ne.emit("error",ce)})}).on("error",function(ee){e.emit("error",ee)}).on("finish",function(){ae=!0,u()})}Ka.prototype.write=function(e,A){let t=this.parser.write(e);t&&!this._pause?A():(this._needDrain=!t,this._cb=A)};Ka.prototype.end=function(){let e=this;e.parser.writable?e.parser.end():e._boy._done||process.nextTick(function(){e._boy._done=!0,e._boy.emit("finish")})};function Hn(e){e.resume()}function Tu(e){lB.call(this,e),this.bytesRead=0,this.truncated=!1}Jx(Tu,lB);Tu.prototype._read=function(e){};uB.exports=Ka});var dB=Q((p4,hB)=>{"use strict";var Kx=/\+/g,Zx=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function Mu(){this.buffer=void 0}Mu.prototype.write=function(e){e=e.replace(Kx," ");let A="",t=0,r=0,n=e.length;for(;tr&&(A+=e.substring(r,t),r=t),this.buffer="",++r);return r{"use strict";var Xx=dB(),Wn=_a(),vu=Ha(),zx=/^charset$/i;Za.detect=/^application\/x-www-form-urlencoded/i;function Za(e,A){let t=A.limits,r=A.parsedConType;this.boy=e,this.fieldSizeLimit=vu(t,"fieldSize",1*1024*1024),this.fieldNameSizeLimit=vu(t,"fieldNameSize",100),this.fieldsLimit=vu(t,"fields",1/0);let n;for(var i=0,s=r.length;ii&&(this._key+=this.decoder.write(e.toString("binary",i,t))),this._state="val",this._hitLimit=!1,this._checkingBytes=!0,this._val="",this._bytesVal=0,this._valTrunc=!1,this.decoder.reset(),i=t+1;else if(r!==void 0){++this._fields;let o,a=this._keyTrunc;if(r>i?o=this._key+=this.decoder.write(e.toString("binary",i,r)):o=this._key,this._hitLimit=!1,this._checkingBytes=!0,this._key="",this._bytesKey=0,this._keyTrunc=!1,this.decoder.reset(),o.length&&this.boy.emit("field",Wn(o,"binary",this.charset),"",a,!1),i=r+1,this._fields===this.fieldsLimit)return A()}else this._hitLimit?(n>i&&(this._key+=this.decoder.write(e.toString("binary",i,n))),i=n,(this._bytesKey=this._key.length)===this.fieldNameSizeLimit&&(this._checkingBytes=!1,this._keyTrunc=!0)):(ii&&(this._val+=this.decoder.write(e.toString("binary",i,r))),this.boy.emit("field",Wn(this._key,"binary",this.charset),Wn(this._val,"binary",this.charset),this._keyTrunc,this._valTrunc),this._state="key",this._hitLimit=!1,this._checkingBytes=!0,this._key="",this._bytesKey=0,this._keyTrunc=!1,this.decoder.reset(),i=r+1,this._fields===this.fieldsLimit)return A()}else this._hitLimit?(n>i&&(this._val+=this.decoder.write(e.toString("binary",i,n))),i=n,(this._val===""&&this.fieldSizeLimit===0||(this._bytesVal=this._val.length)===this.fieldSizeLimit)&&(this._checkingBytes=!1,this._valTrunc=!0)):(i0?this.boy.emit("field",Wn(this._key,"binary",this.charset),"",this._keyTrunc,!1):this._state==="val"&&this.boy.emit("field",Wn(this._key,"binary",this.charset),Wn(this._val,"binary",this.charset),this._keyTrunc,this._valTrunc),this.boy._done=!0,this.boy.emit("finish"))};QB.exports=Za});var BB=Q((y4,ws)=>{"use strict";var Pu=require("stream").Writable,{inherits:$x}=require("util"),eL=Lu(),fB=EB(),IB=CB(),AL=Uu();function Vt(e){if(!(this instanceof Vt))return new Vt(e);if(typeof e!="object")throw new TypeError("Busboy expected an options-Object.");if(typeof e.headers!="object")throw new TypeError("Busboy expected an options-Object with headers-attribute.");if(typeof e.headers["content-type"]!="string")throw new TypeError("Missing Content-Type-header.");let{headers:A,...t}=e;this.opts={autoDestroy:!1,...t},Pu.call(this,this.opts),this._done=!1,this._parser=this.getParserByHeaders(A),this._finished=!1}$x(Vt,Pu);Vt.prototype.emit=function(e){if(e==="finish"){if(this._done){if(this._finished)return}else{this._parser?.end();return}this._finished=!0}Pu.prototype.emit.apply(this,arguments)};Vt.prototype.getParserByHeaders=function(e){let A=AL(e["content-type"]),t={defCharset:this.opts.defCharset,fileHwm:this.opts.fileHwm,headers:e,highWaterMark:this.opts.highWaterMark,isPartAFile:this.opts.isPartAFile,limits:this.opts.limits,parsedConType:A,preservePath:this.opts.preservePath};if(fB.detect.test(A[0]))return new fB(this,t);if(IB.detect.test(A[0]))return new IB(this,t);throw new Error("Unsupported Content-Type.")};Vt.prototype._write=function(e,A,t){this._parser.write(e,t)};ws.exports=Vt;ws.exports.default=Vt;ws.exports.Busboy=Vt;ws.exports.Dicer=eL});var mr=Q((w4,kB)=>{"use strict";var{MessageChannel:tL,receiveMessageOnPort:rL}=require("worker_threads"),pB=["GET","HEAD","POST"],nL=new Set(pB),iL=[101,204,205,304],mB=[301,302,303,307,308],sL=new Set(mB),yB=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","5060","5061","6000","6566","6665","6666","6667","6668","6669","6697","10080"],oL=new Set(yB),wB=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],aL=new Set(wB),cL=["follow","manual","error"],RB=["GET","HEAD","OPTIONS","TRACE"],gL=new Set(RB),lL=["navigate","same-origin","no-cors","cors"],uL=["omit","same-origin","include"],EL=["default","no-store","reload","no-cache","force-cache","only-if-cached"],hL=["content-encoding","content-language","content-location","content-type","content-length"],dL=["half"],DB=["CONNECT","TRACE","TRACK"],QL=new Set(DB),bB=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],CL=new Set(bB),fL=globalThis.DOMException??(()=>{try{atob("~")}catch(e){return Object.getPrototypeOf(e).constructor}})(),_n,IL=globalThis.structuredClone??function(A,t=void 0){if(arguments.length===0)throw new TypeError("missing argument");return _n||(_n=new tL),_n.port1.unref(),_n.port2.unref(),_n.port1.postMessage(A,t?.transfer),rL(_n.port2).message};kB.exports={DOMException:fL,structuredClone:IL,subresource:bB,forbiddenMethods:DB,requestBodyHeader:hL,referrerPolicy:wB,requestRedirect:cL,requestMode:lL,requestCredentials:uL,requestCache:EL,redirectStatus:mB,corsSafeListedMethods:pB,nullBodyStatus:iL,safeMethods:RB,badPorts:yB,requestDuplex:dL,subresourceSet:CL,badPortsSet:oL,redirectStatusSet:sL,corsSafeListedMethodsSet:nL,safeMethodsSet:gL,forbiddenMethodsSet:QL,referrerPolicySet:aL}});var jn=Q((R4,SB)=>{"use strict";var Gu=Symbol.for("undici.globalOrigin.1");function BL(){return globalThis[Gu]}function pL(e){if(e===void 0){Object.defineProperty(globalThis,Gu,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let A=new URL(e);if(A.protocol!=="http:"&&A.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${A.protocol}`);Object.defineProperty(globalThis,Gu,{value:A,writable:!0,enumerable:!1,configurable:!1})}SB.exports={getGlobalOrigin:BL,setGlobalOrigin:pL}});var YA=Q((D4,vB)=>{"use strict";var{redirectStatusSet:mL,referrerPolicySet:yL,badPortsSet:wL}=mr(),{getGlobalOrigin:RL}=jn(),{performance:DL}=require("perf_hooks"),{isBlobLike:bL,toUSVString:kL,ReadableStreamFrom:SL}=W(),Kn=require("assert"),{isUint8Array:FL}=require("util/types"),FB=[],Xa;try{Xa=require("crypto");let e=["sha256","sha384","sha512"];FB=Xa.getHashes().filter(A=>e.includes(A))}catch{}function NB(e){let A=e.urlList,t=A.length;return t===0?null:A[t-1].toString()}function NL(e,A){if(!mL.has(e.status))return null;let t=e.headersList.get("location");return t!==null&&LB(t)&&(t=new URL(t,NB(e))),t&&!t.hash&&(t.hash=A),t}function Ds(e){return e.urlList[e.urlList.length-1]}function xL(e){let A=Ds(e);return MB(A)&&wL.has(A.port)?"blocked":"allowed"}function LL(e){return e instanceof Error||e?.constructor?.name==="Error"||e?.constructor?.name==="DOMException"}function UL(e){for(let A=0;A=32&&t<=126||t>=128&&t<=255))return!1}return!0}function TL(e){switch(e){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return!1;default:return e>=33&&e<=126}}function xB(e){if(e.length===0)return!1;for(let A=0;A0)for(let i=r.length;i!==0;i--){let s=r[i-1].trim();if(yL.has(s)){n=s;break}}n!==""&&(e.referrerPolicy=n)}function PL(){return"allowed"}function GL(){return"success"}function JL(){return"success"}function YL(e){let A=null;A=e.mode,e.headersList.set("sec-fetch-mode",A)}function VL(e){let A=e.origin;if(e.responseTainting==="cors"||e.mode==="websocket")A&&e.headersList.append("origin",A);else if(e.method!=="GET"&&e.method!=="HEAD"){switch(e.referrerPolicy){case"no-referrer":A=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":e.origin&&Vu(e.origin)&&!Vu(Ds(e))&&(A=null);break;case"same-origin":za(e,Ds(e))||(A=null);break;default:}A&&e.headersList.append("origin",A)}}function qL(e){return DL.now()}function OL(e){return{startTime:e.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:e.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}function HL(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function WL(e){return{referrerPolicy:e.referrerPolicy}}function _L(e){let A=e.referrerPolicy;Kn(A);let t=null;if(e.referrer==="client"){let o=RL();if(!o||o.origin==="null")return"no-referrer";t=new URL(o)}else e.referrer instanceof URL&&(t=e.referrer);let r=Ju(t),n=Ju(t,!0);r.toString().length>4096&&(r=n);let i=za(e,r),s=Rs(r)&&!Rs(e.url);switch(A){case"origin":return n??Ju(t,!0);case"unsafe-url":return r;case"same-origin":return i?n:"no-referrer";case"origin-when-cross-origin":return i?r:n;case"strict-origin-when-cross-origin":{let o=Ds(e);return za(r,o)?r:Rs(r)&&!Rs(o)?"no-referrer":n}case"strict-origin":case"no-referrer-when-downgrade":default:return s?"no-referrer":n}}function Ju(e,A){return Kn(e instanceof URL),e.protocol==="file:"||e.protocol==="about:"||e.protocol==="blank:"?"no-referrer":(e.username="",e.password="",e.hash="",A&&(e.pathname="",e.search=""),e)}function Rs(e){if(!(e instanceof URL))return!1;if(e.href==="about:blank"||e.href==="about:srcdoc"||e.protocol==="data:"||e.protocol==="file:")return!0;return A(e.origin);function A(t){if(t==null||t==="null")return!1;let r=new URL(t);return!!(r.protocol==="https:"||r.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(r.hostname)||r.hostname==="localhost"||r.hostname.includes("localhost.")||r.hostname.endsWith(".localhost"))}}function jL(e,A){if(Xa===void 0)return!0;let t=UB(A);if(t==="no metadata"||t.length===0)return!0;let r=ZL(t),n=XL(t,r);for(let i of n){let s=i.algo,o=i.hash,a=Xa.createHash(s).update(e).digest("base64");if(a[a.length-1]==="="&&(a[a.length-2]==="="?a=a.slice(0,-2):a=a.slice(0,-1)),zL(a,o))return!0}return!1}var KL=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function UB(e){let A=[],t=!0;for(let r of e.split(" ")){t=!1;let n=KL.exec(r);if(n===null||n.groups===void 0||n.groups.algo===void 0)continue;let i=n.groups.algo.toLowerCase();FB.includes(i)&&A.push(n.groups)}return t===!0?"no metadata":A}function ZL(e){let A=e[0].algo;if(A[3]==="5")return A;for(let t=1;t{e=r,A=n}),resolve:e,reject:A}}function AU(e){return e.controller.state==="aborted"}function tU(e){return e.controller.state==="aborted"||e.controller.state==="terminated"}var qu={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"};Object.setPrototypeOf(qu,null);function rU(e){return qu[e.toLowerCase()]??e}function nU(e){let A=JSON.stringify(e);if(A===void 0)throw new TypeError("Value is not JSON serializable");return Kn(typeof A=="string"),A}var iU=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function sU(e,A,t){let r={index:0,kind:t,target:e},n={next(){if(Object.getPrototypeOf(this)!==n)throw new TypeError(`'next' called on an object that does not implement interface ${A} Iterator.`);let{index:i,kind:s,target:o}=r,a=o(),c=a.length;if(i>=c)return{value:void 0,done:!0};let g=a[i];return r.index=i+1,oU(g,s)},[Symbol.toStringTag]:`${A} Iterator`};return Object.setPrototypeOf(n,iU),Object.setPrototypeOf({},n)}function oU(e,A){let t;switch(A){case"key":{t=e[0];break}case"value":{t=e[1];break}case"key+value":{t=e;break}}return{value:t,done:!1}}async function aU(e,A,t){let r=A,n=t,i;try{i=e.stream.getReader()}catch(s){n(s);return}try{let s=await TB(i);r(s)}catch(s){n(s)}}var Yu=globalThis.ReadableStream;function cU(e){return Yu||(Yu=require("stream/web").ReadableStream),e instanceof Yu||e[Symbol.toStringTag]==="ReadableStream"&&typeof e.tee=="function"}var gU=65535;function lU(e){return e.lengthA+String.fromCharCode(t),"")}function uU(e){try{e.close()}catch(A){if(!A.message.includes("Controller is already closed"))throw A}}function EU(e){for(let A=0;AObject.prototype.hasOwnProperty.call(e,A));vB.exports={isAborted:AU,isCancelled:tU,createDeferredPromise:eU,ReadableStreamFrom:SL,toUSVString:kL,tryUpgradeRequestToAPotentiallyTrustworthyURL:$L,coarsenedSharedCurrentTime:qL,determineRequestsReferrer:_L,makePolicyContainer:HL,clonePolicyContainer:WL,appendFetchMetadata:YL,appendRequestOriginHeader:VL,TAOCheck:JL,corsCheck:GL,crossOriginResourcePolicyCheck:PL,createOpaqueTimingInfo:OL,setRequestReferrerPolicyOnRedirect:vL,isValidHTTPToken:xB,requestBadPort:xL,requestCurrentURL:Ds,responseURL:NB,responseLocationURL:NL,isBlobLike:bL,isURLPotentiallyTrustworthy:Rs,isValidReasonPhrase:UL,sameOrigin:za,normalizeMethod:rU,serializeJavascriptValueToJSONString:nU,makeIterator:sU,isValidHeaderName:ML,isValidHeaderValue:LB,hasOwn:dU,isErrorLike:LL,fullyReadBody:aU,bytesMatch:jL,isReadableStreamLike:cU,readableStreamClose:uU,isomorphicEncode:EU,isomorphicDecode:lU,urlIsLocal:hU,urlHasHttpsScheme:Vu,urlIsHttpHttpsScheme:MB,readAllBytes:TB,normalizeMethodRecord:qu,parseMetadata:UB}});var qt=Q((b4,PB)=>{"use strict";PB.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kGuard:Symbol("guard"),kRealm:Symbol("realm")}});var iA=Q((k4,JB)=>{"use strict";var{types:It}=require("util"),{hasOwn:GB,toUSVString:QU}=YA(),R={};R.converters={};R.util={};R.errors={};R.errors.exception=function(e){return new TypeError(`${e.header}: ${e.message}`)};R.errors.conversionFailed=function(e){let A=e.types.length===1?"":" one of",t=`${e.argument} could not be converted to${A}: ${e.types.join(", ")}.`;return R.errors.exception({header:e.prefix,message:t})};R.errors.invalidArgument=function(e){return R.errors.exception({header:e.prefix,message:`"${e.value}" is an invalid ${e.type}.`})};R.brandCheck=function(e,A,t=void 0){if(t?.strict!==!1&&!(e instanceof A))throw new TypeError("Illegal invocation");return e?.[Symbol.toStringTag]===A.prototype[Symbol.toStringTag]};R.argumentLengthCheck=function({length:e},A,t){if(en)throw R.errors.exception({header:"Integer conversion",message:`Value must be between ${i}-${n}, got ${s}.`});return s}return!Number.isNaN(s)&&r.clamp===!0?(s=Math.min(Math.max(s,i),n),Math.floor(s)%2===0?s=Math.floor(s):s=Math.ceil(s),s):Number.isNaN(s)||s===0&&Object.is(0,s)||s===Number.POSITIVE_INFINITY||s===Number.NEGATIVE_INFINITY?0:(s=R.util.IntegerPart(s),s=s%Math.pow(2,A),t==="signed"&&s>=Math.pow(2,A)-1?s-Math.pow(2,A):s)};R.util.IntegerPart=function(e){let A=Math.floor(Math.abs(e));return e<0?-1*A:A};R.sequenceConverter=function(e){return A=>{if(R.util.Type(A)!=="Object")throw R.errors.exception({header:"Sequence",message:`Value of type ${R.util.Type(A)} is not an Object.`});let t=A?.[Symbol.iterator]?.(),r=[];if(t===void 0||typeof t.next!="function")throw R.errors.exception({header:"Sequence",message:"Object is not an iterator."});for(;;){let{done:n,value:i}=t.next();if(n)break;r.push(e(i))}return r}};R.recordConverter=function(e,A){return t=>{if(R.util.Type(t)!=="Object")throw R.errors.exception({header:"Record",message:`Value of type ${R.util.Type(t)} is not an Object.`});let r={};if(!It.isProxy(t)){let i=Object.keys(t);for(let s of i){let o=e(s),a=A(t[s]);r[o]=a}return r}let n=Reflect.ownKeys(t);for(let i of n)if(Reflect.getOwnPropertyDescriptor(t,i)?.enumerable){let o=e(i),a=A(t[i]);r[o]=a}return r}};R.interfaceConverter=function(e){return(A,t={})=>{if(t.strict!==!1&&!(A instanceof e))throw R.errors.exception({header:e.name,message:`Expected ${A} to be an instance of ${e.name}.`});return A}};R.dictionaryConverter=function(e){return A=>{let t=R.util.Type(A),r={};if(t==="Null"||t==="Undefined")return r;if(t!=="Object")throw R.errors.exception({header:"Dictionary",message:`Expected ${A} to be one of: Null, Undefined, Object.`});for(let n of e){let{key:i,defaultValue:s,required:o,converter:a}=n;if(o===!0&&!GB(A,i))throw R.errors.exception({header:"Dictionary",message:`Missing required key "${i}".`});let c=A[i],g=GB(n,"defaultValue");if(g&&c!==null&&(c=c??s),o||g||c!==void 0){if(c=a(c),n.allowedValues&&!n.allowedValues.includes(c))throw R.errors.exception({header:"Dictionary",message:`${c} is not an accepted type. Expected one of ${n.allowedValues.join(", ")}.`});r[i]=c}}return r}};R.nullableConverter=function(e){return A=>A===null?A:e(A)};R.converters.DOMString=function(e,A={}){if(e===null&&A.legacyNullToEmptyString)return"";if(typeof e=="symbol")throw new TypeError("Could not convert argument of type symbol to string.");return String(e)};R.converters.ByteString=function(e){let A=R.converters.DOMString(e);for(let t=0;t255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${t} has a value of ${A.charCodeAt(t)} which is greater than 255.`);return A};R.converters.USVString=QU;R.converters.boolean=function(e){return!!e};R.converters.any=function(e){return e};R.converters["long long"]=function(e){return R.util.ConvertToInt(e,64,"signed")};R.converters["unsigned long long"]=function(e){return R.util.ConvertToInt(e,64,"unsigned")};R.converters["unsigned long"]=function(e){return R.util.ConvertToInt(e,32,"unsigned")};R.converters["unsigned short"]=function(e,A){return R.util.ConvertToInt(e,16,"unsigned",A)};R.converters.ArrayBuffer=function(e,A={}){if(R.util.Type(e)!=="Object"||!It.isAnyArrayBuffer(e))throw R.errors.conversionFailed({prefix:`${e}`,argument:`${e}`,types:["ArrayBuffer"]});if(A.allowShared===!1&&It.isSharedArrayBuffer(e))throw R.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});return e};R.converters.TypedArray=function(e,A,t={}){if(R.util.Type(e)!=="Object"||!It.isTypedArray(e)||e.constructor.name!==A.name)throw R.errors.conversionFailed({prefix:`${A.name}`,argument:`${e}`,types:[A.name]});if(t.allowShared===!1&&It.isSharedArrayBuffer(e.buffer))throw R.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});return e};R.converters.DataView=function(e,A={}){if(R.util.Type(e)!=="Object"||!It.isDataView(e))throw R.errors.exception({header:"DataView",message:"Object is not a DataView."});if(A.allowShared===!1&&It.isSharedArrayBuffer(e.buffer))throw R.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});return e};R.converters.BufferSource=function(e,A={}){if(It.isAnyArrayBuffer(e))return R.converters.ArrayBuffer(e,A);if(It.isTypedArray(e))return R.converters.TypedArray(e,e.constructor);if(It.isDataView(e))return R.converters.DataView(e,A);throw new TypeError(`Could not convert ${e} to a BufferSource.`)};R.converters["sequence"]=R.sequenceConverter(R.converters.ByteString);R.converters["sequence>"]=R.sequenceConverter(R.converters["sequence"]);R.converters["record"]=R.recordConverter(R.converters.ByteString,R.converters.ByteString);JB.exports={webidl:R}});var $A=Q((S4,WB)=>{"use strict";var ec=require("assert"),{atob:CU}=require("buffer"),{isomorphicDecode:fU}=YA(),IU=new TextEncoder,$a=/^[!#$%&'*+-.^_|~A-Za-z0-9]+$/,BU=/(\u000A|\u000D|\u0009|\u0020)/,pU=/[\u0009|\u0020-\u007E|\u0080-\u00FF]/;function mU(e){ec(e.protocol==="data:");let A=qB(e,!0);A=A.slice(5);let t={position:0},r=Zn(",",A,t),n=r.length;if(r=DU(r,!0,!0),t.position>=A.length)return"failure";t.position++;let i=A.slice(n+1),s=OB(i);if(/;(\u0020){0,}base64$/i.test(r)){let a=fU(s);if(s=wU(a),s==="failure")return"failure";r=r.slice(0,-6),r=r.replace(/(\u0020)+$/,""),r=r.slice(0,-1)}r.startsWith(";")&&(r="text/plain"+r);let o=Hu(r);return o==="failure"&&(o=Hu("text/plain;charset=US-ASCII")),{mimeType:o,body:s}}function qB(e,A=!1){if(!A)return e.href;let t=e.href,r=e.hash.length;return r===0?t:t.substring(0,t.length-r)}function Ac(e,A,t){let r="";for(;t.positione.length)return"failure";A.position++;let r=Zn(";",e,A);if(r=Ou(r,!1,!0),r.length===0||!$a.test(r))return"failure";let n=t.toLowerCase(),i=r.toLowerCase(),s={type:n,subtype:i,parameters:new Map,essence:`${n}/${i}`};for(;A.positionBU.test(c),e,A);let o=Ac(c=>c!==";"&&c!=="=",e,A);if(o=o.toLowerCase(),A.positione.length)break;let a=null;if(e[A.position]==='"')a=HB(e,A,!0),Zn(";",e,A);else if(a=Zn(";",e,A),a=Ou(a,!1,!0),a.length===0)continue;o.length!==0&&$a.test(o)&&(a.length===0||pU.test(a))&&!s.parameters.has(o)&&s.parameters.set(o,a)}return s}function wU(e){if(e=e.replace(/[\u0009\u000A\u000C\u000D\u0020]/g,""),e.length%4===0&&(e=e.replace(/=?=$/,"")),e.length%4===1||/[^+/0-9A-Za-z]/.test(e))return"failure";let A=CU(e),t=new Uint8Array(A.length);for(let r=0;rs!=='"'&&s!=="\\",e,A),!(A.position>=e.length);){let i=e[A.position];if(A.position++,i==="\\"){if(A.position>=e.length){n+="\\";break}n+=e[A.position],A.position++}else{ec(i==='"');break}}return t?n:e.slice(r,A.position)}function RU(e){ec(e!=="failure");let{parameters:A,essence:t}=e,r=t;for(let[n,i]of A.entries())r+=";",r+=n,r+="=",$a.test(i)||(i=i.replace(/(\\|")/g,"\\$1"),i='"'+i,i+='"'),r+=i;return r}function YB(e){return e==="\r"||e===` -`||e===" "||e===" "}function Ou(e,A=!0,t=!0){let r=0,n=e.length-1;if(A)for(;r0&&YB(e[n]);n--);return e.slice(r,n+1)}function VB(e){return e==="\r"||e===` -`||e===" "||e==="\f"||e===" "}function DU(e,A=!0,t=!0){let r=0,n=e.length-1;if(A)for(;r0&&VB(e[n]);n--);return e.slice(r,n+1)}WB.exports={dataURLProcessor:mU,URLSerializer:qB,collectASequenceOfCodePoints:Ac,collectASequenceOfCodePointsFast:Zn,stringPercentDecode:OB,parseMIMEType:Hu,collectAnHTTPQuotedString:HB,serializeAMimeType:RU}});var tc=Q((F4,XB)=>{"use strict";var{Blob:KB,File:_B}=require("buffer"),{types:Wu}=require("util"),{kState:RA}=qt(),{isBlobLike:ZB}=YA(),{webidl:te}=iA(),{parseMIMEType:bU,serializeAMimeType:kU}=$A(),{kEnumerableProperty:jB}=W(),SU=new TextEncoder,bs=class e extends KB{constructor(A,t,r={}){te.argumentLengthCheck(arguments,2,{header:"File constructor"}),A=te.converters["sequence"](A),t=te.converters.USVString(t),r=te.converters.FilePropertyBag(r);let n=t,i=r.type,s;e:{if(i){if(i=bU(i),i==="failure"){i="";break e}i=kU(i).toLowerCase()}s=r.lastModified}super(FU(A,r),{type:i}),this[RA]={name:n,lastModified:s,type:i}}get name(){return te.brandCheck(this,e),this[RA].name}get lastModified(){return te.brandCheck(this,e),this[RA].lastModified}get type(){return te.brandCheck(this,e),this[RA].type}},_u=class e{constructor(A,t,r={}){let n=t,i=r.type,s=r.lastModified??Date.now();this[RA]={blobLike:A,name:n,type:i,lastModified:s}}stream(...A){return te.brandCheck(this,e),this[RA].blobLike.stream(...A)}arrayBuffer(...A){return te.brandCheck(this,e),this[RA].blobLike.arrayBuffer(...A)}slice(...A){return te.brandCheck(this,e),this[RA].blobLike.slice(...A)}text(...A){return te.brandCheck(this,e),this[RA].blobLike.text(...A)}get size(){return te.brandCheck(this,e),this[RA].blobLike.size}get type(){return te.brandCheck(this,e),this[RA].blobLike.type}get name(){return te.brandCheck(this,e),this[RA].name}get lastModified(){return te.brandCheck(this,e),this[RA].lastModified}get[Symbol.toStringTag](){return"File"}};Object.defineProperties(bs.prototype,{[Symbol.toStringTag]:{value:"File",configurable:!0},name:jB,lastModified:jB});te.converters.Blob=te.interfaceConverter(KB);te.converters.BlobPart=function(e,A){if(te.util.Type(e)==="Object"){if(ZB(e))return te.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||Wu.isAnyArrayBuffer(e))return te.converters.BufferSource(e,A)}return te.converters.USVString(e,A)};te.converters["sequence"]=te.sequenceConverter(te.converters.BlobPart);te.converters.FilePropertyBag=te.dictionaryConverter([{key:"lastModified",converter:te.converters["long long"],get defaultValue(){return Date.now()}},{key:"type",converter:te.converters.DOMString,defaultValue:""},{key:"endings",converter:e=>(e=te.converters.DOMString(e),e=e.toLowerCase(),e!=="native"&&(e="transparent"),e),defaultValue:"transparent"}]);function FU(e,A){let t=[];for(let r of e)if(typeof r=="string"){let n=r;A.endings==="native"&&(n=NU(n)),t.push(SU.encode(n))}else Wu.isAnyArrayBuffer(r)||Wu.isTypedArray(r)?r.buffer?t.push(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)):t.push(new Uint8Array(r)):ZB(r)&&t.push(r);return t}function NU(e){let A=` -`;return process.platform==="win32"&&(A=`\r -`),e.replace(/\r?\n/g,A)}function xU(e){return _B&&e instanceof _B||e instanceof bs||e&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&e[Symbol.toStringTag]==="File"}XB.exports={File:bs,FileLike:_u,isFileLike:xU}});var nc=Q((N4,tp)=>{"use strict";var{isBlobLike:rc,toUSVString:LU,makeIterator:ju}=YA(),{kState:$e}=qt(),{File:Ap,FileLike:zB,isFileLike:UU}=tc(),{webidl:re}=iA(),{Blob:TU,File:Ku}=require("buffer"),$B=Ku??Ap,Xn=class e{constructor(A){if(A!==void 0)throw re.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[$e]=[]}append(A,t,r=void 0){if(re.brandCheck(this,e),re.argumentLengthCheck(arguments,2,{header:"FormData.append"}),arguments.length===3&&!rc(t))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");A=re.converters.USVString(A),t=rc(t)?re.converters.Blob(t,{strict:!1}):re.converters.USVString(t),r=arguments.length===3?re.converters.USVString(r):void 0;let n=ep(A,t,r);this[$e].push(n)}delete(A){re.brandCheck(this,e),re.argumentLengthCheck(arguments,1,{header:"FormData.delete"}),A=re.converters.USVString(A),this[$e]=this[$e].filter(t=>t.name!==A)}get(A){re.brandCheck(this,e),re.argumentLengthCheck(arguments,1,{header:"FormData.get"}),A=re.converters.USVString(A);let t=this[$e].findIndex(r=>r.name===A);return t===-1?null:this[$e][t].value}getAll(A){return re.brandCheck(this,e),re.argumentLengthCheck(arguments,1,{header:"FormData.getAll"}),A=re.converters.USVString(A),this[$e].filter(t=>t.name===A).map(t=>t.value)}has(A){return re.brandCheck(this,e),re.argumentLengthCheck(arguments,1,{header:"FormData.has"}),A=re.converters.USVString(A),this[$e].findIndex(t=>t.name===A)!==-1}set(A,t,r=void 0){if(re.brandCheck(this,e),re.argumentLengthCheck(arguments,2,{header:"FormData.set"}),arguments.length===3&&!rc(t))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");A=re.converters.USVString(A),t=rc(t)?re.converters.Blob(t,{strict:!1}):re.converters.USVString(t),r=arguments.length===3?LU(r):void 0;let n=ep(A,t,r),i=this[$e].findIndex(s=>s.name===A);i!==-1?this[$e]=[...this[$e].slice(0,i),n,...this[$e].slice(i+1).filter(s=>s.name!==A)]:this[$e].push(n)}entries(){return re.brandCheck(this,e),ju(()=>this[$e].map(A=>[A.name,A.value]),"FormData","key+value")}keys(){return re.brandCheck(this,e),ju(()=>this[$e].map(A=>[A.name,A.value]),"FormData","key")}values(){return re.brandCheck(this,e),ju(()=>this[$e].map(A=>[A.name,A.value]),"FormData","value")}forEach(A,t=globalThis){if(re.brandCheck(this,e),re.argumentLengthCheck(arguments,1,{header:"FormData.forEach"}),typeof A!="function")throw new TypeError("Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'.");for(let[r,n]of this)A.apply(t,[n,r,this])}};Xn.prototype[Symbol.iterator]=Xn.prototype.entries;Object.defineProperties(Xn.prototype,{[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function ep(e,A,t){if(e=Buffer.from(e).toString("utf8"),typeof A=="string")A=Buffer.from(A).toString("utf8");else if(UU(A)||(A=A instanceof TU?new $B([A],"blob",{type:A.type}):new zB(A,"blob",{type:A.type})),t!==void 0){let r={type:A.type,lastModified:A.lastModified};A=Ku&&A instanceof Ku||A instanceof Ap?new $B([A],t,r):new zB(A,t,r)}return{name:e,value:A}}tp.exports={FormData:Xn}});var ks=Q((x4,lp)=>{"use strict";var MU=BB(),zn=W(),{ReadableStreamFrom:vU,isBlobLike:rp,isReadableStreamLike:PU,readableStreamClose:GU,createDeferredPromise:JU,fullyReadBody:YU}=YA(),{FormData:np}=nc(),{kState:Ht}=qt(),{webidl:Zu}=iA(),{DOMException:op,structuredClone:VU}=mr(),{Blob:qU,File:OU}=require("buffer"),{kBodyUsed:HU}=de(),Xu=require("assert"),{isErrored:WU}=W(),{isUint8Array:ap,isArrayBuffer:_U}=require("util/types"),{File:jU}=tc(),{parseMIMEType:KU,serializeAMimeType:ZU}=$A(),Ot=globalThis.ReadableStream,ip=OU??jU,ic=new TextEncoder,XU=new TextDecoder;function cp(e,A=!1){Ot||(Ot=require("stream/web").ReadableStream);let t=null;e instanceof Ot?t=e:rp(e)?t=e.stream():t=new Ot({async pull(a){a.enqueue(typeof n=="string"?ic.encode(n):n),queueMicrotask(()=>GU(a))},start(){},type:void 0}),Xu(PU(t));let r=null,n=null,i=null,s=null;if(typeof e=="string")n=e,s="text/plain;charset=UTF-8";else if(e instanceof URLSearchParams)n=e.toString(),s="application/x-www-form-urlencoded;charset=UTF-8";else if(_U(e))n=new Uint8Array(e.slice());else if(ArrayBuffer.isView(e))n=new Uint8Array(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));else if(zn.isFormDataLike(e)){let a=`----formdata-undici-0${`${Math.floor(Math.random()*1e11)}`.padStart(11,"0")}`,c=`--${a}\r -Content-Disposition: form-data`;let g=C=>C.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),l=C=>C.replace(/\r?\n|\r/g,`\r -`),u=[],E=new Uint8Array([13,10]);i=0;let h=!1;for(let[C,I]of e)if(typeof I=="string"){let p=ic.encode(c+`; name="${g(l(C))}"\r -\r -${l(I)}\r -`);u.push(p),i+=p.byteLength}else{let p=ic.encode(`${c}; name="${g(l(C))}"`+(I.name?`; filename="${g(I.name)}"`:"")+`\r -Content-Type: ${I.type||"application/octet-stream"}\r -\r -`);u.push(p,I,E),typeof I.size=="number"?i+=p.byteLength+I.size+E.byteLength:h=!0}let d=ic.encode(`--${a}--`);u.push(d),i+=d.byteLength,h&&(i=null),n=e,r=async function*(){for(let C of u)C.stream?yield*C.stream():yield C},s="multipart/form-data; boundary="+a}else if(rp(e))n=e,i=e.size,e.type&&(s=e.type);else if(typeof e[Symbol.asyncIterator]=="function"){if(A)throw new TypeError("keepalive");if(zn.isDisturbed(e)||e.locked)throw new TypeError("Response body object should not be disturbed or locked");t=e instanceof Ot?e:vU(e)}if((typeof n=="string"||zn.isBuffer(n))&&(i=Buffer.byteLength(n)),r!=null){let a;t=new Ot({async start(){a=r(e)[Symbol.asyncIterator]()},async pull(c){let{value:g,done:l}=await a.next();return l?queueMicrotask(()=>{c.close()}):WU(t)||c.enqueue(new Uint8Array(g)),c.desiredSize>0},async cancel(c){await a.return()},type:void 0})}return[{stream:t,source:n,length:i},s]}function zU(e,A=!1){return Ot||(Ot=require("stream/web").ReadableStream),e instanceof Ot&&(Xu(!zn.isDisturbed(e),"The body has already been consumed."),Xu(!e.locked,"The stream is locked.")),cp(e,A)}function $U(e){let[A,t]=e.stream.tee(),r=VU(t,{transfer:[t]}),[,n]=r.tee();return e.stream=A,{stream:n,length:e.length,source:e.source}}async function*sp(e){if(e)if(ap(e))yield e;else{let A=e.stream;if(zn.isDisturbed(A))throw new TypeError("The body has already been consumed.");if(A.locked)throw new TypeError("The stream is locked.");A[HU]=!0,yield*A}}function zu(e){if(e.aborted)throw new op("The operation was aborted.","AbortError")}function eT(e){return{blob(){return sc(this,t=>{let r=nT(this);return r==="failure"?r="":r&&(r=ZU(r)),new qU([t],{type:r})},e)},arrayBuffer(){return sc(this,t=>new Uint8Array(t).buffer,e)},text(){return sc(this,gp,e)},json(){return sc(this,rT,e)},async formData(){Zu.brandCheck(this,e),zu(this[Ht]);let t=this.headers.get("Content-Type");if(/multipart\/form-data/.test(t)){let r={};for(let[o,a]of this.headers)r[o.toLowerCase()]=a;let n=new np,i;try{i=new MU({headers:r,preservePath:!0})}catch(o){throw new op(`${o}`,"AbortError")}i.on("field",(o,a)=>{n.append(o,a)}),i.on("file",(o,a,c,g,l)=>{let u=[];if(g==="base64"||g.toLowerCase()==="base64"){let E="";a.on("data",h=>{E+=h.toString().replace(/[\r\n]/gm,"");let d=E.length-E.length%4;u.push(Buffer.from(E.slice(0,d),"base64")),E=E.slice(d)}),a.on("end",()=>{u.push(Buffer.from(E,"base64")),n.append(o,new ip(u,c,{type:l}))})}else a.on("data",E=>{u.push(E)}),a.on("end",()=>{n.append(o,new ip(u,c,{type:l}))})});let s=new Promise((o,a)=>{i.on("finish",o),i.on("error",c=>a(new TypeError(c)))});if(this.body!==null)for await(let o of sp(this[Ht].body))i.write(o);return i.end(),await s,n}else if(/application\/x-www-form-urlencoded/.test(t)){let r;try{let i="",s=new TextDecoder("utf-8",{ignoreBOM:!0});for await(let o of sp(this[Ht].body)){if(!ap(o))throw new TypeError("Expected Uint8Array chunk");i+=s.decode(o,{stream:!0})}i+=s.decode(),r=new URLSearchParams(i)}catch(i){throw Object.assign(new TypeError,{cause:i})}let n=new np;for(let[i,s]of r)n.append(i,s);return n}else throw await Promise.resolve(),zu(this[Ht]),Zu.errors.exception({header:`${e.name}.formData`,message:"Could not parse content as FormData."})}}}function AT(e){Object.assign(e.prototype,eT(e))}async function sc(e,A,t){if(Zu.brandCheck(e,t),zu(e[Ht]),tT(e[Ht].body))throw new TypeError("Body is unusable");let r=JU(),n=s=>r.reject(s),i=s=>{try{r.resolve(A(s))}catch(o){n(o)}};return e[Ht].body==null?(i(new Uint8Array),r.promise):(await YU(e[Ht].body,i,n),r.promise)}function tT(e){return e!=null&&(e.stream.locked||zn.isDisturbed(e.stream))}function gp(e){return e.length===0?"":(e[0]===239&&e[1]===187&&e[2]===191&&(e=e.subarray(3)),XU.decode(e))}function rT(e){return JSON.parse(gp(e))}function nT(e){let{headersList:A}=e[Ht],t=A.get("content-type");return t===null?"failure":KU(t)}lp.exports={extractBody:cp,safelyExtractBody:zU,cloneBody:$U,mixinBody:AT}});var dp=Q((L4,hp)=>{"use strict";var{InvalidArgumentError:Qe,NotSupportedError:iT}=le(),Wt=require("assert"),{kHTTP2BuildRequest:sT,kHTTP2CopyHeaders:oT,kHTTP1BuildRequest:aT}=de(),QA=W(),up=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/,Ep=/[^\t\x20-\x7e\x80-\xff]/,cT=/[^\u0021-\u00ff]/,et=Symbol("handler"),Te={},$u;try{let e=require("diagnostics_channel");Te.create=e.channel("undici:request:create"),Te.bodySent=e.channel("undici:request:bodySent"),Te.headers=e.channel("undici:request:headers"),Te.trailers=e.channel("undici:request:trailers"),Te.error=e.channel("undici:request:error")}catch{Te.create={hasSubscribers:!1},Te.bodySent={hasSubscribers:!1},Te.headers={hasSubscribers:!1},Te.trailers={hasSubscribers:!1},Te.error={hasSubscribers:!1}}var eE=class e{constructor(A,{path:t,method:r,body:n,headers:i,query:s,idempotent:o,blocking:a,upgrade:c,headersTimeout:g,bodyTimeout:l,reset:u,throwOnError:E,expectContinue:h},d){if(typeof t!="string")throw new Qe("path must be a string");if(t[0]!=="/"&&!(t.startsWith("http://")||t.startsWith("https://"))&&r!=="CONNECT")throw new Qe("path must be an absolute URL or start with a slash");if(cT.exec(t)!==null)throw new Qe("invalid request path");if(typeof r!="string")throw new Qe("method must be a string");if(up.exec(r)===null)throw new Qe("invalid request method");if(c&&typeof c!="string")throw new Qe("upgrade must be a string");if(g!=null&&(!Number.isFinite(g)||g<0))throw new Qe("invalid headersTimeout");if(l!=null&&(!Number.isFinite(l)||l<0))throw new Qe("invalid bodyTimeout");if(u!=null&&typeof u!="boolean")throw new Qe("invalid reset");if(h!=null&&typeof h!="boolean")throw new Qe("invalid expectContinue");if(this.headersTimeout=g,this.bodyTimeout=l,this.throwOnError=E===!0,this.method=r,this.abort=null,n==null)this.body=null;else if(QA.isStream(n)){this.body=n;let C=this.body._readableState;(!C||!C.autoDestroy)&&(this.endHandler=function(){QA.destroy(this)},this.body.on("end",this.endHandler)),this.errorHandler=I=>{this.abort?this.abort(I):this.error=I},this.body.on("error",this.errorHandler)}else if(QA.isBuffer(n))this.body=n.byteLength?n:null;else if(ArrayBuffer.isView(n))this.body=n.buffer.byteLength?Buffer.from(n.buffer,n.byteOffset,n.byteLength):null;else if(n instanceof ArrayBuffer)this.body=n.byteLength?Buffer.from(n):null;else if(typeof n=="string")this.body=n.length?Buffer.from(n):null;else if(QA.isFormDataLike(n)||QA.isIterable(n)||QA.isBlobLike(n))this.body=n;else throw new Qe("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=c||null,this.path=s?QA.buildURL(t,s):t,this.origin=A,this.idempotent=o??(r==="HEAD"||r==="GET"),this.blocking=a??!1,this.reset=u??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers="",this.expectContinue=h??!1,Array.isArray(i)){if(i.length%2!==0)throw new Qe("headers array must be even");for(let C=0;C{"use strict";var gT=require("events"),AE=class extends gT{dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}};Qp.exports=AE});var Ns=Q((T4,Cp)=>{"use strict";var lT=oc(),{ClientDestroyedError:tE,ClientClosedError:uT,InvalidArgumentError:$n}=le(),{kDestroy:ET,kClose:hT,kDispatch:rE,kInterceptors:Hr}=de(),ei=Symbol("destroyed"),Fs=Symbol("closed"),_t=Symbol("onDestroyed"),Ai=Symbol("onClosed"),ac=Symbol("Intercepted Dispatch"),nE=class extends lT{constructor(){super(),this[ei]=!1,this[_t]=null,this[Fs]=!1,this[Ai]=[]}get destroyed(){return this[ei]}get closed(){return this[Fs]}get interceptors(){return this[Hr]}set interceptors(A){if(A){for(let t=A.length-1;t>=0;t--)if(typeof this[Hr][t]!="function")throw new $n("interceptor must be an function")}this[Hr]=A}close(A){if(A===void 0)return new Promise((r,n)=>{this.close((i,s)=>i?n(i):r(s))});if(typeof A!="function")throw new $n("invalid callback");if(this[ei]){queueMicrotask(()=>A(new tE,null));return}if(this[Fs]){this[Ai]?this[Ai].push(A):queueMicrotask(()=>A(null,null));return}this[Fs]=!0,this[Ai].push(A);let t=()=>{let r=this[Ai];this[Ai]=null;for(let n=0;nthis.destroy()).then(()=>{queueMicrotask(t)})}destroy(A,t){if(typeof A=="function"&&(t=A,A=null),t===void 0)return new Promise((n,i)=>{this.destroy(A,(s,o)=>s?i(s):n(o))});if(typeof t!="function")throw new $n("invalid callback");if(this[ei]){this[_t]?this[_t].push(t):queueMicrotask(()=>t(null,null));return}A||(A=new tE),this[ei]=!0,this[_t]=this[_t]||[],this[_t].push(t);let r=()=>{let n=this[_t];this[_t]=null;for(let i=0;i{queueMicrotask(r)})}[ac](A,t){if(!this[Hr]||this[Hr].length===0)return this[ac]=this[rE],this[rE](A,t);let r=this[rE].bind(this);for(let n=this[Hr].length-1;n>=0;n--)r=this[Hr][n](r);return this[ac]=r,r(A,t)}dispatch(A,t){if(!t||typeof t!="object")throw new $n("handler must be an object");try{if(!A||typeof A!="object")throw new $n("opts must be an object.");if(this[ei]||this[_t])throw new tE;if(this[Fs])throw new uT;return this[ac](A,t)}catch(r){if(typeof t.onError!="function")throw new $n("invalid onError method");return t.onError(r),!1}}};Cp.exports=nE});var xs=Q((P4,Bp)=>{"use strict";var dT=require("net"),fp=require("assert"),Ip=W(),{InvalidArgumentError:QT,ConnectTimeoutError:CT}=le(),iE,sE;global.FinalizationRegistry&&!process.env.NODE_V8_COVERAGE?sE=class{constructor(A){this._maxCachedSessions=A,this._sessionCache=new Map,this._sessionRegistry=new global.FinalizationRegistry(t=>{if(this._sessionCache.size=this._maxCachedSessions){let{value:r}=this._sessionCache.keys().next();this._sessionCache.delete(r)}this._sessionCache.set(A,t)}}};function fT({allowH2:e,maxCachedSessions:A,socketPath:t,timeout:r,...n}){if(A!=null&&(!Number.isInteger(A)||A<0))throw new QT("maxCachedSessions must be a positive integer or zero");let i={path:t,...n},s=new sE(A??100);return r=r??1e4,e=e??!1,function({hostname:a,host:c,protocol:g,port:l,servername:u,localAddress:E,httpSocket:h},d){let C;if(g==="https:"){iE||(iE=require("tls")),u=u||i.servername||Ip.getServerName(c)||null;let p=u||a,w=s.get(p)||null;fp(p),C=iE.connect({highWaterMark:16384,...i,servername:u,session:w,localAddress:E,ALPNProtocols:e?["http/1.1","h2"]:["http/1.1"],socket:h,port:l||443,host:a}),C.on("session",function(m){s.set(p,m)})}else fp(!h,"httpSocket can only be sent on TLS update"),C=dT.connect({highWaterMark:64*1024,...i,localAddress:E,port:l||80,host:a});if(i.keepAlive==null||i.keepAlive){let p=i.keepAliveInitialDelay===void 0?6e4:i.keepAliveInitialDelay;C.setKeepAlive(!0,p)}let I=IT(()=>BT(C),r);return C.setNoDelay(!0).once(g==="https:"?"secureConnect":"connect",function(){if(I(),d){let p=d;d=null,p(null,this)}}).on("error",function(p){if(I(),d){let w=d;d=null,w(p)}}),C}}function IT(e,A){if(!A)return()=>{};let t=null,r=null,n=setTimeout(()=>{t=setImmediate(()=>{process.platform==="win32"?r=setImmediate(()=>e()):e()})},A);return()=>{clearTimeout(n),clearImmediate(t),clearImmediate(r)}}function BT(e){Ip.destroy(e,new CT)}Bp.exports=fT});var pp=Q(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.enumToMap=void 0;function pT(e){let A={};return Object.keys(e).forEach(t=>{let r=e[t];typeof r=="number"&&(A[t]=r)}),A}cc.enumToMap=pT});var mp=Q(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.SPECIAL_HEADERS=y.HEADER_STATE=y.MINOR=y.MAJOR=y.CONNECTION_TOKEN_CHARS=y.HEADER_CHARS=y.TOKEN=y.STRICT_TOKEN=y.HEX=y.URL_CHAR=y.STRICT_URL_CHAR=y.USERINFO_CHARS=y.MARK=y.ALPHANUM=y.NUM=y.HEX_MAP=y.NUM_MAP=y.ALPHA=y.FINISH=y.H_METHOD_MAP=y.METHOD_MAP=y.METHODS_RTSP=y.METHODS_ICE=y.METHODS_HTTP=y.METHODS=y.LENIENT_FLAGS=y.FLAGS=y.TYPE=y.ERROR=void 0;var mT=pp(),yT;(function(e){e[e.OK=0]="OK",e[e.INTERNAL=1]="INTERNAL",e[e.STRICT=2]="STRICT",e[e.LF_EXPECTED=3]="LF_EXPECTED",e[e.UNEXPECTED_CONTENT_LENGTH=4]="UNEXPECTED_CONTENT_LENGTH",e[e.CLOSED_CONNECTION=5]="CLOSED_CONNECTION",e[e.INVALID_METHOD=6]="INVALID_METHOD",e[e.INVALID_URL=7]="INVALID_URL",e[e.INVALID_CONSTANT=8]="INVALID_CONSTANT",e[e.INVALID_VERSION=9]="INVALID_VERSION",e[e.INVALID_HEADER_TOKEN=10]="INVALID_HEADER_TOKEN",e[e.INVALID_CONTENT_LENGTH=11]="INVALID_CONTENT_LENGTH",e[e.INVALID_CHUNK_SIZE=12]="INVALID_CHUNK_SIZE",e[e.INVALID_STATUS=13]="INVALID_STATUS",e[e.INVALID_EOF_STATE=14]="INVALID_EOF_STATE",e[e.INVALID_TRANSFER_ENCODING=15]="INVALID_TRANSFER_ENCODING",e[e.CB_MESSAGE_BEGIN=16]="CB_MESSAGE_BEGIN",e[e.CB_HEADERS_COMPLETE=17]="CB_HEADERS_COMPLETE",e[e.CB_MESSAGE_COMPLETE=18]="CB_MESSAGE_COMPLETE",e[e.CB_CHUNK_HEADER=19]="CB_CHUNK_HEADER",e[e.CB_CHUNK_COMPLETE=20]="CB_CHUNK_COMPLETE",e[e.PAUSED=21]="PAUSED",e[e.PAUSED_UPGRADE=22]="PAUSED_UPGRADE",e[e.PAUSED_H2_UPGRADE=23]="PAUSED_H2_UPGRADE",e[e.USER=24]="USER"})(yT=y.ERROR||(y.ERROR={}));var wT;(function(e){e[e.BOTH=0]="BOTH",e[e.REQUEST=1]="REQUEST",e[e.RESPONSE=2]="RESPONSE"})(wT=y.TYPE||(y.TYPE={}));var RT;(function(e){e[e.CONNECTION_KEEP_ALIVE=1]="CONNECTION_KEEP_ALIVE",e[e.CONNECTION_CLOSE=2]="CONNECTION_CLOSE",e[e.CONNECTION_UPGRADE=4]="CONNECTION_UPGRADE",e[e.CHUNKED=8]="CHUNKED",e[e.UPGRADE=16]="UPGRADE",e[e.CONTENT_LENGTH=32]="CONTENT_LENGTH",e[e.SKIPBODY=64]="SKIPBODY",e[e.TRAILING=128]="TRAILING",e[e.TRANSFER_ENCODING=512]="TRANSFER_ENCODING"})(RT=y.FLAGS||(y.FLAGS={}));var DT;(function(e){e[e.HEADERS=1]="HEADERS",e[e.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",e[e.KEEP_ALIVE=4]="KEEP_ALIVE"})(DT=y.LENIENT_FLAGS||(y.LENIENT_FLAGS={}));var S;(function(e){e[e.DELETE=0]="DELETE",e[e.GET=1]="GET",e[e.HEAD=2]="HEAD",e[e.POST=3]="POST",e[e.PUT=4]="PUT",e[e.CONNECT=5]="CONNECT",e[e.OPTIONS=6]="OPTIONS",e[e.TRACE=7]="TRACE",e[e.COPY=8]="COPY",e[e.LOCK=9]="LOCK",e[e.MKCOL=10]="MKCOL",e[e.MOVE=11]="MOVE",e[e.PROPFIND=12]="PROPFIND",e[e.PROPPATCH=13]="PROPPATCH",e[e.SEARCH=14]="SEARCH",e[e.UNLOCK=15]="UNLOCK",e[e.BIND=16]="BIND",e[e.REBIND=17]="REBIND",e[e.UNBIND=18]="UNBIND",e[e.ACL=19]="ACL",e[e.REPORT=20]="REPORT",e[e.MKACTIVITY=21]="MKACTIVITY",e[e.CHECKOUT=22]="CHECKOUT",e[e.MERGE=23]="MERGE",e[e["M-SEARCH"]=24]="M-SEARCH",e[e.NOTIFY=25]="NOTIFY",e[e.SUBSCRIBE=26]="SUBSCRIBE",e[e.UNSUBSCRIBE=27]="UNSUBSCRIBE",e[e.PATCH=28]="PATCH",e[e.PURGE=29]="PURGE",e[e.MKCALENDAR=30]="MKCALENDAR",e[e.LINK=31]="LINK",e[e.UNLINK=32]="UNLINK",e[e.SOURCE=33]="SOURCE",e[e.PRI=34]="PRI",e[e.DESCRIBE=35]="DESCRIBE",e[e.ANNOUNCE=36]="ANNOUNCE",e[e.SETUP=37]="SETUP",e[e.PLAY=38]="PLAY",e[e.PAUSE=39]="PAUSE",e[e.TEARDOWN=40]="TEARDOWN",e[e.GET_PARAMETER=41]="GET_PARAMETER",e[e.SET_PARAMETER=42]="SET_PARAMETER",e[e.REDIRECT=43]="REDIRECT",e[e.RECORD=44]="RECORD",e[e.FLUSH=45]="FLUSH"})(S=y.METHODS||(y.METHODS={}));y.METHODS_HTTP=[S.DELETE,S.GET,S.HEAD,S.POST,S.PUT,S.CONNECT,S.OPTIONS,S.TRACE,S.COPY,S.LOCK,S.MKCOL,S.MOVE,S.PROPFIND,S.PROPPATCH,S.SEARCH,S.UNLOCK,S.BIND,S.REBIND,S.UNBIND,S.ACL,S.REPORT,S.MKACTIVITY,S.CHECKOUT,S.MERGE,S["M-SEARCH"],S.NOTIFY,S.SUBSCRIBE,S.UNSUBSCRIBE,S.PATCH,S.PURGE,S.MKCALENDAR,S.LINK,S.UNLINK,S.PRI,S.SOURCE];y.METHODS_ICE=[S.SOURCE];y.METHODS_RTSP=[S.OPTIONS,S.DESCRIBE,S.ANNOUNCE,S.SETUP,S.PLAY,S.PAUSE,S.TEARDOWN,S.GET_PARAMETER,S.SET_PARAMETER,S.REDIRECT,S.RECORD,S.FLUSH,S.GET,S.POST];y.METHOD_MAP=mT.enumToMap(S);y.H_METHOD_MAP={};Object.keys(y.METHOD_MAP).forEach(e=>{/^H/.test(e)&&(y.H_METHOD_MAP[e]=y.METHOD_MAP[e])});var bT;(function(e){e[e.SAFE=0]="SAFE",e[e.SAFE_WITH_CB=1]="SAFE_WITH_CB",e[e.UNSAFE=2]="UNSAFE"})(bT=y.FINISH||(y.FINISH={}));y.ALPHA=[];for(let e=65;e<=90;e++)y.ALPHA.push(String.fromCharCode(e)),y.ALPHA.push(String.fromCharCode(e+32));y.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};y.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};y.NUM=["0","1","2","3","4","5","6","7","8","9"];y.ALPHANUM=y.ALPHA.concat(y.NUM);y.MARK=["-","_",".","!","~","*","'","(",")"];y.USERINFO_CHARS=y.ALPHANUM.concat(y.MARK).concat(["%",";",":","&","=","+","$",","]);y.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(y.ALPHANUM);y.URL_CHAR=y.STRICT_URL_CHAR.concat([" ","\f"]);for(let e=128;e<=255;e++)y.URL_CHAR.push(e);y.HEX=y.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);y.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(y.ALPHANUM);y.TOKEN=y.STRICT_TOKEN.concat([" "]);y.HEADER_CHARS=[" "];for(let e=32;e<=255;e++)e!==127&&y.HEADER_CHARS.push(e);y.CONNECTION_TOKEN_CHARS=y.HEADER_CHARS.filter(e=>e!==44);y.MAJOR=y.NUM_MAP;y.MINOR=y.MAJOR;var ti;(function(e){e[e.GENERAL=0]="GENERAL",e[e.CONNECTION=1]="CONNECTION",e[e.CONTENT_LENGTH=2]="CONTENT_LENGTH",e[e.TRANSFER_ENCODING=3]="TRANSFER_ENCODING",e[e.UPGRADE=4]="UPGRADE",e[e.CONNECTION_KEEP_ALIVE=5]="CONNECTION_KEEP_ALIVE",e[e.CONNECTION_CLOSE=6]="CONNECTION_CLOSE",e[e.CONNECTION_UPGRADE=7]="CONNECTION_UPGRADE",e[e.TRANSFER_ENCODING_CHUNKED=8]="TRANSFER_ENCODING_CHUNKED"})(ti=y.HEADER_STATE||(y.HEADER_STATE={}));y.SPECIAL_HEADERS={connection:ti.CONNECTION,"content-length":ti.CONTENT_LENGTH,"proxy-connection":ti.CONNECTION,"transfer-encoding":ti.TRANSFER_ENCODING,upgrade:ti.UPGRADE}});var cE=Q((Y4,Rp)=>{"use strict";var jt=W(),{kBodyUsed:Ls}=de(),aE=require("assert"),{InvalidArgumentError:kT}=le(),ST=require("events"),FT=[300,301,302,303,307,308],yp=Symbol("body"),gc=class{constructor(A){this[yp]=A,this[Ls]=!1}async*[Symbol.asyncIterator](){aE(!this[Ls],"disturbed"),this[Ls]=!0,yield*this[yp]}},oE=class{constructor(A,t,r,n){if(t!=null&&(!Number.isInteger(t)||t<0))throw new kT("maxRedirections must be a positive number");jt.validateHandler(n,r.method,r.upgrade),this.dispatch=A,this.location=null,this.abort=null,this.opts={...r,maxRedirections:0},this.maxRedirections=t,this.handler=n,this.history=[],jt.isStream(this.opts.body)?(jt.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){aE(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[Ls]=!1,ST.prototype.on.call(this.opts.body,"data",function(){this[Ls]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new gc(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&jt.isIterable(this.opts.body)&&(this.opts.body=new gc(this.opts.body))}onConnect(A){this.abort=A,this.handler.onConnect(A,{history:this.history})}onUpgrade(A,t,r){this.handler.onUpgrade(A,t,r)}onError(A){this.handler.onError(A)}onHeaders(A,t,r,n){if(this.location=this.history.length>=this.maxRedirections||jt.isDisturbed(this.opts.body)?null:NT(A,t),this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location)return this.handler.onHeaders(A,t,r,n);let{origin:i,pathname:s,search:o}=jt.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),a=o?`${s}${o}`:s;this.opts.headers=xT(this.opts.headers,A===303,this.opts.origin!==i),this.opts.path=a,this.opts.origin=i,this.opts.maxRedirections=0,this.opts.query=null,A===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",this.opts.body=null)}onData(A){if(!this.location)return this.handler.onData(A)}onComplete(A){this.location?(this.location=null,this.abort=null,this.dispatch(this.opts,this)):this.handler.onComplete(A)}onBodySent(A){this.handler.onBodySent&&this.handler.onBodySent(A)}};function NT(e,A){if(FT.indexOf(e)===-1)return null;for(let t=0;t{"use strict";var LT=cE();function UT({maxRedirections:e}){return A=>function(r,n){let{maxRedirections:i=e}=r;if(!i)return A(r,n);let s=new LT(A,i,r,n);return r={...r,maxRedirections:0},A(r,s)}}Dp.exports=UT});var gE=Q((q4,bp)=>{"use strict";bp.exports="AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQ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kACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY4BjwGQAZEBlAG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ICIREM5QELQgMhEQzkAQtCBCERDOMBC0IFIREM4gELQgYhEQzhAQtCByERDOABC0IIIREM3wELQgkhEQzeAQtCCiERDN0BC0ILIREM3AELQgwhEQzbAQtCDSERDNoBC0IOIREM2QELQg8hEQzYAQtCCiERDNcBC0ILIREM1gELQgwhEQzVAQtCDSERDNQBC0IOIREM0wELQg8hEQzSAQtCACERAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQLQAAQVBqDjflAeQBAAECAwQFBgfmAeYB5gHmAeYB5gHmAQgJCgsMDeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gEODxAREhPmAQtCAiERDOQBC0IDIREM4wELQgQhEQziAQtCBSERDOEBC0IGIREM4AELQgchEQzfAQtCCCERDN4BC0IJIREM3QELQgohEQzcAQtCCyERDNsBC0IMIREM2gELQg0hEQzZAQtCDiERDNgBC0IPIREM1wELQgohEQzWAQtCCyERDNUBC0IMIREM1AELQg0hEQzTAQtCDiERDNIBC0IPIREM0QELIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN0gFBHyEQDMADCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEkIRAMpwMLQSAhEAy/AwsgACABIhAgAhC+gICAAEF/ag4FtgEAxQIB0QHSAQtBESEQDKQDCyAAQQE6AC8gECEBDLsDCyABIgEgAkcN0gFBJCEQDLsDCyABIg0gAkcNHkHGACEQDLoDCyAAIAEiASACELKAgIAAIhAN1AEgASEBDLUBCyABIhAgAkcNJkHQACEQDLgDCwJAIAEiASACRw0AQSghEAy4AwsgAEEANgIEIABBjICAgAA2AgggACABIAEQsYCAgAAiEA3TASABIQEM2AELAkAgASIQIAJHDQBBKSEQDLcDCyAQLQAAIgFBIEYNFCABQQlHDdMBIBBBAWohAQwVCwJAIAEiASACRg0AIAFBAWohAQwXC0EqIRAMtQMLAkAgASIQ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BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2Ag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KEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob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BIRAMIQtBpAEhEAwgC0GlASEQDB8LQaYBIRAMHgtBpwEhEAwdC0GoASEQDBwLQakBIRAMGwtBqgEhEAwaC0GrASEQDBkLQawBIRAMGAtBrQEhEAwXC0GuASEQDBYLQQEhEAwVC0GvASEQDBQLQbABIRAMEwtBsQEhEAwSC0GzASEQDBELQbIBIRAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQA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AM+QMLIAEiASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQA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AgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEI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SQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=="});var Js=Q((H4,jp)=>{"use strict";var D=require("assert"),xp=require("net"),TT=require("http"),{pipeline:MT}=require("stream"),k=W(),lE=HI(),EE=dp(),vT=Ns(),{RequestContentLengthMismatchError:Kt,ResponseContentLengthMismatchError:PT,InvalidArgumentError:Ue,RequestAbortedError:pE,HeadersTimeoutError:GT,HeadersOverflowError:JT,SocketError:ni,InformationalError:yt,BodyTimeoutError:YT,HTTPParserError:VT,ResponseExceededMaxSizeError:qT,ClientDestroyedError:OT}=le(),HT=xs(),{kUrl:Ke,kReset:sA,kServerName:yr,kClient:wt,kBusy:hE,kParser:Se,kConnect:WT,kBlocking:ii,kResuming:Wr,kRunning:be,kPending:jr,kSize:_r,kWriting:Zt,kQueue:Ie,kConnected:_T,kConnecting:ri,kNeedDrain:Rr,kNoRef:Us,kKeepAliveDefaultTimeout:dE,kHostHeader:Lp,kPendingIdx:DA,kRunningIdx:Be,kError:Ze,kPipelining:Dr,kSocket:Fe,kKeepAliveTimeoutValue:vs,kMaxHeadersSize:hc,kKeepAliveMaxTimeout:Up,kKeepAliveTimeoutThreshold:Tp,kHeadersTimeout:Mp,kBodyTimeout:vp,kStrictContentLength:Ps,kConnector:Ts,kMaxRedirections:jT,kMaxRequests:Gs,kCounter:Pp,kClose:KT,kDestroy:ZT,kDispatch:XT,kInterceptors:zT,kLocalAddress:Ms,kMaxResponseSize:Gp,kHTTPConnVersion:Rt,kHost:Jp,kHTTP2Session:bA,kHTTP2SessionState:Qc,kHTTP2BuildRequest:$T,kHTTP2CopyHeaders:eM,kHTTP1BuildRequest:AM}=de(),Cc;try{Cc=require("http2")}catch{Cc={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:tM,HTTP2_HEADER_METHOD:rM,HTTP2_HEADER_PATH:nM,HTTP2_HEADER_SCHEME:iM,HTTP2_HEADER_CONTENT_LENGTH:sM,HTTP2_HEADER_EXPECT:oM,HTTP2_HEADER_STATUS:aM}}=Cc,Fp=!1,uc=Buffer[Symbol.species],wr=Symbol("kClosedResolve"),eA={};try{let e=require("diagnostics_channel");eA.sendHeaders=e.channel("undici:client:sendHeaders"),eA.beforeConnect=e.channel("undici:client:beforeConnect"),eA.connectError=e.channel("undici:client:connectError"),eA.connected=e.channel("undici:client:connected")}catch{eA.sendHeaders={hasSubscribers:!1},eA.beforeConnect={hasSubscribers:!1},eA.connectError={hasSubscribers:!1},eA.connected={hasSubscribers:!1}}var QE=class extends vT{constructor(A,{interceptors:t,maxHeaderSize:r,headersTimeout:n,socketTimeout:i,requestTimeout:s,connectTimeout:o,bodyTimeout:a,idleTimeout:c,keepAlive:g,keepAliveTimeout:l,maxKeepAliveTimeout:u,keepAliveMaxTimeout:E,keepAliveTimeoutThreshold:h,socketPath:d,pipelining:C,tls:I,strictContentLength:p,maxCachedSessions:w,maxRedirections:m,connect:K,maxRequestsPerClient:H,localAddress:ne,maxResponseSize:q,autoSelectFamily:ae,autoSelectFamilyAttemptTimeout:De,allowH2:ee,maxConcurrentStreams:Y}={}){if(super(),g!==void 0)throw new Ue("unsupported keepAlive, use pipelining=0 instead");if(i!==void 0)throw new Ue("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new Ue("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new Ue("unsupported idleTimeout, use keepAliveTimeout instead");if(u!==void 0)throw new Ue("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null&&!Number.isFinite(r))throw new Ue("invalid maxHeaderSize");if(d!=null&&typeof d!="string")throw new Ue("invalid socketPath");if(o!=null&&(!Number.isFinite(o)||o<0))throw new Ue("invalid connectTimeout");if(l!=null&&(!Number.isFinite(l)||l<=0))throw new Ue("invalid keepAliveTimeout");if(E!=null&&(!Number.isFinite(E)||E<=0))throw new Ue("invalid keepAliveMaxTimeout");if(h!=null&&!Number.isFinite(h))throw new Ue("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new Ue("headersTimeout must be a positive integer or zero");if(a!=null&&(!Number.isInteger(a)||a<0))throw new Ue("bodyTimeout must be a positive integer or zero");if(K!=null&&typeof K!="function"&&typeof K!="object")throw new Ue("connect must be a function or an object");if(m!=null&&(!Number.isInteger(m)||m<0))throw new Ue("maxRedirections must be a positive number");if(H!=null&&(!Number.isInteger(H)||H<0))throw new Ue("maxRequestsPerClient must be a positive number");if(ne!=null&&(typeof ne!="string"||xp.isIP(ne)===0))throw new Ue("localAddress must be valid string IP address");if(q!=null&&(!Number.isInteger(q)||q<-1))throw new Ue("maxResponseSize must be a positive number");if(De!=null&&(!Number.isInteger(De)||De<-1))throw new Ue("autoSelectFamilyAttemptTimeout must be a positive number");if(ee!=null&&typeof ee!="boolean")throw new Ue("allowH2 must be a valid boolean value");if(Y!=null&&(typeof Y!="number"||Y<1))throw new Ue("maxConcurrentStreams must be a possitive integer, greater than 0");typeof K!="function"&&(K=HT({...I,maxCachedSessions:w,allowH2:ee,socketPath:d,timeout:o,...k.nodeHasAutoSelectFamily&&ae?{autoSelectFamily:ae,autoSelectFamilyAttemptTimeout:De}:void 0,...K})),this[zT]=t&&t.Client&&Array.isArray(t.Client)?t.Client:[EM({maxRedirections:m})],this[Ke]=k.parseOrigin(A),this[Ts]=K,this[Fe]=null,this[Dr]=C??1,this[hc]=r||TT.maxHeaderSize,this[dE]=l??4e3,this[Up]=E??6e5,this[Tp]=h??1e3,this[vs]=this[dE],this[yr]=null,this[Ms]=ne??null,this[Wr]=0,this[Rr]=0,this[Lp]=`host: ${this[Ke].hostname}${this[Ke].port?`:${this[Ke].port}`:""}\r -`,this[vp]=a??3e5,this[Mp]=n??3e5,this[Ps]=p??!0,this[jT]=m,this[Gs]=H,this[wr]=null,this[Gp]=q>-1?q:-1,this[Rt]="h1",this[bA]=null,this[Qc]=ee?{openStreams:0,maxConcurrentStreams:Y??100}:null,this[Jp]=`${this[Ke].hostname}${this[Ke].port?`:${this[Ke].port}`:""}`,this[Ie]=[],this[Be]=0,this[DA]=0}get pipelining(){return this[Dr]}set pipelining(A){this[Dr]=A,kA(this,!0)}get[jr](){return this[Ie].length-this[DA]}get[be](){return this[DA]-this[Be]}get[_r](){return this[Ie].length-this[Be]}get[_T](){return!!this[Fe]&&!this[ri]&&!this[Fe].destroyed}get[hE](){let A=this[Fe];return A&&(A[sA]||A[Zt]||A[ii])||this[_r]>=(this[Dr]||1)||this[jr]>0}[WT](A){Op(this),this.once("connect",A)}[XT](A,t){let r=A.origin||this[Ke].origin,n=this[Rt]==="h2"?EE[$T](r,A,t):EE[AM](r,A,t);return this[Ie].push(n),this[Wr]||(k.bodyLength(n.body)==null&&k.isIterable(n.body)?(this[Wr]=1,process.nextTick(kA,this)):kA(this,!0)),this[Wr]&&this[Rr]!==2&&this[hE]&&(this[Rr]=2),this[Rr]<2}async[KT](){return new Promise(A=>{this[_r]?this[wr]=A:A(null)})}async[ZT](A){return new Promise(t=>{let r=this[Ie].splice(this[DA]);for(let i=0;i{this[wr]&&(this[wr](),this[wr]=null),t()};this[bA]!=null&&(k.destroy(this[bA],A),this[bA]=null,this[Qc]=null),this[Fe]?k.destroy(this[Fe].on("close",n),A):queueMicrotask(n),kA(this)})}};function cM(e){D(e.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Fe][Ze]=e,Bc(this[wt],e)}function gM(e,A,t){let r=new yt(`HTTP/2: "frameError" received - type ${e}, code ${A}`);t===0&&(this[Fe][Ze]=r,Bc(this[wt],r))}function lM(){k.destroy(this,new ni("other side closed")),k.destroy(this[Fe],new ni("other side closed"))}function uM(e){let A=this[wt],t=new yt(`HTTP/2: "GOAWAY" frame received with code ${e}`);if(A[Fe]=null,A[bA]=null,A.destroyed){D(this[jr]===0);let r=A[Ie].splice(A[Be]);for(let n=0;n0){let r=A[Ie][A[Be]];A[Ie][A[Be]++]=null,oA(A,r,t)}A[DA]=A[Be],D(A[be]===0),A.emit("disconnect",A[Ke],[A],t),kA(A)}var Bt=mp(),EM=lc(),hM=Buffer.alloc(0);async function dM(){let e=process.env.JEST_WORKER_ID?gE():void 0,A;try{A=await WebAssembly.compile(Buffer.from(Sp(),"base64"))}catch{A=await WebAssembly.compile(Buffer.from(e||gE(),"base64"))}return await WebAssembly.instantiate(A,{env:{wasm_on_url:(t,r,n)=>0,wasm_on_status:(t,r,n)=>{D.strictEqual(Ge.ptr,t);let i=r-mt+pt.byteOffset;return Ge.onStatus(new uc(pt.buffer,i,n))||0},wasm_on_message_begin:t=>(D.strictEqual(Ge.ptr,t),Ge.onMessageBegin()||0),wasm_on_header_field:(t,r,n)=>{D.strictEqual(Ge.ptr,t);let i=r-mt+pt.byteOffset;return Ge.onHeaderField(new uc(pt.buffer,i,n))||0},wasm_on_header_value:(t,r,n)=>{D.strictEqual(Ge.ptr,t);let i=r-mt+pt.byteOffset;return Ge.onHeaderValue(new uc(pt.buffer,i,n))||0},wasm_on_headers_complete:(t,r,n,i)=>(D.strictEqual(Ge.ptr,t),Ge.onHeadersComplete(r,!!n,!!i)||0),wasm_on_body:(t,r,n)=>{D.strictEqual(Ge.ptr,t);let i=r-mt+pt.byteOffset;return Ge.onBody(new uc(pt.buffer,i,n))||0},wasm_on_message_complete:t=>(D.strictEqual(Ge.ptr,t),Ge.onMessageComplete()||0)}})}var uE=null,CE=dM();CE.catch();var Ge=null,pt=null,Ec=0,mt=null,si=1,dc=2,fE=3,IE=class{constructor(A,t,{exports:r}){D(Number.isFinite(A[hc])&&A[hc]>0),this.llhttp=r,this.ptr=this.llhttp.llhttp_alloc(Bt.TYPE.RESPONSE),this.client=A,this.socket=t,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=A[hc],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=A[Gp]}setTimeout(A,t){this.timeoutType=t,A!==this.timeoutValue?(lE.clearTimeout(this.timeout),A?(this.timeout=lE.setTimeout(QM,A,this),this.timeout.unref&&this.timeout.unref()):this.timeout=null,this.timeoutValue=A):this.timeout&&this.timeout.refresh&&this.timeout.refresh()}resume(){this.socket.destroyed||!this.paused||(D(this.ptr!=null),D(Ge==null),this.llhttp.llhttp_resume(this.ptr),D(this.timeoutType===dc),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||hM),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let A=this.socket.read();if(A===null)break;this.execute(A)}}execute(A){D(this.ptr!=null),D(Ge==null),D(!this.paused);let{socket:t,llhttp:r}=this;A.length>Ec&&(mt&&r.free(mt),Ec=Math.ceil(A.length/4096)*4096,mt=r.malloc(Ec)),new Uint8Array(r.memory.buffer,mt,Ec).set(A);try{let n;try{pt=A,Ge=this,n=r.llhttp_execute(this.ptr,mt,A.length)}catch(s){throw s}finally{Ge=null,pt=null}let i=r.llhttp_get_error_pos(this.ptr)-mt;if(n===Bt.ERROR.PAUSED_UPGRADE)this.onUpgrade(A.slice(i));else if(n===Bt.ERROR.PAUSED)this.paused=!0,t.unshift(A.slice(i));else if(n!==Bt.ERROR.OK){let s=r.llhttp_get_error_reason(this.ptr),o="";if(s){let a=new Uint8Array(r.memory.buffer,s).indexOf(0);o="Response does not match the HTTP/1.1 protocol ("+Buffer.from(r.memory.buffer,s,a).toString()+")"}throw new VT(o,Bt.ERROR[n],A.slice(i))}}catch(n){k.destroy(t,n)}}destroy(){D(this.ptr!=null),D(Ge==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,lE.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(A){this.statusText=A.toString()}onMessageBegin(){let{socket:A,client:t}=this;if(A.destroyed||!t[Ie][t[Be]])return-1}onHeaderField(A){let t=this.headers.length;t&1?this.headers[t-1]=Buffer.concat([this.headers[t-1],A]):this.headers.push(A),this.trackHeader(A.length)}onHeaderValue(A){let t=this.headers.length;(t&1)===1?(this.headers.push(A),t+=1):this.headers[t-1]=Buffer.concat([this.headers[t-1],A]);let r=this.headers[t-2];r.length===10&&r.toString().toLowerCase()==="keep-alive"?this.keepAlive+=A.toString():r.length===10&&r.toString().toLowerCase()==="connection"?this.connection+=A.toString():r.length===14&&r.toString().toLowerCase()==="content-length"&&(this.contentLength+=A.toString()),this.trackHeader(A.length)}trackHeader(A){this.headersSize+=A,this.headersSize>=this.headersMaxSize&&k.destroy(this.socket,new JT)}onUpgrade(A){let{upgrade:t,client:r,socket:n,headers:i,statusCode:s}=this;D(t);let o=r[Ie][r[Be]];D(o),D(!n.destroyed),D(n===r[Fe]),D(!this.paused),D(o.upgrade||o.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,D(this.headers.length%2===0),this.headers=[],this.headersSize=0,n.unshift(A),n[Se].destroy(),n[Se]=null,n[wt]=null,n[Ze]=null,n.removeListener("error",Vp).removeListener("readable",Yp).removeListener("end",qp).removeListener("close",BE),r[Fe]=null,r[Ie][r[Be]++]=null,r.emit("disconnect",r[Ke],[r],new yt("upgrade"));try{o.onUpgrade(s,i,n)}catch(a){k.destroy(n,a)}kA(r)}onHeadersComplete(A,t,r){let{client:n,socket:i,headers:s,statusText:o}=this;if(i.destroyed)return-1;let a=n[Ie][n[Be]];if(!a)return-1;if(D(!this.upgrade),D(this.statusCode<200),A===100)return k.destroy(i,new ni("bad response",k.getSocketInfo(i))),-1;if(t&&!a.upgrade)return k.destroy(i,new ni("bad upgrade",k.getSocketInfo(i))),-1;if(D.strictEqual(this.timeoutType,si),this.statusCode=A,this.shouldKeepAlive=r||a.method==="HEAD"&&!i[sA]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let g=a.bodyTimeout!=null?a.bodyTimeout:n[vp];this.setTimeout(g,dc)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(a.method==="CONNECT")return D(n[be]===1),this.upgrade=!0,2;if(t)return D(n[be]===1),this.upgrade=!0,2;if(D(this.headers.length%2===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&n[Dr]){let g=this.keepAlive?k.parseKeepAliveTimeout(this.keepAlive):null;if(g!=null){let l=Math.min(g-n[Tp],n[Up]);l<=0?i[sA]=!0:n[vs]=l}else n[vs]=n[dE]}else i[sA]=!0;let c=a.onHeaders(A,s,this.resume,o)===!1;return a.aborted?-1:a.method==="HEAD"||A<200?1:(i[ii]&&(i[ii]=!1,kA(n)),c?Bt.ERROR.PAUSED:0)}onBody(A){let{client:t,socket:r,statusCode:n,maxResponseSize:i}=this;if(r.destroyed)return-1;let s=t[Ie][t[Be]];if(D(s),D.strictEqual(this.timeoutType,dc),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),D(n>=200),i>-1&&this.bytesRead+A.length>i)return k.destroy(r,new qT),-1;if(this.bytesRead+=A.length,s.onData(A)===!1)return Bt.ERROR.PAUSED}onMessageComplete(){let{client:A,socket:t,statusCode:r,upgrade:n,headers:i,contentLength:s,bytesRead:o,shouldKeepAlive:a}=this;if(t.destroyed&&(!r||a))return-1;if(n)return;let c=A[Ie][A[Be]];if(D(c),D(r>=100),this.statusCode=null,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",D(this.headers.length%2===0),this.headers=[],this.headersSize=0,!(r<200)){if(c.method!=="HEAD"&&s&&o!==parseInt(s,10))return k.destroy(t,new PT),-1;if(c.onComplete(i),A[Ie][A[Be]++]=null,t[Zt])return D.strictEqual(A[be],0),k.destroy(t,new yt("reset")),Bt.ERROR.PAUSED;if(a){if(t[sA]&&A[be]===0)return k.destroy(t,new yt("reset")),Bt.ERROR.PAUSED;A[Dr]===1?setImmediate(kA,A):kA(A)}else return k.destroy(t,new yt("reset")),Bt.ERROR.PAUSED}}};function QM(e){let{socket:A,timeoutType:t,client:r}=e;t===si?(!A[Zt]||A.writableNeedDrain||r[be]>1)&&(D(!e.paused,"cannot be paused while waiting for headers"),k.destroy(A,new GT)):t===dc?e.paused||k.destroy(A,new YT):t===fE&&(D(r[be]===0&&r[vs]),k.destroy(A,new yt("socket idle timeout")))}function Yp(){let{[Se]:e}=this;e&&e.readMore()}function Vp(e){let{[wt]:A,[Se]:t}=this;if(D(e.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),A[Rt]!=="h2"&&e.code==="ECONNRESET"&&t.statusCode&&!t.shouldKeepAlive){t.onMessageComplete();return}this[Ze]=e,Bc(this[wt],e)}function Bc(e,A){if(e[be]===0&&A.code!=="UND_ERR_INFO"&&A.code!=="UND_ERR_SOCKET"){D(e[DA]===e[Be]);let t=e[Ie].splice(e[Be]);for(let r=0;r0&&t.code!=="UND_ERR_INFO"){let r=e[Ie][e[Be]];e[Ie][e[Be]++]=null,oA(e,r,t)}e[DA]=e[Be],D(e[be]===0),e.emit("disconnect",e[Ke],[e],t),kA(e)}async function Op(e){D(!e[ri]),D(!e[Fe]);let{host:A,hostname:t,protocol:r,port:n}=e[Ke];if(t[0]==="["){let i=t.indexOf("]");D(i!==-1);let s=t.substring(1,i);D(xp.isIP(s)),t=s}e[ri]=!0,eA.beforeConnect.hasSubscribers&&eA.beforeConnect.publish({connectParams:{host:A,hostname:t,protocol:r,port:n,servername:e[yr],localAddress:e[Ms]},connector:e[Ts]});try{let i=await new Promise((o,a)=>{e[Ts]({host:A,hostname:t,protocol:r,port:n,servername:e[yr],localAddress:e[Ms]},(c,g)=>{c?a(c):o(g)})});if(e.destroyed){k.destroy(i.on("error",()=>{}),new OT);return}if(e[ri]=!1,D(i),i.alpnProtocol==="h2"){Fp||(Fp=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let o=Cc.connect(e[Ke],{createConnection:()=>i,peerMaxConcurrentStreams:e[Qc].maxConcurrentStreams});e[Rt]="h2",o[wt]=e,o[Fe]=i,o.on("error",cM),o.on("frameError",gM),o.on("end",lM),o.on("goaway",uM),o.on("close",BE),o.unref(),e[bA]=o,i[bA]=o}else uE||(uE=await CE,CE=null),i[Us]=!1,i[Zt]=!1,i[sA]=!1,i[ii]=!1,i[Se]=new IE(e,i,uE);i[Pp]=0,i[Gs]=e[Gs],i[wt]=e,i[Ze]=null,i.on("error",Vp).on("readable",Yp).on("end",qp).on("close",BE),e[Fe]=i,eA.connected.hasSubscribers&&eA.connected.publish({connectParams:{host:A,hostname:t,protocol:r,port:n,servername:e[yr],localAddress:e[Ms]},connector:e[Ts],socket:i}),e.emit("connect",e[Ke],[e])}catch(i){if(e.destroyed)return;if(e[ri]=!1,eA.connectError.hasSubscribers&&eA.connectError.publish({connectParams:{host:A,hostname:t,protocol:r,port:n,servername:e[yr],localAddress:e[Ms]},connector:e[Ts],error:i}),i.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(D(e[be]===0);e[jr]>0&&e[Ie][e[DA]].servername===e[yr];){let s=e[Ie][e[DA]++];oA(e,s,i)}else Bc(e,i);e.emit("connectionError",e[Ke],[e],i)}kA(e)}function Np(e){e[Rr]=0,e.emit("drain",e[Ke],[e])}function kA(e,A){e[Wr]!==2&&(e[Wr]=2,CM(e,A),e[Wr]=0,e[Be]>256&&(e[Ie].splice(0,e[Be]),e[DA]-=e[Be],e[Be]=0))}function CM(e,A){for(;;){if(e.destroyed){D(e[jr]===0);return}if(e[wr]&&!e[_r]){e[wr](),e[wr]=null;return}let t=e[Fe];if(t&&!t.destroyed&&t.alpnProtocol!=="h2"){if(e[_r]===0?!t[Us]&&t.unref&&(t.unref(),t[Us]=!0):t[Us]&&t.ref&&(t.ref(),t[Us]=!1),e[_r]===0)t[Se].timeoutType!==fE&&t[Se].setTimeout(e[vs],fE);else if(e[be]>0&&t[Se].statusCode<200&&t[Se].timeoutType!==si){let n=e[Ie][e[Be]],i=n.headersTimeout!=null?n.headersTimeout:e[Mp];t[Se].setTimeout(i,si)}}if(e[hE])e[Rr]=2;else if(e[Rr]===2){A?(e[Rr]=1,process.nextTick(Np,e)):Np(e);continue}if(e[jr]===0||e[be]>=(e[Dr]||1))return;let r=e[Ie][e[DA]];if(e[Ke].protocol==="https:"&&e[yr]!==r.servername){if(e[be]>0)return;if(e[yr]=r.servername,t&&t.servername!==r.servername){k.destroy(t,new yt("servername changed"));return}}if(e[ri])return;if(!t&&!e[bA]){Op(e);return}if(t.destroyed||t[Zt]||t[sA]||t[ii]||e[be]>0&&!r.idempotent||e[be]>0&&(r.upgrade||r.method==="CONNECT")||e[be]>0&&k.bodyLength(r.body)!==0&&(k.isStream(r.body)||k.isAsyncIterable(r.body)))return;!r.aborted&&fM(e,r)?e[DA]++:e[Ie].splice(e[DA],1)}}function Hp(e){return e!=="GET"&&e!=="HEAD"&&e!=="OPTIONS"&&e!=="TRACE"&&e!=="CONNECT"}function fM(e,A){if(e[Rt]==="h2"){IM(e,e[bA],A);return}let{body:t,method:r,path:n,host:i,upgrade:s,headers:o,blocking:a,reset:c}=A,g=r==="PUT"||r==="POST"||r==="PATCH";t&&typeof t.read=="function"&&t.read(0);let l=k.bodyLength(t),u=l;if(u===null&&(u=A.contentLength),u===0&&!g&&(u=null),Hp(r)&&u>0&&A.contentLength!==null&&A.contentLength!==u){if(e[Ps])return oA(e,A,new Kt),!1;process.emitWarning(new Kt)}let E=e[Fe];try{A.onConnect(d=>{A.aborted||A.completed||(oA(e,A,d||new pE),k.destroy(E,new yt("aborted")))})}catch(d){oA(e,A,d)}if(A.aborted)return!1;r==="HEAD"&&(E[sA]=!0),(s||r==="CONNECT")&&(E[sA]=!0),c!=null&&(E[sA]=c),e[Gs]&&E[Pp]++>=e[Gs]&&(E[sA]=!0),a&&(E[ii]=!0);let h=`${r} ${n} HTTP/1.1\r -`;return typeof i=="string"?h+=`host: ${i}\r -`:h+=e[Lp],s?h+=`connection: upgrade\r -upgrade: ${s}\r -`:e[Dr]&&!E[sA]?h+=`connection: keep-alive\r -`:h+=`connection: close\r -`,o&&(h+=o),eA.sendHeaders.hasSubscribers&&eA.sendHeaders.publish({request:A,headers:h,socket:E}),!t||l===0?(u===0?E.write(`${h}content-length: 0\r -\r -`,"latin1"):(D(u===null,"no body must not have content length"),E.write(`${h}\r -`,"latin1")),A.onRequestSent()):k.isBuffer(t)?(D(u===t.byteLength,"buffer body must have content length"),E.cork(),E.write(`${h}content-length: ${u}\r -\r -`,"latin1"),E.write(t),E.uncork(),A.onBodySent(t),A.onRequestSent(),g||(E[sA]=!0)):k.isBlobLike(t)?typeof t.stream=="function"?fc({body:t.stream(),client:e,request:A,socket:E,contentLength:u,header:h,expectsPayload:g}):_p({body:t,client:e,request:A,socket:E,contentLength:u,header:h,expectsPayload:g}):k.isStream(t)?Wp({body:t,client:e,request:A,socket:E,contentLength:u,header:h,expectsPayload:g}):k.isIterable(t)?fc({body:t,client:e,request:A,socket:E,contentLength:u,header:h,expectsPayload:g}):D(!1),!0}function IM(e,A,t){let{body:r,method:n,path:i,host:s,upgrade:o,expectContinue:a,signal:c,headers:g}=t,l;if(typeof g=="string"?l=EE[eM](g.trim()):l=g,o)return oA(e,t,new Error("Upgrade not supported for H2")),!1;try{t.onConnect(p=>{t.aborted||t.completed||oA(e,t,p||new pE)})}catch(p){oA(e,t,p)}if(t.aborted)return!1;let u,E=e[Qc];if(l[tM]=s||e[Jp],l[rM]=n,n==="CONNECT")return A.ref(),u=A.request(l,{endStream:!1,signal:c}),u.id&&!u.pending?(t.onUpgrade(null,null,u),++E.openStreams):u.once("ready",()=>{t.onUpgrade(null,null,u),++E.openStreams}),u.once("close",()=>{E.openStreams-=1,E.openStreams===0&&A.unref()}),!0;l[nM]=i,l[iM]="https";let h=n==="PUT"||n==="POST"||n==="PATCH";r&&typeof r.read=="function"&&r.read(0);let d=k.bodyLength(r);if(d==null&&(d=t.contentLength),(d===0||!h)&&(d=null),Hp(n)&&d>0&&t.contentLength!=null&&t.contentLength!==d){if(e[Ps])return oA(e,t,new Kt),!1;process.emitWarning(new Kt)}d!=null&&(D(r,"no body must not have content length"),l[sM]=`${d}`),A.ref();let C=n==="GET"||n==="HEAD";return a?(l[oM]="100-continue",u=A.request(l,{endStream:C,signal:c}),u.once("continue",I)):(u=A.request(l,{endStream:C,signal:c}),I()),++E.openStreams,u.once("response",p=>{let{[aM]:w,...m}=p;t.onHeaders(Number(w),m,u.resume.bind(u),"")===!1&&u.pause()}),u.once("end",()=>{t.onComplete([])}),u.on("data",p=>{t.onData(p)===!1&&u.pause()}),u.once("close",()=>{E.openStreams-=1,E.openStreams===0&&A.unref()}),u.once("error",function(p){e[bA]&&!e[bA].destroyed&&!this.closed&&!this.destroyed&&(E.streams-=1,k.destroy(u,p))}),u.once("frameError",(p,w)=>{let m=new yt(`HTTP/2: "frameError" received - type ${p}, code ${w}`);oA(e,t,m),e[bA]&&!e[bA].destroyed&&!this.closed&&!this.destroyed&&(E.streams-=1,k.destroy(u,m))}),!0;function I(){r?k.isBuffer(r)?(D(d===r.byteLength,"buffer body must have content length"),u.cork(),u.write(r),u.uncork(),u.end(),t.onBodySent(r),t.onRequestSent()):k.isBlobLike(r)?typeof r.stream=="function"?fc({client:e,request:t,contentLength:d,h2stream:u,expectsPayload:h,body:r.stream(),socket:e[Fe],header:""}):_p({body:r,client:e,request:t,contentLength:d,expectsPayload:h,h2stream:u,header:"",socket:e[Fe]}):k.isStream(r)?Wp({body:r,client:e,request:t,contentLength:d,expectsPayload:h,socket:e[Fe],h2stream:u,header:""}):k.isIterable(r)?fc({body:r,client:e,request:t,contentLength:d,expectsPayload:h,header:"",h2stream:u,socket:e[Fe]}):D(!1):t.onRequestSent()}}function Wp({h2stream:e,body:A,client:t,request:r,socket:n,contentLength:i,header:s,expectsPayload:o}){if(D(i!==0||t[be]===0,"stream body cannot be pipelined"),t[Rt]==="h2"){let d=function(C){r.onBodySent(C)},h=MT(A,e,C=>{C?(k.destroy(A,C),k.destroy(e,C)):r.onRequestSent()});h.on("data",d),h.once("end",()=>{h.removeListener("data",d),k.destroy(h)});return}let a=!1,c=new Ic({socket:n,request:r,contentLength:i,client:t,expectsPayload:o,header:s}),g=function(h){if(!a)try{!c.write(h)&&this.pause&&this.pause()}catch(d){k.destroy(this,d)}},l=function(){a||A.resume&&A.resume()},u=function(){if(a)return;let h=new pE;queueMicrotask(()=>E(h))},E=function(h){if(!a){if(a=!0,D(n.destroyed||n[Zt]&&t[be]<=1),n.off("drain",l).off("error",E),A.removeListener("data",g).removeListener("end",E).removeListener("error",E).removeListener("close",u),!h)try{c.end()}catch(d){h=d}c.destroy(h),h&&(h.code!=="UND_ERR_INFO"||h.message!=="reset")?k.destroy(A,h):k.destroy(A)}};A.on("data",g).on("end",E).on("error",E).on("close",u),A.resume&&A.resume(),n.on("drain",l).on("error",E)}async function _p({h2stream:e,body:A,client:t,request:r,socket:n,contentLength:i,header:s,expectsPayload:o}){D(i===A.size,"blob body must have content length");let a=t[Rt]==="h2";try{if(i!=null&&i!==A.size)throw new Kt;let c=Buffer.from(await A.arrayBuffer());a?(e.cork(),e.write(c),e.uncork()):(n.cork(),n.write(`${s}content-length: ${i}\r -\r -`,"latin1"),n.write(c),n.uncork()),r.onBodySent(c),r.onRequestSent(),o||(n[sA]=!0),kA(t)}catch(c){k.destroy(a?e:n,c)}}async function fc({h2stream:e,body:A,client:t,request:r,socket:n,contentLength:i,header:s,expectsPayload:o}){D(i!==0||t[be]===0,"iterator body cannot be pipelined");let a=null;function c(){if(a){let u=a;a=null,u()}}let g=()=>new Promise((u,E)=>{D(a===null),n[Ze]?E(n[Ze]):a=u});if(t[Rt]==="h2"){e.on("close",c).on("drain",c);try{for await(let u of A){if(n[Ze])throw n[Ze];let E=e.write(u);r.onBodySent(u),E||await g()}}catch(u){e.destroy(u)}finally{r.onRequestSent(),e.end(),e.off("close",c).off("drain",c)}return}n.on("close",c).on("drain",c);let l=new Ic({socket:n,request:r,contentLength:i,client:t,expectsPayload:o,header:s});try{for await(let u of A){if(n[Ze])throw n[Ze];l.write(u)||await g()}l.end()}catch(u){l.destroy(u)}finally{n.off("close",c).off("drain",c)}}var Ic=class{constructor({socket:A,request:t,contentLength:r,client:n,expectsPayload:i,header:s}){this.socket=A,this.request=t,this.contentLength=r,this.client=n,this.bytesWritten=0,this.expectsPayload=i,this.header=s,A[Zt]=!0}write(A){let{socket:t,request:r,contentLength:n,client:i,bytesWritten:s,expectsPayload:o,header:a}=this;if(t[Ze])throw t[Ze];if(t.destroyed)return!1;let c=Buffer.byteLength(A);if(!c)return!0;if(n!==null&&s+c>n){if(i[Ps])throw new Kt;process.emitWarning(new Kt)}t.cork(),s===0&&(o||(t[sA]=!0),n===null?t.write(`${a}transfer-encoding: chunked\r -`,"latin1"):t.write(`${a}content-length: ${n}\r -\r -`,"latin1")),n===null&&t.write(`\r -${c.toString(16)}\r -`,"latin1"),this.bytesWritten+=c;let g=t.write(A);return t.uncork(),r.onBodySent(A),g||t[Se].timeout&&t[Se].timeoutType===si&&t[Se].timeout.refresh&&t[Se].timeout.refresh(),g}end(){let{socket:A,contentLength:t,client:r,bytesWritten:n,expectsPayload:i,header:s,request:o}=this;if(o.onRequestSent(),A[Zt]=!1,A[Ze])throw A[Ze];if(!A.destroyed){if(n===0?i?A.write(`${s}content-length: 0\r -\r -`,"latin1"):A.write(`${s}\r -`,"latin1"):t===null&&A.write(`\r -0\r -\r -`,"latin1"),t!==null&&n!==t){if(r[Ps])throw new Kt;process.emitWarning(new Kt)}A[Se].timeout&&A[Se].timeoutType===si&&A[Se].timeout.refresh&&A[Se].timeout.refresh(),kA(r)}}destroy(A){let{socket:t,client:r}=this;t[Zt]=!1,A&&(D(r[be]<=1,"pipeline should only contain this request"),k.destroy(t,A))}};function oA(e,A,t){try{A.onError(t),D(A.aborted)}catch(r){e.emit("error",r)}}jp.exports=QE});var Zp=Q((_4,Kp)=>{"use strict";var pc=class{constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(A){this.list[this.top]=A,this.top=this.top+1&2047}shift(){let A=this.list[this.bottom];return A===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,A)}};Kp.exports=class{constructor(){this.head=this.tail=new pc}isEmpty(){return this.head.isEmpty()}push(A){this.head.isFull()&&(this.head=this.head.next=new pc),this.head.push(A)}shift(){let A=this.tail,t=A.shift();return A.isEmpty()&&A.next!==null&&(this.tail=A.next),t}}});var zp=Q((j4,Xp)=>{"use strict";var{kFree:BM,kConnected:pM,kPending:mM,kQueued:yM,kRunning:wM,kSize:RM}=de(),Kr=Symbol("pool"),mE=class{constructor(A){this[Kr]=A}get connected(){return this[Kr][pM]}get free(){return this[Kr][BM]}get pending(){return this[Kr][mM]}get queued(){return this[Kr][yM]}get running(){return this[Kr][wM]}get size(){return this[Kr][RM]}};Xp.exports=mE});var kE=Q((K4,am)=>{"use strict";var DM=Ns(),bM=Zp(),{kConnected:yE,kSize:$p,kRunning:em,kPending:Am,kQueued:Ys,kBusy:kM,kFree:SM,kUrl:FM,kClose:NM,kDestroy:xM,kDispatch:LM}=de(),UM=zp(),CA=Symbol("clients"),aA=Symbol("needDrain"),Vs=Symbol("queue"),wE=Symbol("closed resolve"),RE=Symbol("onDrain"),tm=Symbol("onConnect"),rm=Symbol("onDisconnect"),nm=Symbol("onConnectionError"),DE=Symbol("get dispatcher"),sm=Symbol("add client"),om=Symbol("remove client"),im=Symbol("stats"),bE=class extends DM{constructor(){super(),this[Vs]=new bM,this[CA]=[],this[Ys]=0;let A=this;this[RE]=function(r,n){let i=A[Vs],s=!1;for(;!s;){let o=i.shift();if(!o)break;A[Ys]--,s=!this.dispatch(o.opts,o.handler)}this[aA]=s,!this[aA]&&A[aA]&&(A[aA]=!1,A.emit("drain",r,[A,...n])),A[wE]&&i.isEmpty()&&Promise.all(A[CA].map(o=>o.close())).then(A[wE])},this[tm]=(t,r)=>{A.emit("connect",t,[A,...r])},this[rm]=(t,r,n)=>{A.emit("disconnect",t,[A,...r],n)},this[nm]=(t,r,n)=>{A.emit("connectionError",t,[A,...r],n)},this[im]=new UM(this)}get[kM](){return this[aA]}get[yE](){return this[CA].filter(A=>A[yE]).length}get[SM](){return this[CA].filter(A=>A[yE]&&!A[aA]).length}get[Am](){let A=this[Ys];for(let{[Am]:t}of this[CA])A+=t;return A}get[em](){let A=0;for(let{[em]:t}of this[CA])A+=t;return A}get[$p](){let A=this[Ys];for(let{[$p]:t}of this[CA])A+=t;return A}get stats(){return this[im]}async[NM](){return this[Vs].isEmpty()?Promise.all(this[CA].map(A=>A.close())):new Promise(A=>{this[wE]=A})}async[xM](A){for(;;){let t=this[Vs].shift();if(!t)break;t.handler.onError(A)}return Promise.all(this[CA].map(t=>t.destroy(A)))}[LM](A,t){let r=this[DE]();return r?r.dispatch(A,t)||(r[aA]=!0,this[aA]=!this[DE]()):(this[aA]=!0,this[Vs].push({opts:A,handler:t}),this[Ys]++),!this[aA]}[sm](A){return A.on("drain",this[RE]).on("connect",this[tm]).on("disconnect",this[rm]).on("connectionError",this[nm]),this[CA].push(A),this[aA]&&process.nextTick(()=>{this[aA]&&this[RE](A[FM],[this,A])}),this}[om](A){A.close(()=>{let t=this[CA].indexOf(A);t!==-1&&this[CA].splice(t,1)}),this[aA]=this[CA].some(t=>!t[aA]&&t.closed!==!0&&t.destroyed!==!0)}};am.exports={PoolBase:bE,kClients:CA,kNeedDrain:aA,kAddClient:sm,kRemoveClient:om,kGetDispatcher:DE}});var oi=Q((Z4,um)=>{"use strict";var{PoolBase:TM,kClients:cm,kNeedDrain:MM,kAddClient:vM,kGetDispatcher:PM}=kE(),GM=Js(),{InvalidArgumentError:SE}=le(),FE=W(),{kUrl:gm,kInterceptors:JM}=de(),YM=xs(),NE=Symbol("options"),xE=Symbol("connections"),lm=Symbol("factory");function VM(e,A){return new GM(e,A)}var LE=class extends TM{constructor(A,{connections:t,factory:r=VM,connect:n,connectTimeout:i,tls:s,maxCachedSessions:o,socketPath:a,autoSelectFamily:c,autoSelectFamilyAttemptTimeout:g,allowH2:l,...u}={}){if(super(),t!=null&&(!Number.isFinite(t)||t<0))throw new SE("invalid connections");if(typeof r!="function")throw new SE("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new SE("connect must be a function or an object");typeof n!="function"&&(n=YM({...s,maxCachedSessions:o,allowH2:l,socketPath:a,timeout:i,...FE.nodeHasAutoSelectFamily&&c?{autoSelectFamily:c,autoSelectFamilyAttemptTimeout:g}:void 0,...n})),this[JM]=u.interceptors&&u.interceptors.Pool&&Array.isArray(u.interceptors.Pool)?u.interceptors.Pool:[],this[xE]=t||null,this[gm]=FE.parseOrigin(A),this[NE]={...FE.deepClone(u),connect:n,allowH2:l},this[NE].interceptors=u.interceptors?{...u.interceptors}:void 0,this[lm]=r}[PM](){let A=this[cm].find(t=>!t[MM]);return A||((!this[xE]||this[cm].length{"use strict";var{BalancedPoolMissingUpstreamError:qM,InvalidArgumentError:OM}=le(),{PoolBase:HM,kClients:cA,kNeedDrain:qs,kAddClient:WM,kRemoveClient:_M,kGetDispatcher:jM}=kE(),KM=oi(),{kUrl:UE,kInterceptors:ZM}=de(),{parseOrigin:Em}=W(),hm=Symbol("factory"),mc=Symbol("options"),dm=Symbol("kGreatestCommonDivisor"),Zr=Symbol("kCurrentWeight"),Xr=Symbol("kIndex"),VA=Symbol("kWeight"),yc=Symbol("kMaxWeightPerServer"),wc=Symbol("kErrorPenalty");function Qm(e,A){return A===0?e:Qm(A,e%A)}function XM(e,A){return new KM(e,A)}var TE=class extends HM{constructor(A=[],{factory:t=XM,...r}={}){if(super(),this[mc]=r,this[Xr]=-1,this[Zr]=0,this[yc]=this[mc].maxWeightPerServer||100,this[wc]=this[mc].errorPenalty||15,Array.isArray(A)||(A=[A]),typeof t!="function")throw new OM("factory must be a function.");this[ZM]=r.interceptors&&r.interceptors.BalancedPool&&Array.isArray(r.interceptors.BalancedPool)?r.interceptors.BalancedPool:[],this[hm]=t;for(let n of A)this.addUpstream(n);this._updateBalancedPoolStats()}addUpstream(A){let t=Em(A).origin;if(this[cA].find(n=>n[UE].origin===t&&n.closed!==!0&&n.destroyed!==!0))return this;let r=this[hm](t,Object.assign({},this[mc]));this[WM](r),r.on("connect",()=>{r[VA]=Math.min(this[yc],r[VA]+this[wc])}),r.on("connectionError",()=>{r[VA]=Math.max(1,r[VA]-this[wc]),this._updateBalancedPoolStats()}),r.on("disconnect",(...n)=>{let i=n[2];i&&i.code==="UND_ERR_SOCKET"&&(r[VA]=Math.max(1,r[VA]-this[wc]),this._updateBalancedPoolStats())});for(let n of this[cA])n[VA]=this[yc];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){this[dm]=this[cA].map(A=>A[VA]).reduce(Qm,0)}removeUpstream(A){let t=Em(A).origin,r=this[cA].find(n=>n[UE].origin===t&&n.closed!==!0&&n.destroyed!==!0);return r&&this[_M](r),this}get upstreams(){return this[cA].filter(A=>A.closed!==!0&&A.destroyed!==!0).map(A=>A[UE].origin)}[jM](){if(this[cA].length===0)throw new qM;if(!this[cA].find(i=>!i[qs]&&i.closed!==!0&&i.destroyed!==!0)||this[cA].map(i=>i[qs]).reduce((i,s)=>i&&s,!0))return;let r=0,n=this[cA].findIndex(i=>!i[qs]);for(;r++this[cA][n][VA]&&!i[qs]&&(n=this[Xr]),this[Xr]===0&&(this[Zr]=this[Zr]-this[dm],this[Zr]<=0&&(this[Zr]=this[yc])),i[VA]>=this[Zr]&&!i[qs])return i}return this[Zr]=this[cA][n][VA],this[Xr]=n,this[cA][n]}};Cm.exports=TE});var ME=Q((z4,pm)=>{"use strict";var{kConnected:Im,kSize:Bm}=de(),Rc=class{constructor(A){this.value=A}deref(){return this.value[Im]===0&&this.value[Bm]===0?void 0:this.value}},Dc=class{constructor(A){this.finalizer=A}register(A,t){A.on&&A.on("disconnect",()=>{A[Im]===0&&A[Bm]===0&&this.finalizer(t)})}};pm.exports=function(){return process.env.NODE_V8_COVERAGE?{WeakRef:Rc,FinalizationRegistry:Dc}:{WeakRef:global.WeakRef||Rc,FinalizationRegistry:global.FinalizationRegistry||Dc}}});var Os=Q(($4,Sm)=>{"use strict";var{InvalidArgumentError:bc}=le(),{kClients:br,kRunning:mm,kClose:zM,kDestroy:$M,kDispatch:ev,kInterceptors:Av}=de(),tv=Ns(),rv=oi(),nv=Js(),iv=W(),sv=lc(),{WeakRef:ov,FinalizationRegistry:av}=ME()(),ym=Symbol("onConnect"),wm=Symbol("onDisconnect"),Rm=Symbol("onConnectionError"),cv=Symbol("maxRedirections"),Dm=Symbol("onDrain"),bm=Symbol("factory"),km=Symbol("finalizer"),vE=Symbol("options");function gv(e,A){return A&&A.connections===1?new nv(e,A):new rv(e,A)}var PE=class extends tv{constructor({factory:A=gv,maxRedirections:t=0,connect:r,...n}={}){if(super(),typeof A!="function")throw new bc("factory must be a function.");if(r!=null&&typeof r!="function"&&typeof r!="object")throw new bc("connect must be a function or an object");if(!Number.isInteger(t)||t<0)throw new bc("maxRedirections must be a positive number");r&&typeof r!="function"&&(r={...r}),this[Av]=n.interceptors&&n.interceptors.Agent&&Array.isArray(n.interceptors.Agent)?n.interceptors.Agent:[sv({maxRedirections:t})],this[vE]={...iv.deepClone(n),connect:r},this[vE].interceptors=n.interceptors?{...n.interceptors}:void 0,this[cv]=t,this[bm]=A,this[br]=new Map,this[km]=new av(s=>{let o=this[br].get(s);o!==void 0&&o.deref()===void 0&&this[br].delete(s)});let i=this;this[Dm]=(s,o)=>{i.emit("drain",s,[i,...o])},this[ym]=(s,o)=>{i.emit("connect",s,[i,...o])},this[wm]=(s,o,a)=>{i.emit("disconnect",s,[i,...o],a)},this[Rm]=(s,o,a)=>{i.emit("connectionError",s,[i,...o],a)}}get[mm](){let A=0;for(let t of this[br].values()){let r=t.deref();r&&(A+=r[mm])}return A}[ev](A,t){let r;if(A.origin&&(typeof A.origin=="string"||A.origin instanceof URL))r=String(A.origin);else throw new bc("opts.origin must be a non-empty string or URL.");let n=this[br].get(r),i=n?n.deref():null;return i||(i=this[bm](A.origin,this[vE]).on("drain",this[Dm]).on("connect",this[ym]).on("disconnect",this[wm]).on("connectionError",this[Rm]),this[br].set(r,new ov(i)),this[km].register(i,r)),i.dispatch(A,t)}async[zM](){let A=[];for(let t of this[br].values()){let r=t.deref();r&&A.push(r.close())}await Promise.all(A)}async[$M](A){let t=[];for(let r of this[br].values()){let n=r.deref();n&&t.push(n.destroy(A))}await Promise.all(t)}};Sm.exports=PE});var Pm=Q((Aj,vm)=>{"use strict";var Lm=require("assert"),{Readable:lv}=require("stream"),{RequestAbortedError:Um,NotSupportedError:uv,InvalidArgumentError:Ev}=le(),Fc=W(),{ReadableStreamFrom:hv,toUSVString:dv}=W(),GE,SA=Symbol("kConsume"),kc=Symbol("kReading"),kr=Symbol("kBody"),Fm=Symbol("abort"),Tm=Symbol("kContentType"),Nm=()=>{};vm.exports=class extends lv{constructor({resume:A,abort:t,contentType:r="",highWaterMark:n=64*1024}){super({autoDestroy:!0,read:A,highWaterMark:n}),this._readableState.dataEmitted=!1,this[Fm]=t,this[SA]=null,this[kr]=null,this[Tm]=r,this[kc]=!1}destroy(A){return this.destroyed?this:(!A&&!this._readableState.endEmitted&&(A=new Um),A&&this[Fm](),super.destroy(A))}emit(A,...t){return A==="data"?this._readableState.dataEmitted=!0:A==="error"&&(this._readableState.errorEmitted=!0),super.emit(A,...t)}on(A,...t){return(A==="data"||A==="readable")&&(this[kc]=!0),super.on(A,...t)}addListener(A,...t){return this.on(A,...t)}off(A,...t){let r=super.off(A,...t);return(A==="data"||A==="readable")&&(this[kc]=this.listenerCount("data")>0||this.listenerCount("readable")>0),r}removeListener(A,...t){return this.off(A,...t)}push(A){return this[SA]&&A!==null&&this.readableLength===0?(Mm(this[SA],A),this[kc]?super.push(A):!0):super.push(A)}async text(){return Sc(this,"text")}async json(){return Sc(this,"json")}async blob(){return Sc(this,"blob")}async arrayBuffer(){return Sc(this,"arrayBuffer")}async formData(){throw new uv}get bodyUsed(){return Fc.isDisturbed(this)}get body(){return this[kr]||(this[kr]=hv(this),this[SA]&&(this[kr].getReader(),Lm(this[kr].locked))),this[kr]}dump(A){let t=A&&Number.isFinite(A.limit)?A.limit:262144,r=A&&A.signal;if(r)try{if(typeof r!="object"||!("aborted"in r))throw new Ev("signal must be an AbortSignal");Fc.throwIfAborted(r)}catch(n){return Promise.reject(n)}return this.closed?Promise.resolve(null):new Promise((n,i)=>{let s=r?Fc.addAbortListener(r,()=>{this.destroy()}):Nm;this.on("close",function(){s(),r&&r.aborted?i(r.reason||Object.assign(new Error("The operation was aborted"),{name:"AbortError"})):n(null)}).on("error",Nm).on("data",function(o){t-=o.length,t<=0&&this.destroy()}).resume()})}};function Qv(e){return e[kr]&&e[kr].locked===!0||e[SA]}function Cv(e){return Fc.isDisturbed(e)||Qv(e)}async function Sc(e,A){if(Cv(e))throw new TypeError("unusable");return Lm(!e[SA]),new Promise((t,r)=>{e[SA]={type:A,stream:e,resolve:t,reject:r,length:0,body:[]},e.on("error",function(n){JE(this[SA],n)}).on("close",function(){this[SA].body!==null&&JE(this[SA],new Um)}),process.nextTick(fv,e[SA])})}function fv(e){if(e.body===null)return;let{_readableState:A}=e.stream;for(let t of A.buffer)Mm(e,t);for(A.endEmitted?xm(this[SA]):e.stream.on("end",function(){xm(this[SA])}),e.stream.resume();e.stream.read()!=null;);}function xm(e){let{type:A,body:t,resolve:r,stream:n,length:i}=e;try{if(A==="text")r(dv(Buffer.concat(t)));else if(A==="json")r(JSON.parse(Buffer.concat(t)));else if(A==="arrayBuffer"){let s=new Uint8Array(i),o=0;for(let a of t)s.set(a,o),o+=a.byteLength;r(s.buffer)}else A==="blob"&&(GE||(GE=require("buffer").Blob),r(new GE(t,{type:n[Tm]})));JE(e)}catch(s){n.destroy(s)}}function Mm(e,A){e.length+=A.length,e.body.push(A)}function JE(e,A){e.body!==null&&(A?e.reject(A):e.resolve(),e.type=null,e.stream=null,e.resolve=null,e.reject=null,e.length=0,e.body=null)}});var YE=Q((tj,Jm)=>{"use strict";var Iv=require("assert"),{ResponseStatusCodeError:Nc}=le(),{toUSVString:Gm}=W();async function Bv({callback:e,body:A,contentType:t,statusCode:r,statusMessage:n,headers:i}){Iv(A);let s=[],o=0;for await(let a of A)if(s.push(a),o+=a.length,o>128*1024){s=null;break}if(r===204||!t||!s){process.nextTick(e,new Nc(`Response status code ${r}${n?`: ${n}`:""}`,r,i));return}try{if(t.startsWith("application/json")){let a=JSON.parse(Gm(Buffer.concat(s)));process.nextTick(e,new Nc(`Response status code ${r}${n?`: ${n}`:""}`,r,i,a));return}if(t.startsWith("text/")){let a=Gm(Buffer.concat(s));process.nextTick(e,new Nc(`Response status code ${r}${n?`: ${n}`:""}`,r,i,a));return}}catch{}process.nextTick(e,new Nc(`Response status code ${r}${n?`: ${n}`:""}`,r,i))}Jm.exports={getResolveErrorBodyCallback:Bv}});var ci=Q((rj,Vm)=>{"use strict";var{addAbortListener:pv}=W(),{RequestAbortedError:mv}=le(),ai=Symbol("kListener"),Sr=Symbol("kSignal");function Ym(e){e.abort?e.abort():e.onError(new mv)}function yv(e,A){if(e[Sr]=null,e[ai]=null,!!A){if(A.aborted){Ym(e);return}e[Sr]=A,e[ai]=()=>{Ym(e)},pv(e[Sr],e[ai])}}function wv(e){e[Sr]&&("removeEventListener"in e[Sr]?e[Sr].removeEventListener("abort",e[ai]):e[Sr].removeListener("abort",e[ai]),e[Sr]=null,e[ai]=null)}Vm.exports={addSignal:yv,removeSignal:wv}});var Hm=Q((nj,VE)=>{"use strict";var Rv=Pm(),{InvalidArgumentError:gi,RequestAbortedError:Dv}=le(),Dt=W(),{getResolveErrorBodyCallback:bv}=YE(),{AsyncResource:kv}=require("async_hooks"),{addSignal:Sv,removeSignal:qm}=ci(),xc=class extends kv{constructor(A,t){if(!A||typeof A!="object")throw new gi("invalid opts");let{signal:r,method:n,opaque:i,body:s,onInfo:o,responseHeaders:a,throwOnError:c,highWaterMark:g}=A;try{if(typeof t!="function")throw new gi("invalid callback");if(g&&(typeof g!="number"||g<0))throw new gi("invalid highWaterMark");if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new gi("signal must be an EventEmitter or EventTarget");if(n==="CONNECT")throw new gi("invalid method");if(o&&typeof o!="function")throw new gi("invalid onInfo callback");super("UNDICI_REQUEST")}catch(l){throw Dt.isStream(s)&&Dt.destroy(s.on("error",Dt.nop),l),l}this.responseHeaders=a||null,this.opaque=i||null,this.callback=t,this.res=null,this.abort=null,this.body=s,this.trailers={},this.context=null,this.onInfo=o||null,this.throwOnError=c,this.highWaterMark=g,Dt.isStream(s)&&s.on("error",l=>{this.onError(l)}),Sv(this,r)}onConnect(A,t){if(!this.callback)throw new Dv;this.abort=A,this.context=t}onHeaders(A,t,r,n){let{callback:i,opaque:s,abort:o,context:a,responseHeaders:c,highWaterMark:g}=this,l=c==="raw"?Dt.parseRawHeaders(t):Dt.parseHeaders(t);if(A<200){this.onInfo&&this.onInfo({statusCode:A,headers:l});return}let E=(c==="raw"?Dt.parseHeaders(t):l)["content-type"],h=new Rv({resume:r,abort:o,contentType:E,highWaterMark:g});this.callback=null,this.res=h,i!==null&&(this.throwOnError&&A>=400?this.runInAsyncScope(bv,null,{callback:i,body:h,contentType:E,statusCode:A,statusMessage:n,headers:l}):this.runInAsyncScope(i,null,null,{statusCode:A,headers:l,trailers:this.trailers,opaque:s,body:h,context:a}))}onData(A){let{res:t}=this;return t.push(A)}onComplete(A){let{res:t}=this;qm(this),Dt.parseHeaders(A,this.trailers),t.push(null)}onError(A){let{res:t,callback:r,body:n,opaque:i}=this;qm(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,A,{opaque:i})})),t&&(this.res=null,queueMicrotask(()=>{Dt.destroy(t,A)})),n&&(this.body=null,Dt.destroy(n,A))}};function Om(e,A){if(A===void 0)return new Promise((t,r)=>{Om.call(this,e,(n,i)=>n?r(n):t(i))});try{this.dispatch(e,new xc(e,A))}catch(t){if(typeof A!="function")throw t;let r=e&&e.opaque;queueMicrotask(()=>A(t,{opaque:r}))}}VE.exports=Om;VE.exports.RequestHandler=xc});var Km=Q((ij,jm)=>{"use strict";var{finished:Fv,PassThrough:Nv}=require("stream"),{InvalidArgumentError:li,InvalidReturnValueError:xv,RequestAbortedError:Lv}=le(),At=W(),{getResolveErrorBodyCallback:Uv}=YE(),{AsyncResource:Tv}=require("async_hooks"),{addSignal:Mv,removeSignal:Wm}=ci(),qE=class extends Tv{constructor(A,t,r){if(!A||typeof A!="object")throw new li("invalid opts");let{signal:n,method:i,opaque:s,body:o,onInfo:a,responseHeaders:c,throwOnError:g}=A;try{if(typeof r!="function")throw new li("invalid callback");if(typeof t!="function")throw new li("invalid factory");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new li("signal must be an EventEmitter or EventTarget");if(i==="CONNECT")throw new li("invalid method");if(a&&typeof a!="function")throw new li("invalid onInfo callback");super("UNDICI_STREAM")}catch(l){throw At.isStream(o)&&At.destroy(o.on("error",At.nop),l),l}this.responseHeaders=c||null,this.opaque=s||null,this.factory=t,this.callback=r,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=o,this.onInfo=a||null,this.throwOnError=g||!1,At.isStream(o)&&o.on("error",l=>{this.onError(l)}),Mv(this,n)}onConnect(A,t){if(!this.callback)throw new Lv;this.abort=A,this.context=t}onHeaders(A,t,r,n){let{factory:i,opaque:s,context:o,callback:a,responseHeaders:c}=this,g=c==="raw"?At.parseRawHeaders(t):At.parseHeaders(t);if(A<200){this.onInfo&&this.onInfo({statusCode:A,headers:g});return}this.factory=null;let l;if(this.throwOnError&&A>=400){let h=(c==="raw"?At.parseHeaders(t):g)["content-type"];l=new Nv,this.callback=null,this.runInAsyncScope(Uv,null,{callback:a,body:l,contentType:h,statusCode:A,statusMessage:n,headers:g})}else{if(i===null)return;if(l=this.runInAsyncScope(i,null,{statusCode:A,headers:g,opaque:s,context:o}),!l||typeof l.write!="function"||typeof l.end!="function"||typeof l.on!="function")throw new xv("expected Writable");Fv(l,{readable:!1},E=>{let{callback:h,res:d,opaque:C,trailers:I,abort:p}=this;this.res=null,(E||!d.readable)&&At.destroy(d,E),this.callback=null,this.runInAsyncScope(h,null,E||null,{opaque:C,trailers:I}),E&&p()})}return l.on("drain",r),this.res=l,(l.writableNeedDrain!==void 0?l.writableNeedDrain:l._writableState&&l._writableState.needDrain)!==!0}onData(A){let{res:t}=this;return t?t.write(A):!0}onComplete(A){let{res:t}=this;Wm(this),t&&(this.trailers=At.parseHeaders(A),t.end())}onError(A){let{res:t,callback:r,opaque:n,body:i}=this;Wm(this),this.factory=null,t?(this.res=null,At.destroy(t,A)):r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,A,{opaque:n})})),i&&(this.body=null,At.destroy(i,A))}};function _m(e,A,t){if(t===void 0)return new Promise((r,n)=>{_m.call(this,e,A,(i,s)=>i?n(i):r(s))});try{this.dispatch(e,new qE(e,A,t))}catch(r){if(typeof t!="function")throw r;let n=e&&e.opaque;queueMicrotask(()=>t(r,{opaque:n}))}}jm.exports=_m});var zm=Q((sj,Xm)=>{"use strict";var{Readable:Zm,Duplex:vv,PassThrough:Pv}=require("stream"),{InvalidArgumentError:Hs,InvalidReturnValueError:Gv,RequestAbortedError:Lc}=le(),qA=W(),{AsyncResource:Jv}=require("async_hooks"),{addSignal:Yv,removeSignal:Vv}=ci(),qv=require("assert"),ui=Symbol("resume"),OE=class extends Zm{constructor(){super({autoDestroy:!0}),this[ui]=null}_read(){let{[ui]:A}=this;A&&(this[ui]=null,A())}_destroy(A,t){this._read(),t(A)}},HE=class extends Zm{constructor(A){super({autoDestroy:!0}),this[ui]=A}_read(){this[ui]()}_destroy(A,t){!A&&!this._readableState.endEmitted&&(A=new Lc),t(A)}},WE=class extends Jv{constructor(A,t){if(!A||typeof A!="object")throw new Hs("invalid opts");if(typeof t!="function")throw new Hs("invalid handler");let{signal:r,method:n,opaque:i,onInfo:s,responseHeaders:o}=A;if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new Hs("signal must be an EventEmitter or EventTarget");if(n==="CONNECT")throw new Hs("invalid method");if(s&&typeof s!="function")throw new Hs("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=i||null,this.responseHeaders=o||null,this.handler=t,this.abort=null,this.context=null,this.onInfo=s||null,this.req=new OE().on("error",qA.nop),this.ret=new vv({readableObjectMode:A.objectMode,autoDestroy:!0,read:()=>{let{body:a}=this;a&&a.resume&&a.resume()},write:(a,c,g)=>{let{req:l}=this;l.push(a,c)||l._readableState.destroyed?g():l[ui]=g},destroy:(a,c)=>{let{body:g,req:l,res:u,ret:E,abort:h}=this;!a&&!E._readableState.endEmitted&&(a=new Lc),h&&a&&h(),qA.destroy(g,a),qA.destroy(l,a),qA.destroy(u,a),Vv(this),c(a)}}).on("prefinish",()=>{let{req:a}=this;a.push(null)}),this.res=null,Yv(this,r)}onConnect(A,t){let{ret:r,res:n}=this;if(qv(!n,"pipeline cannot be retried"),r.destroyed)throw new Lc;this.abort=A,this.context=t}onHeaders(A,t,r){let{opaque:n,handler:i,context:s}=this;if(A<200){if(this.onInfo){let a=this.responseHeaders==="raw"?qA.parseRawHeaders(t):qA.parseHeaders(t);this.onInfo({statusCode:A,headers:a})}return}this.res=new HE(r);let o;try{this.handler=null;let a=this.responseHeaders==="raw"?qA.parseRawHeaders(t):qA.parseHeaders(t);o=this.runInAsyncScope(i,null,{statusCode:A,headers:a,opaque:n,body:this.res,context:s})}catch(a){throw this.res.on("error",qA.nop),a}if(!o||typeof o.on!="function")throw new Gv("expected Readable");o.on("data",a=>{let{ret:c,body:g}=this;!c.push(a)&&g.pause&&g.pause()}).on("error",a=>{let{ret:c}=this;qA.destroy(c,a)}).on("end",()=>{let{ret:a}=this;a.push(null)}).on("close",()=>{let{ret:a}=this;a._readableState.ended||qA.destroy(a,new Lc)}),this.body=o}onData(A){let{res:t}=this;return t.push(A)}onComplete(A){let{res:t}=this;t.push(null)}onError(A){let{ret:t}=this;this.handler=null,qA.destroy(t,A)}};function Ov(e,A){try{let t=new WE(e,A);return this.dispatch({...e,body:t.req},t),t.ret}catch(t){return new Pv().destroy(t)}}Xm.exports=Ov});var ry=Q((oj,ty)=>{"use strict";var{InvalidArgumentError:_E,RequestAbortedError:Hv,SocketError:Wv}=le(),{AsyncResource:_v}=require("async_hooks"),$m=W(),{addSignal:jv,removeSignal:ey}=ci(),Kv=require("assert"),jE=class extends _v{constructor(A,t){if(!A||typeof A!="object")throw new _E("invalid opts");if(typeof t!="function")throw new _E("invalid callback");let{signal:r,opaque:n,responseHeaders:i}=A;if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new _E("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=i||null,this.opaque=n||null,this.callback=t,this.abort=null,this.context=null,jv(this,r)}onConnect(A,t){if(!this.callback)throw new Hv;this.abort=A,this.context=null}onHeaders(){throw new Wv("bad upgrade",null)}onUpgrade(A,t,r){let{callback:n,opaque:i,context:s}=this;Kv.strictEqual(A,101),ey(this),this.callback=null;let o=this.responseHeaders==="raw"?$m.parseRawHeaders(t):$m.parseHeaders(t);this.runInAsyncScope(n,null,null,{headers:o,socket:r,opaque:i,context:s})}onError(A){let{callback:t,opaque:r}=this;ey(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,A,{opaque:r})}))}};function Ay(e,A){if(A===void 0)return new Promise((t,r)=>{Ay.call(this,e,(n,i)=>n?r(n):t(i))});try{let t=new jE(e,A);this.dispatch({...e,method:e.method||"GET",upgrade:e.protocol||"Websocket"},t)}catch(t){if(typeof A!="function")throw t;let r=e&&e.opaque;queueMicrotask(()=>A(t,{opaque:r}))}}ty.exports=Ay});var ay=Q((aj,oy)=>{"use strict";var{AsyncResource:Zv}=require("async_hooks"),{InvalidArgumentError:KE,RequestAbortedError:Xv,SocketError:zv}=le(),ny=W(),{addSignal:$v,removeSignal:iy}=ci(),ZE=class extends Zv{constructor(A,t){if(!A||typeof A!="object")throw new KE("invalid opts");if(typeof t!="function")throw new KE("invalid callback");let{signal:r,opaque:n,responseHeaders:i}=A;if(r&&typeof r.on!="function"&&typeof r.addEventListener!="function")throw new KE("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=n||null,this.responseHeaders=i||null,this.callback=t,this.abort=null,$v(this,r)}onConnect(A,t){if(!this.callback)throw new Xv;this.abort=A,this.context=t}onHeaders(){throw new zv("bad connect",null)}onUpgrade(A,t,r){let{callback:n,opaque:i,context:s}=this;iy(this),this.callback=null;let o=t;o!=null&&(o=this.responseHeaders==="raw"?ny.parseRawHeaders(t):ny.parseHeaders(t)),this.runInAsyncScope(n,null,null,{statusCode:A,headers:o,socket:r,opaque:i,context:s})}onError(A){let{callback:t,opaque:r}=this;iy(this),t&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(t,null,A,{opaque:r})}))}};function sy(e,A){if(A===void 0)return new Promise((t,r)=>{sy.call(this,e,(n,i)=>n?r(n):t(i))});try{let t=new ZE(e,A);this.dispatch({...e,method:"CONNECT"},t)}catch(t){if(typeof A!="function")throw t;let r=e&&e.opaque;queueMicrotask(()=>A(t,{opaque:r}))}}oy.exports=sy});var cy=Q((cj,Ei)=>{"use strict";Ei.exports.request=Hm();Ei.exports.stream=Km();Ei.exports.pipeline=zm();Ei.exports.upgrade=ry();Ei.exports.connect=ay()});var zE=Q((gj,gy)=>{"use strict";var{UndiciError:eP}=le(),XE=class e extends eP{constructor(A){super(A),Error.captureStackTrace(this,e),this.name="MockNotMatchedError",this.message=A||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}};gy.exports={MockNotMatchedError:XE}});var hi=Q((lj,ly)=>{"use strict";ly.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected")}});var Ws=Q((uj,yy)=>{"use strict";var{MockNotMatchedError:zr}=zE(),{kDispatches:Uc,kMockAgent:AP,kOriginalDispatch:tP,kOrigin:rP,kGetNetConnect:nP}=hi(),{buildURL:iP,nop:sP}=W(),{STATUS_CODES:oP}=require("http"),{types:{isPromise:aP}}=require("util");function Xt(e,A){return typeof e=="string"?e===A:e instanceof RegExp?e.test(A):typeof e=="function"?e(A)===!0:!1}function Ey(e){return Object.fromEntries(Object.entries(e).map(([A,t])=>[A.toLocaleLowerCase(),t]))}function hy(e,A){if(Array.isArray(e)){for(let t=0;t"u")return!0;if(typeof A!="object"||typeof e.headers!="object")return!1;for(let[t,r]of Object.entries(e.headers)){let n=hy(A,t);if(!Xt(r,n))return!1}return!0}function uy(e){if(typeof e!="string")return e;let A=e.split("?");if(A.length!==2)return e;let t=new URLSearchParams(A.pop());return t.sort(),[...A,t.toString()].join("?")}function cP(e,{path:A,method:t,body:r,headers:n}){let i=Xt(e.path,A),s=Xt(e.method,t),o=typeof e.body<"u"?Xt(e.body,r):!0,a=Qy(e,n);return i&&s&&o&&a}function Cy(e){return Buffer.isBuffer(e)?e:typeof e=="object"?JSON.stringify(e):e.toString()}function fy(e,A){let t=A.query?iP(A.path,A.query):A.path,r=typeof t=="string"?uy(t):t,n=e.filter(({consumed:i})=>!i).filter(({path:i})=>Xt(uy(i),r));if(n.length===0)throw new zr(`Mock dispatch not matched for path '${r}'`);if(n=n.filter(({method:i})=>Xt(i,A.method)),n.length===0)throw new zr(`Mock dispatch not matched for method '${A.method}'`);if(n=n.filter(({body:i})=>typeof i<"u"?Xt(i,A.body):!0),n.length===0)throw new zr(`Mock dispatch not matched for body '${A.body}'`);if(n=n.filter(i=>Qy(i,A.headers)),n.length===0)throw new zr(`Mock dispatch not matched for headers '${typeof A.headers=="object"?JSON.stringify(A.headers):A.headers}'`);return n[0]}function gP(e,A,t){let r={timesInvoked:0,times:1,persist:!1,consumed:!1},n=typeof t=="function"?{callback:t}:{...t},i={...r,...A,pending:!0,data:{error:null,...n}};return e.push(i),i}function $E(e,A){let t=e.findIndex(r=>r.consumed?cP(r,A):!1);t!==-1&&e.splice(t,1)}function Iy(e){let{path:A,method:t,body:r,headers:n,query:i}=e;return{path:A,method:t,body:r,headers:n,query:i}}function eh(e){return Object.entries(e).reduce((A,[t,r])=>[...A,Buffer.from(`${t}`),Array.isArray(r)?r.map(n=>Buffer.from(`${n}`)):Buffer.from(`${r}`)],[])}function By(e){return oP[e]||"unknown"}async function lP(e){let A=[];for await(let t of e)A.push(t);return Buffer.concat(A).toString("utf8")}function py(e,A){let t=Iy(e),r=fy(this[Uc],t);r.timesInvoked++,r.data.callback&&(r.data={...r.data,...r.data.callback(e)});let{data:{statusCode:n,data:i,headers:s,trailers:o,error:a},delay:c,persist:g}=r,{timesInvoked:l,times:u}=r;if(r.consumed=!g&&l>=u,r.pending=l0?setTimeout(()=>{E(this[Uc])},c):E(this[Uc]);function E(d,C=i){let I=Array.isArray(e.headers)?dy(e.headers):e.headers,p=typeof C=="function"?C({...e,headers:I}):C;if(aP(p)){p.then(H=>E(d,H));return}let w=Cy(p),m=eh(s),K=eh(o);A.abort=sP,A.onHeaders(n,m,h,By(n)),A.onData(Buffer.from(w)),A.onComplete(K),$E(d,t)}function h(){}return!0}function uP(){let e=this[AP],A=this[rP],t=this[tP];return function(n,i){if(e.isMockActive)try{py.call(this,n,i)}catch(s){if(s instanceof zr){let o=e[nP]();if(o===!1)throw new zr(`${s.message}: subsequent request to origin ${A} was not allowed (net.connect disabled)`);if(my(o,A))t.call(this,n,i);else throw new zr(`${s.message}: subsequent request to origin ${A} was not allowed (net.connect is not enabled for this origin)`)}else throw s}else t.call(this,n,i)}}function my(e,A){let t=new URL(A);return e===!0?!0:!!(Array.isArray(e)&&e.some(r=>Xt(r,t.host)))}function EP(e){if(e){let{agent:A,...t}=e;return t}}yy.exports={getResponseData:Cy,getMockDispatch:fy,addMockDispatch:gP,deleteMockDispatch:$E,buildKey:Iy,generateKeyValues:eh,matchValue:Xt,getResponse:lP,getStatusText:By,mockDispatch:py,buildMockDispatch:uP,checkNetConnect:my,buildMockOptions:EP,getHeaderByName:hy}});var oh=Q((Ej,sh)=>{"use strict";var{getResponseData:hP,buildKey:dP,addMockDispatch:Ah}=Ws(),{kDispatches:Tc,kDispatchKey:Mc,kDefaultHeaders:th,kDefaultTrailers:rh,kContentLength:nh,kMockDispatch:vc}=hi(),{InvalidArgumentError:tt}=le(),{buildURL:QP}=W(),di=class{constructor(A){this[vc]=A}delay(A){if(typeof A!="number"||!Number.isInteger(A)||A<=0)throw new tt("waitInMs must be a valid integer > 0");return this[vc].delay=A,this}persist(){return this[vc].persist=!0,this}times(A){if(typeof A!="number"||!Number.isInteger(A)||A<=0)throw new tt("repeatTimes must be a valid integer > 0");return this[vc].times=A,this}},ih=class{constructor(A,t){if(typeof A!="object")throw new tt("opts must be an object");if(typeof A.path>"u")throw new tt("opts.path must be defined");if(typeof A.method>"u"&&(A.method="GET"),typeof A.path=="string")if(A.query)A.path=QP(A.path,A.query);else{let r=new URL(A.path,"data://");A.path=r.pathname+r.search}typeof A.method=="string"&&(A.method=A.method.toUpperCase()),this[Mc]=dP(A),this[Tc]=t,this[th]={},this[rh]={},this[nh]=!1}createMockScopeDispatchData(A,t,r={}){let n=hP(t),i=this[nh]?{"content-length":n.length}:{},s={...this[th],...i,...r.headers},o={...this[rh],...r.trailers};return{statusCode:A,data:t,headers:s,trailers:o}}validateReplyParameters(A,t,r){if(typeof A>"u")throw new tt("statusCode must be defined");if(typeof t>"u")throw new tt("data must be defined");if(typeof r!="object")throw new tt("responseOptions must be an object")}reply(A){if(typeof A=="function"){let o=c=>{let g=A(c);if(typeof g!="object")throw new tt("reply options callback must return an object");let{statusCode:l,data:u="",responseOptions:E={}}=g;return this.validateReplyParameters(l,u,E),{...this.createMockScopeDispatchData(l,u,E)}},a=Ah(this[Tc],this[Mc],o);return new di(a)}let[t,r="",n={}]=[...arguments];this.validateReplyParameters(t,r,n);let i=this.createMockScopeDispatchData(t,r,n),s=Ah(this[Tc],this[Mc],i);return new di(s)}replyWithError(A){if(typeof A>"u")throw new tt("error must be defined");let t=Ah(this[Tc],this[Mc],{error:A});return new di(t)}defaultReplyHeaders(A){if(typeof A>"u")throw new tt("headers must be defined");return this[th]=A,this}defaultReplyTrailers(A){if(typeof A>"u")throw new tt("trailers must be defined");return this[rh]=A,this}replyContentLength(){return this[nh]=!0,this}};sh.exports.MockInterceptor=ih;sh.exports.MockScope=di});var gh=Q((hj,Fy)=>{"use strict";var{promisify:CP}=require("util"),fP=Js(),{buildMockDispatch:IP}=Ws(),{kDispatches:wy,kMockAgent:Ry,kClose:Dy,kOriginalClose:by,kOrigin:ky,kOriginalDispatch:BP,kConnected:ah}=hi(),{MockInterceptor:pP}=oh(),Sy=de(),{InvalidArgumentError:mP}=le(),ch=class extends fP{constructor(A,t){if(super(A,t),!t||!t.agent||typeof t.agent.dispatch!="function")throw new mP("Argument opts.agent must implement Agent");this[Ry]=t.agent,this[ky]=A,this[wy]=[],this[ah]=1,this[BP]=this.dispatch,this[by]=this.close.bind(this),this.dispatch=IP.call(this),this.close=this[Dy]}get[Sy.kConnected](){return this[ah]}intercept(A){return new pP(A,this[wy])}async[Dy](){await CP(this[by])(),this[ah]=0,this[Ry][Sy.kClients].delete(this[ky])}};Fy.exports=ch});var Eh=Q((dj,vy)=>{"use strict";var{promisify:yP}=require("util"),wP=oi(),{buildMockDispatch:RP}=Ws(),{kDispatches:Ny,kMockAgent:xy,kClose:Ly,kOriginalClose:Uy,kOrigin:Ty,kOriginalDispatch:DP,kConnected:lh}=hi(),{MockInterceptor:bP}=oh(),My=de(),{InvalidArgumentError:kP}=le(),uh=class extends wP{constructor(A,t){if(super(A,t),!t||!t.agent||typeof t.agent.dispatch!="function")throw new kP("Argument opts.agent must implement Agent");this[xy]=t.agent,this[Ty]=A,this[Ny]=[],this[lh]=1,this[DP]=this.dispatch,this[Uy]=this.close.bind(this),this.dispatch=RP.call(this),this.close=this[Ly]}get[My.kConnected](){return this[lh]}intercept(A){return new bP(A,this[Ny])}async[Ly](){await yP(this[Uy])(),this[lh]=0,this[xy][My.kClients].delete(this[Ty])}};vy.exports=uh});var Gy=Q((Cj,Py)=>{"use strict";var SP={pronoun:"it",is:"is",was:"was",this:"this"},FP={pronoun:"they",is:"are",was:"were",this:"these"};Py.exports=class{constructor(A,t){this.singular=A,this.plural=t}pluralize(A){let t=A===1,r=t?SP:FP,n=t?this.singular:this.plural;return{...r,count:A,noun:n}}}});var Yy=Q((Ij,Jy)=>{"use strict";var{Transform:NP}=require("stream"),{Console:xP}=require("console");Jy.exports=class{constructor({disableColors:A}={}){this.transform=new NP({transform(t,r,n){n(null,t)}}),this.logger=new xP({stdout:this.transform,inspectOptions:{colors:!A&&!process.env.CI}})}format(A){let t=A.map(({method:r,path:n,data:{statusCode:i},persist:s,times:o,timesInvoked:a,origin:c})=>({Method:r,Origin:c,Path:n,"Status code":i,Persistent:s?"\u2705":"\u274C",Invocations:a,Remaining:s?1/0:o-a}));return this.logger.table(t),this.transform.read().toString()}}});var Hy=Q((Bj,Oy)=>{"use strict";var{kClients:$r}=de(),LP=Os(),{kAgent:hh,kMockAgentSet:Pc,kMockAgentGet:Vy,kDispatches:dh,kIsMockActive:Gc,kNetConnect:en,kGetNetConnect:UP,kOptions:Jc,kFactory:Yc}=hi(),TP=gh(),MP=Eh(),{matchValue:vP,buildMockOptions:PP}=Ws(),{InvalidArgumentError:qy,UndiciError:GP}=le(),JP=oc(),YP=Gy(),VP=Yy(),Qh=class{constructor(A){this.value=A}deref(){return this.value}},Ch=class extends JP{constructor(A){if(super(A),this[en]=!0,this[Gc]=!0,A&&A.agent&&typeof A.agent.dispatch!="function")throw new qy("Argument opts.agent must implement Agent");let t=A&&A.agent?A.agent:new LP(A);this[hh]=t,this[$r]=t[$r],this[Jc]=PP(A)}get(A){let t=this[Vy](A);return t||(t=this[Yc](A),this[Pc](A,t)),t}dispatch(A,t){return this.get(A.origin),this[hh].dispatch(A,t)}async close(){await this[hh].close(),this[$r].clear()}deactivate(){this[Gc]=!1}activate(){this[Gc]=!0}enableNetConnect(A){if(typeof A=="string"||typeof A=="function"||A instanceof RegExp)Array.isArray(this[en])?this[en].push(A):this[en]=[A];else if(typeof A>"u")this[en]=!0;else throw new qy("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[en]=!1}get isMockActive(){return this[Gc]}[Pc](A,t){this[$r].set(A,new Qh(t))}[Yc](A){let t=Object.assign({agent:this},this[Jc]);return this[Jc]&&this[Jc].connections===1?new TP(A,t):new MP(A,t)}[Vy](A){let t=this[$r].get(A);if(t)return t.deref();if(typeof A!="string"){let r=this[Yc]("http://localhost:9999");return this[Pc](A,r),r}for(let[r,n]of Array.from(this[$r])){let i=n.deref();if(i&&typeof r!="string"&&vP(r,A)){let s=this[Yc](A);return this[Pc](A,s),s[dh]=i[dh],s}}}[UP](){return this[en]}pendingInterceptors(){let A=this[$r];return Array.from(A.entries()).flatMap(([t,r])=>r.deref()[dh].map(n=>({...n,origin:t}))).filter(({pending:t})=>t)}assertNoPendingInterceptors({pendingInterceptorsFormatter:A=new VP}={}){let t=this.pendingInterceptors();if(t.length===0)return;let r=new YP("interceptor","interceptors").pluralize(t.length);throw new GP(` -${r.count} ${r.noun} ${r.is} pending: - -${A.format(t)} -`.trim())}};Oy.exports=Ch});var Xy=Q((pj,Zy)=>{"use strict";var{kProxy:qP,kClose:OP,kDestroy:HP,kInterceptors:WP}=de(),{URL:Wy}=require("url"),_y=Os(),_P=oi(),jP=Ns(),{InvalidArgumentError:Ks,RequestAbortedError:KP}=le(),jy=xs(),_s=Symbol("proxy agent"),Vc=Symbol("proxy client"),js=Symbol("proxy headers"),fh=Symbol("request tls settings"),ZP=Symbol("proxy tls settings"),Ky=Symbol("connect endpoint function");function XP(e){return e==="https:"?443:80}function zP(e){if(typeof e=="string"&&(e={uri:e}),!e||!e.uri)throw new Ks("Proxy opts.uri is mandatory");return{uri:e.uri,protocol:e.protocol||"https"}}function $P(e,A){return new _P(e,A)}var Ih=class extends jP{constructor(A){if(super(A),this[qP]=zP(A),this[_s]=new _y(A),this[WP]=A.interceptors&&A.interceptors.ProxyAgent&&Array.isArray(A.interceptors.ProxyAgent)?A.interceptors.ProxyAgent:[],typeof A=="string"&&(A={uri:A}),!A||!A.uri)throw new Ks("Proxy opts.uri is mandatory");let{clientFactory:t=$P}=A;if(typeof t!="function")throw new Ks("Proxy opts.clientFactory must be a function.");this[fh]=A.requestTls,this[ZP]=A.proxyTls,this[js]=A.headers||{};let r=new Wy(A.uri),{origin:n,port:i,host:s,username:o,password:a}=r;if(A.auth&&A.token)throw new Ks("opts.auth cannot be used in combination with opts.token");A.auth?this[js]["proxy-authorization"]=`Basic ${A.auth}`:A.token?this[js]["proxy-authorization"]=A.token:o&&a&&(this[js]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(o)}:${decodeURIComponent(a)}`).toString("base64")}`);let c=jy({...A.proxyTls});this[Ky]=jy({...A.requestTls}),this[Vc]=t(r,{connect:c}),this[_s]=new _y({...A,connect:async(g,l)=>{let u=g.host;g.port||(u+=`:${XP(g.protocol)}`);try{let{socket:E,statusCode:h}=await this[Vc].connect({origin:n,port:i,path:u,signal:g.signal,headers:{...this[js],host:s}});if(h!==200&&(E.on("error",()=>{}).destroy(),l(new KP(`Proxy response (${h}) !== 200 when HTTP Tunneling`))),g.protocol!=="https:"){l(null,E);return}let d;this[fh]?d=this[fh].servername:d=g.servername,this[Ky]({...g,servername:d,httpSocket:E},l)}catch(E){l(E)}}})}dispatch(A,t){let{host:r}=new Wy(A.origin),n=e2(A.headers);return A2(n),this[_s].dispatch({...A,headers:{...n,host:r}},t)}async[OP](){await this[_s].close(),await this[Vc].close()}async[HP](){await this[_s].destroy(),await this[Vc].destroy()}};function e2(e){if(Array.isArray(e)){let A={};for(let t=0;tt.toLowerCase()==="proxy-authorization"))throw new Ks("Proxy-Authorization should be sent in ProxyAgent constructor")}Zy.exports=Ih});var tw=Q((mj,Aw)=>{"use strict";var An=require("assert"),{kRetryHandlerDefaultRetry:zy}=de(),{RequestRetryError:qc}=le(),{isDisturbed:$y,parseHeaders:t2,parseRangeHeader:ew}=W();function r2(e){let A=Date.now();return new Date(e).getTime()-A}var Bh=class e{constructor(A,t){let{retryOptions:r,...n}=A,{retry:i,maxRetries:s,maxTimeout:o,minTimeout:a,timeoutFactor:c,methods:g,errorCodes:l,retryAfter:u,statusCodes:E}=r??{};this.dispatch=t.dispatch,this.handler=t.handler,this.opts=n,this.abort=null,this.aborted=!1,this.retryOpts={retry:i??e[zy],retryAfter:u??!0,maxTimeout:o??30*1e3,timeout:a??500,timeoutFactor:c??2,maxRetries:s??5,methods:g??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:E??[500,502,503,504,429],errorCodes:l??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE"]},this.retryCount=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(h=>{this.aborted=!0,this.abort?this.abort(h):this.reason=h})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(A,t,r){this.handler.onUpgrade&&this.handler.onUpgrade(A,t,r)}onConnect(A){this.aborted?A(this.reason):this.abort=A}onBodySent(A){if(this.handler.onBodySent)return this.handler.onBodySent(A)}static[zy](A,{state:t,opts:r},n){let{statusCode:i,code:s,headers:o}=A,{method:a,retryOptions:c}=r,{maxRetries:g,timeout:l,maxTimeout:u,timeoutFactor:E,statusCodes:h,errorCodes:d,methods:C}=c,{counter:I,currentTimeout:p}=t;if(p=p!=null&&p>0?p:l,s&&s!=="UND_ERR_REQ_RETRY"&&s!=="UND_ERR_SOCKET"&&!d.includes(s)){n(A);return}if(Array.isArray(C)&&!C.includes(a)){n(A);return}if(i!=null&&Array.isArray(h)&&!h.includes(i)){n(A);return}if(I>g){n(A);return}let w=o!=null&&o["retry-after"];w&&(w=Number(w),w=isNaN(w)?r2(w):w*1e3);let m=w>0?Math.min(w,u):Math.min(p*E**I,u);t.currentTimeout=m,setTimeout(()=>n(null),m)}onHeaders(A,t,r,n){let i=t2(t);if(this.retryCount+=1,A>=300)return this.abort(new qc("Request failed",A,{headers:i,count:this.retryCount})),!1;if(this.resume!=null){if(this.resume=null,A!==206)return!0;let o=ew(i["content-range"]);if(!o)return this.abort(new qc("Content-Range mismatch",A,{headers:i,count:this.retryCount})),!1;if(this.etag!=null&&this.etag!==i.etag)return this.abort(new qc("ETag mismatch",A,{headers:i,count:this.retryCount})),!1;let{start:a,size:c,end:g=c}=o;return An(this.start===a,"content-range mismatch"),An(this.end==null||this.end===g,"content-range mismatch"),this.resume=r,!0}if(this.end==null){if(A===206){let o=ew(i["content-range"]);if(o==null)return this.handler.onHeaders(A,t,r,n);let{start:a,size:c,end:g=c}=o;An(a!=null&&Number.isFinite(a)&&this.start!==a,"content-range mismatch"),An(Number.isFinite(a)),An(g!=null&&Number.isFinite(g)&&this.end!==g,"invalid content-length"),this.start=a,this.end=g}if(this.end==null){let o=i["content-length"];this.end=o!=null?Number(o):null}return An(Number.isFinite(this.start)),An(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=r,this.etag=i.etag!=null?i.etag:null,this.handler.onHeaders(A,t,r,n)}let s=new qc("Request failed",A,{headers:i,count:this.retryCount});return this.abort(s),!1}onData(A){return this.start+=A.length,this.handler.onData(A)}onComplete(A){return this.retryCount=0,this.handler.onComplete(A)}onError(A){if(this.aborted||$y(this.opts.body))return this.handler.onError(A);this.retryOpts.retry(A,{state:{counter:this.retryCount++,currentTimeout:this.retryAfter},opts:{retryOptions:this.retryOpts,...this.opts}},t.bind(this));function t(r){if(r!=null||this.aborted||$y(this.opts.body))return this.handler.onError(r);this.start!==0&&(this.opts={...this.opts,headers:{...this.opts.headers,range:`bytes=${this.start}-${this.end??""}`}});try{this.dispatch(this.opts,this)}catch(n){this.handler.onError(n)}}}};Aw.exports=Bh});var Qi=Q((yj,sw)=>{"use strict";var rw=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:n2}=le(),i2=Os();iw()===void 0&&nw(new i2);function nw(e){if(!e||typeof e.dispatch!="function")throw new n2("Argument agent must implement Agent");Object.defineProperty(globalThis,rw,{value:e,writable:!0,enumerable:!1,configurable:!1})}function iw(){return globalThis[rw]}sw.exports={setGlobalDispatcher:nw,getGlobalDispatcher:iw}});var aw=Q((Rj,ow)=>{"use strict";ow.exports=class{constructor(A){this.handler=A}onConnect(...A){return this.handler.onConnect(...A)}onError(...A){return this.handler.onError(...A)}onUpgrade(...A){return this.handler.onUpgrade(...A)}onHeaders(...A){return this.handler.onHeaders(...A)}onData(...A){return this.handler.onData(...A)}onComplete(...A){return this.handler.onComplete(...A)}onBodySent(...A){return this.handler.onBodySent(...A)}}});var tn=Q((Dj,Ew)=>{"use strict";var{kHeadersList:IA,kConstruct:s2}=de(),{kGuard:kt}=qt(),{kEnumerableProperty:bt}=W(),{makeIterator:Ci,isValidHeaderName:Zs,isValidHeaderValue:gw}=YA(),{webidl:V}=iA(),o2=require("assert"),fA=Symbol("headers map"),Xe=Symbol("headers map sorted");function cw(e){return e===10||e===13||e===9||e===32}function lw(e){let A=0,t=e.length;for(;t>A&&cw(e.charCodeAt(t-1));)--t;for(;t>A&&cw(e.charCodeAt(A));)++A;return A===0&&t===e.length?e:e.substring(A,t)}function uw(e,A){if(Array.isArray(A))for(let t=0;t>","record"]})}function ph(e,A,t){if(t=lw(t),Zs(A)){if(!gw(t))throw V.errors.invalidArgument({prefix:"Headers.append",value:t,type:"header value"})}else throw V.errors.invalidArgument({prefix:"Headers.append",value:A,type:"header name"});if(e[kt]==="immutable")throw new TypeError("immutable");return e[kt],e[IA].append(A,t)}var Oc=class e{constructor(A){yd(this,"cookies",null);A instanceof e?(this[fA]=new Map(A[fA]),this[Xe]=A[Xe],this.cookies=A.cookies===null?null:[...A.cookies]):(this[fA]=new Map(A),this[Xe]=null)}contains(A){return A=A.toLowerCase(),this[fA].has(A)}clear(){this[fA].clear(),this[Xe]=null,this.cookies=null}append(A,t){this[Xe]=null;let r=A.toLowerCase(),n=this[fA].get(r);if(n){let i=r==="cookie"?"; ":", ";this[fA].set(r,{name:n.name,value:`${n.value}${i}${t}`})}else this[fA].set(r,{name:A,value:t});r==="set-cookie"&&(this.cookies??=[],this.cookies.push(t))}set(A,t){this[Xe]=null;let r=A.toLowerCase();r==="set-cookie"&&(this.cookies=[t]),this[fA].set(r,{name:A,value:t})}delete(A){this[Xe]=null,A=A.toLowerCase(),A==="set-cookie"&&(this.cookies=null),this[fA].delete(A)}get(A){let t=this[fA].get(A.toLowerCase());return t===void 0?null:t.value}*[Symbol.iterator](){for(let[A,{value:t}]of this[fA])yield[A,t]}get entries(){let A={};if(this[fA].size)for(let{name:t,value:r}of this[fA].values())A[t]=r;return A}},fi=class e{constructor(A=void 0){A!==s2&&(this[IA]=new Oc,this[kt]="none",A!==void 0&&(A=V.converters.HeadersInit(A),uw(this,A)))}append(A,t){return V.brandCheck(this,e),V.argumentLengthCheck(arguments,2,{header:"Headers.append"}),A=V.converters.ByteString(A),t=V.converters.ByteString(t),ph(this,A,t)}delete(A){if(V.brandCheck(this,e),V.argumentLengthCheck(arguments,1,{header:"Headers.delete"}),A=V.converters.ByteString(A),!Zs(A))throw V.errors.invalidArgument({prefix:"Headers.delete",value:A,type:"header name"});if(this[kt]==="immutable")throw new TypeError("immutable");this[kt],this[IA].contains(A)&&this[IA].delete(A)}get(A){if(V.brandCheck(this,e),V.argumentLengthCheck(arguments,1,{header:"Headers.get"}),A=V.converters.ByteString(A),!Zs(A))throw V.errors.invalidArgument({prefix:"Headers.get",value:A,type:"header name"});return this[IA].get(A)}has(A){if(V.brandCheck(this,e),V.argumentLengthCheck(arguments,1,{header:"Headers.has"}),A=V.converters.ByteString(A),!Zs(A))throw V.errors.invalidArgument({prefix:"Headers.has",value:A,type:"header name"});return this[IA].contains(A)}set(A,t){if(V.brandCheck(this,e),V.argumentLengthCheck(arguments,2,{header:"Headers.set"}),A=V.converters.ByteString(A),t=V.converters.ByteString(t),t=lw(t),Zs(A)){if(!gw(t))throw V.errors.invalidArgument({prefix:"Headers.set",value:t,type:"header value"})}else throw V.errors.invalidArgument({prefix:"Headers.set",value:A,type:"header name"});if(this[kt]==="immutable")throw new TypeError("immutable");this[kt],this[IA].set(A,t)}getSetCookie(){V.brandCheck(this,e);let A=this[IA].cookies;return A?[...A]:[]}get[Xe](){if(this[IA][Xe])return this[IA][Xe];let A=[],t=[...this[IA]].sort((n,i)=>n[0]A,"Headers","key")}return Ci(()=>[...this[Xe].values()],"Headers","key")}values(){if(V.brandCheck(this,e),this[kt]==="immutable"){let A=this[Xe];return Ci(()=>A,"Headers","value")}return Ci(()=>[...this[Xe].values()],"Headers","value")}entries(){if(V.brandCheck(this,e),this[kt]==="immutable"){let A=this[Xe];return Ci(()=>A,"Headers","key+value")}return Ci(()=>[...this[Xe].values()],"Headers","key+value")}forEach(A,t=globalThis){if(V.brandCheck(this,e),V.argumentLengthCheck(arguments,1,{header:"Headers.forEach"}),typeof A!="function")throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");for(let[r,n]of this)A.apply(t,[n,r,this])}[Symbol.for("nodejs.util.inspect.custom")](){return V.brandCheck(this,e),this[IA]}};fi.prototype[Symbol.iterator]=fi.prototype.entries;Object.defineProperties(fi.prototype,{append:bt,delete:bt,get:bt,has:bt,set:bt,getSetCookie:bt,keys:bt,values:bt,entries:bt,forEach:bt,[Symbol.iterator]:{enumerable:!1},[Symbol.toStringTag]:{value:"Headers",configurable:!0}});V.converters.HeadersInit=function(e){if(V.util.Type(e)==="Object")return e[Symbol.iterator]?V.converters["sequence>"](e):V.converters["record"](e);throw V.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};Ew.exports={fill:uw,Headers:fi,HeadersList:Oc}});var jc=Q((kj,pw)=>{"use strict";var{Headers:a2,HeadersList:hw,fill:c2}=tn(),{extractBody:dw,cloneBody:g2,mixinBody:l2}=ks(),wh=W(),{kEnumerableProperty:NA}=wh,{isValidReasonPhrase:u2,isCancelled:E2,isAborted:h2,isBlobLike:d2,serializeJavascriptValueToJSONString:Q2,isErrorLike:C2,isomorphicEncode:f2}=YA(),{redirectStatusSet:I2,nullBodyStatus:B2,DOMException:Qw}=mr(),{kState:Re,kHeaders:We,kGuard:Ii,kRealm:FA}=qt(),{webidl:J}=iA(),{FormData:p2}=nc(),{getGlobalOrigin:m2}=jn(),{URLSerializer:Cw}=$A(),{kHeadersList:mh,kConstruct:y2}=de(),Rh=require("assert"),{types:yh}=require("util"),Iw=globalThis.ReadableStream||require("stream/web").ReadableStream,w2=new TextEncoder("utf-8"),Bi=class e{static error(){let A={settingsObject:{}},t=new e;return t[Re]=Wc(),t[FA]=A,t[We][mh]=t[Re].headersList,t[We][Ii]="immutable",t[We][FA]=A,t}static json(A,t={}){J.argumentLengthCheck(arguments,1,{header:"Response.json"}),t!==null&&(t=J.converters.ResponseInit(t));let r=w2.encode(Q2(A)),n=dw(r),i={settingsObject:{}},s=new e;return s[FA]=i,s[We][Ii]="response",s[We][FA]=i,fw(s,t,{body:n[0],type:"application/json"}),s}static redirect(A,t=302){let r={settingsObject:{}};J.argumentLengthCheck(arguments,1,{header:"Response.redirect"}),A=J.converters.USVString(A),t=J.converters["unsigned short"](t);let n;try{n=new URL(A,m2())}catch(o){throw Object.assign(new TypeError("Failed to parse URL from "+A),{cause:o})}if(!I2.has(t))throw new RangeError("Invalid status code "+t);let i=new e;i[FA]=r,i[We][Ii]="immutable",i[We][FA]=r,i[Re].status=t;let s=f2(Cw(n));return i[Re].headersList.append("location",s),i}constructor(A=null,t={}){A!==null&&(A=J.converters.BodyInit(A)),t=J.converters.ResponseInit(t),this[FA]={settingsObject:{}},this[Re]=_c({}),this[We]=new a2(y2),this[We][Ii]="response",this[We][mh]=this[Re].headersList,this[We][FA]=this[FA];let r=null;if(A!=null){let[n,i]=dw(A);r={body:n,type:i}}fw(this,t,r)}get type(){return J.brandCheck(this,e),this[Re].type}get url(){J.brandCheck(this,e);let A=this[Re].urlList,t=A[A.length-1]??null;return t===null?"":Cw(t,!0)}get redirected(){return J.brandCheck(this,e),this[Re].urlList.length>1}get status(){return J.brandCheck(this,e),this[Re].status}get ok(){return J.brandCheck(this,e),this[Re].status>=200&&this[Re].status<=299}get statusText(){return J.brandCheck(this,e),this[Re].statusText}get headers(){return J.brandCheck(this,e),this[We]}get body(){return J.brandCheck(this,e),this[Re].body?this[Re].body.stream:null}get bodyUsed(){return J.brandCheck(this,e),!!this[Re].body&&wh.isDisturbed(this[Re].body.stream)}clone(){if(J.brandCheck(this,e),this.bodyUsed||this.body&&this.body.locked)throw J.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let A=Dh(this[Re]),t=new e;return t[Re]=A,t[FA]=this[FA],t[We][mh]=A.headersList,t[We][Ii]=this[We][Ii],t[We][FA]=this[We][FA],t}};l2(Bi);Object.defineProperties(Bi.prototype,{type:NA,url:NA,status:NA,ok:NA,redirected:NA,statusText:NA,headers:NA,clone:NA,body:NA,bodyUsed:NA,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(Bi,{json:NA,redirect:NA,error:NA});function Dh(e){if(e.internalResponse)return Bw(Dh(e.internalResponse),e.type);let A=_c({...e,body:null});return e.body!=null&&(A.body=g2(e.body)),A}function _c(e){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...e,headersList:e.headersList?new hw(e.headersList):new hw,urlList:e.urlList?[...e.urlList]:[]}}function Wc(e){let A=C2(e);return _c({type:"error",status:0,error:A?e:new Error(e&&String(e)),aborted:e&&e.name==="AbortError"})}function Hc(e,A){return A={internalResponse:e,...A},new Proxy(e,{get(t,r){return r in A?A[r]:t[r]},set(t,r,n){return Rh(!(r in A)),t[r]=n,!0}})}function Bw(e,A){if(A==="basic")return Hc(e,{type:"basic",headersList:e.headersList});if(A==="cors")return Hc(e,{type:"cors",headersList:e.headersList});if(A==="opaque")return Hc(e,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(A==="opaqueredirect")return Hc(e,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});Rh(!1)}function R2(e,A=null){return Rh(E2(e)),h2(e)?Wc(Object.assign(new Qw("The operation was aborted.","AbortError"),{cause:A})):Wc(Object.assign(new Qw("Request was cancelled."),{cause:A}))}function fw(e,A,t){if(A.status!==null&&(A.status<200||A.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in A&&A.statusText!=null&&!u2(String(A.statusText)))throw new TypeError("Invalid statusText");if("status"in A&&A.status!=null&&(e[Re].status=A.status),"statusText"in A&&A.statusText!=null&&(e[Re].statusText=A.statusText),"headers"in A&&A.headers!=null&&c2(e[We],A.headers),t){if(B2.includes(e.status))throw J.errors.exception({header:"Response constructor",message:"Invalid response status code "+e.status});e[Re].body=t.body,t.type!=null&&!e[Re].headersList.contains("Content-Type")&&e[Re].headersList.append("content-type",t.type)}}J.converters.ReadableStream=J.interfaceConverter(Iw);J.converters.FormData=J.interfaceConverter(p2);J.converters.URLSearchParams=J.interfaceConverter(URLSearchParams);J.converters.XMLHttpRequestBodyInit=function(e){return typeof e=="string"?J.converters.USVString(e):d2(e)?J.converters.Blob(e,{strict:!1}):yh.isArrayBuffer(e)||yh.isTypedArray(e)||yh.isDataView(e)?J.converters.BufferSource(e):wh.isFormDataLike(e)?J.converters.FormData(e,{strict:!1}):e instanceof URLSearchParams?J.converters.URLSearchParams(e):J.converters.DOMString(e)};J.converters.BodyInit=function(e){return e instanceof Iw?J.converters.ReadableStream(e):e?.[Symbol.asyncIterator]?e:J.converters.XMLHttpRequestBodyInit(e)};J.converters.ResponseInit=J.dictionaryConverter([{key:"status",converter:J.converters["unsigned short"],defaultValue:200},{key:"statusText",converter:J.converters.ByteString,defaultValue:""},{key:"headers",converter:J.converters.HeadersInit}]);pw.exports={makeNetworkError:Wc,makeResponse:_c,makeAppropriateNetworkError:R2,filterResponse:Bw,Response:Bi,cloneResponse:Dh}});var $s=Q((Sj,bw)=>{"use strict";var{extractBody:D2,mixinBody:b2,cloneBody:k2}=ks(),{Headers:mw,fill:S2,HeadersList:zc}=tn(),{FinalizationRegistry:F2}=ME()(),zs=W(),{isValidHTTPToken:N2,sameOrigin:yw,normalizeMethod:x2,makePolicyContainer:L2,normalizeMethodRecord:U2}=YA(),{forbiddenMethodsSet:T2,corsSafeListedMethodsSet:M2,referrerPolicy:v2,requestRedirect:P2,requestMode:G2,requestCredentials:J2,requestCache:Y2,requestDuplex:V2}=mr(),{kEnumerableProperty:Me}=zs,{kHeaders:AA,kSignal:Xs,kState:pe,kGuard:Kc,kRealm:xA}=qt(),{webidl:U}=iA(),{getGlobalOrigin:q2}=jn(),{URLSerializer:O2}=$A(),{kHeadersList:Zc,kConstruct:Xc}=de(),H2=require("assert"),{getMaxListeners:ww,setMaxListeners:Rw,getEventListeners:W2,defaultMaxListeners:Dw}=require("events"),bh=globalThis.TransformStream,_2=Symbol("abortController"),j2=new F2(({signal:e,abort:A})=>{e.removeEventListener("abort",A)}),rn=class e{constructor(A,t={}){if(A===Xc)return;U.argumentLengthCheck(arguments,1,{header:"Request constructor"}),A=U.converters.RequestInfo(A),t=U.converters.RequestInit(t),this[xA]={settingsObject:{baseUrl:q2(),get origin(){return this.baseUrl?.origin},policyContainer:L2()}};let r=null,n=null,i=this[xA].settingsObject.baseUrl,s=null;if(typeof A=="string"){let C;try{C=new URL(A,i)}catch(I){throw new TypeError("Failed to parse URL from "+A,{cause:I})}if(C.username||C.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+A);r=$c({urlList:[C]}),n="cors"}else H2(A instanceof e),r=A[pe],s=A[Xs];let o=this[xA].settingsObject.origin,a="client";if(r.window?.constructor?.name==="EnvironmentSettingsObject"&&yw(r.window,o)&&(a=r.window),t.window!=null)throw new TypeError(`'window' option '${a}' must be null`);"window"in t&&(a="no-window"),r=$c({method:r.method,headersList:r.headersList,unsafeRequest:r.unsafeRequest,client:this[xA].settingsObject,window:a,priority:r.priority,origin:r.origin,referrer:r.referrer,referrerPolicy:r.referrerPolicy,mode:r.mode,credentials:r.credentials,cache:r.cache,redirect:r.redirect,integrity:r.integrity,keepalive:r.keepalive,reloadNavigation:r.reloadNavigation,historyNavigation:r.historyNavigation,urlList:[...r.urlList]});let c=Object.keys(t).length!==0;if(c&&(r.mode==="navigate"&&(r.mode="same-origin"),r.reloadNavigation=!1,r.historyNavigation=!1,r.origin="client",r.referrer="client",r.referrerPolicy="",r.url=r.urlList[r.urlList.length-1],r.urlList=[r.url]),t.referrer!==void 0){let C=t.referrer;if(C==="")r.referrer="no-referrer";else{let I;try{I=new URL(C,i)}catch(p){throw new TypeError(`Referrer "${C}" is not a valid URL.`,{cause:p})}I.protocol==="about:"&&I.hostname==="client"||o&&!yw(I,this[xA].settingsObject.baseUrl)?r.referrer="client":r.referrer=I}}t.referrerPolicy!==void 0&&(r.referrerPolicy=t.referrerPolicy);let g;if(t.mode!==void 0?g=t.mode:g=n,g==="navigate")throw U.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(g!=null&&(r.mode=g),t.credentials!==void 0&&(r.credentials=t.credentials),t.cache!==void 0&&(r.cache=t.cache),r.cache==="only-if-cached"&&r.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(t.redirect!==void 0&&(r.redirect=t.redirect),t.integrity!=null&&(r.integrity=String(t.integrity)),t.keepalive!==void 0&&(r.keepalive=!!t.keepalive),t.method!==void 0){let C=t.method;if(!N2(C))throw new TypeError(`'${C}' is not a valid HTTP method.`);if(T2.has(C.toUpperCase()))throw new TypeError(`'${C}' HTTP method is unsupported.`);C=U2[C]??x2(C),r.method=C}t.signal!==void 0&&(s=t.signal),this[pe]=r;let l=new AbortController;if(this[Xs]=l.signal,this[Xs][xA]=this[xA],s!=null){if(!s||typeof s.aborted!="boolean"||typeof s.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(s.aborted)l.abort(s.reason);else{this[_2]=l;let C=new WeakRef(l),I=function(){let p=C.deref();p!==void 0&&p.abort(this.reason)};try{(typeof ww=="function"&&ww(s)===Dw||W2(s,"abort").length>=Dw)&&Rw(100,s)}catch{}zs.addAbortListener(s,I),j2.register(l,{signal:s,abort:I})}}if(this[AA]=new mw(Xc),this[AA][Zc]=r.headersList,this[AA][Kc]="request",this[AA][xA]=this[xA],g==="no-cors"){if(!M2.has(r.method))throw new TypeError(`'${r.method} is unsupported in no-cors mode.`);this[AA][Kc]="request-no-cors"}if(c){let C=this[AA][Zc],I=t.headers!==void 0?t.headers:new zc(C);if(C.clear(),I instanceof zc){for(let[p,w]of I)C.append(p,w);C.cookies=I.cookies}else S2(this[AA],I)}let u=A instanceof e?A[pe].body:null;if((t.body!=null||u!=null)&&(r.method==="GET"||r.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let E=null;if(t.body!=null){let[C,I]=D2(t.body,r.keepalive);E=C,I&&!this[AA][Zc].contains("content-type")&&this[AA].append("content-type",I)}let h=E??u;if(h!=null&&h.source==null){if(E!=null&&t.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(r.mode!=="same-origin"&&r.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');r.useCORSPreflightFlag=!0}let d=h;if(E==null&&u!=null){if(zs.isDisturbed(u.stream)||u.stream.locked)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");bh||(bh=require("stream/web").TransformStream);let C=new bh;u.stream.pipeThrough(C),d={source:u.source,length:u.length,stream:C.readable}}this[pe].body=d}get method(){return U.brandCheck(this,e),this[pe].method}get url(){return U.brandCheck(this,e),O2(this[pe].url)}get headers(){return U.brandCheck(this,e),this[AA]}get destination(){return U.brandCheck(this,e),this[pe].destination}get referrer(){return U.brandCheck(this,e),this[pe].referrer==="no-referrer"?"":this[pe].referrer==="client"?"about:client":this[pe].referrer.toString()}get referrerPolicy(){return U.brandCheck(this,e),this[pe].referrerPolicy}get mode(){return U.brandCheck(this,e),this[pe].mode}get credentials(){return this[pe].credentials}get cache(){return U.brandCheck(this,e),this[pe].cache}get redirect(){return U.brandCheck(this,e),this[pe].redirect}get integrity(){return U.brandCheck(this,e),this[pe].integrity}get keepalive(){return U.brandCheck(this,e),this[pe].keepalive}get isReloadNavigation(){return U.brandCheck(this,e),this[pe].reloadNavigation}get isHistoryNavigation(){return U.brandCheck(this,e),this[pe].historyNavigation}get signal(){return U.brandCheck(this,e),this[Xs]}get body(){return U.brandCheck(this,e),this[pe].body?this[pe].body.stream:null}get bodyUsed(){return U.brandCheck(this,e),!!this[pe].body&&zs.isDisturbed(this[pe].body.stream)}get duplex(){return U.brandCheck(this,e),"half"}clone(){if(U.brandCheck(this,e),this.bodyUsed||this.body?.locked)throw new TypeError("unusable");let A=K2(this[pe]),t=new e(Xc);t[pe]=A,t[xA]=this[xA],t[AA]=new mw(Xc),t[AA][Zc]=A.headersList,t[AA][Kc]=this[AA][Kc],t[AA][xA]=this[AA][xA];let r=new AbortController;return this.signal.aborted?r.abort(this.signal.reason):zs.addAbortListener(this.signal,()=>{r.abort(this.signal.reason)}),t[Xs]=r.signal,t}};b2(rn);function $c(e){let A={method:"GET",localURLsOnly:!1,unsafeRequest:!1,body:null,client:null,reservedClient:null,replacesClientId:"",window:"client",keepalive:!1,serviceWorkers:"all",initiator:"",destination:"",priority:null,origin:"client",policyContainer:"client",referrer:"client",referrerPolicy:"",mode:"no-cors",useCORSPreflightFlag:!1,credentials:"same-origin",useCredentials:!1,cache:"default",redirect:"follow",integrity:"",cryptoGraphicsNonceMetadata:"",parserMetadata:"",reloadNavigation:!1,historyNavigation:!1,userActivation:!1,taintedOrigin:!1,redirectCount:0,responseTainting:"basic",preventNoCacheCacheControlHeaderModification:!1,done:!1,timingAllowFailed:!1,...e,headersList:e.headersList?new zc(e.headersList):new zc};return A.url=A.urlList[0],A}function K2(e){let A=$c({...e,body:null});return e.body!=null&&(A.body=k2(e.body)),A}Object.defineProperties(rn.prototype,{method:Me,url:Me,headers:Me,redirect:Me,clone:Me,signal:Me,duplex:Me,destination:Me,body:Me,bodyUsed:Me,isHistoryNavigation:Me,isReloadNavigation:Me,keepalive:Me,integrity:Me,cache:Me,credentials:Me,attribute:Me,referrerPolicy:Me,referrer:Me,mode:Me,[Symbol.toStringTag]:{value:"Request",configurable:!0}});U.converters.Request=U.interfaceConverter(rn);U.converters.RequestInfo=function(e){return typeof e=="string"?U.converters.USVString(e):e instanceof rn?U.converters.Request(e):U.converters.USVString(e)};U.converters.AbortSignal=U.interfaceConverter(AbortSignal);U.converters.RequestInit=U.dictionaryConverter([{key:"method",converter:U.converters.ByteString},{key:"headers",converter:U.converters.HeadersInit},{key:"body",converter:U.nullableConverter(U.converters.BodyInit)},{key:"referrer",converter:U.converters.USVString},{key:"referrerPolicy",converter:U.converters.DOMString,allowedValues:v2},{key:"mode",converter:U.converters.DOMString,allowedValues:G2},{key:"credentials",converter:U.converters.DOMString,allowedValues:J2},{key:"cache",converter:U.converters.DOMString,allowedValues:Y2},{key:"redirect",converter:U.converters.DOMString,allowedValues:P2},{key:"integrity",converter:U.converters.DOMString},{key:"keepalive",converter:U.converters.boolean},{key:"signal",converter:U.nullableConverter(e=>U.converters.AbortSignal(e,{strict:!1}))},{key:"window",converter:U.converters.any},{key:"duplex",converter:U.converters.DOMString,allowedValues:V2}]);bw.exports={Request:rn,makeRequest:$c}});var sg=Q((Fj,Yw)=>{"use strict";var{Response:Z2,makeNetworkError:ue,makeAppropriateNetworkError:eg,filterResponse:kh,makeResponse:Ag}=jc(),{Headers:kw}=tn(),{Request:X2,makeRequest:z2}=$s(),eo=require("zlib"),{bytesMatch:$2,makePolicyContainer:e1,clonePolicyContainer:A1,requestBadPort:t1,TAOCheck:r1,appendRequestOriginHeader:n1,responseLocationURL:i1,requestCurrentURL:St,setRequestReferrerPolicyOnRedirect:s1,tryUpgradeRequestToAPotentiallyTrustworthyURL:o1,createOpaqueTimingInfo:vh,appendFetchMetadata:a1,corsCheck:c1,crossOriginResourcePolicyCheck:g1,determineRequestsReferrer:l1,coarsenedSharedCurrentTime:Ph,createDeferredPromise:u1,isBlobLike:E1,sameOrigin:Uh,isCancelled:mi,isAborted:Sw,isErrorLike:h1,fullyReadBody:Lw,readableStreamClose:d1,isomorphicEncode:Th,urlIsLocal:Q1,urlIsHttpHttpsScheme:Gh,urlHasHttpsScheme:C1}=YA(),{kState:Mh,kHeaders:Sh,kGuard:f1,kRealm:Fw}=qt(),yi=require("assert"),{safelyExtractBody:tg}=ks(),{redirectStatusSet:Uw,nullBodyStatus:Tw,safeMethodsSet:I1,requestBodyHeader:B1,subresourceSet:p1,DOMException:rg}=mr(),{kHeadersList:pi}=de(),m1=require("events"),{Readable:y1,pipeline:w1}=require("stream"),{addAbortListener:R1,isErrored:D1,isReadable:ng,nodeMajor:Nw,nodeMinor:b1}=W(),{dataURLProcessor:k1,serializeAMimeType:S1}=$A(),{TransformStream:F1}=require("stream/web"),{getGlobalDispatcher:N1}=Qi(),{webidl:x1}=iA(),{STATUS_CODES:L1}=require("http"),U1=["GET","HEAD"],Fh,Nh=globalThis.ReadableStream,ig=class extends m1{constructor(A){super(),this.dispatcher=A,this.connection=null,this.dump=!1,this.state="ongoing",this.setMaxListeners(21)}terminate(A){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(A),this.emit("terminated",A))}abort(A){this.state==="ongoing"&&(this.state="aborted",A||(A=new rg("The operation was aborted.","AbortError")),this.serializedAbortReason=A,this.connection?.destroy(A),this.emit("terminated",A))}};function T1(e,A={}){x1.argumentLengthCheck(arguments,1,{header:"globalThis.fetch"});let t=u1(),r;try{r=new X2(e,A)}catch(u){return t.reject(u),t.promise}let n=r[Mh];if(r.signal.aborted)return xh(t,n,null,r.signal.reason),t.promise;n.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(n.serviceWorkers="none");let s=null,o=null,a=!1,c=null;return R1(r.signal,()=>{a=!0,yi(c!=null),c.abort(r.signal.reason),xh(t,n,s,r.signal.reason)}),c=vw({request:n,processResponseEndOfBody:u=>Mw(u,"fetch"),processResponse:u=>{if(a)return Promise.resolve();if(u.aborted)return xh(t,n,s,c.serializedAbortReason),Promise.resolve();if(u.type==="error")return t.reject(Object.assign(new TypeError("fetch failed"),{cause:u.error})),Promise.resolve();s=new Z2,s[Mh]=u,s[Fw]=o,s[Sh][pi]=u.headersList,s[Sh][f1]="immutable",s[Sh][Fw]=o,t.resolve(s)},dispatcher:A.dispatcher??N1()}),t.promise}function Mw(e,A="other"){if(e.type==="error"&&e.aborted||!e.urlList?.length)return;let t=e.urlList[0],r=e.timingInfo,n=e.cacheState;Gh(t)&&r!==null&&(e.timingAllowPassed||(r=vh({startTime:r.startTime}),n=""),r.endTime=Ph(),e.timingInfo=r,M1(r,t,A,globalThis,n))}function M1(e,A,t,r,n){(Nw>18||Nw===18&&b1>=2)&&performance.markResourceTiming(e,A.href,t,r,n)}function xh(e,A,t,r){if(r||(r=new rg("The operation was aborted.","AbortError")),e.reject(r),A.body!=null&&ng(A.body?.stream)&&A.body.stream.cancel(r).catch(i=>{if(i.code!=="ERR_INVALID_STATE")throw i}),t==null)return;let n=t[Mh];n.body!=null&&ng(n.body?.stream)&&n.body.stream.cancel(r).catch(i=>{if(i.code!=="ERR_INVALID_STATE")throw i})}function vw({request:e,processRequestBodyChunkLength:A,processRequestEndOfBody:t,processResponse:r,processResponseEndOfBody:n,processResponseConsumeBody:i,useParallelQueue:s=!1,dispatcher:o}){let a=null,c=!1;e.client!=null&&(a=e.client.globalObject,c=e.client.crossOriginIsolatedCapability);let g=Ph(c),l=vh({startTime:g}),u={controller:new ig(o),request:e,timingInfo:l,processRequestBodyChunkLength:A,processRequestEndOfBody:t,processResponse:r,processResponseConsumeBody:i,processResponseEndOfBody:n,taskDestination:a,crossOriginIsolatedCapability:c};return yi(!e.body||e.body.stream),e.window==="client"&&(e.window=e.client?.globalObject?.constructor?.name==="Window"?e.client:"no-window"),e.origin==="client"&&(e.origin=e.client?.origin),e.policyContainer==="client"&&(e.client!=null?e.policyContainer=A1(e.client.policyContainer):e.policyContainer=e1()),e.headersList.contains("accept")||e.headersList.append("accept","*/*"),e.headersList.contains("accept-language")||e.headersList.append("accept-language","*"),e.priority,p1.has(e.destination),Pw(u).catch(E=>{u.controller.terminate(E)}),u.controller}async function Pw(e,A=!1){let t=e.request,r=null;if(t.localURLsOnly&&!Q1(St(t))&&(r=ue("local URLs only")),o1(t),t1(t)==="blocked"&&(r=ue("bad port")),t.referrerPolicy===""&&(t.referrerPolicy=t.policyContainer.referrerPolicy),t.referrer!=="no-referrer"&&(t.referrer=l1(t)),r===null&&(r=await(async()=>{let i=St(t);return Uh(i,t.url)&&t.responseTainting==="basic"||i.protocol==="data:"||t.mode==="navigate"||t.mode==="websocket"?(t.responseTainting="basic",await xw(e)):t.mode==="same-origin"?ue('request mode cannot be "same-origin"'):t.mode==="no-cors"?t.redirect!=="follow"?ue('redirect mode cannot be "follow" for "no-cors" request'):(t.responseTainting="opaque",await xw(e)):Gh(St(t))?(t.responseTainting="cors",await Gw(e)):ue("URL scheme must be a HTTP(S) scheme")})()),A)return r;r.status!==0&&!r.internalResponse&&(t.responseTainting,t.responseTainting==="basic"?r=kh(r,"basic"):t.responseTainting==="cors"?r=kh(r,"cors"):t.responseTainting==="opaque"?r=kh(r,"opaque"):yi(!1));let n=r.status===0?r:r.internalResponse;if(n.urlList.length===0&&n.urlList.push(...t.urlList),t.timingAllowFailed||(r.timingAllowPassed=!0),r.type==="opaque"&&n.status===206&&n.rangeRequested&&!t.headers.contains("range")&&(r=n=ue()),r.status!==0&&(t.method==="HEAD"||t.method==="CONNECT"||Tw.includes(n.status))&&(n.body=null,e.controller.dump=!0),t.integrity){let i=o=>Lh(e,ue(o));if(t.responseTainting==="opaque"||r.body==null){i(r.error);return}let s=o=>{if(!$2(o,t.integrity)){i("integrity mismatch");return}r.body=tg(o)[0],Lh(e,r)};await Lw(r.body,s,i)}else Lh(e,r)}function xw(e){if(mi(e)&&e.request.redirectCount===0)return Promise.resolve(eg(e));let{request:A}=e,{protocol:t}=St(A);switch(t){case"about:":return Promise.resolve(ue("about scheme is not supported"));case"blob:":{Fh||(Fh=require("buffer").resolveObjectURL);let r=St(A);if(r.search.length!==0)return Promise.resolve(ue("NetworkError when attempting to fetch resource."));let n=Fh(r.toString());if(A.method!=="GET"||!E1(n))return Promise.resolve(ue("invalid method"));let i=tg(n),s=i[0],o=Th(`${s.length}`),a=i[1]??"",c=Ag({statusText:"OK",headersList:[["content-length",{name:"Content-Length",value:o}],["content-type",{name:"Content-Type",value:a}]]});return c.body=s,Promise.resolve(c)}case"data:":{let r=St(A),n=k1(r);if(n==="failure")return Promise.resolve(ue("failed to fetch the data URL"));let i=S1(n.mimeType);return Promise.resolve(Ag({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:i}]],body:tg(n.body)[0]}))}case"file:":return Promise.resolve(ue("not implemented... yet..."));case"http:":case"https:":return Gw(e).catch(r=>ue(r));default:return Promise.resolve(ue("unknown scheme"))}}function v1(e,A){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(A))}function Lh(e,A){A.type==="error"&&(A.urlList=[e.request.urlList[0]],A.timingInfo=vh({startTime:e.timingInfo.startTime}));let t=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(A))};if(e.processResponse!=null&&queueMicrotask(()=>e.processResponse(A)),A.body==null)t();else{let r=(i,s)=>{s.enqueue(i)},n=new F1({start(){},transform:r,flush:t},{size(){return 1}},{size(){return 1}});A.body={stream:A.body.stream.pipeThrough(n)}}if(e.processResponseConsumeBody!=null){let r=i=>e.processResponseConsumeBody(A,i),n=i=>e.processResponseConsumeBody(A,i);if(A.body==null)queueMicrotask(()=>r(null));else return Lw(A.body,r,n);return Promise.resolve()}}async function Gw(e){let A=e.request,t=null,r=null,n=e.timingInfo;if(A.serviceWorkers,t===null){if(A.redirect==="follow"&&(A.serviceWorkers="none"),r=t=await Jw(e),A.responseTainting==="cors"&&c1(A,t)==="failure")return ue("cors failure");r1(A,t)==="failure"&&(A.timingAllowFailed=!0)}return(A.responseTainting==="opaque"||t.type==="opaque")&&g1(A.origin,A.client,A.destination,r)==="blocked"?ue("blocked"):(Uw.has(r.status)&&(A.redirect!=="manual"&&e.controller.connection.destroy(),A.redirect==="error"?t=ue("unexpected redirect"):A.redirect==="manual"?t=r:A.redirect==="follow"?t=await P1(e,t):yi(!1)),t.timingInfo=n,t)}function P1(e,A){let t=e.request,r=A.internalResponse?A.internalResponse:A,n;try{if(n=i1(r,St(t).hash),n==null)return A}catch(s){return Promise.resolve(ue(s))}if(!Gh(n))return Promise.resolve(ue("URL scheme must be a HTTP(S) scheme"));if(t.redirectCount===20)return Promise.resolve(ue("redirect count exceeded"));if(t.redirectCount+=1,t.mode==="cors"&&(n.username||n.password)&&!Uh(t,n))return Promise.resolve(ue('cross origin not allowed for request mode "cors"'));if(t.responseTainting==="cors"&&(n.username||n.password))return Promise.resolve(ue('URL cannot contain credentials for request mode "cors"'));if(r.status!==303&&t.body!=null&&t.body.source==null)return Promise.resolve(ue());if([301,302].includes(r.status)&&t.method==="POST"||r.status===303&&!U1.includes(t.method)){t.method="GET",t.body=null;for(let s of B1)t.headersList.delete(s)}Uh(St(t),n)||(t.headersList.delete("authorization"),t.headersList.delete("proxy-authorization",!0),t.headersList.delete("cookie"),t.headersList.delete("host")),t.body!=null&&(yi(t.body.source!=null),t.body=tg(t.body.source)[0]);let i=e.timingInfo;return i.redirectEndTime=i.postRedirectStartTime=Ph(e.crossOriginIsolatedCapability),i.redirectStartTime===0&&(i.redirectStartTime=i.startTime),t.urlList.push(n),s1(t,r),Pw(e,!0)}async function Jw(e,A=!1,t=!1){let r=e.request,n=null,i=null,s=null,o=null,a=!1;r.window==="no-window"&&r.redirect==="error"?(n=e,i=r):(i=z2(r),n={...e},n.request=i);let c=r.credentials==="include"||r.credentials==="same-origin"&&r.responseTainting==="basic",g=i.body?i.body.length:null,l=null;if(i.body==null&&["POST","PUT"].includes(i.method)&&(l="0"),g!=null&&(l=Th(`${g}`)),l!=null&&i.headersList.append("content-length",l),g!=null&&i.keepalive,i.referrer instanceof URL&&i.headersList.append("referer",Th(i.referrer.href)),n1(i),a1(i),i.headersList.contains("user-agent")||i.headersList.append("user-agent",typeof esbuildDetection>"u"?"undici":"node"),i.cache==="default"&&(i.headersList.contains("if-modified-since")||i.headersList.contains("if-none-match")||i.headersList.contains("if-unmodified-since")||i.headersList.contains("if-match")||i.headersList.contains("if-range"))&&(i.cache="no-store"),i.cache==="no-cache"&&!i.preventNoCacheCacheControlHeaderModification&&!i.headersList.contains("cache-control")&&i.headersList.append("cache-control","max-age=0"),(i.cache==="no-store"||i.cache==="reload")&&(i.headersList.contains("pragma")||i.headersList.append("pragma","no-cache"),i.headersList.contains("cache-control")||i.headersList.append("cache-control","no-cache")),i.headersList.contains("range")&&i.headersList.append("accept-encoding","identity"),i.headersList.contains("accept-encoding")||(C1(St(i))?i.headersList.append("accept-encoding","br, gzip, deflate"):i.headersList.append("accept-encoding","gzip, deflate")),i.headersList.delete("host"),o==null&&(i.cache="no-store"),i.mode!=="no-store"&&i.mode,s==null){if(i.mode==="only-if-cached")return ue("only if cached");let u=await G1(n,c,t);!I1.has(i.method)&&u.status>=200&&u.status<=399,a&&u.status,s==null&&(s=u)}if(s.urlList=[...i.urlList],i.headersList.contains("range")&&(s.rangeRequested=!0),s.requestIncludesCredentials=c,s.status===407)return r.window==="no-window"?ue():mi(e)?eg(e):ue("proxy authentication required");if(s.status===421&&!t&&(r.body==null||r.body.source!=null)){if(mi(e))return eg(e);e.controller.connection.destroy(),s=await Jw(e,A,!0)}return s}async function G1(e,A=!1,t=!1){yi(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(h){this.destroyed||(this.destroyed=!0,this.abort?.(h??new rg("The operation was aborted.","AbortError")))}};let r=e.request,n=null,i=e.timingInfo;null==null&&(r.cache="no-store");let o=t?"yes":"no";r.mode;let a=null;if(r.body==null&&e.processRequestEndOfBody)queueMicrotask(()=>e.processRequestEndOfBody());else if(r.body!=null){let h=async function*(I){mi(e)||(yield I,e.processRequestBodyChunkLength?.(I.byteLength))},d=()=>{mi(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},C=I=>{mi(e)||(I.name==="AbortError"?e.controller.abort():e.controller.terminate(I))};a=async function*(){try{for await(let I of r.body.stream)yield*h(I);d()}catch(I){C(I)}}()}try{let{body:h,status:d,statusText:C,headersList:I,socket:p}=await E({body:a});if(p)n=Ag({status:d,statusText:C,headersList:I,socket:p});else{let w=h[Symbol.asyncIterator]();e.controller.next=()=>w.next(),n=Ag({status:d,statusText:C,headersList:I})}}catch(h){return h.name==="AbortError"?(e.controller.connection.destroy(),eg(e,h)):ue(h)}let c=()=>{e.controller.resume()},g=h=>{e.controller.abort(h)};Nh||(Nh=require("stream/web").ReadableStream);let l=new Nh({async start(h){e.controller.controller=h},async pull(h){await c(h)},async cancel(h){await g(h)}},{highWaterMark:0,size(){return 1}});n.body={stream:l},e.controller.on("terminated",u),e.controller.resume=async()=>{for(;;){let h,d;try{let{done:C,value:I}=await e.controller.next();if(Sw(e))break;h=C?void 0:I}catch(C){e.controller.ended&&!i.encodedBodySize?h=void 0:(h=C,d=!0)}if(h===void 0){d1(e.controller.controller),v1(e,n);return}if(i.decodedBodySize+=h?.byteLength??0,d){e.controller.terminate(h);return}if(e.controller.controller.enqueue(new Uint8Array(h)),D1(l)){e.controller.terminate();return}if(!e.controller.controller.desiredSize)return}};function u(h){Sw(e)?(n.aborted=!0,ng(l)&&e.controller.controller.error(e.controller.serializedAbortReason)):ng(l)&&e.controller.controller.error(new TypeError("terminated",{cause:h1(h)?h:void 0})),e.controller.connection.destroy()}return n;async function E({body:h}){let d=St(r),C=e.controller.dispatcher;return new Promise((I,p)=>C.dispatch({path:d.pathname+d.search,origin:d.origin,method:r.method,body:e.controller.dispatcher.isMockActive?r.body&&(r.body.source||r.body.stream):h,headers:r.headersList.entries,maxRedirections:0,upgrade:r.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(w){let{connection:m}=e.controller;m.destroyed?w(new rg("The operation was aborted.","AbortError")):(e.controller.on("terminated",w),this.abort=m.abort=w)},onHeaders(w,m,K,H){if(w<200)return;let ne=[],q="",ae=new kw;if(Array.isArray(m))for(let Y=0;Yfe.trim()):ce.toLowerCase()==="location"&&(q=Je),ae[pi].append(ce,Je)}else{let Y=Object.keys(m);for(let ce of Y){let Je=m[ce];ce.toLowerCase()==="content-encoding"?ne=Je.toLowerCase().split(",").map(fe=>fe.trim()).reverse():ce.toLowerCase()==="location"&&(q=Je),ae[pi].append(ce,Je)}}this.body=new y1({read:K});let De=[],ee=r.redirect==="follow"&&q&&Uw.has(w);if(r.method!=="HEAD"&&r.method!=="CONNECT"&&!Tw.includes(w)&&!ee)for(let Y of ne)if(Y==="x-gzip"||Y==="gzip")De.push(eo.createGunzip({flush:eo.constants.Z_SYNC_FLUSH,finishFlush:eo.constants.Z_SYNC_FLUSH}));else if(Y==="deflate")De.push(eo.createInflate());else if(Y==="br")De.push(eo.createBrotliDecompress());else{De.length=0;break}return I({status:w,statusText:H,headersList:ae[pi],body:De.length?w1(this.body,...De,()=>{}):this.body.on("error",()=>{})}),!0},onData(w){if(e.controller.dump)return;let m=w;return i.encodedBodySize+=m.byteLength,this.body.push(m)},onComplete(){this.abort&&e.controller.off("terminated",this.abort),e.controller.ended=!0,this.body.push(null)},onError(w){this.abort&&e.controller.off("terminated",this.abort),this.body?.destroy(w),e.controller.terminate(w),p(w)},onUpgrade(w,m,K){if(w!==101)return;let H=new kw;for(let ne=0;ne{"use strict";Vw.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var Ow=Q((xj,qw)=>{"use strict";var{webidl:LA}=iA(),og=Symbol("ProgressEvent state"),Yh=class e extends Event{constructor(A,t={}){A=LA.converters.DOMString(A),t=LA.converters.ProgressEventInit(t??{}),super(A,t),this[og]={lengthComputable:t.lengthComputable,loaded:t.loaded,total:t.total}}get lengthComputable(){return LA.brandCheck(this,e),this[og].lengthComputable}get loaded(){return LA.brandCheck(this,e),this[og].loaded}get total(){return LA.brandCheck(this,e),this[og].total}};LA.converters.ProgressEventInit=LA.dictionaryConverter([{key:"lengthComputable",converter:LA.converters.boolean,defaultValue:!1},{key:"loaded",converter:LA.converters["unsigned long long"],defaultValue:0},{key:"total",converter:LA.converters["unsigned long long"],defaultValue:0},{key:"bubbles",converter:LA.converters.boolean,defaultValue:!1},{key:"cancelable",converter:LA.converters.boolean,defaultValue:!1},{key:"composed",converter:LA.converters.boolean,defaultValue:!1}]);qw.exports={ProgressEvent:Yh}});var Ww=Q((Lj,Hw)=>{"use strict";function J1(e){if(!e)return"failure";switch(e.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}Hw.exports={getEncoding:J1}});var e0=Q((Uj,$w)=>{"use strict";var{kState:wi,kError:Vh,kResult:_w,kAborted:Ao,kLastProgressEventFired:qh}=Jh(),{ProgressEvent:Y1}=Ow(),{getEncoding:jw}=Ww(),{DOMException:V1}=mr(),{serializeAMimeType:q1,parseMIMEType:Kw}=$A(),{types:O1}=require("util"),{StringDecoder:Zw}=require("string_decoder"),{btoa:Xw}=require("buffer"),H1={enumerable:!0,writable:!1,configurable:!1};function W1(e,A,t,r){if(e[wi]==="loading")throw new V1("Invalid state","InvalidStateError");e[wi]="loading",e[_w]=null,e[Vh]=null;let i=A.stream().getReader(),s=[],o=i.read(),a=!0;(async()=>{for(;!e[Ao];)try{let{done:c,value:g}=await o;if(a&&!e[Ao]&&queueMicrotask(()=>{Fr("loadstart",e)}),a=!1,!c&&O1.isUint8Array(g))s.push(g),(e[qh]===void 0||Date.now()-e[qh]>=50)&&!e[Ao]&&(e[qh]=Date.now(),queueMicrotask(()=>{Fr("progress",e)})),o=i.read();else if(c){queueMicrotask(()=>{e[wi]="done";try{let l=_1(s,t,A.type,r);if(e[Ao])return;e[_w]=l,Fr("load",e)}catch(l){e[Vh]=l,Fr("error",e)}e[wi]!=="loading"&&Fr("loadend",e)});break}}catch(c){if(e[Ao])return;queueMicrotask(()=>{e[wi]="done",e[Vh]=c,Fr("error",e),e[wi]!=="loading"&&Fr("loadend",e)});break}})()}function Fr(e,A){let t=new Y1(e,{bubbles:!1,cancelable:!1});A.dispatchEvent(t)}function _1(e,A,t,r){switch(A){case"DataURL":{let n="data:",i=Kw(t||"application/octet-stream");i!=="failure"&&(n+=q1(i)),n+=";base64,";let s=new Zw("latin1");for(let o of e)n+=Xw(s.write(o));return n+=Xw(s.end()),n}case"Text":{let n="failure";if(r&&(n=jw(r)),n==="failure"&&t){let i=Kw(t);i!=="failure"&&(n=jw(i.parameters.get("charset")))}return n==="failure"&&(n="UTF-8"),j1(e,n)}case"ArrayBuffer":return zw(e).buffer;case"BinaryString":{let n="",i=new Zw("latin1");for(let s of e)n+=i.write(s);return n+=i.end(),n}}}function j1(e,A){let t=zw(e),r=K1(t),n=0;r!==null&&(A=r,n=r==="UTF-8"?3:2);let i=t.slice(n);return new TextDecoder(A).decode(i)}function K1(e){let[A,t,r]=e;return A===239&&t===187&&r===191?"UTF-8":A===254&&t===255?"UTF-16BE":A===255&&t===254?"UTF-16LE":null}function zw(e){let A=e.reduce((r,n)=>r+n.byteLength,0),t=0;return e.reduce((r,n)=>(r.set(n,t),t+=n.byteLength,r),new Uint8Array(A))}$w.exports={staticPropertyDescriptors:H1,readOperation:W1,fireAProgressEvent:Fr}});var n0=Q((Tj,r0)=>{"use strict";var{staticPropertyDescriptors:Ri,readOperation:ag,fireAProgressEvent:A0}=e0(),{kState:nn,kError:t0,kResult:cg,kEvents:$,kAborted:Z1}=Jh(),{webidl:se}=iA(),{kEnumerableProperty:BA}=W(),rt=class e extends EventTarget{constructor(){super(),this[nn]="empty",this[cg]=null,this[t0]=null,this[$]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(A){se.brandCheck(this,e),se.argumentLengthCheck(arguments,1,{header:"FileReader.readAsArrayBuffer"}),A=se.converters.Blob(A,{strict:!1}),ag(this,A,"ArrayBuffer")}readAsBinaryString(A){se.brandCheck(this,e),se.argumentLengthCheck(arguments,1,{header:"FileReader.readAsBinaryString"}),A=se.converters.Blob(A,{strict:!1}),ag(this,A,"BinaryString")}readAsText(A,t=void 0){se.brandCheck(this,e),se.argumentLengthCheck(arguments,1,{header:"FileReader.readAsText"}),A=se.converters.Blob(A,{strict:!1}),t!==void 0&&(t=se.converters.DOMString(t)),ag(this,A,"Text",t)}readAsDataURL(A){se.brandCheck(this,e),se.argumentLengthCheck(arguments,1,{header:"FileReader.readAsDataURL"}),A=se.converters.Blob(A,{strict:!1}),ag(this,A,"DataURL")}abort(){if(this[nn]==="empty"||this[nn]==="done"){this[cg]=null;return}this[nn]==="loading"&&(this[nn]="done",this[cg]=null),this[Z1]=!0,A0("abort",this),this[nn]!=="loading"&&A0("loadend",this)}get readyState(){switch(se.brandCheck(this,e),this[nn]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return se.brandCheck(this,e),this[cg]}get error(){return se.brandCheck(this,e),this[t0]}get onloadend(){return se.brandCheck(this,e),this[$].loadend}set onloadend(A){se.brandCheck(this,e),this[$].loadend&&this.removeEventListener("loadend",this[$].loadend),typeof A=="function"?(this[$].loadend=A,this.addEventListener("loadend",A)):this[$].loadend=null}get onerror(){return se.brandCheck(this,e),this[$].error}set onerror(A){se.brandCheck(this,e),this[$].error&&this.removeEventListener("error",this[$].error),typeof A=="function"?(this[$].error=A,this.addEventListener("error",A)):this[$].error=null}get onloadstart(){return se.brandCheck(this,e),this[$].loadstart}set onloadstart(A){se.brandCheck(this,e),this[$].loadstart&&this.removeEventListener("loadstart",this[$].loadstart),typeof A=="function"?(this[$].loadstart=A,this.addEventListener("loadstart",A)):this[$].loadstart=null}get onprogress(){return se.brandCheck(this,e),this[$].progress}set onprogress(A){se.brandCheck(this,e),this[$].progress&&this.removeEventListener("progress",this[$].progress),typeof A=="function"?(this[$].progress=A,this.addEventListener("progress",A)):this[$].progress=null}get onload(){return se.brandCheck(this,e),this[$].load}set onload(A){se.brandCheck(this,e),this[$].load&&this.removeEventListener("load",this[$].load),typeof A=="function"?(this[$].load=A,this.addEventListener("load",A)):this[$].load=null}get onabort(){return se.brandCheck(this,e),this[$].abort}set onabort(A){se.brandCheck(this,e),this[$].abort&&this.removeEventListener("abort",this[$].abort),typeof A=="function"?(this[$].abort=A,this.addEventListener("abort",A)):this[$].abort=null}};rt.EMPTY=rt.prototype.EMPTY=0;rt.LOADING=rt.prototype.LOADING=1;rt.DONE=rt.prototype.DONE=2;Object.defineProperties(rt.prototype,{EMPTY:Ri,LOADING:Ri,DONE:Ri,readAsArrayBuffer:BA,readAsBinaryString:BA,readAsText:BA,readAsDataURL:BA,abort:BA,readyState:BA,result:BA,error:BA,onloadstart:BA,onprogress:BA,onload:BA,onabort:BA,onerror:BA,onloadend:BA,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(rt,{EMPTY:Ri,LOADING:Ri,DONE:Ri});r0.exports={FileReader:rt}});var gg=Q((Mj,i0)=>{"use strict";i0.exports={kConstruct:de().kConstruct}});var a0=Q((vj,o0)=>{"use strict";var X1=require("assert"),{URLSerializer:s0}=$A(),{isValidHeaderName:z1}=YA();function $1(e,A,t=!1){let r=s0(e,t),n=s0(A,t);return r===n}function eG(e){X1(e!==null);let A=[];for(let t of e.split(",")){if(t=t.trim(),t.length){if(!z1(t))continue}else continue;A.push(t)}return A}o0.exports={urlEquals:$1,fieldValues:eG}});var d0=Q((Pj,h0)=>{"use strict";var{kConstruct:AG}=gg(),{urlEquals:tG,fieldValues:Oh}=a0(),{kEnumerableProperty:sn,isDisturbed:rG}=W(),{kHeadersList:c0}=de(),{webidl:F}=iA(),{Response:l0,cloneResponse:nG}=jc(),{Request:Ft}=$s(),{kState:gA,kHeaders:lg,kGuard:g0,kRealm:iG}=qt(),{fetching:sG}=sg(),{urlIsHttpHttpsScheme:ug,createDeferredPromise:Di,readAllBytes:oG}=YA(),Hh=require("assert"),{getGlobalDispatcher:aG}=Qi(),Nt,pA,Eg,bi,u0,zt=class zt{constructor(){Ne(this,pA);Ne(this,Nt);arguments[0]!==AG&&F.illegalConstructor(),Ae(this,Nt,arguments[1])}async match(A,t={}){F.brandCheck(this,zt),F.argumentLengthCheck(arguments,1,{header:"Cache.match"}),A=F.converters.RequestInfo(A),t=F.converters.CacheQueryOptions(t);let r=await this.matchAll(A,t);if(r.length!==0)return r[0]}async matchAll(A=void 0,t={}){F.brandCheck(this,zt),A!==void 0&&(A=F.converters.RequestInfo(A)),t=F.converters.CacheQueryOptions(t);let r=null;if(A!==void 0)if(A instanceof Ft){if(r=A[gA],r.method!=="GET"&&!t.ignoreMethod)return[]}else typeof A=="string"&&(r=new Ft(A)[gA]);let n=[];if(A===void 0)for(let s of f(this,Nt))n.push(s[1]);else{let s=MA(this,pA,bi).call(this,r,t);for(let o of s)n.push(o[1])}let i=[];for(let s of n){let o=new l0(s.body?.source??null),a=o[gA].body;o[gA]=s,o[gA].body=a,o[lg][c0]=s.headersList,o[lg][g0]="immutable",i.push(o)}return Object.freeze(i)}async add(A){F.brandCheck(this,zt),F.argumentLengthCheck(arguments,1,{header:"Cache.add"}),A=F.converters.RequestInfo(A);let t=[A];return await this.addAll(t)}async addAll(A){F.brandCheck(this,zt),F.argumentLengthCheck(arguments,1,{header:"Cache.addAll"}),A=F.converters["sequence"](A);let t=[],r=[];for(let l of A){if(typeof l=="string")continue;let u=l[gA];if(!ug(u.url)||u.method!=="GET")throw F.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme when method is not GET."})}let n=[];for(let l of A){let u=new Ft(l)[gA];if(!ug(u.url))throw F.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme."});u.initiator="fetch",u.destination="subresource",r.push(u);let E=Di();n.push(sG({request:u,dispatcher:aG(),processResponse(h){if(h.type==="error"||h.status===206||h.status<200||h.status>299)E.reject(F.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(h.headersList.contains("vary")){let d=Oh(h.headersList.get("vary"));for(let C of d)if(C==="*"){E.reject(F.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let I of n)I.abort();return}}},processResponseEndOfBody(h){if(h.aborted){E.reject(new DOMException("aborted","AbortError"));return}E.resolve(h)}})),t.push(E.promise)}let s=await Promise.all(t),o=[],a=0;for(let l of s){let u={type:"put",request:r[a],response:l};o.push(u),a++}let c=Di(),g=null;try{MA(this,pA,Eg).call(this,o)}catch(l){g=l}return queueMicrotask(()=>{g===null?c.resolve(void 0):c.reject(g)}),c.promise}async put(A,t){F.brandCheck(this,zt),F.argumentLengthCheck(arguments,2,{header:"Cache.put"}),A=F.converters.RequestInfo(A),t=F.converters.Response(t);let r=null;if(A instanceof Ft?r=A[gA]:r=new Ft(A)[gA],!ug(r.url)||r.method!=="GET")throw F.errors.exception({header:"Cache.put",message:"Expected an http/s scheme when method is not GET"});let n=t[gA];if(n.status===206)throw F.errors.exception({header:"Cache.put",message:"Got 206 status"});if(n.headersList.contains("vary")){let u=Oh(n.headersList.get("vary"));for(let E of u)if(E==="*")throw F.errors.exception({header:"Cache.put",message:"Got * vary field value"})}if(n.body&&(rG(n.body.stream)||n.body.stream.locked))throw F.errors.exception({header:"Cache.put",message:"Response body is locked or disturbed"});let i=nG(n),s=Di();if(n.body!=null){let E=n.body.stream.getReader();oG(E).then(s.resolve,s.reject)}else s.resolve(void 0);let o=[],a={type:"put",request:r,response:i};o.push(a);let c=await s.promise;i.body!=null&&(i.body.source=c);let g=Di(),l=null;try{MA(this,pA,Eg).call(this,o)}catch(u){l=u}return queueMicrotask(()=>{l===null?g.resolve():g.reject(l)}),g.promise}async delete(A,t={}){F.brandCheck(this,zt),F.argumentLengthCheck(arguments,1,{header:"Cache.delete"}),A=F.converters.RequestInfo(A),t=F.converters.CacheQueryOptions(t);let r=null;if(A instanceof Ft){if(r=A[gA],r.method!=="GET"&&!t.ignoreMethod)return!1}else Hh(typeof A=="string"),r=new Ft(A)[gA];let n=[],i={type:"delete",request:r,options:t};n.push(i);let s=Di(),o=null,a;try{a=MA(this,pA,Eg).call(this,n)}catch(c){o=c}return queueMicrotask(()=>{o===null?s.resolve(!!a?.length):s.reject(o)}),s.promise}async keys(A=void 0,t={}){F.brandCheck(this,zt),A!==void 0&&(A=F.converters.RequestInfo(A)),t=F.converters.CacheQueryOptions(t);let r=null;if(A!==void 0)if(A instanceof Ft){if(r=A[gA],r.method!=="GET"&&!t.ignoreMethod)return[]}else typeof A=="string"&&(r=new Ft(A)[gA]);let n=Di(),i=[];if(A===void 0)for(let s of f(this,Nt))i.push(s[0]);else{let s=MA(this,pA,bi).call(this,r,t);for(let o of s)i.push(o[0])}return queueMicrotask(()=>{let s=[];for(let o of i){let a=new Ft("https://a");a[gA]=o,a[lg][c0]=o.headersList,a[lg][g0]="immutable",a[iG]=o.client,s.push(a)}n.resolve(Object.freeze(s))}),n.promise}};Nt=new WeakMap,pA=new WeakSet,Eg=function(A){let t=f(this,Nt),r=[...t],n=[],i=[];try{for(let s of A){if(s.type!=="delete"&&s.type!=="put")throw F.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(s.type==="delete"&&s.response!=null)throw F.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(MA(this,pA,bi).call(this,s.request,s.options,n).length)throw new DOMException("???","InvalidStateError");let o;if(s.type==="delete"){if(o=MA(this,pA,bi).call(this,s.request,s.options),o.length===0)return[];for(let a of o){let c=t.indexOf(a);Hh(c!==-1),t.splice(c,1)}}else if(s.type==="put"){if(s.response==null)throw F.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let a=s.request;if(!ug(a.url))throw F.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(a.method!=="GET")throw F.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(s.options!=null)throw F.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});o=MA(this,pA,bi).call(this,s.request);for(let c of o){let g=t.indexOf(c);Hh(g!==-1),t.splice(g,1)}t.push([s.request,s.response]),n.push([s.request,s.response])}i.push([s.request,s.response])}return i}catch(s){throw f(this,Nt).length=0,Ae(this,Nt,r),s}},bi=function(A,t,r){let n=[],i=r??f(this,Nt);for(let s of i){let[o,a]=s;MA(this,pA,u0).call(this,A,o,a,t)&&n.push(s)}return n},u0=function(A,t,r=null,n){let i=new URL(A.url),s=new URL(t.url);if(n?.ignoreSearch&&(s.search="",i.search=""),!tG(i,s,!0))return!1;if(r==null||n?.ignoreVary||!r.headersList.contains("vary"))return!0;let o=Oh(r.headersList.get("vary"));for(let a of o){if(a==="*")return!1;let c=t.headersList.get(a),g=A.headersList.get(a);if(c!==g)return!1}return!0};var hg=zt;Object.defineProperties(hg.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:sn,matchAll:sn,add:sn,addAll:sn,put:sn,delete:sn,keys:sn});var E0=[{key:"ignoreSearch",converter:F.converters.boolean,defaultValue:!1},{key:"ignoreMethod",converter:F.converters.boolean,defaultValue:!1},{key:"ignoreVary",converter:F.converters.boolean,defaultValue:!1}];F.converters.CacheQueryOptions=F.dictionaryConverter(E0);F.converters.MultiCacheQueryOptions=F.dictionaryConverter([...E0,{key:"cacheName",converter:F.converters.DOMString}]);F.converters.Response=F.interfaceConverter(l0);F.converters["sequence"]=F.sequenceConverter(F.converters.RequestInfo);h0.exports={Cache:hg}});var C0=Q((Jj,Q0)=>{"use strict";var{kConstruct:to}=gg(),{Cache:dg}=d0(),{webidl:lA}=iA(),{kEnumerableProperty:ro}=W(),OA,on=class on{constructor(){Ne(this,OA,new Map);arguments[0]!==to&&lA.illegalConstructor()}async match(A,t={}){if(lA.brandCheck(this,on),lA.argumentLengthCheck(arguments,1,{header:"CacheStorage.match"}),A=lA.converters.RequestInfo(A),t=lA.converters.MultiCacheQueryOptions(t),t.cacheName!=null){if(f(this,OA).has(t.cacheName)){let r=f(this,OA).get(t.cacheName);return await new dg(to,r).match(A,t)}}else for(let r of f(this,OA).values()){let i=await new dg(to,r).match(A,t);if(i!==void 0)return i}}async has(A){return lA.brandCheck(this,on),lA.argumentLengthCheck(arguments,1,{header:"CacheStorage.has"}),A=lA.converters.DOMString(A),f(this,OA).has(A)}async open(A){if(lA.brandCheck(this,on),lA.argumentLengthCheck(arguments,1,{header:"CacheStorage.open"}),A=lA.converters.DOMString(A),f(this,OA).has(A)){let r=f(this,OA).get(A);return new dg(to,r)}let t=[];return f(this,OA).set(A,t),new dg(to,t)}async delete(A){return lA.brandCheck(this,on),lA.argumentLengthCheck(arguments,1,{header:"CacheStorage.delete"}),A=lA.converters.DOMString(A),f(this,OA).delete(A)}async keys(){return lA.brandCheck(this,on),[...f(this,OA).keys()]}};OA=new WeakMap;var Qg=on;Object.defineProperties(Qg.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:ro,has:ro,open:ro,delete:ro,keys:ro});Q0.exports={CacheStorage:Qg}});var I0=Q((Vj,f0)=>{"use strict";f0.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Wh=Q((qj,m0)=>{"use strict";var B0=require("assert"),{kHeadersList:p0}=de();function cG(e){if(e.length===0)return!1;for(let A of e){let t=A.charCodeAt(0);if(t>=0||t<=8||t>=10||t<=31||t===127)return!1}}function gG(e){for(let A of e){let t=A.charCodeAt(0);if(t<=32||t>127||A==="("||A===")"||A===">"||A==="<"||A==="@"||A===","||A===";"||A===":"||A==="\\"||A==='"'||A==="/"||A==="["||A==="]"||A==="?"||A==="="||A==="{"||A==="}")throw new Error("Invalid cookie name")}}function lG(e){for(let A of e){let t=A.charCodeAt(0);if(t<33||t===34||t===44||t===59||t===92||t>126)throw new Error("Invalid header value")}}function uG(e){for(let A of e)if(A.charCodeAt(0)<33||A===";")throw new Error("Invalid cookie path")}function EG(e){if(e.startsWith("-")||e.endsWith(".")||e.endsWith("-"))throw new Error("Invalid cookie domain")}function hG(e){typeof e=="number"&&(e=new Date(e));let A=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=A[e.getUTCDay()],n=e.getUTCDate().toString().padStart(2,"0"),i=t[e.getUTCMonth()],s=e.getUTCFullYear(),o=e.getUTCHours().toString().padStart(2,"0"),a=e.getUTCMinutes().toString().padStart(2,"0"),c=e.getUTCSeconds().toString().padStart(2,"0");return`${r}, ${n} ${i} ${s} ${o}:${a}:${c} GMT`}function dG(e){if(e<0)throw new Error("Invalid cookie max-age")}function QG(e){if(e.name.length===0)return null;gG(e.name),lG(e.value);let A=[`${e.name}=${e.value}`];e.name.startsWith("__Secure-")&&(e.secure=!0),e.name.startsWith("__Host-")&&(e.secure=!0,e.domain=null,e.path="/"),e.secure&&A.push("Secure"),e.httpOnly&&A.push("HttpOnly"),typeof e.maxAge=="number"&&(dG(e.maxAge),A.push(`Max-Age=${e.maxAge}`)),e.domain&&(EG(e.domain),A.push(`Domain=${e.domain}`)),e.path&&(uG(e.path),A.push(`Path=${e.path}`)),e.expires&&e.expires.toString()!=="Invalid Date"&&A.push(`Expires=${hG(e.expires)}`),e.sameSite&&A.push(`SameSite=${e.sameSite}`);for(let t of e.unparsed){if(!t.includes("="))throw new Error("Invalid unparsed");let[r,...n]=t.split("=");A.push(`${r.trim()}=${n.join("=")}`)}return A.join("; ")}var Cg;function CG(e){if(e[p0])return e[p0];Cg||(Cg=Object.getOwnPropertySymbols(e).find(t=>t.description==="headers list"),B0(Cg,"Headers cannot be parsed"));let A=e[Cg];return B0(A),A}m0.exports={isCTLExcludingHtab:cG,stringify:QG,getHeadersList:CG}});var w0=Q((Oj,y0)=>{"use strict";var{maxNameValuePairSize:fG,maxAttributeValueSize:IG}=I0(),{isCTLExcludingHtab:BG}=Wh(),{collectASequenceOfCodePointsFast:fg}=$A(),pG=require("assert");function mG(e){if(BG(e))return null;let A="",t="",r="",n="";if(e.includes(";")){let i={position:0};A=fg(";",e,i),t=e.slice(i.position)}else A=e;if(!A.includes("="))n=A;else{let i={position:0};r=fg("=",A,i),n=A.slice(i.position+1)}return r=r.trim(),n=n.trim(),r.length+n.length>fG?null:{name:r,value:n,...ki(t)}}function ki(e,A={}){if(e.length===0)return A;pG(e[0]===";"),e=e.slice(1);let t="";e.includes(";")?(t=fg(";",e,{position:0}),e=e.slice(t.length)):(t=e,e="");let r="",n="";if(t.includes("=")){let s={position:0};r=fg("=",t,s),n=t.slice(s.position+1)}else r=t;if(r=r.trim(),n=n.trim(),n.length>IG)return ki(e,A);let i=r.toLowerCase();if(i==="expires"){let s=new Date(n);A.expires=s}else if(i==="max-age"){let s=n.charCodeAt(0);if((s<48||s>57)&&n[0]!=="-"||!/^\d+$/.test(n))return ki(e,A);let o=Number(n);A.maxAge=o}else if(i==="domain"){let s=n;s[0]==="."&&(s=s.slice(1)),s=s.toLowerCase(),A.domain=s}else if(i==="path"){let s="";n.length===0||n[0]!=="/"?s="/":s=n,A.path=s}else if(i==="secure")A.secure=!0;else if(i==="httponly")A.httpOnly=!0;else if(i==="samesite"){let s="Default",o=n.toLowerCase();o.includes("none")&&(s="None"),o.includes("strict")&&(s="Strict"),o.includes("lax")&&(s="Lax"),A.sameSite=s}else A.unparsed??=[],A.unparsed.push(`${r}=${n}`);return ki(e,A)}y0.exports={parseSetCookie:mG,parseUnparsedAttributes:ki}});var k0=Q((Hj,b0)=>{"use strict";var{parseSetCookie:yG}=w0(),{stringify:R0,getHeadersList:wG}=Wh(),{webidl:O}=iA(),{Headers:Ig}=tn();function RG(e){O.argumentLengthCheck(arguments,1,{header:"getCookies"}),O.brandCheck(e,Ig,{strict:!1});let A=e.get("cookie"),t={};if(!A)return t;for(let r of A.split(";")){let[n,...i]=r.split("=");t[n.trim()]=i.join("=")}return t}function DG(e,A,t){O.argumentLengthCheck(arguments,2,{header:"deleteCookie"}),O.brandCheck(e,Ig,{strict:!1}),A=O.converters.DOMString(A),t=O.converters.DeleteCookieAttributes(t),D0(e,{name:A,value:"",expires:new Date(0),...t})}function bG(e){O.argumentLengthCheck(arguments,1,{header:"getSetCookies"}),O.brandCheck(e,Ig,{strict:!1});let A=wG(e).cookies;return A?A.map(t=>yG(Array.isArray(t)?t[1]:t)):[]}function D0(e,A){O.argumentLengthCheck(arguments,2,{header:"setCookie"}),O.brandCheck(e,Ig,{strict:!1}),A=O.converters.Cookie(A),R0(A)&&e.append("Set-Cookie",R0(A))}O.converters.DeleteCookieAttributes=O.dictionaryConverter([{converter:O.nullableConverter(O.converters.DOMString),key:"path",defaultValue:null},{converter:O.nullableConverter(O.converters.DOMString),key:"domain",defaultValue:null}]);O.converters.Cookie=O.dictionaryConverter([{converter:O.converters.DOMString,key:"name"},{converter:O.converters.DOMString,key:"value"},{converter:O.nullableConverter(e=>typeof e=="number"?O.converters["unsigned long long"](e):new Date(e)),key:"expires",defaultValue:null},{converter:O.nullableConverter(O.converters["long long"]),key:"maxAge",defaultValue:null},{converter:O.nullableConverter(O.converters.DOMString),key:"domain",defaultValue:null},{converter:O.nullableConverter(O.converters.DOMString),key:"path",defaultValue:null},{converter:O.nullableConverter(O.converters.boolean),key:"secure",defaultValue:null},{converter:O.nullableConverter(O.converters.boolean),key:"httpOnly",defaultValue:null},{converter:O.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:O.sequenceConverter(O.converters.DOMString),key:"unparsed",defaultValue:[]}]);b0.exports={getCookies:RG,deleteCookie:DG,getSetCookies:bG,setCookie:D0}});var Si=Q((Wj,S0)=>{"use strict";var kG="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",SG={enumerable:!0,writable:!1,configurable:!1},FG={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},NG={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},xG=2**16-1,LG={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},UG=Buffer.allocUnsafe(0);S0.exports={uid:kG,staticPropertyDescriptors:SG,states:FG,opcodes:NG,maxUnsigned16Bit:xG,parserStates:LG,emptyBuffer:UG}});var no=Q((_j,F0)=>{"use strict";F0.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var jh=Q((jj,N0)=>{"use strict";var{webidl:N}=iA(),{kEnumerableProperty:mA}=W(),{MessagePort:TG}=require("worker_threads"),nt,$t=class $t extends Event{constructor(t,r={}){N.argumentLengthCheck(arguments,1,{header:"MessageEvent constructor"}),t=N.converters.DOMString(t),r=N.converters.MessageEventInit(r);super(t,r);Ne(this,nt);Ae(this,nt,r)}get data(){return N.brandCheck(this,$t),f(this,nt).data}get origin(){return N.brandCheck(this,$t),f(this,nt).origin}get lastEventId(){return N.brandCheck(this,$t),f(this,nt).lastEventId}get source(){return N.brandCheck(this,$t),f(this,nt).source}get ports(){return N.brandCheck(this,$t),Object.isFrozen(f(this,nt).ports)||Object.freeze(f(this,nt).ports),f(this,nt).ports}initMessageEvent(t,r=!1,n=!1,i=null,s="",o="",a=null,c=[]){return N.brandCheck(this,$t),N.argumentLengthCheck(arguments,1,{header:"MessageEvent.initMessageEvent"}),new $t(t,{bubbles:r,cancelable:n,data:i,origin:s,lastEventId:o,source:a,ports:c})}};nt=new WeakMap;var Bg=$t,cn,io=class io extends Event{constructor(t,r={}){N.argumentLengthCheck(arguments,1,{header:"CloseEvent constructor"}),t=N.converters.DOMString(t),r=N.converters.CloseEventInit(r);super(t,r);Ne(this,cn);Ae(this,cn,r)}get wasClean(){return N.brandCheck(this,io),f(this,cn).wasClean}get code(){return N.brandCheck(this,io),f(this,cn).code}get reason(){return N.brandCheck(this,io),f(this,cn).reason}};cn=new WeakMap;var pg=io,er,an=class an extends Event{constructor(t,r){N.argumentLengthCheck(arguments,1,{header:"ErrorEvent constructor"});super(t,r);Ne(this,er);t=N.converters.DOMString(t),r=N.converters.ErrorEventInit(r??{}),Ae(this,er,r)}get message(){return N.brandCheck(this,an),f(this,er).message}get filename(){return N.brandCheck(this,an),f(this,er).filename}get lineno(){return N.brandCheck(this,an),f(this,er).lineno}get colno(){return N.brandCheck(this,an),f(this,er).colno}get error(){return N.brandCheck(this,an),f(this,er).error}};er=new WeakMap;var mg=an;Object.defineProperties(Bg.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:mA,origin:mA,lastEventId:mA,source:mA,ports:mA,initMessageEvent:mA});Object.defineProperties(pg.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:mA,code:mA,wasClean:mA});Object.defineProperties(mg.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:mA,filename:mA,lineno:mA,colno:mA,error:mA});N.converters.MessagePort=N.interfaceConverter(TG);N.converters["sequence"]=N.sequenceConverter(N.converters.MessagePort);var _h=[{key:"bubbles",converter:N.converters.boolean,defaultValue:!1},{key:"cancelable",converter:N.converters.boolean,defaultValue:!1},{key:"composed",converter:N.converters.boolean,defaultValue:!1}];N.converters.MessageEventInit=N.dictionaryConverter([..._h,{key:"data",converter:N.converters.any,defaultValue:null},{key:"origin",converter:N.converters.USVString,defaultValue:""},{key:"lastEventId",converter:N.converters.DOMString,defaultValue:""},{key:"source",converter:N.nullableConverter(N.converters.MessagePort),defaultValue:null},{key:"ports",converter:N.converters["sequence"],get defaultValue(){return[]}}]);N.converters.CloseEventInit=N.dictionaryConverter([..._h,{key:"wasClean",converter:N.converters.boolean,defaultValue:!1},{key:"code",converter:N.converters["unsigned short"],defaultValue:0},{key:"reason",converter:N.converters.USVString,defaultValue:""}]);N.converters.ErrorEventInit=N.dictionaryConverter([..._h,{key:"message",converter:N.converters.DOMString,defaultValue:""},{key:"filename",converter:N.converters.USVString,defaultValue:""},{key:"lineno",converter:N.converters["unsigned long"],defaultValue:0},{key:"colno",converter:N.converters["unsigned long"],defaultValue:0},{key:"error",converter:N.converters.any}]);N0.exports={MessageEvent:Bg,CloseEvent:pg,ErrorEvent:mg}});var Rg=Q((Zj,U0)=>{"use strict";var{kReadyState:yg,kController:MG,kResponse:vG,kBinaryType:PG,kWebSocketURL:GG}=no(),{states:wg,opcodes:x0}=Si(),{MessageEvent:JG,ErrorEvent:YG}=jh();function VG(e){return e[yg]===wg.OPEN}function qG(e){return e[yg]===wg.CLOSING}function OG(e){return e[yg]===wg.CLOSED}function Kh(e,A,t=Event,r){let n=new t(e,r);A.dispatchEvent(n)}function HG(e,A,t){if(e[yg]!==wg.OPEN)return;let r;if(A===x0.TEXT)try{r=new TextDecoder("utf-8",{fatal:!0}).decode(t)}catch{L0(e,"Received invalid UTF-8 in text frame.");return}else A===x0.BINARY&&(e[PG]==="blob"?r=new Blob([t]):r=new Uint8Array(t).buffer);Kh("message",e,JG,{origin:e[GG].origin,data:r})}function WG(e){if(e.length===0)return!1;for(let A of e){let t=A.charCodeAt(0);if(t<33||t>126||A==="("||A===")"||A==="<"||A===">"||A==="@"||A===","||A===";"||A===":"||A==="\\"||A==='"'||A==="/"||A==="["||A==="]"||A==="?"||A==="="||A==="{"||A==="}"||t===32||t===9)return!1}return!0}function _G(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function L0(e,A){let{[MG]:t,[vG]:r}=e;t.abort(),r?.socket&&!r.socket.destroyed&&r.socket.destroy(),A&&Kh("error",e,YG,{error:new Error(A)})}U0.exports={isEstablished:VG,isClosing:qG,isClosed:OG,fireEvent:Kh,isValidSubprotocol:WG,isValidStatusCode:_G,failWebsocketConnection:L0,websocketMessageReceived:HG}});var J0=Q((Xj,G0)=>{"use strict";var Xh=require("diagnostics_channel"),{uid:jG,states:M0}=Si(),{kReadyState:v0,kSentClose:T0,kByteParser:P0,kReceivedClose:KG}=no(),{fireEvent:ZG,failWebsocketConnection:gn}=Rg(),{CloseEvent:XG}=jh(),{makeRequest:zG}=$s(),{fetching:$G}=sg(),{Headers:eJ}=tn(),{getGlobalDispatcher:AJ}=Qi(),{kHeadersList:tJ}=de(),Ar={};Ar.open=Xh.channel("undici:websocket:open");Ar.close=Xh.channel("undici:websocket:close");Ar.socketError=Xh.channel("undici:websocket:socket_error");var Zh;try{Zh=require("crypto")}catch{}function rJ(e,A,t,r,n){let i=e;i.protocol=e.protocol==="ws:"?"http:":"https:";let s=zG({urlList:[i],serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(n.headers){let g=new eJ(n.headers)[tJ];s.headersList=g}let o=Zh.randomBytes(16).toString("base64");s.headersList.append("sec-websocket-key",o),s.headersList.append("sec-websocket-version","13");for(let g of A)s.headersList.append("sec-websocket-protocol",g);let a="";return $G({request:s,useParallelQueue:!0,dispatcher:n.dispatcher??AJ(),processResponse(g){if(g.type==="error"||g.status!==101){gn(t,"Received network error or non-101 status code.");return}if(A.length!==0&&!g.headersList.get("Sec-WebSocket-Protocol")){gn(t,"Server did not respond with sent protocols.");return}if(g.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){gn(t,'Server did not set Upgrade header to "websocket".');return}if(g.headersList.get("Connection")?.toLowerCase()!=="upgrade"){gn(t,'Server did not set Connection header to "upgrade".');return}let l=g.headersList.get("Sec-WebSocket-Accept"),u=Zh.createHash("sha1").update(o+jG).digest("base64");if(l!==u){gn(t,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let E=g.headersList.get("Sec-WebSocket-Extensions");if(E!==null&&E!==a){gn(t,"Received different permessage-deflate than the one set.");return}let h=g.headersList.get("Sec-WebSocket-Protocol");if(h!==null&&h!==s.headersList.get("Sec-WebSocket-Protocol")){gn(t,"Protocol was not set in the opening handshake.");return}g.socket.on("data",nJ),g.socket.on("close",iJ),g.socket.on("error",sJ),Ar.open.hasSubscribers&&Ar.open.publish({address:g.socket.address(),protocol:h,extensions:E}),r(g)}})}function nJ(e){this.ws[P0].write(e)||this.pause()}function iJ(){let{ws:e}=this,A=e[T0]&&e[KG],t=1005,r="",n=e[P0].closingInfo;n?(t=n.code??1005,r=n.reason):e[T0]||(t=1006),e[v0]=M0.CLOSED,ZG("close",e,XG,{wasClean:A,code:t,reason:r}),Ar.close.hasSubscribers&&Ar.close.publish({websocket:e,code:t,reason:r})}function sJ(e){let{ws:A}=this;A[v0]=M0.CLOSING,Ar.socketError.hasSubscribers&&Ar.socketError.publish(e),this.destroy()}G0.exports={establishWebSocketConnection:rJ}});var $h=Q((zj,V0)=>{"use strict";var{maxUnsigned16Bit:oJ}=Si(),Y0;try{Y0=require("crypto")}catch{}var zh=class{constructor(A){this.frameData=A,this.maskKey=Y0.randomBytes(4)}createFrame(A){let t=this.frameData?.byteLength??0,r=t,n=6;t>oJ?(n+=8,r=127):t>125&&(n+=2,r=126);let i=Buffer.allocUnsafe(t+n);i[0]=i[1]=0,i[0]|=128,i[0]=(i[0]&240)+A;i[n-4]=this.maskKey[0],i[n-3]=this.maskKey[1],i[n-2]=this.maskKey[2],i[n-1]=this.maskKey[3],i[1]=r,r===126?i.writeUInt16BE(t,2):r===127&&(i[2]=i[3]=0,i.writeUIntBE(t,4,6)),i[1]|=128;for(let s=0;s{"use strict";var{Writable:aJ}=require("stream"),j0=require("diagnostics_channel"),{parserStates:HA,opcodes:WA,states:cJ,emptyBuffer:gJ}=Si(),{kReadyState:lJ,kSentClose:q0,kResponse:O0,kReceivedClose:H0}=no(),{isValidStatusCode:W0,failWebsocketConnection:so,websocketMessageReceived:uJ}=Rg(),{WebsocketFrameSend:_0}=$h(),Fi={};Fi.ping=j0.channel("undici:websocket:ping");Fi.pong=j0.channel("undici:websocket:pong");var it,uA,yA,_,Ni,ed=class extends aJ{constructor(t){super();Ne(this,it,[]);Ne(this,uA,0);Ne(this,yA,HA.INFO);Ne(this,_,{});Ne(this,Ni,[]);this.ws=t}_write(t,r,n){f(this,it).push(t),Ae(this,uA,f(this,uA)+t.length),this.run(n)}run(t){for(;;){if(f(this,yA)===HA.INFO){if(f(this,uA)<2)return t();let r=this.consume(2);if(f(this,_).fin=(r[0]&128)!==0,f(this,_).opcode=r[0]&15,f(this,_).originalOpcode??=f(this,_).opcode,f(this,_).fragmented=!f(this,_).fin&&f(this,_).opcode!==WA.CONTINUATION,f(this,_).fragmented&&f(this,_).opcode!==WA.BINARY&&f(this,_).opcode!==WA.TEXT){so(this.ws,"Invalid frame type was fragmented.");return}let n=r[1]&127;if(n<=125?(f(this,_).payloadLength=n,Ae(this,yA,HA.READ_DATA)):n===126?Ae(this,yA,HA.PAYLOADLENGTH_16):n===127&&Ae(this,yA,HA.PAYLOADLENGTH_64),f(this,_).fragmented&&n>125){so(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((f(this,_).opcode===WA.PING||f(this,_).opcode===WA.PONG||f(this,_).opcode===WA.CLOSE)&&n>125){so(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(f(this,_).opcode===WA.CLOSE){if(n===1){so(this.ws,"Received close frame with a 1-byte body.");return}let i=this.consume(n);if(f(this,_).closeInfo=this.parseCloseBody(!1,i),!this.ws[q0]){let s=Buffer.allocUnsafe(2);s.writeUInt16BE(f(this,_).closeInfo.code,0);let o=new _0(s);this.ws[O0].socket.write(o.createFrame(WA.CLOSE),a=>{a||(this.ws[q0]=!0)})}this.ws[lJ]=cJ.CLOSING,this.ws[H0]=!0,this.end();return}else if(f(this,_).opcode===WA.PING){let i=this.consume(n);if(!this.ws[H0]){let s=new _0(i);this.ws[O0].socket.write(s.createFrame(WA.PONG)),Fi.ping.hasSubscribers&&Fi.ping.publish({payload:i})}if(Ae(this,yA,HA.INFO),f(this,uA)>0)continue;t();return}else if(f(this,_).opcode===WA.PONG){let i=this.consume(n);if(Fi.pong.hasSubscribers&&Fi.pong.publish({payload:i}),f(this,uA)>0)continue;t();return}}else if(f(this,yA)===HA.PAYLOADLENGTH_16){if(f(this,uA)<2)return t();let r=this.consume(2);f(this,_).payloadLength=r.readUInt16BE(0),Ae(this,yA,HA.READ_DATA)}else if(f(this,yA)===HA.PAYLOADLENGTH_64){if(f(this,uA)<8)return t();let r=this.consume(8),n=r.readUInt32BE(0);if(n>2**31-1){so(this.ws,"Received payload length > 2^31 bytes.");return}let i=r.readUInt32BE(4);f(this,_).payloadLength=(n<<8)+i,Ae(this,yA,HA.READ_DATA)}else if(f(this,yA)===HA.READ_DATA){if(f(this,uA)=f(this,_).payloadLength){let r=this.consume(f(this,_).payloadLength);if(f(this,Ni).push(r),!f(this,_).fragmented||f(this,_).fin&&f(this,_).opcode===WA.CONTINUATION){let n=Buffer.concat(f(this,Ni));uJ(this.ws,f(this,_).originalOpcode,n),Ae(this,_,{}),f(this,Ni).length=0}Ae(this,yA,HA.INFO)}}if(!(f(this,uA)>0)){t();break}}}consume(t){if(t>f(this,uA))return null;if(t===0)return gJ;if(f(this,it)[0].length===t)return Ae(this,uA,f(this,uA)-f(this,it)[0].length),f(this,it).shift();let r=Buffer.allocUnsafe(t),n=0;for(;n!==t;){let i=f(this,it)[0],{length:s}=i;if(s+n===t){r.set(f(this,it).shift(),n);break}else if(s+n>t){r.set(i.subarray(0,t-n),n),f(this,it)[0]=i.subarray(t-n);break}else r.set(f(this,it).shift(),n),n+=i.length}return Ae(this,uA,f(this,uA)-t),r}parseCloseBody(t,r){let n;if(r.length>=2&&(n=r.readUInt16BE(0)),t)return W0(n)?{code:n}:null;let i=r.subarray(2);if(i[0]===239&&i[1]===187&&i[2]===191&&(i=i.subarray(3)),n!==void 0&&!W0(n))return null;try{i=new TextDecoder("utf-8",{fatal:!0}).decode(i)}catch{return null}return{code:n,reason:i}}get closingInfo(){return f(this,_).closeInfo}};it=new WeakMap,uA=new WeakMap,yA=new WeakMap,_=new WeakMap,Ni=new WeakMap;K0.exports={ByteParser:ed}});var iR=Q((A8,nR)=>{"use strict";var{webidl:M}=iA(),{DOMException:Nr}=mr(),{URLSerializer:EJ}=$A(),{getGlobalOrigin:hJ}=jn(),{staticPropertyDescriptors:xr,states:xi,opcodes:oo,emptyBuffer:dJ}=Si(),{kWebSocketURL:X0,kReadyState:tr,kController:QJ,kBinaryType:Dg,kResponse:bg,kSentClose:CJ,kByteParser:fJ}=no(),{isEstablished:z0,isClosing:$0,isValidSubprotocol:IJ,failWebsocketConnection:BJ,fireEvent:pJ}=Rg(),{establishWebSocketConnection:mJ}=J0(),{WebsocketFrameSend:ao}=$h(),{ByteParser:yJ}=Z0(),{kEnumerableProperty:_A,isBlobLike:AR}=W(),{getGlobalDispatcher:wJ}=Qi(),{types:tR}=require("util"),eR=!1,ke,jA,co,go,kg,rR,me=class me extends EventTarget{constructor(t,r=[]){super();Ne(this,kg);Ne(this,ke,{open:null,error:null,close:null,message:null});Ne(this,jA,0);Ne(this,co,"");Ne(this,go,"");M.argumentLengthCheck(arguments,1,{header:"WebSocket constructor"}),eR||(eR=!0,process.emitWarning("WebSockets are experimental, expect them to change at any time.",{code:"UNDICI-WS"}));let n=M.converters["DOMString or sequence or WebSocketInit"](r);t=M.converters.USVString(t),r=n.protocols;let i=hJ(),s;try{s=new URL(t,i)}catch(o){throw new Nr(o,"SyntaxError")}if(s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),s.protocol!=="ws:"&&s.protocol!=="wss:")throw new Nr(`Expected a ws: or wss: protocol, got ${s.protocol}`,"SyntaxError");if(s.hash||s.href.endsWith("#"))throw new Nr("Got fragment","SyntaxError");if(typeof r=="string"&&(r=[r]),r.length!==new Set(r.map(o=>o.toLowerCase())).size)throw new Nr("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(o=>IJ(o)))throw new Nr("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[X0]=new URL(s.href),this[QJ]=mJ(s,r,this,o=>MA(this,kg,rR).call(this,o),n),this[tr]=me.CONNECTING,this[Dg]="blob"}close(t=void 0,r=void 0){if(M.brandCheck(this,me),t!==void 0&&(t=M.converters["unsigned short"](t,{clamp:!0})),r!==void 0&&(r=M.converters.USVString(r)),t!==void 0&&t!==1e3&&(t<3e3||t>4999))throw new Nr("invalid code","InvalidAccessError");let n=0;if(r!==void 0&&(n=Buffer.byteLength(r),n>123))throw new Nr(`Reason must be less than 123 bytes; received ${n}`,"SyntaxError");if(!(this[tr]===me.CLOSING||this[tr]===me.CLOSED))if(!z0(this))BJ(this,"Connection was closed before it was established."),this[tr]=me.CLOSING;else if($0(this))this[tr]=me.CLOSING;else{let i=new ao;t!==void 0&&r===void 0?(i.frameData=Buffer.allocUnsafe(2),i.frameData.writeUInt16BE(t,0)):t!==void 0&&r!==void 0?(i.frameData=Buffer.allocUnsafe(2+n),i.frameData.writeUInt16BE(t,0),i.frameData.write(r,2,"utf-8")):i.frameData=dJ,this[bg].socket.write(i.createFrame(oo.CLOSE),o=>{o||(this[CJ]=!0)}),this[tr]=xi.CLOSING}}send(t){if(M.brandCheck(this,me),M.argumentLengthCheck(arguments,1,{header:"WebSocket.send"}),t=M.converters.WebSocketSendData(t),this[tr]===me.CONNECTING)throw new Nr("Sent before connected.","InvalidStateError");if(!z0(this)||$0(this))return;let r=this[bg].socket;if(typeof t=="string"){let n=Buffer.from(t),s=new ao(n).createFrame(oo.TEXT);Ae(this,jA,f(this,jA)+n.byteLength),r.write(s,()=>{Ae(this,jA,f(this,jA)-n.byteLength)})}else if(tR.isArrayBuffer(t)){let n=Buffer.from(t),s=new ao(n).createFrame(oo.BINARY);Ae(this,jA,f(this,jA)+n.byteLength),r.write(s,()=>{Ae(this,jA,f(this,jA)-n.byteLength)})}else if(ArrayBuffer.isView(t)){let n=Buffer.from(t,t.byteOffset,t.byteLength),s=new ao(n).createFrame(oo.BINARY);Ae(this,jA,f(this,jA)+n.byteLength),r.write(s,()=>{Ae(this,jA,f(this,jA)-n.byteLength)})}else if(AR(t)){let n=new ao;t.arrayBuffer().then(i=>{let s=Buffer.from(i);n.frameData=s;let o=n.createFrame(oo.BINARY);Ae(this,jA,f(this,jA)+s.byteLength),r.write(o,()=>{Ae(this,jA,f(this,jA)-s.byteLength)})})}}get readyState(){return M.brandCheck(this,me),this[tr]}get bufferedAmount(){return M.brandCheck(this,me),f(this,jA)}get url(){return M.brandCheck(this,me),EJ(this[X0])}get extensions(){return M.brandCheck(this,me),f(this,go)}get protocol(){return M.brandCheck(this,me),f(this,co)}get onopen(){return M.brandCheck(this,me),f(this,ke).open}set onopen(t){M.brandCheck(this,me),f(this,ke).open&&this.removeEventListener("open",f(this,ke).open),typeof t=="function"?(f(this,ke).open=t,this.addEventListener("open",t)):f(this,ke).open=null}get onerror(){return M.brandCheck(this,me),f(this,ke).error}set onerror(t){M.brandCheck(this,me),f(this,ke).error&&this.removeEventListener("error",f(this,ke).error),typeof t=="function"?(f(this,ke).error=t,this.addEventListener("error",t)):f(this,ke).error=null}get onclose(){return M.brandCheck(this,me),f(this,ke).close}set onclose(t){M.brandCheck(this,me),f(this,ke).close&&this.removeEventListener("close",f(this,ke).close),typeof t=="function"?(f(this,ke).close=t,this.addEventListener("close",t)):f(this,ke).close=null}get onmessage(){return M.brandCheck(this,me),f(this,ke).message}set onmessage(t){M.brandCheck(this,me),f(this,ke).message&&this.removeEventListener("message",f(this,ke).message),typeof t=="function"?(f(this,ke).message=t,this.addEventListener("message",t)):f(this,ke).message=null}get binaryType(){return M.brandCheck(this,me),this[Dg]}set binaryType(t){M.brandCheck(this,me),t!=="blob"&&t!=="arraybuffer"?this[Dg]="blob":this[Dg]=t}};ke=new WeakMap,jA=new WeakMap,co=new WeakMap,go=new WeakMap,kg=new WeakSet,rR=function(t){this[bg]=t;let r=new yJ(this);r.on("drain",function(){this.ws[bg].socket.resume()}),t.socket.ws=this,this[fJ]=r,this[tr]=xi.OPEN;let n=t.headersList.get("sec-websocket-extensions");n!==null&&Ae(this,go,n);let i=t.headersList.get("sec-websocket-protocol");i!==null&&Ae(this,co,i),pJ("open",this)};var UA=me;UA.CONNECTING=UA.prototype.CONNECTING=xi.CONNECTING;UA.OPEN=UA.prototype.OPEN=xi.OPEN;UA.CLOSING=UA.prototype.CLOSING=xi.CLOSING;UA.CLOSED=UA.prototype.CLOSED=xi.CLOSED;Object.defineProperties(UA.prototype,{CONNECTING:xr,OPEN:xr,CLOSING:xr,CLOSED:xr,url:_A,readyState:_A,bufferedAmount:_A,onopen:_A,onerror:_A,onclose:_A,close:_A,onmessage:_A,binaryType:_A,send:_A,extensions:_A,protocol:_A,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(UA,{CONNECTING:xr,OPEN:xr,CLOSING:xr,CLOSED:xr});M.converters["sequence"]=M.sequenceConverter(M.converters.DOMString);M.converters["DOMString or sequence"]=function(e){return M.util.Type(e)==="Object"&&Symbol.iterator in e?M.converters["sequence"](e):M.converters.DOMString(e)};M.converters.WebSocketInit=M.dictionaryConverter([{key:"protocols",converter:M.converters["DOMString or sequence"],get defaultValue(){return[]}},{key:"dispatcher",converter:e=>e,get defaultValue(){return wJ()}},{key:"headers",converter:M.nullableConverter(M.converters.HeadersInit)}]);M.converters["DOMString or sequence or WebSocketInit"]=function(e){return M.util.Type(e)==="Object"&&!(Symbol.iterator in e)?M.converters.WebSocketInit(e):{protocols:M.converters["DOMString or sequence"](e)}};M.converters.WebSocketSendData=function(e){if(M.util.Type(e)==="Object"){if(AR(e))return M.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||tR.isAnyArrayBuffer(e))return M.converters.BufferSource(e)}return M.converters.USVString(e)};nR.exports={WebSocket:UA}});var cR=Q((r8,G)=>{"use strict";var RJ=Js(),sR=oc(),oR=le(),DJ=oi(),bJ=fm(),kJ=Os(),ln=W(),{InvalidArgumentError:Sg}=oR,Li=cy(),SJ=xs(),FJ=gh(),NJ=Hy(),xJ=Eh(),LJ=zE(),UJ=Xy(),TJ=tw(),{getGlobalDispatcher:aR,setGlobalDispatcher:MJ}=Qi(),vJ=aw(),PJ=cE(),GJ=lc(),Ad;try{require("crypto"),Ad=!0}catch{Ad=!1}Object.assign(sR.prototype,Li);G.exports.Dispatcher=sR;G.exports.Client=RJ;G.exports.Pool=DJ;G.exports.BalancedPool=bJ;G.exports.Agent=kJ;G.exports.ProxyAgent=UJ;G.exports.RetryHandler=TJ;G.exports.DecoratorHandler=vJ;G.exports.RedirectHandler=PJ;G.exports.createRedirectInterceptor=GJ;G.exports.buildConnector=SJ;G.exports.errors=oR;function lo(e){return(A,t,r)=>{if(typeof t=="function"&&(r=t,t=null),!A||typeof A!="string"&&typeof A!="object"&&!(A instanceof URL))throw new Sg("invalid url");if(t!=null&&typeof t!="object")throw new Sg("invalid opts");if(t&&t.path!=null){if(typeof t.path!="string")throw new Sg("invalid opts.path");let s=t.path;t.path.startsWith("/")||(s=`/${s}`),A=new URL(ln.parseOrigin(A).origin+s)}else t||(t=typeof A=="object"?A:{}),A=ln.parseURL(A);let{agent:n,dispatcher:i=aR()}=t;if(n)throw new Sg("unsupported opts.agent. Did you mean opts.client?");return e.call(i,{...t,origin:A.origin,path:A.search?`${A.pathname}${A.search}`:A.pathname,method:t.method||(t.body?"PUT":"GET")},r)}}G.exports.setGlobalDispatcher=MJ;G.exports.getGlobalDispatcher=aR;if(ln.nodeMajor>16||ln.nodeMajor===16&&ln.nodeMinor>=8){let e=null;G.exports.fetch=async function(s){e||(e=sg().fetch);try{return await e(...arguments)}catch(o){throw typeof o=="object"&&Error.captureStackTrace(o,this),o}},G.exports.Headers=tn().Headers,G.exports.Response=jc().Response,G.exports.Request=$s().Request,G.exports.FormData=nc().FormData,G.exports.File=tc().File,G.exports.FileReader=n0().FileReader;let{setGlobalOrigin:A,getGlobalOrigin:t}=jn();G.exports.setGlobalOrigin=A,G.exports.getGlobalOrigin=t;let{CacheStorage:r}=C0(),{kConstruct:n}=gg();G.exports.caches=new r(n)}if(ln.nodeMajor>=16){let{deleteCookie:e,getCookies:A,getSetCookies:t,setCookie:r}=k0();G.exports.deleteCookie=e,G.exports.getCookies=A,G.exports.getSetCookies=t,G.exports.setCookie=r;let{parseMIMEType:n,serializeAMimeType:i}=$A();G.exports.parseMIMEType=n,G.exports.serializeAMimeType=i}if(ln.nodeMajor>=18&&Ad){let{WebSocket:e}=iR();G.exports.WebSocket=e}G.exports.request=lo(Li.request);G.exports.stream=lo(Li.stream);G.exports.pipeline=lo(Li.pipeline);G.exports.connect=lo(Li.connect);G.exports.upgrade=lo(Li.upgrade);G.exports.MockClient=FJ;G.exports.MockPool=xJ;G.exports.MockAgent=NJ;G.exports.mockErrors=LJ});var ud=Q((X3,bR)=>{"use strict";bR.exports=function(){function e(A,t,r,n,i){return Ar?r+1:A+1:n===i?t:t+1}return function(A,t){if(A===t)return 0;if(A.length>t.length){var r=A;A=t,t=r}for(var n=A.length,i=t.length;n>0&&A.charCodeAt(n-1)===t.charCodeAt(i-1);)n--,i--;for(var s=0;sKg,Decimal:()=>Qt,Extensions:()=>Hg,MetricsClient:()=>bn,NotFoundError:()=>Pt,PrismaClientInitializationError:()=>z,PrismaClientKnownRequestError:()=>xe,PrismaClientRustPanicError:()=>JA,PrismaClientUnknownRequestError:()=>ve,PrismaClientValidationError:()=>Oe,Public:()=>Wg,Sql:()=>hA,defineDmmfProperty:()=>Af,empty:()=>sf,getPrismaClient:()=>mD,getRuntime:()=>EI,join:()=>nf,makeStrictEnum:()=>yD,makeTypedQueryFactory:()=>rf,objectEnumValues:()=>da,raw:()=>ql,skip:()=>Qa,sqltag:()=>Ol,warnEnvConflicts:()=>wD,warnOnce:()=>ss});module.exports=xD(tV);var Hg={};Oi(Hg,{defineExtension:()=>wd,getExtensionContext:()=>Rd});function wd(e){return typeof e=="function"?e:A=>A.$extends(e)}function Rd(e){return e}var Wg={};Oi(Wg,{validator:()=>Dd});function Dd(...e){return A=>A}var Mo={};Oi(Mo,{$:()=>Nd,bgBlack:()=>VD,bgBlue:()=>WD,bgCyan:()=>jD,bgGreen:()=>OD,bgMagenta:()=>_D,bgRed:()=>qD,bgWhite:()=>KD,bgYellow:()=>HD,black:()=>PD,blue:()=>Ut,bold:()=>Ve,cyan:()=>Tt,dim:()=>Ur,gray:()=>Hi,green:()=>ir,grey:()=>YD,hidden:()=>MD,inverse:()=>TD,italic:()=>UD,magenta:()=>GD,red:()=>vA,reset:()=>LD,strikethrough:()=>vD,underline:()=>EA,white:()=>JD,yellow:()=>Lt});var _g,bd,kd,Sd,Fd=!0;typeof process<"u"&&({FORCE_COLOR:_g,NODE_DISABLE_COLORS:bd,NO_COLOR:kd,TERM:Sd}=process.env||{},Fd=process.stdout&&process.stdout.isTTY);var Nd={enabled:!bd&&kd==null&&Sd!=="dumb"&&(_g!=null&&_g!=="0"||Fd)};function Ee(e,A){let t=new RegExp(`\\x1b\\[${A}m`,"g"),r=`\x1B[${e}m`,n=`\x1B[${A}m`;return function(i){return!Nd.enabled||i==null?i:r+(~(""+i).indexOf(n)?i.replace(t,n+r):i)+n}}var LD=Ee(0,0),Ve=Ee(1,22),Ur=Ee(2,22),UD=Ee(3,23),EA=Ee(4,24),TD=Ee(7,27),MD=Ee(8,28),vD=Ee(9,29),PD=Ee(30,39),vA=Ee(31,39),ir=Ee(32,39),Lt=Ee(33,39),Ut=Ee(34,39),GD=Ee(35,39),Tt=Ee(36,39),JD=Ee(37,39),Hi=Ee(90,39),YD=Ee(90,39),VD=Ee(40,49),qD=Ee(41,49),OD=Ee(42,49),HD=Ee(43,49),WD=Ee(44,49),_D=Ee(45,49),jD=Ee(46,49),KD=Ee(47,49);var ZD=100,xd=["green","yellow","blue","magenta","cyan","red"],Wi=[],Ld=Date.now(),XD=0,jg=typeof process<"u"?process.env:{};globalThis.DEBUG??=jg.DEBUG??"";globalThis.DEBUG_COLORS??=jg.DEBUG_COLORS?jg.DEBUG_COLORS==="true":!0;var _i={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let A=globalThis.DEBUG.split(",").map(n=>n.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),t=A.some(n=>n===""||n[0]==="-"?!1:e.match(RegExp(n.split("*").join(".*")+"$"))),r=A.some(n=>n===""||n[0]!=="-"?!1:e.match(RegExp(n.slice(1).split("*").join(".*")+"$")));return t&&!r},log:(...e)=>{let[A,t,...r]=e;(console.warn??console.log)(`${A} ${t}`,...r)},formatters:{}};function zD(e){let A={color:xd[XD++%xd.length],enabled:_i.enabled(e),namespace:e,log:_i.log,extend:()=>{}},t=(...r)=>{let{enabled:n,namespace:i,color:s,log:o}=A;if(r.length!==0&&Wi.push([i,...r]),Wi.length>ZD&&Wi.shift(),_i.enabled(i)||n){let a=r.map(g=>typeof g=="string"?g:$D(g)),c=`+${Date.now()-Ld}ms`;Ld=Date.now(),globalThis.DEBUG_COLORS?o(Mo[s](Ve(i)),...a,Mo[s](c)):o(i,...a,c)}};return new Proxy(t,{get:(r,n)=>A[n],set:(r,n,i)=>A[n]=i})}var Kg=new Proxy(zD,{get:(e,A)=>_i[A],set:(e,A,t)=>_i[A]=t});function $D(e,A=2){let t=new Set;return JSON.stringify(e,(r,n)=>{if(typeof n=="object"&&n!==null){if(t.has(n))return"[Circular *]";t.add(n)}else if(typeof n=="bigint")return n.toString();return n},A)}function Ud(e=7500){let A=Wi.map(([t,...r])=>`${t} ${r.map(n=>typeof n=="string"?n:JSON.stringify(n)).join(" ")}`).join(` -`);return A.length!!(e&&typeof e=="object"),Go=e=>e&&!!e[Mt],ct=(e,A,t)=>{if(Go(e)){let r=e[Mt](),{matched:n,selections:i}=r.match(A);return n&&i&&Object.keys(i).forEach(s=>t(s,i[s])),n}if(Xg(e)){if(!Xg(A))return!1;if(Array.isArray(e)){if(!Array.isArray(A))return!1;let r=[],n=[],i=[];for(let s of e.keys()){let o=e[s];Go(o)&&o[eb]?i.push(o):i.length?n.push(o):r.push(o)}if(i.length){if(i.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(A.lengthct(c,s[g],t))&&n.every((c,g)=>ct(c,o[g],t))&&(i.length===0||ct(i[0],a,t))}return e.length===A.length&&e.every((s,o)=>ct(s,A[o],t))}return Object.keys(e).every(r=>{let n=e[r];return(r in A||Go(i=n)&&i[Mt]().matcherType==="optional")&&ct(n,A[r],t);var i})}return Object.is(A,e)},gr=e=>{var A,t,r;return Xg(e)?Go(e)?(A=(t=(r=e[Mt]()).getSelectionKeys)==null?void 0:t.call(r))!=null?A:[]:Array.isArray(e)?ji(e,gr):ji(Object.values(e),gr):[]},ji=(e,A)=>e.reduce((t,r)=>t.concat(A(r)),[]);function PA(e){return Object.assign(e,{optional:()=>Ab(e),and:A=>ye(e,A),or:A=>tb(e,A),select:A=>A===void 0?Md(e):Md(A,e)})}function Ab(e){return PA({[Mt]:()=>({match:A=>{let t={},r=(n,i)=>{t[n]=i};return A===void 0?(gr(e).forEach(n=>r(n,void 0)),{matched:!0,selections:t}):{matched:ct(e,A,r),selections:t}},getSelectionKeys:()=>gr(e),matcherType:"optional"})})}function ye(...e){return PA({[Mt]:()=>({match:A=>{let t={},r=(n,i)=>{t[n]=i};return{matched:e.every(n=>ct(n,A,r)),selections:t}},getSelectionKeys:()=>ji(e,gr),matcherType:"and"})})}function tb(...e){return PA({[Mt]:()=>({match:A=>{let t={},r=(n,i)=>{t[n]=i};return ji(e,gr).forEach(n=>r(n,void 0)),{matched:e.some(n=>ct(n,A,r)),selections:t}},getSelectionKeys:()=>ji(e,gr),matcherType:"or"})})}function X(e){return{[Mt]:()=>({match:A=>({matched:!!e(A)})})}}function Md(...e){let A=typeof e[0]=="string"?e[0]:void 0,t=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return PA({[Mt]:()=>({match:r=>{let n={[A??Jo]:r};return{matched:t===void 0||ct(t,r,(i,s)=>{n[i]=s}),selections:n}},getSelectionKeys:()=>[A??Jo].concat(t===void 0?[]:gr(t))})})}function ot(e){return typeof e=="number"}function sr(e){return typeof e=="string"}function or(e){return typeof e=="bigint"}var hV=PA(X(function(e){return!0}));var ar=e=>Object.assign(PA(e),{startsWith:A=>{return ar(ye(e,(t=A,X(r=>sr(r)&&r.startsWith(t)))));var t},endsWith:A=>{return ar(ye(e,(t=A,X(r=>sr(r)&&r.endsWith(t)))));var t},minLength:A=>ar(ye(e,(t=>X(r=>sr(r)&&r.length>=t))(A))),length:A=>ar(ye(e,(t=>X(r=>sr(r)&&r.length===t))(A))),maxLength:A=>ar(ye(e,(t=>X(r=>sr(r)&&r.length<=t))(A))),includes:A=>{return ar(ye(e,(t=A,X(r=>sr(r)&&r.includes(t)))));var t},regex:A=>{return ar(ye(e,(t=A,X(r=>sr(r)&&!!r.match(t)))));var t}}),dV=ar(X(sr)),at=e=>Object.assign(PA(e),{between:(A,t)=>at(ye(e,((r,n)=>X(i=>ot(i)&&r<=i&&n>=i))(A,t))),lt:A=>at(ye(e,(t=>X(r=>ot(r)&&rat(ye(e,(t=>X(r=>ot(r)&&r>t))(A))),lte:A=>at(ye(e,(t=>X(r=>ot(r)&&r<=t))(A))),gte:A=>at(ye(e,(t=>X(r=>ot(r)&&r>=t))(A))),int:()=>at(ye(e,X(A=>ot(A)&&Number.isInteger(A)))),finite:()=>at(ye(e,X(A=>ot(A)&&Number.isFinite(A)))),positive:()=>at(ye(e,X(A=>ot(A)&&A>0))),negative:()=>at(ye(e,X(A=>ot(A)&&A<0)))}),QV=at(X(ot)),cr=e=>Object.assign(PA(e),{between:(A,t)=>cr(ye(e,((r,n)=>X(i=>or(i)&&r<=i&&n>=i))(A,t))),lt:A=>cr(ye(e,(t=>X(r=>or(r)&&rcr(ye(e,(t=>X(r=>or(r)&&r>t))(A))),lte:A=>cr(ye(e,(t=>X(r=>or(r)&&r<=t))(A))),gte:A=>cr(ye(e,(t=>X(r=>or(r)&&r>=t))(A))),positive:()=>cr(ye(e,X(A=>or(A)&&A>0))),negative:()=>cr(ye(e,X(A=>or(A)&&A<0)))}),CV=cr(X(or)),fV=PA(X(function(e){return typeof e=="boolean"})),IV=PA(X(function(e){return typeof e=="symbol"})),BV=PA(X(function(e){return e==null})),pV=PA(X(function(e){return e!=null}));var zg={matched:!1,value:void 0};function Yo(e){return new $g(e,zg)}var $g=class e{constructor(A,t){this.input=void 0,this.state=void 0,this.input=A,this.state=t}with(...A){if(this.state.matched)return this;let t=A[A.length-1],r=[A[0]],n;A.length===3&&typeof A[1]=="function"?n=A[1]:A.length>2&&r.push(...A.slice(1,A.length-1));let i=!1,s={},o=(c,g)=>{i=!0,s[c]=g},a=!r.some(c=>ct(c,this.input,o))||n&&!n(this.input)?zg:{matched:!0,value:t(i?Jo in s?s[Jo]:s:this.input,this.input)};return new e(this.input,a)}when(A,t){if(this.state.matched)return this;let r=!!A(this.input);return new e(this.input,r?{matched:!0,value:t(this.input,this.input)}:zg)}otherwise(A){return this.state.matched?this.state.value:A(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let A;try{A=JSON.stringify(this.input)}catch{A=this.input}throw new Error(`Pattern matching error: no pattern matches value ${A}`)}run(){return this.exhaustive()}returnType(){return this}};var Jd=require("util");var rb={warn:Lt("prisma:warn")},nb={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Vo(e,...A){nb.warn()&&console.warn(`${rb.warn} ${e}`,...A)}var ib=(0,Jd.promisify)(Gd.default.exec),rA=ie("prisma:get-platform"),sb=["1.0.x","1.1.x","3.0.x"];async function Yd(){let e=Oo.default.platform(),A=process.arch;if(e==="freebsd"){let s=await Ho("freebsd-version");if(s&&s.trim().length>0){let a=/^(\d+)\.?/.exec(s);if(a)return{platform:"freebsd",targetDistro:`freebsd${a[1]}`,arch:A}}}if(e!=="linux")return{platform:e,arch:A};let t=await ab(),r=await Cb(),n=gb({arch:A,archFromUname:r,familyDistro:t.familyDistro}),{libssl:i}=await lb(n);return{platform:"linux",libssl:i,arch:A,archFromUname:r,...t}}function ob(e){let A=/^ID="?([^"\n]*)"?$/im,t=/^ID_LIKE="?([^"\n]*)"?$/im,r=A.exec(e),n=r&&r[1]&&r[1].toLowerCase()||"",i=t.exec(e),s=i&&i[1]&&i[1].toLowerCase()||"",o=Yo({id:n,idLike:s}).with({id:"alpine"},({id:a})=>({targetDistro:"musl",familyDistro:a,originalDistro:a})).with({id:"raspbian"},({id:a})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:a})).with({id:"nixos"},({id:a})=>({targetDistro:"nixos",originalDistro:a,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:a})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:a})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:a})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:a})).when(({idLike:a})=>a.includes("debian")||a.includes("ubuntu"),({id:a})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:a})).when(({idLike:a})=>n==="arch"||a.includes("arch"),({id:a})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:a})).when(({idLike:a})=>a.includes("centos")||a.includes("fedora")||a.includes("rhel")||a.includes("suse"),({id:a})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:a})).otherwise(({id:a})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:a}));return rA(`Found distro info: -${JSON.stringify(o,null,2)}`),o}async function ab(){let e="/etc/os-release";try{let A=await el.default.readFile(e,{encoding:"utf-8"});return ob(A)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function cb(e){let A=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(A){let t=`${A[1]}.x`;return Vd(t)}}function vd(e){let A=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(A){let t=`${A[1]}${A[2]??".0"}.x`;return Vd(t)}}function Vd(e){let A=(()=>{if(qd(e))return e;let t=e.split(".");return t[1]="0",t.join(".")})();if(sb.includes(A))return A}function gb(e){return Yo(e).with({familyDistro:"musl"},()=>(rA('Trying platform-specific paths for "alpine"'),["/lib"])).with({familyDistro:"debian"},({archFromUname:A})=>(rA('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${A}-linux-gnu`,`/lib/${A}-linux-gnu`])).with({familyDistro:"rhel"},()=>(rA('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:A,arch:t,archFromUname:r})=>(rA(`Don't know any platform-specific paths for "${A}" on ${t} (${r})`),[]))}async function lb(e){let A='grep -v "libssl.so.0"',t=await Pd(e);if(t){rA(`Found libssl.so file using platform-specific paths: ${t}`);let i=vd(t);if(rA(`The parsed libssl version is: ${i}`),i)return{libssl:i,strategy:"libssl-specific-path"}}rA('Falling back to "ldconfig" and other generic paths');let r=await Ho(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${A}`);if(r||(r=await Pd(["/lib64","/usr/lib64","/lib"])),r){rA(`Found libssl.so file using "ldconfig" or other generic paths: ${r}`);let i=vd(r);if(rA(`The parsed libssl version is: ${i}`),i)return{libssl:i,strategy:"ldconfig"}}let n=await Ho("openssl version -v");if(n){rA(`Found openssl binary with version: ${n}`);let i=cb(n);if(rA(`The parsed openssl version is: ${i}`),i)return{libssl:i,strategy:"openssl-binary"}}return rA("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function Pd(e){for(let A of e){let t=await ub(A);if(t)return t}}async function ub(e){try{return(await el.default.readdir(e)).find(t=>t.startsWith("libssl.so.")&&!t.startsWith("libssl.so.0"))}catch(A){if(A.code==="ENOENT")return;throw A}}async function Tr(){let{binaryTarget:e}=await hb();return e}function Eb(e){return e.binaryTarget!==void 0}var qo={};async function hb(){if(Eb(qo))return Promise.resolve({...qo,memoized:!0});let e=await Yd(),A=db(e);return qo={...e,binaryTarget:A},{...qo,memoized:!1}}function db(e){let{platform:A,arch:t,archFromUname:r,libssl:n,targetDistro:i,familyDistro:s,originalDistro:o}=e;A==="linux"&&!["x64","arm64"].includes(t)&&Vo(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${t}" instead). If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${r}".`);let a="1.1.x";if(A==="linux"&&n===void 0){let g=Yo({familyDistro:s}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");Vo(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${a}". -${g}`)}let c="debian";if(A==="linux"&&i===void 0&&rA(`Distro is "${o}". Falling back to Prisma engines built for "${c}".`),A==="darwin"&&t==="arm64")return"darwin-arm64";if(A==="darwin")return"darwin";if(A==="win32")return"windows";if(A==="freebsd")return i;if(A==="openbsd")return"openbsd";if(A==="netbsd")return"netbsd";if(A==="linux"&&i==="nixos")return"linux-nixos";if(A==="linux"&&t==="arm64")return`${i==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${n||a}`;if(A==="linux"&&t==="arm")return`linux-arm-openssl-${n||a}`;if(A==="linux"&&i==="musl"){let g="linux-musl";return!n||qd(n)?g:`${g}-openssl-${n}`}return A==="linux"&&i&&n?`${i}-openssl-${n}`:(A!=="linux"&&Vo(`Prisma detected unknown OS "${A}" and may not work as expected. Defaulting to "linux".`),n?`${c}-openssl-${n}`:i?`${i}-openssl-${a}`:`${c}-openssl-${a}`)}async function Qb(e){try{return await e()}catch{return}}function Ho(e){return Qb(async()=>{let A=await ib(e);return rA(`Command "${e}" successfully returned "${A.stdout}"`),A.stdout})}async function Cb(){return typeof Oo.default.machine=="function"?Oo.default.machine():(await Ho("uname -m"))?.trim()}function qd(e){return e.startsWith("1.")}var CS=Z(ml());var he=Z(require("path")),fS=Z(ml()),Fq=ie("prisma:engines");function LC(){return he.default.join(__dirname,"../")}var Nq="libquery-engine";he.default.join(__dirname,"../query-engine-darwin");he.default.join(__dirname,"../query-engine-darwin-arm64");he.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");he.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");he.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");he.default.join(__dirname,"../query-engine-linux-static-x64");he.default.join(__dirname,"../query-engine-linux-static-arm64");he.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");he.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");he.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");he.default.join(__dirname,"../libquery_engine-darwin.dylib.node");he.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");he.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");he.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");he.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");he.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");he.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");he.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");he.default.join(__dirname,"../libquery_engine-linux-musl.so.node");he.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");he.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");he.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");he.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");he.default.join(__dirname,"../query_engine-windows.dll.node");var yl=Z(require("fs")),UC=ie("chmodPlusX");function wl(e){if(process.platform==="win32")return;let A=yl.default.statSync(e),t=A.mode|64|8|1;if(A.mode===t){UC(`Execution permissions of ${e} are fine`);return}let r=t.toString(8).slice(-3);UC(`Have to call chmodPlusX on ${e}`),yl.default.chmodSync(e,r)}var bl=Z(vC()),ga=Z(require("fs"));var Rn=Z(require("path"));function PC(e){let A=e.ignoreProcessEnv?{}:process.env,t=r=>r.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(i,s){let o=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!o)return i;let a=o[1],c,g;if(a==="\\")g=o[0],c=g.replace("\\$","$");else{let l=o[2];g=o[0].substring(a.length),c=Object.hasOwnProperty.call(A,l)?A[l]:e.parsed[l]||"",c=t(c)}return i.replace(g,c)},r)??r;for(let r in e.parsed){let n=Object.hasOwnProperty.call(A,r)?A[r]:e.parsed[r];e.parsed[r]=t(n)}for(let r in e.parsed)A[r]=e.parsed[r];return e}var Dl=ie("prisma:tryLoadEnv");function es({rootEnvPath:e,schemaEnvPath:A},t={conflictCheck:"none"}){let r=GC(e);t.conflictCheck!=="none"&&kS(r,A,t.conflictCheck);let n=null;return JC(r?.path,A)||(n=GC(A)),!r&&!n&&Dl("No Environment variables loaded"),n?.dotenvResult.error?console.error(vA(Ve("Schema Env Error: "))+n.dotenvResult.error):{message:[r?.message,n?.message].filter(Boolean).join(` -`),parsed:{...r?.dotenvResult?.parsed,...n?.dotenvResult?.parsed}}}function kS(e,A,t){let r=e?.dotenvResult.parsed,n=!JC(e?.path,A);if(r&&A&&n&&ga.default.existsSync(A)){let i=bl.default.parse(ga.default.readFileSync(A)),s=[];for(let o in i)r[o]===i[o]&&s.push(o);if(s.length>0){let o=Rn.default.relative(process.cwd(),e.path),a=Rn.default.relative(process.cwd(),A);if(t==="error"){let c=`There is a conflict between env var${s.length>1?"s":""} in ${EA(o)} and ${EA(a)} -Conflicting env vars: -${s.map(g=>` ${Ve(g)}`).join(` -`)} - -We suggest to move the contents of ${EA(a)} to ${EA(o)} to consolidate your env vars. -`;throw new Error(c)}else if(t==="warn"){let c=`Conflict for env var${s.length>1?"s":""} ${s.map(g=>Ve(g)).join(", ")} in ${EA(o)} and ${EA(a)} -Env vars from ${EA(a)} overwrite the ones from ${EA(o)} - `;console.warn(`${Lt("warn(prisma)")} ${c}`)}}}}function GC(e){if(SS(e)){Dl(`Environment variables loaded from ${e}`);let A=bl.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:PC(A),message:Ur(`Environment variables loaded from ${Rn.default.relative(process.cwd(),e)}`),path:e}}else Dl(`Environment variables not found at ${e}`);return null}function JC(e,A){return e&&A&&Rn.default.resolve(e)===Rn.default.resolve(A)}function SS(e){return!!(e&&ga.default.existsSync(e))}var YC="library";function As(e){let A=FS();return A||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":YC)}function FS(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}var lr;(A=>{let e;(m=>(m.findUnique="findUnique",m.findUniqueOrThrow="findUniqueOrThrow",m.findFirst="findFirst",m.findFirstOrThrow="findFirstOrThrow",m.findMany="findMany",m.create="create",m.createMany="createMany",m.createManyAndReturn="createManyAndReturn",m.update="update",m.updateMany="updateMany",m.upsert="upsert",m.delete="delete",m.deleteMany="deleteMany",m.groupBy="groupBy",m.count="count",m.aggregate="aggregate",m.findRaw="findRaw",m.aggregateRaw="aggregateRaw"))(e=A.ModelAction||={})})(lr||={});var ts=Z(require("path"));function kl(e){return ts.default.sep===ts.default.posix.sep?e:e.split(ts.default.sep).join(ts.default.posix.sep)}var _C=Z(Sl());function Nl(e){return String(new Fl(e))}var Fl=class{constructor(A){this.config=A}toString(){let{config:A}=this,t=A.provider.fromEnvVar?`env("${A.provider.fromEnvVar}")`:A.provider.value,r=JSON.parse(JSON.stringify({provider:t,binaryTargets:xS(A.binaryTargets)}));return`generator ${A.name} { -${(0,_C.default)(LS(r),2)} -}`}};function xS(e){let A;if(e.length>0){let t=e.find(r=>r.fromEnvVar!==null);t?A=`env("${t.fromEnvVar}")`:A=e.map(r=>r.native?"native":r.value)}else A=void 0;return A}function LS(e){let A=Object.keys(e).reduce((t,r)=>Math.max(t,r.length),0);return Object.entries(e).map(([t,r])=>`${t.padEnd(A)} = ${US(r)}`).join(` -`)}function US(e){return JSON.parse(JSON.stringify(e,(A,t)=>Array.isArray(t)?`[${t.map(r=>JSON.stringify(r)).join(", ")}]`:JSON.stringify(t)))}var ns={};Oi(ns,{error:()=>vS,info:()=>MS,log:()=>TS,query:()=>PS,should:()=>jC,tags:()=>rs,warn:()=>xl});var rs={error:vA("prisma:error"),warn:Lt("prisma:warn"),info:Tt("prisma:info"),query:Ut("prisma:query")},jC={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function TS(...e){console.log(...e)}function xl(e,...A){jC.warn()&&console.warn(`${rs.warn} ${e}`,...A)}function MS(e,...A){console.info(`${rs.info} ${e}`,...A)}function vS(e,...A){console.error(`${rs.error} ${e}`,...A)}function PS(e,...A){console.log(`${rs.query} ${e}`,...A)}function vt(e,A){throw new Error(A)}var la=Z(require("stream")),zC=Z(require("util"));function is(e,A){return JS(e,A)}function JS(e,A){return e?YS(e,A):new Gr(A)}function YS(e,A){if(!e)throw new Error("expected readStream");if(!e.readable)throw new Error("readStream must be readable");let t=new Gr(A);return e.pipe(t),t}function Gr(e){la.default.Transform.call(this,e),e=e||{},this._readableState.objectMode=!0,this._lineBuffer=[],this._keepEmptyLines=e.keepEmptyLines||!1,this._lastChunkEndedWithCR=!1,this.on("pipe",function(A){this.encoding||A instanceof la.default.Readable&&(this.encoding=A._readableState.encoding)})}zC.default.inherits(Gr,la.default.Transform);Gr.prototype._transform=function(e,A,t){A=A||"utf8",Buffer.isBuffer(e)&&(A=="buffer"?(e=e.toString(),A="utf8"):e=e.toString(A)),this._chunkEncoding=A;let r=e.split(/\r\n|\r|\n/g);this._lastChunkEndedWithCR&&e[0]==` -`&&r.shift(),this._lineBuffer.length>0&&(this._lineBuffer[this._lineBuffer.length-1]+=r[0],r.shift()),this._lastChunkEndedWithCR=e[e.length-1]=="\r",this._lineBuffer=this._lineBuffer.concat(r),this._pushBuffer(A,1,t)};Gr.prototype._pushBuffer=function(e,A,t){for(;this._lineBuffer.length>A;){let r=this._lineBuffer.shift();if((this._keepEmptyLines||r.length>0)&&!this.push(this._reencode(r,e))){let n=this;setImmediate(function(){n._pushBuffer(e,A,t)});return}}t()};Gr.prototype._flush=function(e){this._pushBuffer(this._chunkEncoding,0,e)};Gr.prototype._reencode=function(e,A){return this.encoding&&this.encoding!=A?Buffer.from(e,A).toString(this.encoding):this.encoding?e:Buffer.from(e,A)};function Ul(e,A){return Object.prototype.hasOwnProperty.call(e,A)}var Tl=(e,A)=>e.reduce((t,r)=>(t[A(r)]=r,t),{});function Dn(e,A){let t={};for(let r of Object.keys(e))t[r]=A(e[r],r);return t}function Ml(e,A){if(e.length===0)return;let t=e[0];for(let r=1;r{ef.has(e)||(ef.add(e),xl(A,...t))};var xe=class extends Error{constructor(A,{code:t,clientVersion:r,meta:n,batchRequestIdx:i}){super(A),this.name="PrismaClientKnownRequestError",this.code=t,this.clientVersion=r,this.meta=n,Object.defineProperty(this,"batchRequestIdx",{value:i,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};L(xe,"PrismaClientKnownRequestError");var Pt=class extends xe{constructor(A,t){super(A,{code:"P2025",clientVersion:t}),this.name="NotFoundError"}};L(Pt,"NotFoundError");var z=class e extends Error{constructor(A,t,r){super(A),this.name="PrismaClientInitializationError",this.clientVersion=t,this.errorCode=r,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};L(z,"PrismaClientInitializationError");var JA=class extends Error{constructor(A,t){super(A),this.name="PrismaClientRustPanicError",this.clientVersion=t}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};L(JA,"PrismaClientRustPanicError");var ve=class extends Error{constructor(A,{clientVersion:t,batchRequestIdx:r}){super(A),this.name="PrismaClientUnknownRequestError",this.clientVersion=t,Object.defineProperty(this,"batchRequestIdx",{value:r,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};L(ve,"PrismaClientUnknownRequestError");var Oe=class extends Error{constructor(t,{clientVersion:r}){super(t);this.name="PrismaClientValidationError";this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};L(Oe,"PrismaClientValidationError");var bn=class{constructor(A){this._engine=A}prometheus(A){return this._engine.metrics({format:"prometheus",...A})}json(A){return this._engine.metrics({format:"json",...A})}};function os(e){let A;return{get(){return A||(A={value:e()}),A.value}}}function Af(e,A){let t=os(()=>VS(A));Object.defineProperty(e,"dmmf",{get:()=>t.get()})}function VS(e){return{datamodel:{models:vl(e.models),enums:vl(e.enums),types:vl(e.types)}}}function vl(e){return Object.entries(e).map(([A,t])=>({name:A,...t}))}var ha=Symbol(),Pl=new WeakMap,Gt=class{constructor(A){A===ha?Pl.set(this,`Prisma.${this._getName()}`):Pl.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Pl.get(this)}},as=class extends Gt{_getNamespace(){return"NullTypes"}},cs=class extends as{};Gl(cs,"DbNull");var gs=class extends as{};Gl(gs,"JsonNull");var ls=class extends as{};Gl(ls,"AnyNull");var da={classes:{DbNull:cs,JsonNull:gs,AnyNull:ls},instances:{DbNull:new cs(ha),JsonNull:new gs(ha),AnyNull:new ls(ha)}};function Gl(e,A){Object.defineProperty(e,"name",{value:A,configurable:!0})}var tf=Symbol(),us=class{constructor(A){if(A!==tf)throw new Error("Skip instance can not be constructed directly")}ifUndefined(A){return A===void 0?Qa:A}},Qa=new us(tf);function lt(e){return e instanceof us}var Jl=new WeakMap,Es=class{constructor(A,t){Jl.set(this,{sql:A,values:t})}get sql(){return Jl.get(this).sql}get values(){return Jl.get(this).values}};function rf(e){return(...A)=>new Es(e,A)}function hs(e){return{ok:!1,error:e,map(){return hs(e)},flatMap(){return hs(e)}}}var Yl=class{constructor(){this.registeredErrors=[]}consumeError(A){return this.registeredErrors[A]}registerNewError(A){let t=0;for(;this.registeredErrors[t]!==void 0;)t++;return this.registeredErrors[t]={error:A},t}},Vl=e=>{let A=new Yl,t=ut(A,e.transactionContext.bind(e)),r={adapterName:e.adapterName,errorRegistry:A,queryRaw:ut(A,e.queryRaw.bind(e)),executeRaw:ut(A,e.executeRaw.bind(e)),provider:e.provider,transactionContext:async(...n)=>(await t(...n)).map(s=>qS(A,s))};return e.getConnectionInfo&&(r.getConnectionInfo=HS(A,e.getConnectionInfo.bind(e))),r},qS=(e,A)=>{let t=ut(e,A.startTransaction.bind(A));return{adapterName:A.adapterName,provider:A.provider,queryRaw:ut(e,A.queryRaw.bind(A)),executeRaw:ut(e,A.executeRaw.bind(A)),startTransaction:async(...r)=>(await t(...r)).map(i=>OS(e,i))}},OS=(e,A)=>({adapterName:A.adapterName,provider:A.provider,options:A.options,queryRaw:ut(e,A.queryRaw.bind(A)),executeRaw:ut(e,A.executeRaw.bind(A)),commit:ut(e,A.commit.bind(A)),rollback:ut(e,A.rollback.bind(A))});function ut(e,A){return async(...t)=>{try{return await A(...t)}catch(r){let n=e.registerNewError(r);return hs({kind:"GenericJs",id:n})}}}function HS(e,A){return(...t)=>{try{return A(...t)}catch(r){let n=e.registerNewError(r);return hs({kind:"GenericJs",id:n})}}}var fD=Z(pl());var ID=require("async_hooks"),BD=require("events"),pD=Z(require("fs")),Lo=Z(require("path"));var hA=class e{constructor(A,t){if(A.length-1!==t.length)throw A.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${A.length} strings to have ${A.length-1} values`);let r=t.reduce((s,o)=>s+(o instanceof e?o.values.length:1),0);this.values=new Array(r),this.strings=new Array(r+1),this.strings[0]=A[0];let n=0,i=0;for(;ne.getPropertyValue(t))},getPropertyDescriptor(t){return e.getPropertyDescriptor?.(t)}}}var Ca={enumerable:!0,configurable:!0,writable:!0};function fa(e){let A=new Set(e);return{getOwnPropertyDescriptor:()=>Ca,has:(t,r)=>A.has(r),set:(t,r,n)=>A.add(r)&&Reflect.set(t,r,n),ownKeys:()=>[...A]}}var of=Symbol.for("nodejs.util.inspect.custom");function ht(e,A){let t=WS(A),r=new Set,n=new Proxy(e,{get(i,s){if(r.has(s))return i[s];let o=t.get(s);return o?o.getPropertyValue(s):i[s]},has(i,s){if(r.has(s))return!0;let o=t.get(s);return o?o.has?.(s)??!0:Reflect.has(i,s)},ownKeys(i){let s=af(Reflect.ownKeys(i),t),o=af(Array.from(t.keys()),t);return[...new Set([...s,...o,...r])]},set(i,s,o){return t.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(r.add(s),Reflect.set(i,s,o))},getOwnPropertyDescriptor(i,s){let o=Reflect.getOwnPropertyDescriptor(i,s);if(o&&!o.configurable)return o;let a=t.get(s);return a?a.getPropertyDescriptor?{...Ca,...a?.getPropertyDescriptor(s)}:Ca:o},defineProperty(i,s,o){return r.add(s),Reflect.defineProperty(i,s,o)}});return n[of]=function(){let i={...this};return delete i[of],i},n}function WS(e){let A=new Map;for(let t of e){let r=t.getKeys();for(let n of r)A.set(n,t)}return A}function af(e,A){return e.filter(t=>A.get(t)?.has?.(t)??!0)}function kn(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Sn(e,A){return{batch:e,transaction:A?.kind==="batch"?{isolationLevel:A.options.isolationLevel}:void 0}}var Fn=class{constructor(A=0,t){this.context=t;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=A}write(A){return typeof A=="string"?this.currentLine+=A:A.write(this),this}writeJoined(A,t,r=(n,i)=>i.write(n)){let n=t.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(A){return this.marginSymbol=A,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let A=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+A.slice(1):A}};function cf(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Nn(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Ia(e){return e.toString()!=="Invalid Date"}var xn=9e15,dr=1e9,Hl="0123456789abcdef",pa="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",ma="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Wl={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-xn,maxE:xn,crypto:!1},Ef,Jt,T=!0,wa="[DecimalError] ",hr=wa+"Invalid argument: ",hf=wa+"Precision limit exceeded",df=wa+"crypto unavailable",Qf="[object Decimal]",ze=Math.floor,Pe=Math.pow,_S=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,jS=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,KS=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Cf=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ZA=1e7,x=7,ZS=9007199254740991,XS=pa.length-1,_l=ma.length-1,B={toStringTag:Qf};B.absoluteValue=B.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),b(e)};B.ceil=function(){return b(new this.constructor(this),this.e+1,2)};B.clampedTo=B.clamp=function(e,A){var t,r=this,n=r.constructor;if(e=new n(e),A=new n(A),!e.s||!A.s)return new n(NaN);if(e.gt(A))throw Error(hr+A);return t=r.cmp(e),t<0?e:r.cmp(A)>0?A:new n(r)};B.comparedTo=B.cmp=function(e){var A,t,r,n,i=this,s=i.d,o=(e=new i.constructor(e)).d,a=i.s,c=e.s;if(!s||!o)return!a||!c?NaN:a!==c?a:s===o?0:!s^a<0?1:-1;if(!s[0]||!o[0])return s[0]?a:o[0]?-c:0;if(a!==c)return a;if(i.e!==e.e)return i.e>e.e^a<0?1:-1;for(r=s.length,n=o.length,A=0,t=ro[A]^a<0?1:-1;return r===n?0:r>n^a<0?1:-1};B.cosine=B.cos=function(){var e,A,t=this,r=t.constructor;return t.d?t.d[0]?(e=r.precision,A=r.rounding,r.precision=e+Math.max(t.e,t.sd())+x,r.rounding=1,t=zS(r,mf(r,t)),r.precision=e,r.rounding=A,b(Jt==2||Jt==3?t.neg():t,e,A,!0)):new r(1):new r(NaN)};B.cubeRoot=B.cbrt=function(){var e,A,t,r,n,i,s,o,a,c,g=this,l=g.constructor;if(!g.isFinite()||g.isZero())return new l(g);for(T=!1,i=g.s*Pe(g.s*g,1/3),!i||Math.abs(i)==1/0?(t=_e(g.d),e=g.e,(i=(e-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=Pe(t,1/3),e=ze((e+1)/3)-(e%3==(e<0?-1:2)),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new l(t),r.s=g.s):r=new l(i.toString()),s=(e=l.precision)+3;;)if(o=r,a=o.times(o).times(o),c=a.plus(g),r=ge(c.plus(g).times(o),c.plus(a),s+2,1),_e(o.d).slice(0,s)===(t=_e(r.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!n&&t=="4999"){if(!n&&(b(o,e+1,0),o.times(o).times(o).eq(g))){r=o;break}s+=4,n=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(b(r,e+1,1),A=!r.times(r).times(r).eq(g));break}return T=!0,b(r,e,l.rounding,A)};B.decimalPlaces=B.dp=function(){var e,A=this.d,t=NaN;if(A){if(e=A.length-1,t=(e-ze(this.e/x))*x,e=A[e],e)for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t};B.dividedBy=B.div=function(e){return ge(this,new this.constructor(e))};B.dividedToIntegerBy=B.divToInt=function(e){var A=this,t=A.constructor;return b(ge(A,new t(e),0,1,1),t.precision,t.rounding)};B.equals=B.eq=function(e){return this.cmp(e)===0};B.floor=function(){return b(new this.constructor(this),this.e+1,3)};B.greaterThan=B.gt=function(e){return this.cmp(e)>0};B.greaterThanOrEqualTo=B.gte=function(e){var A=this.cmp(e);return A==1||A===0};B.hyperbolicCosine=B.cosh=function(){var e,A,t,r,n,i=this,s=i.constructor,o=new s(1);if(!i.isFinite())return new s(i.s?1/0:NaN);if(i.isZero())return o;t=s.precision,r=s.rounding,s.precision=t+Math.max(i.e,i.sd())+4,s.rounding=1,n=i.d.length,n<32?(e=Math.ceil(n/3),A=(1/Da(4,e)).toString()):(e=16,A="2.3283064365386962890625e-10"),i=Ln(s,1,i.times(A),new s(1),!0);for(var a,c=e,g=new s(8);c--;)a=i.times(i),i=o.minus(a.times(g.minus(a.times(g))));return b(i,s.precision=t,s.rounding=r,!0)};B.hyperbolicSine=B.sinh=function(){var e,A,t,r,n=this,i=n.constructor;if(!n.isFinite()||n.isZero())return new i(n);if(A=i.precision,t=i.rounding,i.precision=A+Math.max(n.e,n.sd())+4,i.rounding=1,r=n.d.length,r<3)n=Ln(i,2,n,n,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,n=n.times(1/Da(5,e)),n=Ln(i,2,n,n,!0);for(var s,o=new i(5),a=new i(16),c=new i(20);e--;)s=n.times(n),n=n.times(o.plus(s.times(a.times(s).plus(c))))}return i.precision=A,i.rounding=t,b(n,A,t,!0)};B.hyperbolicTangent=B.tanh=function(){var e,A,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(e=r.precision,A=r.rounding,r.precision=e+7,r.rounding=1,ge(t.sinh(),t.cosh(),r.precision=e,r.rounding=A)):new r(t.s)};B.inverseCosine=B.acos=function(){var e,A=this,t=A.constructor,r=A.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?A.isNeg()?KA(t,n,i):new t(0):new t(NaN):A.isZero()?KA(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,A=A.asin(),e=KA(t,n+4,i).times(.5),t.precision=n,t.rounding=i,e.minus(A))};B.inverseHyperbolicCosine=B.acosh=function(){var e,A,t=this,r=t.constructor;return t.lte(1)?new r(t.eq(1)?0:NaN):t.isFinite()?(e=r.precision,A=r.rounding,r.precision=e+Math.max(Math.abs(t.e),t.sd())+4,r.rounding=1,T=!1,t=t.times(t).minus(1).sqrt().plus(t),T=!0,r.precision=e,r.rounding=A,t.ln()):new r(t)};B.inverseHyperbolicSine=B.asinh=function(){var e,A,t=this,r=t.constructor;return!t.isFinite()||t.isZero()?new r(t):(e=r.precision,A=r.rounding,r.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,r.rounding=1,T=!1,t=t.times(t).plus(1).sqrt().plus(t),T=!0,r.precision=e,r.rounding=A,t.ln())};B.inverseHyperbolicTangent=B.atanh=function(){var e,A,t,r,n=this,i=n.constructor;return n.isFinite()?n.e>=0?new i(n.abs().eq(1)?n.s/0:n.isZero()?n:NaN):(e=i.precision,A=i.rounding,r=n.sd(),Math.max(r,e)<2*-n.e-1?b(new i(n),e,A,!0):(i.precision=t=r-n.e,n=ge(n.plus(1),new i(1).minus(n),t+e,1),i.precision=e+4,i.rounding=1,n=n.ln(),i.precision=e,i.rounding=A,n.times(.5))):new i(NaN)};B.inverseSine=B.asin=function(){var e,A,t,r,n=this,i=n.constructor;return n.isZero()?new i(n):(A=n.abs().cmp(1),t=i.precision,r=i.rounding,A!==-1?A===0?(e=KA(i,t+4,r).times(.5),e.s=n.s,e):new i(NaN):(i.precision=t+6,i.rounding=1,n=n.div(new i(1).minus(n.times(n)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=r,n.times(2)))};B.inverseTangent=B.atan=function(){var e,A,t,r,n,i,s,o,a,c=this,g=c.constructor,l=g.precision,u=g.rounding;if(c.isFinite()){if(c.isZero())return new g(c);if(c.abs().eq(1)&&l+4<=_l)return s=KA(g,l+4,u).times(.25),s.s=c.s,s}else{if(!c.s)return new g(NaN);if(l+4<=_l)return s=KA(g,l+4,u).times(.5),s.s=c.s,s}for(g.precision=o=l+10,g.rounding=1,t=Math.min(28,o/x+2|0),e=t;e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(T=!1,A=Math.ceil(o/x),r=1,a=c.times(c),s=new g(c),n=c;e!==-1;)if(n=n.times(a),i=s.minus(n.div(r+=2)),n=n.times(a),s=i.plus(n.div(r+=2)),s.d[A]!==void 0)for(e=A;s.d[e]===i.d[e]&&e--;);return t&&(s=s.times(2<this.d.length-2};B.isNaN=function(){return!this.s};B.isNegative=B.isNeg=function(){return this.s<0};B.isPositive=B.isPos=function(){return this.s>0};B.isZero=function(){return!!this.d&&this.d[0]===0};B.lessThan=B.lt=function(e){return this.cmp(e)<0};B.lessThanOrEqualTo=B.lte=function(e){return this.cmp(e)<1};B.logarithm=B.log=function(e){var A,t,r,n,i,s,o,a,c=this,g=c.constructor,l=g.precision,u=g.rounding,E=5;if(e==null)e=new g(10),A=!0;else{if(e=new g(e),t=e.d,e.s<0||!t||!t[0]||e.eq(1))return new g(NaN);A=e.eq(10)}if(t=c.d,c.s<0||!t||!t[0]||c.eq(1))return new g(t&&!t[0]?-1/0:c.s!=1?NaN:t?0:1/0);if(A)if(t.length>1)i=!0;else{for(n=t[0];n%10===0;)n/=10;i=n!==1}if(T=!1,o=l+E,s=Er(c,o),r=A?ya(g,o+10):Er(e,o),a=ge(s,r,o,1),Qs(a.d,n=l,u))do if(o+=10,s=Er(c,o),r=A?ya(g,o+10):Er(e,o),a=ge(s,r,o,1),!i){+_e(a.d).slice(n+1,n+15)+1==1e14&&(a=b(a,l+1,0));break}while(Qs(a.d,n+=10,u));return T=!0,b(a,l,u)};B.minus=B.sub=function(e){var A,t,r,n,i,s,o,a,c,g,l,u,E=this,h=E.constructor;if(e=new h(e),!E.d||!e.d)return!E.s||!e.s?e=new h(NaN):E.d?e.s=-e.s:e=new h(e.d||E.s!==e.s?E:NaN),e;if(E.s!=e.s)return e.s=-e.s,E.plus(e);if(c=E.d,u=e.d,o=h.precision,a=h.rounding,!c[0]||!u[0]){if(u[0])e.s=-e.s;else if(c[0])e=new h(E);else return new h(a===3?-0:0);return T?b(e,o,a):e}if(t=ze(e.e/x),g=ze(E.e/x),c=c.slice(),i=g-t,i){for(l=i<0,l?(A=c,i=-i,s=u.length):(A=u,t=g,s=c.length),r=Math.max(Math.ceil(o/x),s)+2,i>r&&(i=r,A.length=1),A.reverse(),r=i;r--;)A.push(0);A.reverse()}else{for(r=c.length,s=u.length,l=r0;--r)c[s++]=0;for(r=u.length;r>i;){if(c[--r]s?i+1:s+1,n>s&&(n=s,t.length=1),t.reverse();n--;)t.push(0);t.reverse()}for(s=c.length,n=g.length,s-n<0&&(n=s,t=g,g=c,c=t),A=0;n;)A=(c[--n]=c[n]+g[n]+A)/ZA|0,c[n]%=ZA;for(A&&(c.unshift(A),++r),s=c.length;c[--s]==0;)c.pop();return e.d=c,e.e=Ra(c,r),T?b(e,o,a):e};B.precision=B.sd=function(e){var A,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(hr+e);return t.d?(A=ff(t.d),e&&t.e+1>A&&(A=t.e+1)):A=NaN,A};B.round=function(){var e=this,A=e.constructor;return b(new A(e),e.e+1,A.rounding)};B.sine=B.sin=function(){var e,A,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(e=r.precision,A=r.rounding,r.precision=e+Math.max(t.e,t.sd())+x,r.rounding=1,t=eF(r,mf(r,t)),r.precision=e,r.rounding=A,b(Jt>2?t.neg():t,e,A,!0)):new r(NaN)};B.squareRoot=B.sqrt=function(){var e,A,t,r,n,i,s=this,o=s.d,a=s.e,c=s.s,g=s.constructor;if(c!==1||!o||!o[0])return new g(!c||c<0&&(!o||o[0])?NaN:o?s:1/0);for(T=!1,c=Math.sqrt(+s),c==0||c==1/0?(A=_e(o),(A.length+a)%2==0&&(A+="0"),c=Math.sqrt(A),a=ze((a+1)/2)-(a<0||a%2),c==1/0?A="5e"+a:(A=c.toExponential(),A=A.slice(0,A.indexOf("e")+1)+a),r=new g(A)):r=new g(c.toString()),t=(a=g.precision)+3;;)if(i=r,r=i.plus(ge(s,i,t+2,1)).times(.5),_e(i.d).slice(0,t)===(A=_e(r.d)).slice(0,t))if(A=A.slice(t-3,t+1),A=="9999"||!n&&A=="4999"){if(!n&&(b(i,a+1,0),i.times(i).eq(s))){r=i;break}t+=4,n=1}else{(!+A||!+A.slice(1)&&A.charAt(0)=="5")&&(b(r,a+1,1),e=!r.times(r).eq(s));break}return T=!0,b(r,a,g.rounding,e)};B.tangent=B.tan=function(){var e,A,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(e=r.precision,A=r.rounding,r.precision=e+10,r.rounding=1,t=t.sin(),t.s=1,t=ge(t,new r(1).minus(t.times(t)).sqrt(),e+10,0),r.precision=e,r.rounding=A,b(Jt==2||Jt==4?t.neg():t,e,A,!0)):new r(NaN)};B.times=B.mul=function(e){var A,t,r,n,i,s,o,a,c,g=this,l=g.constructor,u=g.d,E=(e=new l(e)).d;if(e.s*=g.s,!u||!u[0]||!E||!E[0])return new l(!e.s||u&&!u[0]&&!E||E&&!E[0]&&!u?NaN:!u||!E?e.s/0:e.s*0);for(t=ze(g.e/x)+ze(e.e/x),a=u.length,c=E.length,a=0;){for(A=0,n=a+r;n>r;)o=i[n]+E[r]*u[n-r-1]+A,i[n--]=o%ZA|0,A=o/ZA|0;i[n]=(i[n]+A)%ZA|0}for(;!i[--s];)i.pop();return A?++t:i.shift(),e.d=i,e.e=Ra(i,t),T?b(e,l.precision,l.rounding):e};B.toBinary=function(e,A){return Zl(this,2,e,A)};B.toDecimalPlaces=B.toDP=function(e,A){var t=this,r=t.constructor;return t=new r(t),e===void 0?t:(dA(e,0,dr),A===void 0?A=r.rounding:dA(A,0,8),b(t,e+t.e+1,A))};B.toExponential=function(e,A){var t,r=this,n=r.constructor;return e===void 0?t=dt(r,!0):(dA(e,0,dr),A===void 0?A=n.rounding:dA(A,0,8),r=b(new n(r),e+1,A),t=dt(r,!0,e+1)),r.isNeg()&&!r.isZero()?"-"+t:t};B.toFixed=function(e,A){var t,r,n=this,i=n.constructor;return e===void 0?t=dt(n):(dA(e,0,dr),A===void 0?A=i.rounding:dA(A,0,8),r=b(new i(n),e+n.e+1,A),t=dt(r,!1,e+r.e+1)),n.isNeg()&&!n.isZero()?"-"+t:t};B.toFraction=function(e){var A,t,r,n,i,s,o,a,c,g,l,u,E=this,h=E.d,d=E.constructor;if(!h)return new d(E);if(c=t=new d(1),r=a=new d(0),A=new d(r),i=A.e=ff(h)-E.e-1,s=i%x,A.d[0]=Pe(10,s<0?x+s:s),e==null)e=i>0?A:c;else{if(o=new d(e),!o.isInt()||o.lt(c))throw Error(hr+o);e=o.gt(A)?i>0?A:c:o}for(T=!1,o=new d(_e(h)),g=d.precision,d.precision=i=h.length*x*2;l=ge(o,A,0,1,1),n=t.plus(l.times(r)),n.cmp(e)!=1;)t=r,r=n,n=c,c=a.plus(l.times(n)),a=n,n=A,A=o.minus(l.times(n)),o=n;return n=ge(e.minus(t),r,0,1,1),a=a.plus(n.times(c)),t=t.plus(n.times(r)),a.s=c.s=E.s,u=ge(c,r,i,1).minus(E).abs().cmp(ge(a,t,i,1).minus(E).abs())<1?[c,r]:[a,t],d.precision=g,T=!0,u};B.toHexadecimal=B.toHex=function(e,A){return Zl(this,16,e,A)};B.toNearest=function(e,A){var t=this,r=t.constructor;if(t=new r(t),e==null){if(!t.d)return t;e=new r(1),A=r.rounding}else{if(e=new r(e),A===void 0?A=r.rounding:dA(A,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(T=!1,t=ge(t,e,0,A,1).times(e),T=!0,b(t)):(e.s=t.s,t=e),t};B.toNumber=function(){return+this};B.toOctal=function(e,A){return Zl(this,8,e,A)};B.toPower=B.pow=function(e){var A,t,r,n,i,s,o=this,a=o.constructor,c=+(e=new a(e));if(!o.d||!e.d||!o.d[0]||!e.d[0])return new a(Pe(+o,c));if(o=new a(o),o.eq(1))return o;if(r=a.precision,i=a.rounding,e.eq(1))return b(o,r,i);if(A=ze(e.e/x),A>=e.d.length-1&&(t=c<0?-c:c)<=ZS)return n=If(a,o,t,r),e.s<0?new a(1).div(n):b(n,r,i);if(s=o.s,s<0){if(Aa.maxE+1||A0?s/0:0):(T=!1,a.rounding=o.s=1,t=Math.min(12,(A+"").length),n=jl(e.times(Er(o,r+t)),r),n.d&&(n=b(n,r+5,1),Qs(n.d,r,i)&&(A=r+10,n=b(jl(e.times(Er(o,A+t)),A),A+5,1),+_e(n.d).slice(r+1,r+15)+1==1e14&&(n=b(n,r+1,0)))),n.s=s,T=!0,a.rounding=i,b(n,r,i))};B.toPrecision=function(e,A){var t,r=this,n=r.constructor;return e===void 0?t=dt(r,r.e<=n.toExpNeg||r.e>=n.toExpPos):(dA(e,1,dr),A===void 0?A=n.rounding:dA(A,0,8),r=b(new n(r),e,A),t=dt(r,e<=r.e||r.e<=n.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+t:t};B.toSignificantDigits=B.toSD=function(e,A){var t=this,r=t.constructor;return e===void 0?(e=r.precision,A=r.rounding):(dA(e,1,dr),A===void 0?A=r.rounding:dA(A,0,8)),b(new r(t),e,A)};B.toString=function(){var e=this,A=e.constructor,t=dt(e,e.e<=A.toExpNeg||e.e>=A.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t};B.truncated=B.trunc=function(){return b(new this.constructor(this),this.e+1,1)};B.valueOf=B.toJSON=function(){var e=this,A=e.constructor,t=dt(e,e.e<=A.toExpNeg||e.e>=A.toExpPos);return e.isNeg()?"-"+t:t};function _e(e){var A,t,r,n=e.length-1,i="",s=e[0];if(n>0){for(i+=s,A=1;At)throw Error(hr+e)}function Qs(e,A,t,r){var n,i,s,o;for(i=e[0];i>=10;i/=10)--A;return--A<0?(A+=x,n=0):(n=Math.ceil((A+1)/x),A%=x),i=Pe(10,x-A),o=e[n]%i|0,r==null?A<3?(A==0?o=o/100|0:A==1&&(o=o/10|0),s=t<4&&o==99999||t>3&&o==49999||o==5e4||o==0):s=(t<4&&o+1==i||t>3&&o+1==i/2)&&(e[n+1]/i/100|0)==Pe(10,A-2)-1||(o==i/2||o==0)&&(e[n+1]/i/100|0)==0:A<4?(A==0?o=o/1e3|0:A==1?o=o/100|0:A==2&&(o=o/10|0),s=(r||t<4)&&o==9999||!r&&t>3&&o==4999):s=((r||t<4)&&o+1==i||!r&&t>3&&o+1==i/2)&&(e[n+1]/i/1e3|0)==Pe(10,A-3)-1,s}function Ba(e,A,t){for(var r,n=[0],i,s=0,o=e.length;st-1&&(n[r+1]===void 0&&(n[r+1]=0),n[r+1]+=n[r]/t|0,n[r]%=t)}return n.reverse()}function zS(e,A){var t,r,n;if(A.isZero())return A;r=A.d.length,r<32?(t=Math.ceil(r/3),n=(1/Da(4,t)).toString()):(t=16,n="2.3283064365386962890625e-10"),e.precision+=t,A=Ln(e,1,A.times(n),new e(1));for(var i=t;i--;){var s=A.times(A);A=s.times(s).minus(s).times(8).plus(1)}return e.precision-=t,A}var ge=function(){function e(r,n,i){var s,o=0,a=r.length;for(r=r.slice();a--;)s=r[a]*n+o,r[a]=s%i|0,o=s/i|0;return o&&r.unshift(o),r}function A(r,n,i,s){var o,a;if(i!=s)a=i>s?1:-1;else for(o=a=0;on[o]?1:-1;break}return a}function t(r,n,i,s){for(var o=0;i--;)r[i]-=o,o=r[i]1;)r.shift()}return function(r,n,i,s,o,a){var c,g,l,u,E,h,d,C,I,p,w,m,K,H,ne,q,ae,De,ee,Y,ce=r.constructor,Je=r.s==n.s?1:-1,fe=r.d,P=n.d;if(!fe||!fe[0]||!P||!P[0])return new ce(!r.s||!n.s||(fe?P&&fe[0]==P[0]:!P)?NaN:fe&&fe[0]==0||!P?Je*0:Je/0);for(a?(E=1,g=r.e-n.e):(a=ZA,E=x,g=ze(r.e/E)-ze(n.e/E)),ee=P.length,ae=fe.length,I=new ce(Je),p=I.d=[],l=0;P[l]==(fe[l]||0);l++);if(P[l]>(fe[l]||0)&&g--,i==null?(H=i=ce.precision,s=ce.rounding):o?H=i+(r.e-n.e)+1:H=i,H<0)p.push(1),h=!0;else{if(H=H/E+2|0,l=0,ee==1){for(u=0,P=P[0],H++;(l1&&(P=e(P,u,a),fe=e(fe,u,a),ee=P.length,ae=fe.length),q=ee,w=fe.slice(0,ee),m=w.length;m=a/2&&++De;do u=0,c=A(P,w,ee,m),c<0?(K=w[0],ee!=m&&(K=K*a+(w[1]||0)),u=K/De|0,u>1?(u>=a&&(u=a-1),d=e(P,u,a),C=d.length,m=w.length,c=A(d,w,C,m),c==1&&(u--,t(d,ee=10;u/=10)l++;I.e=l+g*E-1,b(I,o?i+I.e+1:i,s,h)}return I}}();function b(e,A,t,r){var n,i,s,o,a,c,g,l,u,E=e.constructor;e:if(A!=null){if(l=e.d,!l)return e;for(n=1,o=l[0];o>=10;o/=10)n++;if(i=A-n,i<0)i+=x,s=A,g=l[u=0],a=g/Pe(10,n-s-1)%10|0;else if(u=Math.ceil((i+1)/x),o=l.length,u>=o)if(r){for(;o++<=u;)l.push(0);g=a=0,n=1,i%=x,s=i-x+1}else break e;else{for(g=o=l[u],n=1;o>=10;o/=10)n++;i%=x,s=i-x+n,a=s<0?0:g/Pe(10,n-s-1)%10|0}if(r=r||A<0||l[u+1]!==void 0||(s<0?g:g%Pe(10,n-s-1)),c=t<4?(a||r)&&(t==0||t==(e.s<0?3:2)):a>5||a==5&&(t==4||r||t==6&&(i>0?s>0?g/Pe(10,n-s):0:l[u-1])%10&1||t==(e.s<0?8:7)),A<1||!l[0])return l.length=0,c?(A-=e.e+1,l[0]=Pe(10,(x-A%x)%x),e.e=-A||0):l[0]=e.e=0,e;if(i==0?(l.length=u,o=1,u--):(l.length=u+1,o=Pe(10,x-i),l[u]=s>0?(g/Pe(10,n-s)%Pe(10,s)|0)*o:0),c)for(;;)if(u==0){for(i=1,s=l[0];s>=10;s/=10)i++;for(s=l[0]+=o,o=1;s>=10;s/=10)o++;i!=o&&(e.e++,l[0]==ZA&&(l[0]=1));break}else{if(l[u]+=o,l[u]!=ZA)break;l[u--]=0,o=1}for(i=l.length;l[--i]===0;)l.pop()}return T&&(e.e>E.maxE?(e.d=null,e.e=NaN):e.e0?i=i.charAt(0)+"."+i.slice(1)+ur(r):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):n<0?(i="0."+ur(-n-1)+i,t&&(r=t-s)>0&&(i+=ur(r))):n>=s?(i+=ur(n+1-s),t&&(r=t-n-1)>0&&(i=i+"."+ur(r))):((r=n+1)0&&(n+1===s&&(i+="."),i+=ur(r))),i}function Ra(e,A){var t=e[0];for(A*=x;t>=10;t/=10)A++;return A}function ya(e,A,t){if(A>XS)throw T=!0,t&&(e.precision=t),Error(hf);return b(new e(pa),A,1,!0)}function KA(e,A,t){if(A>_l)throw Error(hf);return b(new e(ma),A,t,!0)}function ff(e){var A=e.length-1,t=A*x+1;if(A=e[A],A){for(;A%10==0;A/=10)t--;for(A=e[0];A>=10;A/=10)t++}return t}function ur(e){for(var A="";e--;)A+="0";return A}function If(e,A,t,r){var n,i=new e(1),s=Math.ceil(r/x+4);for(T=!1;;){if(t%2&&(i=i.times(A),lf(i.d,s)&&(n=!0)),t=ze(t/2),t===0){t=i.d.length-1,n&&i.d[t]===0&&++i.d[t];break}A=A.times(A),lf(A.d,s)}return T=!0,i}function gf(e){return e.d[e.d.length-1]&1}function Bf(e,A,t){for(var r,n=new e(A[0]),i=0;++i17)return new u(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(A==null?(T=!1,a=h):a=A,o=new u(.03125);e.e>-2;)e=e.times(o),l+=5;for(r=Math.log(Pe(2,l))/Math.LN10*2+5|0,a+=r,t=i=s=new u(1),u.precision=a;;){if(i=b(i.times(e),a,1),t=t.times(++g),o=s.plus(ge(i,t,a,1)),_e(o.d).slice(0,a)===_e(s.d).slice(0,a)){for(n=l;n--;)s=b(s.times(s),a,1);if(A==null)if(c<3&&Qs(s.d,a-r,E,c))u.precision=a+=10,t=i=o=new u(1),g=0,c++;else return b(s,u.precision=h,E,T=!0);else return u.precision=h,s}s=o}}function Er(e,A){var t,r,n,i,s,o,a,c,g,l,u,E=1,h=10,d=e,C=d.d,I=d.constructor,p=I.rounding,w=I.precision;if(d.s<0||!C||!C[0]||!d.e&&C[0]==1&&C.length==1)return new I(C&&!C[0]?-1/0:d.s!=1?NaN:C?0:d);if(A==null?(T=!1,g=w):g=A,I.precision=g+=h,t=_e(C),r=t.charAt(0),Math.abs(i=d.e)<15e14){for(;r<7&&r!=1||r==1&&t.charAt(1)>3;)d=d.times(e),t=_e(d.d),r=t.charAt(0),E++;i=d.e,r>1?(d=new I("0."+t),i++):d=new I(r+"."+t.slice(1))}else return c=ya(I,g+2,w).times(i+""),d=Er(new I(r+"."+t.slice(1)),g-h).plus(c),I.precision=w,A==null?b(d,w,p,T=!0):d;for(l=d,a=s=d=ge(d.minus(1),d.plus(1),g,1),u=b(d.times(d),g,1),n=3;;){if(s=b(s.times(u),g,1),c=a.plus(ge(s,new I(n),g,1)),_e(c.d).slice(0,g)===_e(a.d).slice(0,g))if(a=a.times(2),i!==0&&(a=a.plus(ya(I,g+2,w).times(i+""))),a=ge(a,new I(E),g,1),A==null)if(Qs(a.d,g-h,p,o))I.precision=g+=h,c=s=d=ge(l.minus(1),l.plus(1),g,1),u=b(d.times(d),g,1),n=o=1;else return b(a,I.precision=w,p,T=!0);else return I.precision=w,a;a=c,n+=2}}function pf(e){return String(e.s*e.s/0)}function Kl(e,A){var t,r,n;for((t=A.indexOf("."))>-1&&(A=A.replace(".","")),(r=A.search(/e/i))>0?(t<0&&(t=r),t+=+A.slice(r+1),A=A.substring(0,r)):t<0&&(t=A.length),r=0;A.charCodeAt(r)===48;r++);for(n=A.length;A.charCodeAt(n-1)===48;--n);if(A=A.slice(r,n),A){if(n-=r,e.e=t=t-r-1,e.d=[],r=(t+1)%x,t<0&&(r+=x),re.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(A=A.replace(/(\d)_(?=\d)/g,"$1"),Cf.test(A))return Kl(e,A)}else if(A==="Infinity"||A==="NaN")return+A||(e.s=NaN),e.e=NaN,e.d=null,e;if(jS.test(A))t=16,A=A.toLowerCase();else if(_S.test(A))t=2;else if(KS.test(A))t=8;else throw Error(hr+A);for(i=A.search(/p/i),i>0?(a=+A.slice(i+1),A=A.substring(2,i)):A=A.slice(2),i=A.indexOf("."),s=i>=0,r=e.constructor,s&&(A=A.replace(".",""),o=A.length,i=o-i,n=If(r,new r(t),i,i*2)),c=Ba(A,t,ZA),g=c.length-1,i=g;c[i]===0;--i)c.pop();return i<0?new r(e.s*0):(e.e=Ra(c,g),e.d=c,T=!1,s&&(e=ge(e,n,o*4)),a&&(e=e.times(Math.abs(a)<54?Pe(2,a):Yr.pow(2,a))),T=!0,e)}function eF(e,A){var t,r=A.d.length;if(r<3)return A.isZero()?A:Ln(e,2,A,A);t=1.4*Math.sqrt(r),t=t>16?16:t|0,A=A.times(1/Da(5,t)),A=Ln(e,2,A,A);for(var n,i=new e(5),s=new e(16),o=new e(20);t--;)n=A.times(A),A=A.times(i.plus(n.times(s.times(n).minus(o))));return A}function Ln(e,A,t,r,n){var i,s,o,a,c=1,g=e.precision,l=Math.ceil(g/x);for(T=!1,a=t.times(t),o=new e(r);;){if(s=ge(o.times(a),new e(A++*A++),g,1),o=n?r.plus(s):r.minus(s),r=ge(s.times(a),new e(A++*A++),g,1),s=o.plus(r),s.d[l]!==void 0){for(i=l;s.d[i]===o.d[i]&&i--;);if(i==-1)break}i=o,o=r,r=s,s=i,c++}return T=!0,s.d.length=l+1,s}function Da(e,A){for(var t=e;--A;)t*=e;return t}function mf(e,A){var t,r=A.s<0,n=KA(e,e.precision,1),i=n.times(.5);if(A=A.abs(),A.lte(i))return Jt=r?4:1,A;if(t=A.divToInt(n),t.isZero())Jt=r?3:2;else{if(A=A.minus(t.times(n)),A.lte(i))return Jt=gf(t)?r?2:3:r?4:1,A;Jt=gf(t)?r?1:4:r?3:2}return A.minus(n).abs()}function Zl(e,A,t,r){var n,i,s,o,a,c,g,l,u,E=e.constructor,h=t!==void 0;if(h?(dA(t,1,dr),r===void 0?r=E.rounding:dA(r,0,8)):(t=E.precision,r=E.rounding),!e.isFinite())g=pf(e);else{for(g=dt(e),s=g.indexOf("."),h?(n=2,A==16?t=t*4-3:A==8&&(t=t*3-2)):n=A,s>=0&&(g=g.replace(".",""),u=new E(1),u.e=g.length-s,u.d=Ba(dt(u),10,n),u.e=u.d.length),l=Ba(g,10,n),i=a=l.length;l[--a]==0;)l.pop();if(!l[0])g=h?"0p+0":"0";else{if(s<0?i--:(e=new E(e),e.d=l,e.e=i,e=ge(e,u,t,r,0,n),l=e.d,i=e.e,c=Ef),s=l[t],o=n/2,c=c||l[t+1]!==void 0,c=r<4?(s!==void 0||c)&&(r===0||r===(e.s<0?3:2)):s>o||s===o&&(r===4||c||r===6&&l[t-1]&1||r===(e.s<0?8:7)),l.length=t,c)for(;++l[--t]>n-1;)l[t]=0,t||(++i,l.unshift(1));for(a=l.length;!l[a-1];--a);for(s=0,g="";s1)if(A==16||A==8){for(s=A==16?4:3,--a;a%s;a++)g+="0";for(l=Ba(g,n,A),a=l.length;!l[a-1];--a);for(s=1,g="1.";sa)for(i-=a;i--;)g+="0";else iA)return e.length=A,!0}function AF(e){return new this(e).abs()}function tF(e){return new this(e).acos()}function rF(e){return new this(e).acosh()}function nF(e,A){return new this(e).plus(A)}function iF(e){return new this(e).asin()}function sF(e){return new this(e).asinh()}function oF(e){return new this(e).atan()}function aF(e){return new this(e).atanh()}function cF(e,A){e=new this(e),A=new this(A);var t,r=this.precision,n=this.rounding,i=r+4;return!e.s||!A.s?t=new this(NaN):!e.d&&!A.d?(t=KA(this,i,1).times(A.s>0?.25:.75),t.s=e.s):!A.d||e.isZero()?(t=A.s<0?KA(this,r,n):new this(0),t.s=e.s):!e.d||A.isZero()?(t=KA(this,i,1).times(.5),t.s=e.s):A.s<0?(this.precision=i,this.rounding=1,t=this.atan(ge(e,A,i,1)),A=KA(this,i,1),this.precision=r,this.rounding=n,t=e.s<0?t.minus(A):t.plus(A)):t=this.atan(ge(e,A,i,1)),t}function gF(e){return new this(e).cbrt()}function lF(e){return b(e=new this(e),e.e+1,2)}function uF(e,A,t){return new this(e).clamp(A,t)}function EF(e){if(!e||typeof e!="object")throw Error(wa+"Object expected");var A,t,r,n=e.defaults===!0,i=["precision",1,dr,"rounding",0,8,"toExpNeg",-xn,0,"toExpPos",0,xn,"maxE",0,xn,"minE",-xn,0,"modulo",0,9];for(A=0;A=i[A+1]&&r<=i[A+2])this[t]=r;else throw Error(hr+t+": "+r);if(t="crypto",n&&(this[t]=Wl[t]),(r=e[t])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(df);else this[t]=!1;else throw Error(hr+t+": "+r);return this}function hF(e){return new this(e).cos()}function dF(e){return new this(e).cosh()}function yf(e){var A,t,r;function n(i){var s,o,a,c=this;if(!(c instanceof n))return new n(i);if(c.constructor=n,uf(i)){c.s=i.s,T?!i.d||i.e>n.maxE?(c.e=NaN,c.d=null):i.e=10;o/=10)s++;T?s>n.maxE?(c.e=NaN,c.d=null):s=429e7?A[i]=crypto.getRandomValues(new Uint32Array(1))[0]:o[i++]=n%1e7;else if(crypto.randomBytes){for(A=crypto.randomBytes(r*=4);i=214e7?crypto.randomBytes(4).copy(A,i):(o.push(n%1e7),i+=4);i=r/4}else throw Error(df);else for(;i=10;n/=10)r++;r`}};function Tn(e){return e instanceof Cs}var ba=class{constructor(A){this.value=A}write(A){A.write(this.value)}markAsError(){this.value.markAsError()}};var ka=e=>e,Sa={bold:ka,red:ka,green:ka,dim:ka,enabled:!1},wf={bold:Ve,red:vA,green:ir,dim:Ur,enabled:!0},Mn={write(e){e.writeLine(",")}};var Ct=class{constructor(A){this.contents=A;this.isUnderlined=!1;this.color=A=>A}underline(){return this.isUnderlined=!0,this}setColor(A){return this.color=A,this}write(A){let t=A.getCurrentLineLength();A.write(this.color(this.contents)),this.isUnderlined&&A.afterNextNewline(()=>{A.write(" ".repeat(t)).writeLine(this.color("~".repeat(this.contents.length)))})}};var Qr=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var vn=class extends Qr{constructor(){super(...arguments);this.items=[]}addItem(t){return this.items.push(new ba(t)),this}getField(t){return this.items[t]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(r=>r.value.getPrintWidth()))+2}write(t){if(this.items.length===0){this.writeEmpty(t);return}this.writeWithItems(t)}writeEmpty(t){let r=new Ct("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(Mn,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Rf=": ",Fa=class{constructor(A,t){this.name=A;this.value=t;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Rf.length}write(A){let t=new Ct(this.name);this.hasError&&t.underline().setColor(A.context.colors.red),A.write(t).write(Rf).write(this.value)}};var Pn=class e extends Qr{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(t){this.fields[t.name]=t}addSuggestion(t){this.suggestions.push(t)}getField(t){return this.fields[t]}getDeepField(t){let[r,...n]=t,i=this.getField(r);if(!i)return;let s=i;for(let o of n){let a;if(s.value instanceof e?a=s.value.getField(o):s.value instanceof vn&&(a=s.value.getField(Number(o))),!a)return;s=a}return s}getDeepFieldValue(t){return t.length===0?this:this.getDeepField(t)?.value}hasField(t){return!!this.getField(t)}removeAllFields(){this.fields={}}removeField(t){delete this.fields[t]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(t){return this.getField(t)?.value}getDeepSubSelectionValue(t){let r=this;for(let n of t){if(!(r instanceof e))return;let i=r.getSubSelectionValue(n);if(!i)return;r=i}return r}getDeepSelectionParent(t){let r=this.getSelectionParent();if(!r)return;let n=r;for(let i of t){let s=n.value.getFieldValue(i);if(!s||!(s instanceof e))return;let o=s.getSelectionParent();if(!o)return;n=o}return n}getSelectionParent(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let r=this.getField("include")?.value.asObject();if(r)return{kind:"include",value:r}}getSubSelectionValue(t){return this.getSelectionParent()?.value.fields[t].value}getPrintWidth(){let t=Object.values(this.fields);return t.length==0?2:Math.max(...t.map(n=>n.getPrintWidth()))+2}write(t){let r=Object.values(this.fields);if(r.length===0&&this.suggestions.length===0){this.writeEmpty(t);return}this.writeWithContents(t,r)}asObject(){return this}writeEmpty(t){let r=new Ct("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(Mn,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var He=class extends Qr{constructor(t){super();this.text=t}getPrintWidth(){return this.text.length}write(t){let r=new Ct(this.text);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r)}asObject(){}};var Xl=class{constructor(A){this.errorMessages=[];this.arguments=A}write(A){A.write(this.arguments)}addErrorMessage(A){this.errorMessages.push(A)}renderAllMessages(A){return this.errorMessages.map(t=>t(A)).join(` -`)}};function Gn(e){return new Xl(Df(e))}function Df(e){let A=new Pn;for(let[t,r]of Object.entries(e)){let n=new Fa(t,bf(r));A.addField(n)}return A}function bf(e){if(typeof e=="string")return new He(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new He(String(e));if(typeof e=="bigint")return new He(`${e}n`);if(e===null)return new He("null");if(e===void 0)return new He("undefined");if(Un(e))return new He(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new He(`Buffer.alloc(${e.byteLength})`):new He(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let A=Ia(e)?e.toISOString():"Invalid Date";return new He(`new Date("${A}")`)}return e instanceof Gt?new He(`Prisma.${e._getName()}`):Tn(e)?new He(`prisma.${cf(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?YF(e):typeof e=="object"?Df(e):new He(Object.prototype.toString.call(e))}function YF(e){let A=new vn;for(let t of e)A.addItem(bf(t));return A}function Na(e,A){let t=A==="pretty"?wf:Sa,r=e.renderAllMessages(t),n=new Fn(0,{colors:t}).write(e).toString();return{message:r,args:n}}function kf(e){if(e===void 0)return"";let A=Gn(e);return new Fn(0,{colors:Sa}).write(A).toString()}var VF="P2037";function Yt({error:e,user_facing_error:A},t,r){return A.error_code?new xe(qF(A,r),{code:A.error_code,clientVersion:t,meta:A.meta,batchRequestIdx:A.batch_request_idx}):new ve(e,{clientVersion:t,batchRequestIdx:A.batch_request_idx})}function qF(e,A){let t=e.message;return(A==="postgresql"||A==="postgres"||A==="mysql")&&e.error_code===VF&&(t+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),t}var fs="";function Sf(e){var A=e.split(` -`);return A.reduce(function(t,r){var n=WF(r)||jF(r)||XF(r)||AN(r)||$F(r);return n&&t.push(n),t},[])}var OF=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,HF=/\((\S*)(?::(\d+))(?::(\d+))\)/;function WF(e){var A=OF.exec(e);if(!A)return null;var t=A[2]&&A[2].indexOf("native")===0,r=A[2]&&A[2].indexOf("eval")===0,n=HF.exec(A[2]);return r&&n!=null&&(A[2]=n[1],A[3]=n[2],A[4]=n[3]),{file:t?null:A[2],methodName:A[1]||fs,arguments:t?[A[2]]:[],lineNumber:A[3]?+A[3]:null,column:A[4]?+A[4]:null}}var _F=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function jF(e){var A=_F.exec(e);return A?{file:A[2],methodName:A[1]||fs,arguments:[],lineNumber:+A[3],column:A[4]?+A[4]:null}:null}var KF=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,ZF=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function XF(e){var A=KF.exec(e);if(!A)return null;var t=A[3]&&A[3].indexOf(" > eval")>-1,r=ZF.exec(A[3]);return t&&r!=null&&(A[3]=r[1],A[4]=r[2],A[5]=null),{file:A[3],methodName:A[1]||fs,arguments:A[2]?A[2].split(","):[],lineNumber:A[4]?+A[4]:null,column:A[5]?+A[5]:null}}var zF=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function $F(e){var A=zF.exec(e);return A?{file:A[3],methodName:A[1]||fs,arguments:[],lineNumber:+A[4],column:A[5]?+A[5]:null}:null}var eN=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function AN(e){var A=eN.exec(e);return A?{file:A[2],methodName:A[1]||fs,arguments:[],lineNumber:+A[3],column:A[4]?+A[4]:null}:null}var zl=class{getLocation(){return null}},$l=class{constructor(){this._error=new Error}getLocation(){let A=this._error.stack;if(!A)return null;let r=Sf(A).find(n=>{if(!n.file)return!1;let i=kl(n.file);return i!==""&&!i.includes("@prisma")&&!i.includes("/packages/client/src/runtime/")&&!i.endsWith("/runtime/binary.js")&&!i.endsWith("/runtime/library.js")&&!i.endsWith("/runtime/edge.js")&&!i.endsWith("/runtime/edge-esm.js")&&!i.startsWith("internal/")&&!n.methodName.includes("new ")&&!n.methodName.includes("getCallSite")&&!n.methodName.includes("Proxy.")&&n.methodName.split(".").length<4});return!r||!r.file?null:{fileName:r.file,lineNumber:r.lineNumber,columnNumber:r.column}}};function Cr(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new zl:new $l}var Ff={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Jn(e={}){let A=rN(e);return Object.entries(A).reduce((r,[n,i])=>(Ff[n]!==void 0?r.select[n]={select:i}:r[n]=i,r),{select:{}})}function rN(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function xa(e={}){return A=>(typeof e._count=="boolean"&&(A._count=A._count._all),A)}function Nf(e,A){let t=xa(e);return A({action:"aggregate",unpacker:t,argsMapper:Jn})(e)}function nN(e={}){let{select:A,...t}=e;return typeof A=="object"?Jn({...t,_count:A}):Jn({...t,_count:{_all:!0}})}function iN(e={}){return typeof e.select=="object"?A=>xa(e)(A)._count:A=>xa(e)(A)._count._all}function xf(e,A){return A({action:"count",unpacker:iN(e),argsMapper:nN})(e)}function sN(e={}){let A=Jn(e);if(Array.isArray(A.by))for(let t of A.by)typeof t=="string"&&(A.select[t]=!0);else typeof A.by=="string"&&(A.select[A.by]=!0);return A}function oN(e={}){return A=>(typeof e?._count=="boolean"&&A.forEach(t=>{t._count=t._count._all}),A)}function Lf(e,A){return A({action:"groupBy",unpacker:oN(e),argsMapper:sN})(e)}function Uf(e,A,t){if(A==="aggregate")return r=>Nf(r,t);if(A==="count")return r=>xf(r,t);if(A==="groupBy")return r=>Lf(r,t)}function Tf(e,A){let t=A.fields.filter(n=>!n.relationName),r=Tl(t,n=>n.name);return new Proxy({},{get(n,i){if(i in n||typeof i=="symbol")return n[i];let s=r[i];if(s)return new Cs(e,i,s.type,s.isList,s.kind==="enum")},...fa(Object.keys(r))})}var Mf=e=>Array.isArray(e)?e:e.split("."),eu=(e,A)=>Mf(A).reduce((t,r)=>t&&t[r],e),vf=(e,A,t)=>Mf(A).reduceRight((r,n,i,s)=>Object.assign({},eu(e,s.slice(0,i)),{[n]:r}),t);function aN(e,A){return e===void 0||A===void 0?[]:[...A,"select",e]}function cN(e,A,t){return A===void 0?e??{}:vf(A,t,e||!0)}function Au(e,A,t,r,n,i){let o=e._runtimeDataModel.models[A].fields.reduce((a,c)=>({...a,[c.name]:c}),{});return a=>{let c=Cr(e._errorFormat),g=aN(r,n),l=cN(a,i,g),u=t({dataPath:g,callsite:c})(l),E=gN(e,A);return new Proxy(u,{get(h,d){if(!E.includes(d))return h[d];let I=[o[d].type,t,d],p=[g,l];return Au(e,...I,...p)},...fa([...E,...Object.getOwnPropertyNames(u)])})}}function gN(e,A){return e._runtimeDataModel.models[A].fields.filter(t=>t.kind==="object").map(t=>t.name)}var qf=Z(Sl());var Vf=Z(require("fs"));var Pf={keyword:Tt,entity:Tt,value:e=>Ve(Ut(e)),punctuation:Ut,directive:Tt,function:Tt,variable:e=>Ve(Ut(e)),string:e=>Ve(ir(e)),boolean:Lt,number:Tt,comment:Hi};var lN=e=>e,La={},uN=0,v={manual:La.Prism&&La.Prism.manual,disableWorkerMessageHandler:La.Prism&&La.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof XA){let A=e;return new XA(A.type,v.util.encode(A.content),A.alias)}else return Array.isArray(e)?e.map(v.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(De instanceof XA)continue;if(K&&q!=A.length-1){p.lastIndex=ae;var l=p.exec(e);if(!l)break;var g=l.index+(m?l[1].length:0),u=l.index+l[0].length,o=q,a=ae;for(let P=A.length;o=a&&(++q,ae=a);if(A[q]instanceof XA)continue;c=o-q,De=e.slice(ae,a),l.index-=ae}else{p.lastIndex=0;var l=p.exec(De),c=1}if(!l){if(i)break;continue}m&&(H=l[1]?l[1].length:0);var g=l.index+H,l=l[0].slice(H),u=g+l.length,E=De.slice(0,g),h=De.slice(u);let ee=[q,c];E&&(++q,ae+=E.length,ee.push(E));let Y=new XA(d,w?v.tokenize(l,w):l,ne,l,K);if(ee.push(Y),h&&ee.push(h),Array.prototype.splice.apply(A,ee),c!=1&&v.matchGrammar(e,A,t,q,ae,!0,d),i)break}}}},tokenize:function(e,A){let t=[e],r=A.rest;if(r){for(let n in r)A[n]=r[n];delete A.rest}return v.matchGrammar(e,t,A,0,0,!1),t},hooks:{all:{},add:function(e,A){let t=v.hooks.all;t[e]=t[e]||[],t[e].push(A)},run:function(e,A){let t=v.hooks.all[e];if(!(!t||!t.length))for(var r=0,n;n=t[r++];)n(A)}},Token:XA};v.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};v.languages.javascript=v.languages.extend("clike",{"class-name":[v.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});v.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;v.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:v.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:v.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:v.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:v.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});v.languages.markup&&v.languages.markup.tag.addInlined("script","javascript");v.languages.js=v.languages.javascript;v.languages.typescript=v.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});v.languages.ts=v.languages.typescript;function XA(e,A,t,r,n){this.type=e,this.content=A,this.alias=t,this.length=(r||"").length|0,this.greedy=!!n}XA.stringify=function(e,A){return typeof e=="string"?e:Array.isArray(e)?e.map(function(t){return XA.stringify(t,A)}).join(""):EN(e.type)(e.content)};function EN(e){return Pf[e]||lN}function Gf(e){return hN(e,v.languages.javascript)}function hN(e,A){return v.tokenize(e,A).map(r=>XA.stringify(r)).join("")}var Jf=Z(HC());function Yf(e){return(0,Jf.default)(e)}var Ua=class e{static read(A){let t;try{t=Vf.default.readFileSync(A,"utf-8")}catch{return null}return e.fromContent(t)}static fromContent(A){let t=A.split(/\r?\n/);return new e(1,t)}constructor(A,t){this.firstLineNumber=A,this.lines=t}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(A,t){if(Athis.lines.length+this.firstLineNumber)return this;let r=A-this.firstLineNumber,n=[...this.lines];return n[r]=t(n[r]),new e(this.firstLineNumber,n)}mapLines(A){return new e(this.firstLineNumber,this.lines.map((t,r)=>A(t,this.firstLineNumber+r)))}lineAt(A){return this.lines[A-this.firstLineNumber]}prependSymbolAt(A,t){return this.mapLines((r,n)=>n===A?`${t} ${r}`:` ${r}`)}slice(A,t){let r=this.lines.slice(A-1,t).join(` -`);return new e(A,Yf(r).split(` -`))}highlight(){let A=Gf(this.toString());return new e(this.firstLineNumber,A.split(` -`))}toString(){return this.lines.join(` -`)}};var dN={red:vA,gray:Hi,dim:Ur,bold:Ve,underline:EA,highlightSource:e=>e.highlight()},QN={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function CN({message:e,originalMethod:A,isPanic:t,callArguments:r}){return{functionName:`prisma.${A}()`,message:e,isPanic:t??!1,callArguments:r}}function fN({callsite:e,message:A,originalMethod:t,isPanic:r,callArguments:n},i){let s=CN({message:A,originalMethod:t,isPanic:r,callArguments:n});if(!e||typeof window<"u"||process.env.NODE_ENV==="production")return s;let o=e.getLocation();if(!o||!o.lineNumber||!o.columnNumber)return s;let a=Math.max(1,o.lineNumber-3),c=Ua.read(o.fileName)?.slice(a,o.lineNumber),g=c?.lineAt(o.lineNumber);if(c&&g){let l=BN(g),u=IN(g);if(!u)return s;s.functionName=`${u.code})`,s.location=o,r||(c=c.mapLineAt(o.lineNumber,h=>h.slice(0,u.openingBraceIndex))),c=i.highlightSource(c);let E=String(c.lastLineNumber).length;if(s.contextLines=c.mapLines((h,d)=>i.gray(String(d).padStart(E))+" "+h).mapLines(h=>i.dim(h)).prependSymbolAt(o.lineNumber,i.bold(i.red("\u2192"))),n){let h=l+E+1;h+=2,s.callArguments=(0,qf.default)(n,h).slice(h)}}return s}function IN(e){let A=Object.keys(lr.ModelAction).join("|"),r=new RegExp(String.raw`\.(${A})\(`).exec(e);if(r){let n=r.index+r[0].length,i=e.lastIndexOf(" ",r.index)+1;return{code:e.slice(i,n),openingBraceIndex:n}}return null}function BN(e){let A=0;for(let t=0;t{if("rejectOnNotFound"in r.args){let i=Yn({originalMethod:r.clientMethod,callsite:r.callsite,message:"'rejectOnNotFound' option is not supported"});throw new Oe(i,{clientVersion:A})}return await t(r).catch(i=>{throw i instanceof xe&&i.code==="P2025"?new Pt(`No ${e} found`,A):i})}}function ft(e){return e.replace(/^./,A=>A.toLowerCase())}var wN=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],RN=["aggregate","count","groupBy"];function tu(e,A){let t=e._extensions.getAllModelExtensions(A)??{},r=[DN(e,A),kN(e,A),ds(t),nA("name",()=>A),nA("$name",()=>A),nA("$parent",()=>e._appliedParent)];return ht({},r)}function DN(e,A){let t=ft(A),r=Object.keys(lr.ModelAction).concat("count");return{getKeys(){return r},getPropertyValue(n){let i=n,s=a=>e._request(a);s=Of(i,A,e._clientVersion,s);let o=a=>c=>{let g=Cr(e._errorFormat);return e._createPrismaPromise(l=>{let u={args:c,dataPath:[],action:i,model:A,clientMethod:`${t}.${n}`,jsModelName:t,transaction:l,callsite:g};return s({...u,...a})})};return wN.includes(i)?Au(e,A,o):bN(n)?Uf(e,n,o):o({})}}}function bN(e){return RN.includes(e)}function kN(e,A){return Jr(nA("fields",()=>{let t=e._runtimeDataModel.models[A];return Tf(A,t)}))}function Hf(e){return e.replace(/^./,A=>A.toUpperCase())}var ru=Symbol();function Is(e){let A=[SN(e),nA(ru,()=>e),nA("$parent",()=>e._appliedParent)],t=e._extensions.getAllClientExtensions();return t&&A.push(ds(t)),ht(e,A)}function SN(e){let A=Object.keys(e._runtimeDataModel.models),t=A.map(ft),r=[...new Set(A.concat(t))];return Jr({getKeys(){return r},getPropertyValue(n){let i=Hf(n);if(e._runtimeDataModel.models[i]!==void 0)return tu(e,i);if(e._runtimeDataModel.models[n]!==void 0)return tu(e,n)},getPropertyDescriptor(n){if(!t.includes(n))return{enumerable:!1}}})}function Wf(e){return e[ru]?e[ru]:e}function _f(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let t=e.client.__AccelerateEngine;this._originalClient._engine=new t(this._originalClient._accelerateEngineConfig)}let A=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return Is(A)}function jf({result:e,modelName:A,select:t,omit:r,extensions:n}){let i=n.getAllComputedFields(A);if(!i)return e;let s=[],o=[];for(let a of Object.values(i)){if(r){if(r[a.name])continue;let c=a.needs.filter(g=>r[g]);c.length>0&&o.push(kn(c))}else if(t){if(!t[a.name])continue;let c=a.needs.filter(g=>!t[g]);c.length>0&&o.push(kn(c))}FN(e,a.needs)&&s.push(NN(a,ht(e,s)))}return s.length>0||o.length>0?ht(e,[...s,...o]):e}function FN(e,A){return A.every(t=>Ul(e,t))}function NN(e,A){return Jr(nA(e.name,()=>e.compute(A)))}function Ta({visitor:e,result:A,args:t,runtimeDataModel:r,modelName:n}){if(Array.isArray(A)){for(let s=0;sg.name===i);if(!a||a.kind!=="object"||!a.relationName)continue;let c=typeof s=="object"?s:{};A[i]=Ta({visitor:n,result:A[i],args:c,modelName:a.type,runtimeDataModel:r})}}function Zf({result:e,modelName:A,args:t,extensions:r,runtimeDataModel:n,globalOmit:i}){return r.isEmpty()||e==null||typeof e!="object"||!n.models[A]?e:Ta({result:e,args:t??{},modelName:A,runtimeDataModel:n,visitor:(o,a,c)=>{let g=ft(a);return jf({result:o,modelName:g,select:c.select,omit:c.select?void 0:{...i?.[g],...c.omit},extensions:r})}})}function Xf(e){if(e instanceof hA)return xN(e);if(Array.isArray(e)){let t=[e[0]];for(let r=1;r{let i=A.customDataProxyFetch;return"transaction"in A&&n!==void 0&&(A.transaction?.kind==="batch"&&A.transaction.lock.then(),A.transaction=n),r===t.length?e._executeRequest(A):t[r]({model:A.model,operation:A.model?A.action:A.clientMethod,args:Xf(A.args??{}),__internalParams:A,query:(s,o=A)=>{let a=o.customDataProxyFetch;return o.customDataProxyFetch=rI(i,a),o.args=s,$f(e,o,t,r+1)}})})}function eI(e,A){let{jsModelName:t,action:r,clientMethod:n}=A,i=t?r:n;if(e._extensions.isEmpty())return e._executeRequest(A);let s=e._extensions.getAllQueryCallbacks(t??"$none",i);return $f(e,A,s)}function AI(e){return A=>{let t={requests:A},r=A[0].extensions.getAllBatchQueryCallbacks();return r.length?tI(t,r,0,e):e(t)}}function tI(e,A,t,r){if(t===A.length)return r(e);let n=e.customDataProxyFetch,i=e.requests[0].transaction;return A[t]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:i?{isolationLevel:i.kind==="batch"?i.isolationLevel:void 0}:void 0},__internalParams:e,query(s,o=e){let a=o.customDataProxyFetch;return o.customDataProxyFetch=rI(n,a),tI(o,A,t+1,r)}})}var zf=e=>e;function rI(e=zf,A=zf){return t=>e(A(t))}function iI(e,A,t){let r=ft(t);return!A.result||!(A.result.$allModels||A.result[r])?e:LN({...e,...nI(A.name,e,A.result.$allModels),...nI(A.name,e,A.result[r])})}function LN(e){let A=new Et,t=(r,n)=>A.getOrCreate(r,()=>n.has(r)?[r]:(n.add(r),e[r]?e[r].needs.flatMap(i=>t(i,n)):[r]));return Dn(e,r=>({...r,needs:t(r.name,new Set)}))}function nI(e,A,t){return t?Dn(t,({needs:r,compute:n},i)=>({name:i,needs:r?Object.keys(r).filter(s=>r[s]):[],compute:UN(A,i,n)})):{}}function UN(e,A,t){let r=e?.[A]?.compute;return r?n=>t({...n,[A]:r(n)}):t}function sI(e,A){if(!A)return e;let t={...e};for(let r of Object.values(A))if(e[r.name])for(let n of r.needs)t[n]=!0;return t}function oI(e,A){if(!A)return e;let t={...e};for(let r of Object.values(A))if(!e[r.name])for(let n of r.needs)delete t[n];return t}var Ma=class{constructor(A,t){this.extension=A;this.previous=t;this.computedFieldsCache=new Et;this.modelExtensionsCache=new Et;this.queryCallbacksCache=new Et;this.clientExtensions=os(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=os(()=>{let A=this.previous?.getAllBatchQueryCallbacks()??[],t=this.extension.query?.$__internalBatch;return t?A.concat(t):A})}getAllComputedFields(A){return this.computedFieldsCache.getOrCreate(A,()=>iI(this.previous?.getAllComputedFields(A),this.extension,A))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(A){return this.modelExtensionsCache.getOrCreate(A,()=>{let t=ft(A);return!this.extension.model||!(this.extension.model[t]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(A):{...this.previous?.getAllModelExtensions(A),...this.extension.model.$allModels,...this.extension.model[t]}})}getAllQueryCallbacks(A,t){return this.queryCallbacksCache.getOrCreate(`${A}:${t}`,()=>{let r=this.previous?.getAllQueryCallbacks(A,t)??[],n=[],i=this.extension.query;return!i||!(i[A]||i.$allModels||i[t]||i.$allOperations)?r:(i[A]!==void 0&&(i[A][t]!==void 0&&n.push(i[A][t]),i[A].$allOperations!==void 0&&n.push(i[A].$allOperations)),A!=="$none"&&i.$allModels!==void 0&&(i.$allModels[t]!==void 0&&n.push(i.$allModels[t]),i.$allModels.$allOperations!==void 0&&n.push(i.$allModels.$allOperations)),i[t]!==void 0&&n.push(i[t]),i.$allOperations!==void 0&&n.push(i.$allOperations),r.concat(n))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},va=class e{constructor(A){this.head=A}static empty(){return new e}static single(A){return new e(new Ma(A))}isEmpty(){return this.head===void 0}append(A){return new e(new Ma(A,this.head))}getAllComputedFields(A){return this.head?.getAllComputedFields(A)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(A){return this.head?.getAllModelExtensions(A)}getAllQueryCallbacks(A,t){return this.head?.getAllQueryCallbacks(A,t)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var aI=ie("prisma:client"),cI={Vercel:"vercel","Netlify CI":"netlify"};function gI({postinstall:e,ciName:A,clientVersion:t}){if(aI("checkPlatformCaching:postinstall",e),aI("checkPlatformCaching:ciName",A),e===!0&&A&&A in cI){let r=`Prisma has detected that this project was built on ${A}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${cI[A]}-build`;throw console.error(r),new z(r,t)}}function lI(e,A){return e?e.datasources?e.datasources:e.datasourceUrl?{[A[0]]:{url:e.datasourceUrl}}:{}:{}}var TN="Cloudflare-Workers",MN="node";function uI(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===TN?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===MN?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var vN={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function EI(){let e=uI();return{id:e,prettyName:vN[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var dR=require("child_process"),QR=Z(RC()),Fg=Z(require("fs"));var CR=Z(xC());function Vn(e){return typeof e=="string"?e:e.message}function hI(e){if(e.fields?.message){let A=e.fields?.message;return e.fields?.file&&(A+=` in ${e.fields.file}`,e.fields?.line&&(A+=`:${e.fields.line}`),e.fields?.column&&(A+=`:${e.fields.column}`)),e.fields?.reason&&(A+=` -${e.fields?.reason}`),A}return"Unknown error"}function dI(e){return e.fields?.message==="PANIC"}function PN(e){return e.timestamp&&typeof e.level=="string"&&typeof e.target=="string"}function nu(e){return PN(e)&&(e.level==="error"||e.fields?.message?.includes("fatal error"))}function QI(e){let t=GN(e.fields)?"query":e.level.toLowerCase();return{...e,level:t,timestamp:new Date(e.timestamp)}}function GN(e){return!!e.query}var ps=class extends Error{constructor({clientVersion:A,error:t}){let r=hI(t);super(r??"Unknown error"),this._isPanic=dI(t),this.clientVersion=A}get[Symbol.toStringTag](){return"PrismaClientRustError"}isPanic(){return this._isPanic}};L(ps,"PrismaClientRustError");var pI=Z(require("fs")),ms=Z(require("path"));function Pa(e){let{runtimeBinaryTarget:A}=e;return`Add "${A}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it: - -${JN(e)}`}function JN(e){let{generator:A,generatorBinaryTargets:t,runtimeBinaryTarget:r}=e,n={fromEnvVar:null,value:r},i=[...t,n];return Nl({...A,binaryTargets:i})}function fr(e){let{runtimeBinaryTarget:A}=e;return`Prisma Client could not locate the Query Engine for runtime "${A}".`}function Ir(e){let{searchedLocations:A}=e;return`The following locations have been searched: -${[...new Set(A)].map(n=>` ${n}`).join(` -`)}`}function CI(e){let{runtimeBinaryTarget:A}=e;return`${fr(e)} - -This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${A}". -${Pa(e)} - -${Ir(e)}`}function Ga(e){return`We would appreciate if you could take the time to share some information with us. -Please help us by answering a few questions: https://pris.ly/${e}`}function Ja(e){let{errorStack:A}=e;return A?.match(/\/\.next|\/next@|\/next\//)?` - -We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.`:""}function fI(e){let{queryEngineName:A}=e;return`${fr(e)}${Ja(e)} - -This is likely caused by a bundler that has not copied "${A}" next to the resulting bundle. -Ensure that "${A}" has been copied next to the bundle or in "${e.expectedLocation}". - -${Ga("engine-not-found-bundler-investigation")} - -${Ir(e)}`}function II(e){let{runtimeBinaryTarget:A,generatorBinaryTargets:t}=e,r=t.find(n=>n.native);return`${fr(e)} - -This happened because Prisma Client was generated for "${r?.value??"unknown"}", but the actual deployment required "${A}". -${Pa(e)} - -${Ir(e)}`}function BI(e){let{queryEngineName:A}=e;return`${fr(e)}${Ja(e)} - -This is likely caused by tooling that has not copied "${A}" to the deployment folder. -Ensure that you ran \`prisma generate\` and that "${A}" has been copied to "${e.expectedLocation}". - -${Ga("engine-not-found-tooling-investigation")} - -${Ir(e)}`}var YN=ie("prisma:client:engines:resolveEnginePath"),VN=()=>new RegExp("runtime[\\\\/]binary\\.m?js$");async function iu(e,A){let t={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??A.prismaPath;if(t!==void 0)return t;let{enginePath:r,searchedLocations:n}=await qN(e,A);if(YN("enginePath",r),r!==void 0&&e==="binary"&&wl(r),r!==void 0)return A.prismaPath=r;let i=await Tr(),s=A.generator?.binaryTargets??[],o=s.some(u=>u.native),a=!s.some(u=>u.value===i),c=__filename.match(VN())===null,g={searchedLocations:n,generatorBinaryTargets:s,generator:A.generator,runtimeBinaryTarget:i,queryEngineName:mI(e,i),expectedLocation:ms.default.relative(process.cwd(),A.dirname),errorStack:new Error().stack},l;throw o&&a?l=II(g):a?l=CI(g):c?l=fI(g):l=BI(g),new z(l,A.clientVersion)}async function qN(engineType,config){let binaryTarget=await Tr(),searchedLocations=[],dirname=eval("__dirname"),searchLocations=[config.dirname,ms.default.resolve(dirname,".."),config.generator?.output?.value??dirname,ms.default.resolve(dirname,"../../../.prisma/client"),"/tmp/prisma-engines",config.cwd];__filename.includes("resolveEnginePath")&&searchLocations.push(LC());for(let e of searchLocations){let A=mI(engineType,binaryTarget),t=ms.default.join(e,A);if(searchedLocations.push(e),pI.default.existsSync(t))return{enginePath:t,searchedLocations}}return{enginePath:void 0,searchedLocations}}function mI(e,A){return e==="library"?Po(A,"fs"):`query-engine-${A}${A==="windows"?".exe":""}`}var su=Z(Ll());function yI(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,A=>`${A[0]}5`):""}function wI(e){return e.split(` -`).map(A=>A.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(` -`)}var RI=Z($C());function DI({title:e,user:A="prisma",repo:t="prisma",template:r="bug_report.yml",body:n}){return(0,RI.default)({user:A,repo:t,template:r,title:e,body:n})}function bI({version:e,binaryTarget:A,title:t,description:r,engineVersion:n,database:i,query:s}){let o=Ud(6e3-(s?.length??0)),a=wI((0,su.default)(o)),c=r?`# Description -\`\`\` -${r} -\`\`\``:"",g=(0,su.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report: -## Versions - -| Name | Version | -|-----------------|--------------------| -| Node | ${process.version?.padEnd(19)}| -| OS | ${A?.padEnd(19)}| -| Prisma Client | ${e?.padEnd(19)}| -| Query Engine | ${n?.padEnd(19)}| -| Database | ${i?.padEnd(19)}| - -${c} - -## Logs -\`\`\` -${a} -\`\`\` - -## Client Snippet -\`\`\`ts -// PLEASE FILL YOUR CODE SNIPPET HERE -\`\`\` - -## Schema -\`\`\`prisma -// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE -\`\`\` - -## Prisma Engine Query -\`\`\` -${s?yI(s):""} -\`\`\` -`),l=DI({title:t,body:g});return`${t} - -This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. - -${EA(l)} - -If you want the Prisma team to look into it, please open the link above \u{1F64F} -To increase the chance of success, please post your schema and a snippet of -how you used Prisma Client in the issue. -`}var gR=Z(Cl()),JJ=()=>cR();function YJ(e){if(e===void 0)throw new Error("Connection has not been opened")}var rr=class{constructor(){}static async onHttpError(A,t){let r=await A;return r.statusCode>=400?t(r):r}open(A,t){this._pool||(this._pool=new(JJ()).Pool(A,{connections:1e3,keepAliveMaxTimeout:6e5,headersTimeout:0,bodyTimeout:0,...t}))}async raw(A,t,r,n,i=!0){YJ(this._pool);let s=await this._pool.request({path:t,method:A,headers:{"Content-Type":"application/json",...r},body:n}),o=await(0,gR.default)(s.body);return{statusCode:s.statusCode,headers:s.headers,data:i?JSON.parse(o):o}}post(A,t,r,n){return this.raw("POST",A,r,t,n)}get(A,t){return this.raw("GET",A,t)}close(){this._pool&&this._pool.close(()=>{}),this._pool=void 0}};var tA=ie("prisma:engine"),uo=(...e)=>{},lR=[...Zg,"native"],Ng=[],uR=process.env.PRISMA_CLIENT_NO_RETRY?1:2,ER=process.env.PRISMA_CLIENT_NO_RETRY?1:2,ho=class{constructor(A){this.name="BinaryEngine";this.startCount=0;this.previewFeatures=[];this.stderrLogs="";this.handleRequestError=async A=>{tA({error:A}),this.startPromise&&await this.startPromise;let t=["ECONNRESET","ECONNREFUSED","UND_ERR_CLOSED","UND_ERR_SOCKET","UND_ERR_DESTROYED","UND_ERR_ABORTED"].includes(A.code);if(A instanceof xe)return{error:A,shouldRetry:!1};try{if(this.throwAsyncErrorIfExists(),this.currentRequestPromise?.isCanceled)this.throwAsyncErrorIfExists();else if(t){if(this.globalKillSignalReceived&&!this.child?.connected)throw new ve(`The Node.js process already received a ${this.globalKillSignalReceived} signal, therefore the Prisma query engine exited - and your request can't be processed. - You probably have some open handle that prevents your process from exiting. - It could be an open http server or stream that didn't close yet. - We recommend using the \`wtfnode\` package to debug open handles.`,{clientVersion:this.clientVersion});if(this.throwAsyncErrorIfExists(),this.startCount>uR){for(let r=0;r<5;r++)await new Promise(n=>setTimeout(n,50)),this.throwAsyncErrorIfExists(!0);throw new Error(`Query engine is trying to restart, but can't. - Please look into the logs or turn on the env var DEBUG=* to debug the constantly restarting query engine.`)}}throw this.throwAsyncErrorIfExists(!0),A}catch(r){return{error:r,shouldRetry:t}}};this.config=A,this.env=A.env,this.cwd=this.resolveCwd(A.cwd),this.enableDebugLogs=A.enableDebugLogs??!1,this.allowTriggerPanic=A.allowTriggerPanic??!1,this.datamodelPath=A.datamodelPath,this.tracingHelper=A.tracingHelper,this.logEmitter=A.logEmitter,this.showColors=A.showColors??!1,this.logQueries=A.logQueries??!1,this.clientVersion=A.clientVersion,this.flags=A.flags??[],this.previewFeatures=A.previewFeatures??[],this.activeProvider=A.activeProvider,this.connection=new rr;let t=Object.keys(A.overrideDatasources)[0],r=A.overrideDatasources[t]?.url;t!==void 0&&r!==void 0&&(this.datasourceOverrides=[{name:t,url:r}]),VJ();let n=["middlewares","aggregateApi","distinct","aggregations","insensitiveFilters","atomicNumberOperations","transactionApi","transaction","connectOrCreate","uncheckedScalarInputs","nativeTypes","createMany","groupBy","referentialActions","microsoftSqlServer"],i=this.previewFeatures.filter(s=>n.includes(s));if(i.length>0&&!process.env.PRISMA_HIDE_PREVIEW_FLAG_WARNINGS&&console.log(`${Ut(Ve("info"))} The preview flags \`${i.join("`, `")}\` were removed, you can now safely remove them from your schema.prisma.`),this.previewFeatures=this.previewFeatures.filter(s=>!n.includes(s)),this.engineEndpoint=A.engineEndpoint,this.binaryTarget){if(!lR.includes(this.binaryTarget)&&!Fg.default.existsSync(this.binaryTarget))throw new z(`Unknown ${vA("PRISMA_QUERY_ENGINE_BINARY")} ${vA(Ve(this.binaryTarget))}. Possible binaryTargets: ${ir(lR.join(", "))} or a path to the query engine binary. -You may have to run ${ir("prisma generate")} for your changes to take effect.`,this.clientVersion)}else this.getCurrentBinaryTarget();this.enableDebugLogs&&ie.enable("*"),Ng.push(this)}setError(A){nu(A)&&(this.lastError=new ps({clientVersion:this.clientVersion,error:A}),this.lastError.isPanic()&&(this.child&&(this.stopPromise=qJ(this.child)),this.currentRequestPromise?.cancel&&this.currentRequestPromise.cancel()))}resolveCwd(A){return Fg.default.existsSync(A)&&Fg.default.lstatSync(A).isDirectory()?A:process.cwd()}onBeforeExit(A){this.beforeExitListener=A}async emitExit(){if(this.beforeExitListener)try{await this.beforeExitListener()}catch(A){console.error(A)}}async getCurrentBinaryTarget(){return this.binaryTargetPromise?this.binaryTargetPromise:(this.binaryTargetPromise=Tr(),this.binaryTargetPromise)}printDatasources(){return this.datasourceOverrides?JSON.stringify(this.datasourceOverrides):"[]"}async start(){this.stopPromise&&await this.stopPromise;let A={times:10},t=async()=>{try{await this.internalStart()}catch(n){throw n.retryable===!0&&A.times>0&&(A.times--,await t()),n}},r=async()=>{if(this.startPromise||(this.startCount++,this.startPromise=t()),await this.startPromise,!this.child&&!this.engineEndpoint)throw new ve("Can't perform request, as the Engine has already been stopped",{clientVersion:this.clientVersion})};return this.startPromise?r():this.tracingHelper.runInChildSpan("connect",r)}getEngineEnvVars(){let A={PRISMA_DML_PATH:this.datamodelPath};return this.logQueries&&(A.LOG_QUERIES="true"),this.datasourceOverrides&&(A.OVERWRITE_DATASOURCES=this.printDatasources()),!process.env.NO_COLOR&&this.showColors&&(A.CLICOLOR_FORCE="1"),{...this.env,...process.env,...A,RUST_BACKTRACE:process.env.RUST_BACKTRACE??"1",RUST_LOG:process.env.RUST_LOG??"info"}}internalStart(){return new Promise(async(A,t)=>{if(await new Promise(r=>process.nextTick(r)),this.stopPromise&&await this.stopPromise,this.engineEndpoint){try{this.connection.open(this.engineEndpoint),await(0,CR.default)(()=>this.connection.get("/status"),{retries:10})}catch(r){return t(r)}return A()}try{(this.child?.connected||this.child&&!this.child?.killed)&&tA("There is a child that still runs and we want to start again"),this.lastError=void 0,uo("startin & resettin"),this.globalKillSignalReceived=void 0,tA({cwd:this.cwd});let r=await iu("binary",this.config),n=this.allowTriggerPanic?["--debug"]:[],i=["--enable-raw-queries","--enable-metrics","--enable-open-telemetry",...this.flags,...n];i.push("--port","0"),i.push("--engine-protocol","json"),tA({flags:i});let s=this.getEngineEnvVars();if(this.child=(0,dR.spawn)(r,i,{env:s,cwd:this.cwd,windowsHide:!0,stdio:["ignore","pipe","pipe"]}),is(this.child.stderr).on("data",o=>{let a=String(o);tA("stderr",a);try{let c=JSON.parse(a);if(typeof c.is_panic<"u"&&(tA(c),this.setError(c),this.engineStartDeferred)){let g=new z(c.message,this.clientVersion,c.error_code);this.engineStartDeferred.reject(g)}}catch{!a.includes("Printing to stderr")&&!a.includes("Listening on ")&&(this.stderrLogs+=` -`+a)}}),is(this.child.stdout).on("data",o=>{let a=String(o);try{let c=JSON.parse(a);if(tA("stdout",Vn(c)),this.engineStartDeferred&&c.level==="INFO"&&c.target==="query_engine::server"&&c.fields?.message?.startsWith("Started query engine http server")){let g=c.fields.ip,l=c.fields.port;if(g===void 0||l===void 0){this.engineStartDeferred.reject(new z('This version of Query Engine is not compatible with Prisma Client: "ip" and "port" fields are missing in the startup log entry',this.clientVersion));return}this.connection.open(`http://${g}:${l}`),this.engineStartDeferred.resolve(),this.engineStartDeferred=void 0}if(typeof c.is_panic>"u"){if(c.span===!0){this.tracingHelper.createEngineSpan(c);return}let g=QI(c);nu(g)?this.setError(g):g.level==="query"?this.logEmitter.emit(g.level,{timestamp:g.timestamp,query:g.fields.query,params:g.fields.params,duration:g.fields.duration_ms,target:g.target}):this.logEmitter.emit(g.level,{timestamp:g.timestamp,message:g.fields.message,target:g.target})}else this.setError(c)}catch(c){tA(c,a)}}),this.child.on("exit",o=>{if(uo("removing startPromise"),this.startPromise=void 0,this.engineStopDeferred){this.engineStopDeferred.resolve(o);return}if(this.connection.close(),o!==0&&this.engineStartDeferred&&this.startCount===1){let a,c=this.stderrLogs;this.lastError&&(c=Vn(this.lastError)),o!==null?(a=new z(`Query engine exited with code ${o} -`+c,this.clientVersion),a.retryable=!0):this.child?.signalCode?(a=new z(`Query engine process killed with signal ${this.child.signalCode} for unknown reason. -Make sure that the engine binary at ${r} is not corrupt. -`+c,this.clientVersion),a.retryable=!0):a=new z(c,this.clientVersion),this.engineStartDeferred.reject(a)}this.child&&(this.lastError||o===126&&this.setError({timestamp:new Date,target:"binary engine process exit",level:"error",fields:{message:`Couldn't start query engine as it's not executable on this operating system. -You very likely have the wrong "binaryTarget" defined in the schema.prisma file.`}}))}),this.child.on("error",o=>{this.setError({timestamp:new Date,target:"binary engine process error",level:"error",fields:{message:`Couldn't start query engine: ${o}`}}),t(o)}),this.child.on("close",(o,a)=>{this.connection.close();let c;o===null&&a==="SIGABRT"&&this.child?c=new JA(this.getErrorMessageWithLink("Panic in Query Engine with SIGABRT signal"),this.clientVersion):o===255&&a===null&&this.lastError&&(c=this.lastError),c&&this.logEmitter.emit("error",{message:c.message,timestamp:new Date,target:"binary engine process close"})}),this.lastError)return t(new z(Vn(this.lastError),this.clientVersion));try{await new Promise((o,a)=>{this.engineStartDeferred={resolve:o,reject:a}})}catch(o){throw this.child?.kill(),o}(async()=>{try{let o=await this.version(!0);tA(`Client Version: ${this.clientVersion}`),tA(`Engine Version: ${o}`),tA(`Active provider: ${this.activeProvider}`)}catch(o){tA(o)}})(),this.stopPromise=void 0,A()}catch(r){t(r)}})}async stop(){let A=async()=>(this.stopPromise||(this.stopPromise=this._stop()),this.stopPromise);return this.tracingHelper.runInChildSpan("disconnect",A)}async _stop(){if(this.startPromise&&await this.startPromise,await new Promise(t=>process.nextTick(t)),this.currentRequestPromise)try{await this.currentRequestPromise}catch{}let A;this.child&&(tA("Stopping Prisma engine"),this.startPromise&&(tA("Waiting for start promise"),await this.startPromise),tA("Done waiting for start promise"),this.child.exitCode===null?A=new Promise((t,r)=>{this.engineStopDeferred={resolve:t,reject:r}}):tA("Child already exited with code",this.child.exitCode),this.connection.close(),this.child.kill(),this.child=void 0),A&&await A,await new Promise(t=>process.nextTick(t)),this.startPromise=void 0,this.engineStopDeferred=void 0}kill(A){this.globalKillSignalReceived=A,this.child?.kill(),this.connection.close()}async version(A=!1){return this.versionPromise&&!A?this.versionPromise:(this.versionPromise=this.internalVersion(),this.versionPromise)}async internalVersion(){let A=await iu("binary",this.config),t=await(0,QR.default)(A,["--version"]);return this.lastVersion=t.stdout,this.lastVersion}async request(A,{traceparent:t,numTry:r=1,isWrite:n,interactiveTransaction:i}){await this.start();let s={};t&&(s.traceparent=t),i&&(s["X-transaction-id"]=i.id);let o=JSON.stringify(A);this.currentRequestPromise=rr.onHttpError(this.connection.post("/",o,s),a=>this.httpErrorHandler(a)),this.lastQuery=o;try{let{data:a,headers:c}=await this.currentRequestPromise;if(a.errors)throw a.errors.length===1?Yt(a.errors[0],this.clientVersion,this.config.activeProvider):new ve(JSON.stringify(a.errors),{clientVersion:this.clientVersion});let g=parseInt(c["x-elapsed"])/1e3;return this.startCount>0&&(this.startCount=0),this.currentRequestPromise=void 0,{data:a,elapsed:g}}catch(a){uo("req - e",a);let{error:c,shouldRetry:g}=await this.handleRequestError(a);if(r<=ER&&g&&!n)return uo("trying a retry now"),this.request(A,{traceparent:t,numTry:r+1,isWrite:n,interactiveTransaction:i});throw c}}async requestBatch(A,{traceparent:t,transaction:r,numTry:n=1,containsWrite:i}){await this.start();let s={};t&&(s.traceparent=t);let o=r?.kind==="itx"?r.options:void 0;o&&(s["X-transaction-id"]=o.id);let a=Sn(A,r);return this.lastQuery=JSON.stringify(a),this.currentRequestPromise=rr.onHttpError(this.connection.post("/",this.lastQuery,s),c=>this.httpErrorHandler(c)),this.currentRequestPromise.then(({data:c,headers:g})=>{let l=parseInt(g["x-elapsed"])/1e3,{batchResult:u}=c;if(Array.isArray(u))return u.map(E=>E.errors&&E.errors.length>0?Yt(E.errors[0],this.clientVersion,this.config.activeProvider):{data:E,elapsed:l});throw Yt(c.errors[0],this.clientVersion,this.config.activeProvider)}).catch(async c=>{let{error:g,shouldRetry:l}=await this.handleRequestError(c);if(l&&!i&&n<=ER)return this.requestBatch(A,{traceparent:t,transaction:r,numTry:n+1,containsWrite:i});throw g})}async transaction(A,t,r){if(await this.start(),A==="start"){let n=JSON.stringify({max_wait:r.maxWait,timeout:r.timeout,isolation_level:r.isolationLevel});return(await rr.onHttpError(this.connection.post("/transaction/start",n,t),s=>this.httpErrorHandler(s))).data}else A==="commit"?await rr.onHttpError(this.connection.post(`/transaction/${r.id}/commit`),n=>this.httpErrorHandler(n)):A==="rollback"&&await rr.onHttpError(this.connection.post(`/transaction/${r.id}/rollback`),n=>this.httpErrorHandler(n))}get hasMaxRestarts(){return this.startCount>=uR}throwAsyncErrorIfExists(A=!1){if(uo("throwAsyncErrorIfExists",this.startCount,this.hasMaxRestarts),this.lastError&&(this.hasMaxRestarts||A)){let t=this.lastError;throw this.lastError=void 0,t.isPanic()?new JA(this.getErrorMessageWithLink(Vn(t)),this.clientVersion):new ve(this.getErrorMessageWithLink(Vn(t)),{clientVersion:this.clientVersion})}}getErrorMessageWithLink(A){return bI({binaryTarget:this.binaryTarget,title:A,version:this.clientVersion,engineVersion:this.lastVersion,database:this.lastActiveProvider,query:this.lastQuery})}async metrics({format:A,globalLabels:t}){await this.start();let r=A==="json";return(await this.connection.post(`/metrics?format=${encodeURIComponent(A)}`,JSON.stringify(t),null,r)).data}httpErrorHandler(A){let t=A.data;throw new xe(t.message,{code:t.error_code,clientVersion:this.clientVersion,meta:t.meta})}applyPendingMigrations(){throw new Error("Method not implemented.")}};function Eo(e,A=!1){process.once(e,async()=>{for(let t of Ng)await t.emitExit(),t.kill(e);Ng.splice(0,Ng.length),A&&process.listenerCount(e)===0&&process.exit()})}var hR=!1;function VJ(){hR||(Eo("beforeExit"),Eo("exit"),Eo("SIGINT",!0),Eo("SIGUSR2",!0),Eo("SIGTERM",!0),hR=!0)}function qJ(e){return new Promise(A=>{e.once("exit",A),e.kill()})}function Ui({inlineDatasources:e,overrideDatasources:A,env:t,clientVersion:r}){let n,i=Object.keys(e)[0],s=e[i]?.url,o=A[i]?.url;if(i===void 0?n=void 0:o?n=o:s?.value?n=s.value:s?.fromEnvVar&&(n=t[s.fromEnvVar]),s?.fromEnvVar!==void 0&&n===void 0)throw new z(`error: Environment variable not found: ${s.fromEnvVar}.`,r);if(n===void 0)throw new z("error: Missing URL environment variable, value, or override.",r);return n}var xg=class extends Error{constructor(A,t){super(A),this.clientVersion=t.clientVersion,this.cause=t.cause}get[Symbol.toStringTag](){return this.name}};var wA=class extends xg{constructor(A,t){super(A,t),this.isRetryable=t.isRetryable??!0}};function j(e,A){return{...e,isRetryable:A}}var Ti=class extends wA{constructor(t){super("This request must be retried",j(t,!0));this.name="ForcedRetryError";this.code="P5001"}};L(Ti,"ForcedRetryError");var un=class extends wA{constructor(t,r){super(t,j(r,!1));this.name="InvalidDatasourceError";this.code="P6001"}};L(un,"InvalidDatasourceError");var En=class extends wA{constructor(t,r){super(t,j(r,!1));this.name="NotImplementedYetError";this.code="P5004"}};L(En,"NotImplementedYetError");var Ce=class extends wA{constructor(A,t){super(A,t),this.response=t.response;let r=this.response.headers.get("prisma-request-id");if(r){let n=`(The request id was: ${r})`;this.message=this.message+" "+n}}};var hn=class extends Ce{constructor(t){super("Schema needs to be uploaded",j(t,!0));this.name="SchemaMissingError";this.code="P5005"}};L(hn,"SchemaMissingError");var td="This request could not be understood by the server",Qo=class extends Ce{constructor(t,r,n){super(r||td,j(t,!1));this.name="BadRequestError";this.code="P5000";n&&(this.code=n)}};L(Qo,"BadRequestError");var Co=class extends Ce{constructor(t,r){super("Engine not started: healthcheck timeout",j(t,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=r}};L(Co,"HealthcheckTimeoutError");var fo=class extends Ce{constructor(t,r,n){super(r,j(t,!0));this.name="EngineStartupError";this.code="P5014";this.logs=n}};L(fo,"EngineStartupError");var Io=class extends Ce{constructor(t){super("Engine version is not supported",j(t,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};L(Io,"EngineVersionNotSupportedError");var rd="Request timed out",Bo=class extends Ce{constructor(t,r=rd){super(r,j(t,!1));this.name="GatewayTimeoutError";this.code="P5009"}};L(Bo,"GatewayTimeoutError");var OJ="Interactive transaction error",po=class extends Ce{constructor(t,r=OJ){super(r,j(t,!1));this.name="InteractiveTransactionError";this.code="P5015"}};L(po,"InteractiveTransactionError");var HJ="Request parameters are invalid",mo=class extends Ce{constructor(t,r=HJ){super(r,j(t,!1));this.name="InvalidRequestError";this.code="P5011"}};L(mo,"InvalidRequestError");var nd="Requested resource does not exist",yo=class extends Ce{constructor(t,r=nd){super(r,j(t,!1));this.name="NotFoundError";this.code="P5003"}};L(yo,"NotFoundError");var id="Unknown server error",Mi=class extends Ce{constructor(t,r,n){super(r||id,j(t,!0));this.name="ServerError";this.code="P5006";this.logs=n}};L(Mi,"ServerError");var sd="Unauthorized, check your connection string",wo=class extends Ce{constructor(t,r=sd){super(r,j(t,!1));this.name="UnauthorizedError";this.code="P5007"}};L(wo,"UnauthorizedError");var od="Usage exceeded, retry again later",Ro=class extends Ce{constructor(t,r=od){super(r,j(t,!0));this.name="UsageExceededError";this.code="P5008"}};L(Ro,"UsageExceededError");async function WJ(e){let A;try{A=await e.text()}catch{return{type:"EmptyError"}}try{let t=JSON.parse(A);if(typeof t=="string")switch(t){case"InternalDataProxyError":return{type:"DataProxyError",body:t};default:return{type:"UnknownTextError",body:t}}if(typeof t=="object"&&t!==null){if("is_panic"in t&&"message"in t&&"error_code"in t)return{type:"QueryEngineError",body:t};if("EngineNotStarted"in t||"InteractiveTransactionMisrouted"in t||"InvalidRequestError"in t){let r=Object.values(t)[0].reason;return typeof r=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(r)?{type:"UnknownJsonError",body:t}:{type:"DataProxyError",body:t}}}return{type:"UnknownJsonError",body:t}}catch{return A===""?{type:"EmptyError"}:{type:"UnknownTextError",body:A}}}async function Do(e,A){if(e.ok)return;let t={clientVersion:A,response:e},r=await WJ(e);if(r.type==="QueryEngineError")throw new xe(r.body.message,{code:r.body.error_code,clientVersion:A});if(r.type==="DataProxyError"){if(r.body==="InternalDataProxyError")throw new Mi(t,"Internal Data Proxy error");if("EngineNotStarted"in r.body){if(r.body.EngineNotStarted.reason==="SchemaMissing")return new hn(t);if(r.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Io(t);if("EngineStartupError"in r.body.EngineNotStarted.reason){let{msg:n,logs:i}=r.body.EngineNotStarted.reason.EngineStartupError;throw new fo(t,n,i)}if("KnownEngineStartupError"in r.body.EngineNotStarted.reason){let{msg:n,error_code:i}=r.body.EngineNotStarted.reason.KnownEngineStartupError;throw new z(n,A,i)}if("HealthcheckTimeout"in r.body.EngineNotStarted.reason){let{logs:n}=r.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Co(t,n)}}if("InteractiveTransactionMisrouted"in r.body){let n={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new po(t,n[r.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in r.body)throw new mo(t,r.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new wo(t,vi(sd,r));if(e.status===404)return new yo(t,vi(nd,r));if(e.status===429)throw new Ro(t,vi(od,r));if(e.status===504)throw new Bo(t,vi(rd,r));if(e.status>=500)throw new Mi(t,vi(id,r));if(e.status>=400)throw new Qo(t,vi(td,r))}function vi(e,A){return A.type==="EmptyError"?e:`${e}: ${JSON.stringify(A)}`}function fR(e){let A=Math.pow(2,e)*50,t=Math.ceil(Math.random()*A)-Math.ceil(A/2),r=A+t;return new Promise(n=>setTimeout(()=>n(r),r))}var nr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function IR(e){let A=new TextEncoder().encode(e),t="",r=A.byteLength,n=r%3,i=r-n,s,o,a,c,g;for(let l=0;l>18,o=(g&258048)>>12,a=(g&4032)>>6,c=g&63,t+=nr[s]+nr[o]+nr[a]+nr[c];return n==1?(g=A[i],s=(g&252)>>2,o=(g&3)<<4,t+=nr[s]+nr[o]+"=="):n==2&&(g=A[i]<<8|A[i+1],s=(g&64512)>>10,o=(g&1008)>>4,a=(g&15)<<2,t+=nr[s]+nr[o]+nr[a]+"="),t}function BR(e){if(!!e.generator?.previewFeatures.some(t=>t.toLowerCase().includes("metrics")))throw new z("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}function _J(e){return e[0]*1e3+e[1]/1e6}function pR(e){return new Date(_J(e))}var mR={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var bo=class extends wA{constructor(t,r){super(`Cannot fetch data from service: -${t}`,j(r,!0));this.name="RequestError";this.code="P5010"}};L(bo,"RequestError");async function dn(e,A,t=r=>r){let r=A.clientVersion;try{return typeof fetch=="function"?await t(fetch)(e,A):await t(ad)(e,A)}catch(n){let i=n.message??"Unknown error";throw new bo(i,{clientVersion:r})}}function KJ(e){return{...e.headers,"Content-Type":"application/json"}}function ZJ(e){return{method:e.method,headers:KJ(e)}}function XJ(e,A){return{text:()=>Promise.resolve(Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(Buffer.concat(e).toString())),ok:A.statusCode>=200&&A.statusCode<=299,status:A.statusCode,url:A.url,headers:new cd(A.headers)}}async function ad(e,A={}){let t=zJ("https"),r=ZJ(A),n=[],{origin:i}=new URL(e);return new Promise((s,o)=>{let a=t.request(e,r,c=>{let{statusCode:g,headers:{location:l}}=c;g>=301&&g<=399&&l&&(l.startsWith("http")===!1?s(ad(`${i}${l}`,A)):s(ad(l,A))),c.on("data",u=>n.push(u)),c.on("end",()=>s(XJ(n,c))),c.on("error",o)});a.on("error",o),a.end(A.body??"")})}var zJ=typeof require<"u"?require:()=>{},cd=class{constructor(A={}){this.headers=new Map;for(let[t,r]of Object.entries(A))if(typeof r=="string")this.headers.set(t,r);else if(Array.isArray(r))for(let n of r)this.headers.set(t,n)}append(A,t){this.headers.set(A,t)}delete(A){this.headers.delete(A)}get(A){return this.headers.get(A)??null}has(A){return this.headers.has(A)}set(A,t){this.headers.set(A,t)}forEach(A,t){for(let[r,n]of this.headers)A.call(t,n,r,this)}};var $J=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,yR=ie("prisma:client:dataproxyEngine");async function eY(e,A){let t=mR["@prisma/engines-version"],r=A.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&r!=="0.0.0"&&r!=="in-memory")return r;let[n,i]=r?.split("-")??[];if(i===void 0&&$J.test(n))return n;if(i!==void 0||r==="0.0.0"||r==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[s]=t.split("-")??[],[o,a,c]=s.split("."),g=AY(`<=${o}.${a}.${c}`),l=await dn(g,{clientVersion:r});if(!l.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${l.status} ${l.statusText}, response body: ${await l.text()||""}`);let u=await l.text();yR("length of body fetched from unpkg.com",u.length);let E;try{E=JSON.parse(u)}catch(h){throw console.error("JSON.parse error: body fetched from unpkg.com: ",u),h}return E.version}throw new En("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:r})}async function wR(e,A){let t=await eY(e,A);return yR("version",t),t}function AY(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var RR=3,gd=ie("prisma:client:dataproxyEngine"),ld=class{constructor({apiKey:A,tracingHelper:t,logLevel:r,logQueries:n,engineHash:i}){this.apiKey=A,this.tracingHelper=t,this.logLevel=r,this.logQueries=n,this.engineHash=i}build({traceparent:A,interactiveTransaction:t}={}){let r={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(r.traceparent=A??this.tracingHelper.getTraceParent()),t&&(r["X-transaction-id"]=t.id);let n=this.buildCaptureSettings();return n.length>0&&(r["X-capture-telemetry"]=n.join(", ")),r}buildCaptureSettings(){let A=[];return this.tracingHelper.isEnabled()&&A.push("tracing"),this.logLevel&&A.push(this.logLevel),this.logQueries&&A.push("query"),A}},ko=class{constructor(A){this.name="DataProxyEngine";BR(A),this.config=A,this.env={...A.env,...typeof process<"u"?process.env:{}},this.inlineSchema=IR(A.inlineSchema),this.inlineDatasources=A.inlineDatasources,this.inlineSchemaHash=A.inlineSchemaHash,this.clientVersion=A.clientVersion,this.engineHash=A.engineVersion,this.logEmitter=A.logEmitter,this.tracingHelper=A.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[A,t]=this.extractHostAndApiKey();this.host=A,this.headerBuilder=new ld({apiKey:t,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await wR(A,this.config),gd("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(A){A?.logs?.length&&A.logs.forEach(t=>{switch(t.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let r=typeof t.attributes.query=="string"?t.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[n]=r.split("/* traceparent");r=n}this.logEmitter.emit("query",{query:r,timestamp:pR(t.timestamp),duration:Number(t.attributes.duration_ms),params:t.attributes.params,target:t.attributes.target})}}}),A?.traces?.length&&this.tracingHelper.createEngineSpan({span:!0,spans:A.traces})}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(A){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${A}`}async uploadSchema(){let A={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(A,async()=>{let t=await dn(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});t.ok||gd("schema response status",t.status);let r=await Do(t,this.clientVersion);if(r)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${r.message}`,timestamp:new Date,target:""}),r;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(A,{traceparent:t,interactiveTransaction:r,customDataProxyFetch:n}){return this.requestInternal({body:A,traceparent:t,interactiveTransaction:r,customDataProxyFetch:n})}async requestBatch(A,{traceparent:t,transaction:r,customDataProxyFetch:n}){let i=r?.kind==="itx"?r.options:void 0,s=Sn(A,r),{batchResult:o,elapsed:a}=await this.requestInternal({body:s,customDataProxyFetch:n,interactiveTransaction:i,traceparent:t});return o.map(c=>"errors"in c&&c.errors.length>0?Yt(c.errors[0],this.clientVersion,this.config.activeProvider):{data:c,elapsed:a})}requestInternal({body:A,traceparent:t,customDataProxyFetch:r,interactiveTransaction:n}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:i})=>{let s=n?`${n.payload.endpoint}/graphql`:await this.url("graphql");i(s);let o=await dn(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t,interactiveTransaction:n}),body:JSON.stringify(A),clientVersion:this.clientVersion},r);o.ok||gd("graphql response status",o.status),await this.handleError(await Do(o,this.clientVersion));let a=await o.json(),c=a.extensions;if(c&&this.propagateResponseExtensions(c),a.errors)throw a.errors.length===1?Yt(a.errors[0],this.config.clientVersion,this.config.activeProvider):new ve(a.errors,{clientVersion:this.config.clientVersion});return a}})}async transaction(A,t,r){let n={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${n[A]} transaction`,callback:async({logHttpCall:i})=>{if(A==="start"){let s=JSON.stringify({max_wait:r.maxWait,timeout:r.timeout,isolation_level:r.isolationLevel}),o=await this.url("transaction/start");i(o);let a=await dn(o,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Do(a,this.clientVersion));let c=await a.json(),g=c.extensions;g&&this.propagateResponseExtensions(g);let l=c.id,u=c["data-proxy"].endpoint;return{id:l,payload:{endpoint:u}}}else{let s=`${r.payload.endpoint}/${A}`;i(s);let o=await dn(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Do(o,this.clientVersion));let c=(await o.json()).extensions;c&&this.propagateResponseExtensions(c);return}}})}extractHostAndApiKey(){let A={clientVersion:this.clientVersion},t=Object.keys(this.inlineDatasources)[0],r=Ui({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),n;try{n=new URL(r)}catch{throw new un(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,A)}let{protocol:i,host:s,searchParams:o}=n;if(i!=="prisma:"&&i!=="prisma+postgres:")throw new un(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,A);let a=o.get("api_key");if(a===null||a.length<1)throw new un(`Error validating datasource \`${t}\`: the URL must contain a valid API key`,A);return[s,a]}metrics(){throw new En("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(A){for(let t=0;;t++){let r=n=>{this.logEmitter.emit("info",{message:`Calling ${n} (n=${t})`,timestamp:new Date,target:""})};try{return await A.callback({logHttpCall:r})}catch(n){if(!(n instanceof wA)||!n.isRetryable)throw n;if(t>=RR)throw n instanceof Ti?n.cause:n;this.logEmitter.emit("warn",{message:`Attempt ${t+1}/${RR} failed for ${A.actionGerund}: ${n.message??"(unknown)"}`,timestamp:new Date,target:""});let i=await fR(t);this.logEmitter.emit("warn",{message:`Retrying after ${i}ms`,timestamp:new Date,target:""})}}}async handleError(A){if(A instanceof hn)throw await this.uploadSchema(),new Ti({clientVersion:this.clientVersion,cause:A});if(A)throw A}applyPendingMigrations(){throw new Error("Method not implemented.")}};function DR({copyEngine:e=!0},A){let t;try{t=Ui({inlineDatasources:A.inlineDatasources,overrideDatasources:A.overrideDatasources,env:{...A.env,...process.env},clientVersion:A.clientVersion})}catch{}let r=!!(t?.startsWith("prisma://")||t?.startsWith("prisma+postgres://"));e&&r&&ss("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=As(A.generator),i=r||!e,s=!!A.adapter,o=n==="library",a=n==="binary";if(i&&s||s&&!1){let c;throw e?t?.startsWith("prisma://")?c=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:c=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:c=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new Oe(c.join(` -`),{clientVersion:A.clientVersion})}if(i)return new ko(A);if(a)return new ho(A);throw new Oe("Invalid client engine type, please use `library` or `binary`",{clientVersion:A.clientVersion})}function Lg({generator:e}){return e?.previewFeatures??[]}function Pi(e){return e.substring(0,1).toLowerCase()+e.substring(1)}var xR=Z(ud());function FR(e,A,t){let r=NR(e),n=tY(r),i=nY(n);i?Ug(i,A,t):A.addErrorMessage(()=>"Unknown error")}function NR(e){return e.errors.flatMap(A=>A.kind==="Union"?NR(A):[A])}function tY(e){let A=new Map,t=[];for(let r of e){if(r.kind!=="InvalidArgumentType"){t.push(r);continue}let n=`${r.selectionPath.join(".")}:${r.argumentPath.join(".")}`,i=A.get(n);i?A.set(n,{...r,argument:{...r.argument,typeNames:rY(i.argument.typeNames,r.argument.typeNames)}}):A.set(n,r)}return t.push(...A.values()),t}function rY(e,A){return[...new Set(e.concat(A))]}function nY(e){return Ml(e,(A,t)=>{let r=kR(A),n=kR(t);return r!==n?r-n:SR(A)-SR(t)})}function kR(e){let A=0;return Array.isArray(e.selectionPath)&&(A+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(A+=e.argumentPath.length),A}function SR(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var TA=class{constructor(A,t){this.name=A;this.value=t;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(A){let{colors:{green:t}}=A.context;A.addMarginSymbol(t(this.isRequired?"+":"?")),A.write(t(this.name)),this.isRequired||A.write(t("?")),A.write(t(": ")),typeof this.value=="string"?A.write(t(this.value)):A.write(this.value)}};var So=class{constructor(){this.fields=[]}addField(A,t){return this.fields.push({write(r){let{green:n,dim:i}=r.context.colors;r.write(n(i(`${A}: ${t}`))).addMarginSymbol(n(i("+")))}}),this}write(A){let{colors:{green:t}}=A.context;A.writeLine(t("{")).withIndent(()=>{A.writeJoined(Mn,this.fields).newLine()}).write(t("}")).addMarginSymbol(t("+"))}};function Ug(e,A,t){switch(e.kind){case"MutuallyExclusiveFields":iY(e,A);break;case"IncludeOnScalar":sY(e,A);break;case"EmptySelection":oY(e,A,t);break;case"UnknownSelectionField":lY(e,A);break;case"InvalidSelectionValue":uY(e,A);break;case"UnknownArgument":EY(e,A);break;case"UnknownInputField":hY(e,A);break;case"RequiredArgumentMissing":dY(e,A);break;case"InvalidArgumentType":QY(e,A);break;case"InvalidArgumentValue":CY(e,A);break;case"ValueTooLarge":fY(e,A);break;case"SomeFieldsMissing":IY(e,A);break;case"TooManyFieldsGiven":BY(e,A);break;case"Union":FR(e,A,t);break;default:throw new Error("not implemented: "+e.kind)}}function iY(e,A){let t=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();t&&(t.getField(e.firstField)?.markAsError(),t.getField(e.secondField)?.markAsError()),A.addErrorMessage(r=>`Please ${r.bold("either")} use ${r.green(`\`${e.firstField}\``)} or ${r.green(`\`${e.secondField}\``)}, but ${r.red("not both")} at the same time.`)}function sY(e,A){let[t,r]=Fo(e.selectionPath),n=e.outputType,i=A.arguments.getDeepSelectionParent(t)?.value;if(i&&(i.getField(r)?.markAsError(),n))for(let s of n.fields)s.isRelation&&i.addSuggestion(new TA(s.name,"true"));A.addErrorMessage(s=>{let o=`Invalid scalar field ${s.red(`\`${r}\``)} for ${s.bold("include")} statement`;return n?o+=` on model ${s.bold(n.name)}. ${No(s)}`:o+=".",o+=` -Note that ${s.bold("include")} statements only accept relation fields.`,o})}function oY(e,A,t){let r=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(r){let n=r.getField("omit")?.value.asObject();if(n){aY(e,A,n);return}if(r.hasField("select")){cY(e,A);return}}if(t?.[Pi(e.outputType.name)]){gY(e,A);return}A.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function aY(e,A,t){t.removeAllFields();for(let r of e.outputType.fields)t.addSuggestion(new TA(r.name,"false"));A.addErrorMessage(r=>`The ${r.red("omit")} statement includes every field of the model ${r.bold(e.outputType.name)}. At least one field must be included in the result`)}function cY(e,A){let t=e.outputType,r=A.arguments.getDeepSelectionParent(e.selectionPath)?.value,n=r?.isEmpty()??!1;r&&(r.removeAllFields(),TR(r,t)),A.addErrorMessage(i=>n?`The ${i.red("`select`")} statement for type ${i.bold(t.name)} must not be empty. ${No(i)}`:`The ${i.red("`select`")} statement for type ${i.bold(t.name)} needs ${i.bold("at least one truthy value")}.`)}function gY(e,A){let t=new So;for(let n of e.outputType.fields)n.isRelation||t.addField(n.name,"false");let r=new TA("omit",t).makeRequired();if(e.selectionPath.length===0)A.arguments.addSuggestion(r);else{let[n,i]=Fo(e.selectionPath),o=A.arguments.getDeepSelectionParent(n)?.value.asObject()?.getField(i);if(o){let a=o?.value.asObject()??new Pn;a.addSuggestion(r),o.value=a}}A.addErrorMessage(n=>`The global ${n.red("omit")} configuration excludes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function lY(e,A){let t=MR(e.selectionPath,A);if(t.parentKind!=="unknown"){t.field.markAsError();let r=t.parent;switch(t.parentKind){case"select":TR(r,e.outputType);break;case"include":pY(r,e.outputType);break;case"omit":mY(r,e.outputType);break}}A.addErrorMessage(r=>{let n=[`Unknown field ${r.red(`\`${t.fieldName}\``)}`];return t.parentKind!=="unknown"&&n.push(`for ${r.bold(t.parentKind)} statement`),n.push(`on model ${r.bold(`\`${e.outputType.name}\``)}.`),n.push(No(r)),n.join(" ")})}function uY(e,A){let t=MR(e.selectionPath,A);t.parentKind!=="unknown"&&t.field.value.markAsError(),A.addErrorMessage(r=>`Invalid value for selection field \`${r.red(t.fieldName)}\`: ${e.underlyingError}`)}function EY(e,A){let t=e.argumentPath[0],r=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(t)?.markAsError(),yY(r,e.arguments)),A.addErrorMessage(n=>LR(n,t,e.arguments.map(i=>i.name)))}function hY(e,A){let[t,r]=Fo(e.argumentPath),n=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){n.getDeepField(e.argumentPath)?.markAsError();let i=n.getDeepFieldValue(t)?.asObject();i&&vR(i,e.inputType)}A.addErrorMessage(i=>LR(i,r,e.inputType.fields.map(s=>s.name)))}function LR(e,A,t){let r=[`Unknown argument \`${e.red(A)}\`.`],n=RY(A,t);return n&&r.push(`Did you mean \`${e.green(n)}\`?`),t.length>0&&r.push(No(e)),r.join(" ")}function dY(e,A){let t;A.addErrorMessage(a=>t?.value instanceof He&&t.value.text==="null"?`Argument \`${a.green(i)}\` must not be ${a.red("null")}.`:`Argument \`${a.green(i)}\` is missing.`);let r=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!r)return;let[n,i]=Fo(e.argumentPath),s=new So,o=r.getDeepFieldValue(n)?.asObject();if(o)if(t=o.getField(i),t&&o.removeField(i),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let a of e.inputTypes[0].fields)s.addField(a.name,a.typeNames.join(" | "));o.addSuggestion(new TA(i,s).makeRequired())}else{let a=e.inputTypes.map(UR).join(" | ");o.addSuggestion(new TA(i,a).makeRequired())}}function UR(e){return e.kind==="list"?`${UR(e.elementType)}[]`:e.name}function QY(e,A){let t=e.argument.name,r=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&r.getDeepFieldValue(e.argumentPath)?.markAsError(),A.addErrorMessage(n=>{let i=Tg("or",e.argument.typeNames.map(s=>n.green(s)));return`Argument \`${n.bold(t)}\`: Invalid value provided. Expected ${i}, provided ${n.red(e.inferredType)}.`})}function CY(e,A){let t=e.argument.name,r=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&r.getDeepFieldValue(e.argumentPath)?.markAsError(),A.addErrorMessage(n=>{let i=[`Invalid value for argument \`${n.bold(t)}\``];if(e.underlyingError&&i.push(`: ${e.underlyingError}`),i.push("."),e.argument.typeNames.length>0){let s=Tg("or",e.argument.typeNames.map(o=>n.green(o)));i.push(` Expected ${s}.`)}return i.join("")})}function fY(e,A){let t=e.argument.name,r=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),n;if(r){let s=r.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof He&&(n=s.text)}A.addErrorMessage(i=>{let s=["Unable to fit value"];return n&&s.push(i.red(n)),s.push(`into a 64-bit signed integer for field \`${i.bold(t)}\``),s.join(" ")})}function IY(e,A){let t=e.argumentPath[e.argumentPath.length-1],r=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(r){let n=r.getDeepFieldValue(e.argumentPath)?.asObject();n&&vR(n,e.inputType)}A.addErrorMessage(n=>{let i=[`Argument \`${n.bold(t)}\` of type ${n.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?i.push(`${n.green("at least one of")} ${Tg("or",e.constraints.requiredFields.map(s=>`\`${n.bold(s)}\``))} arguments.`):i.push(`${n.green("at least one")} argument.`):i.push(`${n.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),i.push(No(n)),i.join(" ")})}function BY(e,A){let t=e.argumentPath[e.argumentPath.length-1],r=A.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),n=[];if(r){let i=r.getDeepFieldValue(e.argumentPath)?.asObject();i&&(i.markAsError(),n=Object.keys(i.getFields()))}A.addErrorMessage(i=>{let s=[`Argument \`${i.bold(t)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${i.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${i.green("at most one")} argument,`):s.push(`${i.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${Tg("and",n.map(o=>i.red(o)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function TR(e,A){for(let t of A.fields)e.hasField(t.name)||e.addSuggestion(new TA(t.name,"true"))}function pY(e,A){for(let t of A.fields)t.isRelation&&!e.hasField(t.name)&&e.addSuggestion(new TA(t.name,"true"))}function mY(e,A){for(let t of A.fields)!e.hasField(t.name)&&!t.isRelation&&e.addSuggestion(new TA(t.name,"true"))}function yY(e,A){for(let t of A)e.hasField(t.name)||e.addSuggestion(new TA(t.name,t.typeNames.join(" | ")))}function MR(e,A){let[t,r]=Fo(e),n=A.arguments.getDeepSubSelectionValue(t)?.asObject();if(!n)return{parentKind:"unknown",fieldName:r};let i=n.getFieldValue("select")?.asObject(),s=n.getFieldValue("include")?.asObject(),o=n.getFieldValue("omit")?.asObject(),a=i?.getField(r);return i&&a?{parentKind:"select",parent:i,field:a,fieldName:r}:(a=s?.getField(r),s&&a?{parentKind:"include",field:a,parent:s,fieldName:r}:(a=o?.getField(r),o&&a?{parentKind:"omit",field:a,parent:o,fieldName:r}:{parentKind:"unknown",fieldName:r}))}function vR(e,A){if(A.kind==="object")for(let t of A.fields)e.hasField(t.name)||e.addSuggestion(new TA(t.name,t.typeNames.join(" | ")))}function Fo(e){let A=[...e],t=A.pop();if(!t)throw new Error("unexpected empty path");return[A,t]}function No({green:e,enabled:A}){return"Available options are "+(A?`listed in ${e("green")}`:"marked with ?")+"."}function Tg(e,A){if(A.length===1)return A[0];let t=[...A],r=t.pop();return`${t.join(", ")} ${e} ${r}`}var wY=3;function RY(e,A){let t=1/0,r;for(let n of A){let i=(0,xR.default)(e,n);i>wY||i({name:A.name,typeName:"boolean",isRelation:A.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(A){return this.params.previewFeatures.includes(A)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(A){return this.modelOrType?.fields.find(t=>t.name===A)}nestSelection(A){let t=this.findField(A),r=t?.kind==="object"?t.type:void 0;return new e({...this.params,modelName:r,selectionPath:this.params.selectionPath.concat(A)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[Pi(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:vt(this.params.action,"Unknown action")}}nestArgument(A){return new e({...this.params,argumentPath:this.params.argumentPath.concat(A)})}};var VR=e=>({command:e});var qR=e=>e.strings.reduce((A,t,r)=>`${A}@P${r}${t}`);function Gi(e){try{return OR(e,"fast")}catch{return OR(e,"slow")}}function OR(e,A){return JSON.stringify(e.map(t=>WR(t,A)))}function WR(e,A){return Array.isArray(e)?e.map(t=>WR(t,A)):typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:Nn(e)?{prisma__type:"date",prisma__value:e.toJSON()}:Qt.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:TY(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")}:typeof e=="object"&&A==="slow"?_R(e):e}function TY(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function _R(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(HR);let A={};for(let t of Object.keys(e))A[t]=HR(e[t]);return A}function HR(e){return typeof e=="bigint"?e.toString():_R(e)}var MY=["$connect","$disconnect","$on","$transaction","$use","$extends"],jR=MY;var vY=/^(\s*alter\s)/i,KR=ie("prisma:client");function dd(e,A,t,r){if(!(e!=="postgresql"&&e!=="cockroachdb")&&t.length>0&&vY.exec(A))throw new Error(`Running ALTER using ${r} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var Qd=({clientMethod:e,activeProvider:A})=>t=>{let r="",n;if(t instanceof Es)r=t.sql,n={values:Gi(t.values),__prismaRawParameters__:!0};else if(Array.isArray(t)){let[i,...s]=t;r=i,n={values:Gi(s||[]),__prismaRawParameters__:!0}}else switch(A){case"sqlite":case"mysql":{r=t.sql,n={values:Gi(t.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{r=t.text,n={values:Gi(t.values),__prismaRawParameters__:!0};break}case"sqlserver":{r=qR(t),n={values:Gi(t.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${A} provider does not support ${e}`)}return n?.values?KR(`prisma.${e}(${r}, ${n.values})`):KR(`prisma.${e}(${r})`),{query:r,parameters:n}},ZR={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[A,...t]=e;return new hA(A,t)}},XR={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function Cd(e){return function(t){let r,n=(i=e)=>{try{return i===void 0||i?.kind==="itx"?r??=zR(t(i)):zR(t(i))}catch(s){return Promise.reject(s)}};return{then(i,s){return n().then(i,s)},catch(i){return n().catch(i)},finally(i){return n().finally(i)},requestTransaction(i){let s=n(i);return s.requestTransaction?s.requestTransaction(i):s},[Symbol.toStringTag]:"PrismaPromise"}}}function zR(e){return typeof e.then=="function"?e:Promise.resolve(e)}var $R={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,A){return A()}},fd=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(A){return this.getGlobalTracingHelper().getTraceParent(A)}createEngineSpan(A){return this.getGlobalTracingHelper().createEngineSpan(A)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(A,t){return this.getGlobalTracingHelper().runInChildSpan(A,t)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??$R}};function eD(e){return e.includes("tracing")?new fd:$R}function AD(e,A=()=>{}){let t,r=new Promise(n=>t=n);return{then(n){return--e===0&&t(A()),n?.(r)}}}function tD(e){return typeof e=="string"?e:e.reduce((A,t)=>{let r=typeof t=="string"?t:t.level;return r==="query"?A:A&&(t==="info"||A==="info")?"info":r},void 0)}var vg=class{constructor(){this._middlewares=[]}use(A){this._middlewares.push(A)}get(A){return this._middlewares[A]}has(A){return!!this._middlewares[A]}length(){return this._middlewares.length}};var iD=Z(Ll());function Pg(e){return typeof e.batchRequestIdx=="number"}function Gg(e){return e===null?e:Array.isArray(e)?e.map(Gg):typeof e=="object"?PY(e)?GY(e):Dn(e,Gg):e}function PY(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function GY({$type:e,value:A}){switch(e){case"BigInt":return BigInt(A);case"Bytes":return Buffer.from(A,"base64");case"DateTime":return new Date(A);case"Decimal":return new Qt(A);case"Json":return JSON.parse(A);default:vt(A,"Unknown tagged value")}}function rD(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let A=[];return e.modelName&&A.push(e.modelName),e.query.arguments&&A.push(Id(e.query.arguments)),A.push(Id(e.query.selection)),A.join("")}function Id(e){return`(${Object.keys(e).sort().map(t=>{let r=e[t];return typeof r=="object"&&r!==null?`(${t} ${Id(r)})`:t}).join(" ")})`}var JY={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Bd(e){return JY[e]}var Jg=class{constructor(A){this.options=A;this.tickActive=!1;this.batches={}}request(A){let t=this.options.batchBy(A);return t?(this.batches[t]||(this.batches[t]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((r,n)=>{this.batches[t].push({request:A,resolve:r,reject:n})})):this.options.singleLoader(A)}dispatchBatches(){for(let A in this.batches){let t=this.batches[A];delete this.batches[A],t.length===1?this.options.singleLoader(t[0].request).then(r=>{r instanceof Error?t[0].reject(r):t[0].resolve(r)}).catch(r=>{t[0].reject(r)}):(t.sort((r,n)=>this.options.batchOrder(r.request,n.request)),this.options.batchLoader(t.map(r=>r.request)).then(r=>{if(r instanceof Error)for(let n=0;n{for(let n=0;nQn("bigint",t));case"bytes-array":return A.map(t=>Qn("bytes",t));case"decimal-array":return A.map(t=>Qn("decimal",t));case"datetime-array":return A.map(t=>Qn("datetime",t));case"date-array":return A.map(t=>Qn("date",t));case"time-array":return A.map(t=>Qn("time",t));default:return A}}function nD(e){let A=[],t=YY(e);for(let r=0;r{let{transaction:i,otelParentCtx:s}=r[0],o=r.map(l=>l.protocolQuery),a=this.client._tracingHelper.getTraceParent(s),c=r.some(l=>Bd(l.protocolQuery.action));return(await this.client._engine.requestBatch(o,{traceparent:a,transaction:qY(i),containsWrite:c,customDataProxyFetch:n})).map((l,u)=>{if(l instanceof Error)return l;try{return this.mapQueryEngineResult(r[u],l)}catch(E){return E}})}),singleLoader:async r=>{let n=r.transaction?.kind==="itx"?sD(r.transaction):void 0,i=await this.client._engine.request(r.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:n,isWrite:Bd(r.protocolQuery.action),customDataProxyFetch:r.customDataProxyFetch});return this.mapQueryEngineResult(r,i)},batchBy:r=>r.transaction?.id?`transaction-${r.transaction.id}`:rD(r.protocolQuery),batchOrder(r,n){return r.transaction?.kind==="batch"&&n.transaction?.kind==="batch"?r.transaction.index-n.transaction.index:0}})}async request(A){try{return await this.dataloader.request(A)}catch(t){let{clientMethod:r,callsite:n,transaction:i,args:s,modelName:o}=A;this.handleAndLogRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:s,modelName:o,globalOmit:A.globalOmit})}}mapQueryEngineResult({dataPath:A,unpacker:t},r){let n=r?.data,i=r?.elapsed,s=this.unpack(n,A,t);return process.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:i}:s}handleAndLogRequestError(A){try{this.handleRequestError(A)}catch(t){throw this.logEmitter&&this.logEmitter.emit("error",{message:t.message,target:A.clientMethod,timestamp:new Date}),t}}handleRequestError({error:A,clientMethod:t,callsite:r,transaction:n,args:i,modelName:s,globalOmit:o}){if(VY(A),OY(A,n)||A instanceof Pt)throw A;if(A instanceof xe&&HY(A)){let c=oD(A.meta);Mg({args:i,errors:[c],callsite:r,errorFormat:this.client._errorFormat,originalMethod:t,clientVersion:this.client._clientVersion,globalOmit:o})}let a=A.message;if(r&&(a=Yn({callsite:r,originalMethod:t,isPanic:A.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),A.code){let c=s?{modelName:s,...A.meta}:A.meta;throw new xe(a,{code:A.code,clientVersion:this.client._clientVersion,meta:c,batchRequestIdx:A.batchRequestIdx})}else{if(A.isPanic)throw new JA(a,this.client._clientVersion);if(A instanceof ve)throw new ve(a,{clientVersion:this.client._clientVersion,batchRequestIdx:A.batchRequestIdx});if(A instanceof z)throw new z(a,this.client._clientVersion);if(A instanceof JA)throw new JA(a,this.client._clientVersion)}throw A.clientVersion=this.client._clientVersion,A}sanitizeMessage(A){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,iD.default)(A):A}unpack(A,t,r){if(!A||(A.data&&(A=A.data),!A))return A;let n=Object.keys(A)[0],i=Object.values(A)[0],s=t.filter(c=>c!=="select"&&c!=="include"),o=eu(i,s),a=n==="queryRaw"?nD(o):Gg(o);return r?r(a):a}get[Symbol.toStringTag](){return"RequestHandler"}};function qY(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:sD(e)};vt(e,"Unknown transaction kind")}}function sD(e){return{id:e.id,payload:e.payload}}function OY(e,A){return Pg(e)&&A?.kind==="batch"&&e.batchRequestIdx!==A.index}function HY(e){return e.code==="P2009"||e.code==="P2012"}function oD(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(oD)};if(Array.isArray(e.selectionPath)){let[,...A]=e.selectionPath;return{...e,selectionPath:A}}return e}var aD="5.21.1";var cD=aD;var hD=Z(ud());var oe=class extends Error{constructor(A){super(A+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};L(oe,"PrismaClientConstructorValidationError");var gD=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],lD=["pretty","colorless","minimal"],uD=["info","query","warn","error"],_Y={datasources:(e,{datasourceNames:A})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new oe(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[t,r]of Object.entries(e)){if(!A.includes(t)){let n=Ji(t,A)||` Available datasources: ${A.join(", ")}`;throw new oe(`Unknown datasource ${t} provided to PrismaClient constructor.${n}`)}if(typeof r!="object"||Array.isArray(r))throw new oe(`Invalid value ${JSON.stringify(e)} for datasource "${t}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(r&&typeof r=="object")for(let[n,i]of Object.entries(r)){if(n!=="url")throw new oe(`Invalid value ${JSON.stringify(e)} for datasource "${t}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof i!="string")throw new oe(`Invalid value ${JSON.stringify(i)} for datasource "${t}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,A)=>{if(e===null)return;if(e===void 0)throw new oe('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Lg(A).includes("driverAdapters"))throw new oe('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(As()==="binary")throw new oe('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new oe(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new oe(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!lD.includes(e)){let A=Ji(e,lD);throw new oe(`Invalid errorFormat ${e} provided to PrismaClient constructor.${A}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new oe(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function A(t){if(typeof t=="string"&&!uD.includes(t)){let r=Ji(t,uD);throw new oe(`Invalid log level "${t}" provided to PrismaClient constructor.${r}`)}}for(let t of e){A(t);let r={level:A,emit:n=>{let i=["stdout","event"];if(!i.includes(n)){let s=Ji(n,i);throw new oe(`Invalid value ${JSON.stringify(n)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(t&&typeof t=="object")for(let[n,i]of Object.entries(t))if(r[n])r[n](i);else throw new oe(`Invalid property ${n} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let A=e.maxWait;if(A!=null&&A<=0)throw new oe(`Invalid value ${A} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let t=e.timeout;if(t!=null&&t<=0)throw new oe(`Invalid value ${t} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,A)=>{if(typeof e!="object")throw new oe('"omit" option is expected to be an object.');if(e===null)throw new oe('"omit" option can not be `null`');let t=[];for(let[r,n]of Object.entries(e)){let i=KY(r,A.runtimeDataModel);if(!i){t.push({kind:"UnknownModel",modelKey:r});continue}for(let[s,o]of Object.entries(n)){let a=i.fields.find(c=>c.name===s);if(!a){t.push({kind:"UnknownField",modelKey:r,fieldName:s});continue}if(a.relationName){t.push({kind:"RelationInOmit",modelKey:r,fieldName:s});continue}typeof o!="boolean"&&t.push({kind:"InvalidFieldValue",modelKey:r,fieldName:s})}}if(t.length>0)throw new oe(ZY(e,t))},__internal:e=>{if(!e)return;let A=["debug","engine","configOverride"];if(typeof e!="object")throw new oe(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[t]of Object.entries(e))if(!A.includes(t)){let r=Ji(t,A);throw new oe(`Invalid property ${JSON.stringify(t)} for "__internal" provided to PrismaClient constructor.${r}`)}}};function dD(e,A){for(let[t,r]of Object.entries(e)){if(!gD.includes(t)){let n=Ji(t,gD);throw new oe(`Unknown property ${t} provided to PrismaClient constructor.${n}`)}_Y[t](r,A)}if(e.datasourceUrl&&e.datasources)throw new oe('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Ji(e,A){if(A.length===0||typeof e!="string")return"";let t=jY(e,A);return t?` Did you mean "${t}"?`:""}function jY(e,A){if(A.length===0)return null;let t=A.map(n=>({value:n,distance:(0,hD.default)(e,n)}));t.sort((n,i)=>n.distancePi(r)===A);if(t)return e[t]}function ZY(e,A){let t=Gn(e);for(let i of A)switch(i.kind){case"UnknownModel":t.arguments.getField(i.modelKey)?.markAsError(),t.addErrorMessage(()=>`Unknown model name: ${i.modelKey}.`);break;case"UnknownField":t.arguments.getDeepField([i.modelKey,i.fieldName])?.markAsError(),t.addErrorMessage(()=>`Model "${i.modelKey}" does not have a field named "${i.fieldName}".`);break;case"RelationInOmit":t.arguments.getDeepField([i.modelKey,i.fieldName])?.markAsError(),t.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":t.arguments.getDeepFieldValue([i.modelKey,i.fieldName])?.markAsError(),t.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:r,args:n}=Na(t,"colorless");return`Error validating "omit" option: - -${n} - -${r}`}function QD(e){return e.length===0?Promise.resolve([]):new Promise((A,t)=>{let r=new Array(e.length),n=null,i=!1,s=0,o=()=>{i||(s++,s===e.length&&(i=!0,n?t(n):A(r)))},a=c=>{i||(i=!0,t(c))};for(let c=0;c{r[c]=g,o()},g=>{if(!Pg(g)){a(g);return}g.batchRequestIdx===c?a(g):(n||(n=g),o())})})}var Lr=ie("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var XY={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},zY=Symbol.for("prisma.client.transaction.id"),$Y={id:0,nextId(){return++this.id}};function mD(e){class A{constructor(r){this._originalClient=this;this._middlewares=new vg;this._createPrismaPromise=Cd();this.$extends=_f;e=r?.__internal?.configOverride?.(e)??e,gI(e),r&&dD(r,e);let n=new BD.EventEmitter().on("error",()=>{});this._extensions=va.empty(),this._previewFeatures=Lg(e),this._clientVersion=e.clientVersion??cD,this._activeProvider=e.activeProvider,this._globalOmit=r?.omit,this._tracingHelper=eD(this._previewFeatures);let i={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&Lo.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&Lo.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(r?.adapter){s=Vl(r.adapter);let a=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==a)throw new z(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${a}\` specified in the Prisma schema.`,this._clientVersion);if(r.datasources||r.datasourceUrl!==void 0)throw new z("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let o=!s&&es(i,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let a=r??{},c=a.__internal??{},g=c.debug===!0;g&&ie.enable("prisma:client");let l=Lo.default.resolve(e.dirname,e.relativePath);pD.default.existsSync(l)||(l=e.dirname),Lr("dirname",e.dirname),Lr("relativePath",e.relativePath),Lr("cwd",l);let u=c.engine||{};if(a.errorFormat?this._errorFormat=a.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:l,dirname:e.dirname,enableDebugLogs:g,allowTriggerPanic:u.allowTriggerPanic,datamodelPath:Lo.default.join(e.dirname,e.filename??"schema.prisma"),prismaPath:u.binaryPath??void 0,engineEndpoint:u.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:a.log&&tD(a.log),logQueries:a.log&&!!(typeof a.log=="string"?a.log==="query":a.log.find(E=>typeof E=="string"?E==="query":E.level==="query")),env:o?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:lI(a,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:a.transactionOptions?.maxWait??2e3,timeout:a.transactionOptions?.timeout??5e3,isolationLevel:a.transactionOptions?.isolationLevel},logEmitter:n,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Ui,getBatchRequestPayload:Sn,prismaGraphQLToJSError:Yt,PrismaClientUnknownRequestError:ve,PrismaClientInitializationError:z,PrismaClientKnownRequestError:xe,debug:ie("prisma:client:accelerateEngine"),engineVersion:fD.version,clientVersion:e.clientVersion}},Lr("clientVersion",e.clientVersion),this._engine=DR(e,this._engineConfig),this._requestHandler=new Yg(this,n),a.log)for(let E of a.log){let h=typeof E=="string"?E:E.emit==="stdout"?E.level:null;h&&this.$on(h,d=>{ns.log(`${ns.tags[h]??""}`,d.message||d.query)})}this._metrics=new bn(this._engine)}catch(a){throw a.clientVersion=this._clientVersion,a}return this._appliedParent=Is(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(r){this._middlewares.use(r)}$on(r,n){r==="beforeExit"?this._engine.onBeforeExit(n):r&&this._engineConfig.logEmitter.on(r,n)}$connect(){try{return this._engine.start()}catch(r){throw r.clientVersion=this._clientVersion,r}}async $disconnect(){try{await this._engine.stop()}catch(r){throw r.clientVersion=this._clientVersion,r}finally{Td()}}$executeRawInternal(r,n,i,s){let o=this._activeProvider;return this._request({action:"executeRaw",args:i,transaction:r,clientMethod:n,argsMapper:Qd({clientMethod:n,activeProvider:o}),callsite:Cr(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(r,...n){return this._createPrismaPromise(i=>{if(r.raw!==void 0||r.sql!==void 0){let[s,o]=CD(r,n);return dd(this._activeProvider,s.text,s.values,Array.isArray(r)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(i,"$executeRaw",s,o)}throw new Oe("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(r,...n){return this._createPrismaPromise(i=>(dd(this._activeProvider,r,n,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(i,"$executeRawUnsafe",[r,...n])))}$runCommandRaw(r){if(e.activeProvider!=="mongodb")throw new Oe(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(n=>this._request({args:r,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:VR,callsite:Cr(this._errorFormat),transaction:n}))}async $queryRawInternal(r,n,i,s){let o=this._activeProvider;return this._request({action:"queryRaw",args:i,transaction:r,clientMethod:n,argsMapper:Qd({clientMethod:n,activeProvider:o}),callsite:Cr(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(r,...n){return this._createPrismaPromise(i=>{if(r.raw!==void 0||r.sql!==void 0)return this.$queryRawInternal(i,"$queryRaw",...CD(r,n));throw new Oe("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawTyped(r){return this._createPrismaPromise(n=>{if(!this._hasPreviewFlag("typedSql"))throw new Oe("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(n,"$queryRawTyped",r)})}$queryRawUnsafe(r,...n){return this._createPrismaPromise(i=>this.$queryRawInternal(i,"$queryRawUnsafe",[r,...n]))}_transactionWithArray({promises:r,options:n}){let i=$Y.nextId(),s=AD(r.length),o=r.map((a,c)=>{if(a?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let g=n?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,l={kind:"batch",id:i,index:c,isolationLevel:g,lock:s};return a.requestTransaction?.(l)??a});return QD(o)}async _transactionWithCallback({callback:r,options:n}){let i={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:n?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:n?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:n?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},o=await this._engine.transaction("start",i,s),a;try{let c={kind:"itx",...o};a=await r(this._createItxClient(c)),await this._engine.transaction("commit",i,o)}catch(c){throw await this._engine.transaction("rollback",i,o).catch(()=>{}),c}return a}_createItxClient(r){return Is(ht(Wf(this),[nA("_appliedParent",()=>this._appliedParent._createItxClient(r)),nA("_createPrismaPromise",()=>Cd(r)),nA(zY,()=>r.id),kn(jR)]))}$transaction(r,n){let i;typeof r=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?i=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:i=()=>this._transactionWithCallback({callback:r,options:n}):i=()=>this._transactionWithArray({promises:r,options:n});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,i)}_request(r){r.otelParentCtx=this._tracingHelper.getActiveContext();let n=r.middlewareArgsMapper??XY,i={args:n.requestArgsToMiddlewareArgs(r.args),dataPath:r.dataPath,runInTransaction:!!r.transaction,action:r.action,model:r.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:i.action,model:i.model,name:i.model?`${i.model}.${i.action}`:i.action}}},o=-1,a=async c=>{let g=this._middlewares.get(++o);if(g)return this._tracingHelper.runInChildSpan(s.middleware,C=>g(c,I=>(C?.end(),a(I))));let{runInTransaction:l,args:u,...E}=c,h={...r,...E};u&&(h.args=n.middlewareArgsToRequestArgs(u)),r.transaction!==void 0&&l===!1&&delete h.transaction;let d=await eI(this,h);return h.model?Zf({result:d,modelName:h.model,args:h.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):d};return this._tracingHelper.runInChildSpan(s.operation,()=>new ID.AsyncResource("prisma-client-request").runInAsyncScope(()=>a(i)))}async _executeRequest({args:r,clientMethod:n,dataPath:i,callsite:s,action:o,model:a,argsMapper:c,transaction:g,unpacker:l,otelParentCtx:u,customDataProxyFetch:E}){try{r=c?c(r):r;let h={name:"serialize"},d=this._tracingHelper.runInChildSpan(h,()=>GR({modelName:a,runtimeDataModel:this._runtimeDataModel,action:o,args:r,clientMethod:n,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return ie.enabled("prisma:client")&&(Lr("Prisma Client call:"),Lr(`prisma.${n}(${kf(r)})`),Lr("Generated request:"),Lr(JSON.stringify(d,null,2)+` -`)),g?.kind==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:d,modelName:a,action:o,clientMethod:n,dataPath:i,callsite:s,args:r,extensions:this._extensions,transaction:g,unpacker:l,otelParentCtx:u,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:E})}catch(h){throw h.clientVersion=this._clientVersion,h}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new Oe("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(r){return!!this._engineConfig.previewFeatures?.includes(r)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return A}function CD(e,A){return eV(e)?[new hA(e,A),ZR]:[e,XR]}function eV(e){return Array.isArray(e)&&Array.isArray(e.raw)}var AV=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function yD(e){return new Proxy(e,{get(A,t){if(t in A)return A[t];if(!AV.has(t))throw new TypeError(`Invalid enum value: ${String(t)}`)}})}function wD(e){es(e,{conflictCheck:"warn"})}0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,skip,sqltag,warnEnvConflicts,warnOnce}); -/*! Bundled license information: - -undici/lib/fetch/body.js: - (*! formdata-polyfill. MIT License. Jimmy Wärting *) - -undici/lib/websocket/frame.js: - (*! ws. MIT License. Einar Otto Stangvik *) - -decimal.js/decimal.mjs: - (*! - * decimal.js v10.4.3 - * An arbitrary-precision Decimal type for JavaScript. - * https://github.com/MikeMcl/decimal.js - * Copyright (c) 2022 Michael Mclaughlin - * MIT Licence - *) -*/ -//# sourceMappingURL=binary.js.map diff --git a/node_modules/@prisma/client/runtime/edge-esm.js b/node_modules/@prisma/client/runtime/edge-esm.js deleted file mode 100644 index 341cbe6..0000000 --- a/node_modules/@prisma/client/runtime/edge-esm.js +++ /dev/null @@ -1,31 +0,0 @@ -var na=Object.create;var Kr=Object.defineProperty;var ia=Object.getOwnPropertyDescriptor;var oa=Object.getOwnPropertyNames;var sa=Object.getPrototypeOf,aa=Object.prototype.hasOwnProperty;var zr=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ae=(e,t)=>()=>(e&&(t=e(e=0)),t);var Le=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Yr=(e,t)=>{for(var r in t)Kr(e,r,{get:t[r],enumerable:!0})},la=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of oa(t))!aa.call(e,i)&&i!==r&&Kr(e,i,{get:()=>t[i],enumerable:!(n=ia(t,i))||n.enumerable});return e};var qe=(e,t,r)=>(r=e!=null?na(sa(e)):{},la(t||!e||!e.__esModule?Kr(r,"default",{value:e,enumerable:!0}):r,e));var y,c=Ae(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var b,p=Ae(()=>{"use strict";b=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,d=Ae(()=>{"use strict";E=()=>{};E.prototype=E});var m=Ae(()=>{"use strict"});var hi=Le(Ye=>{"use strict";f();c();p();d();m();var ri=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ua=ri(e=>{"use strict";e.byteLength=l,e.toByteArray=g,e.fromByteArray=S;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var M=A.indexOf("=");M===-1&&(M=R);var F=M===R?0:4-M%4;return[M,F]}function l(A){var R=a(A),M=R[0],F=R[1];return(M+F)*3/4-F}function u(A,R,M){return(R+M)*3/4-M}function g(A){var R,M=a(A),F=M[0],q=M[1],D=new n(u(A,F,q)),I=0,oe=q>0?F-4:F,G;for(G=0;G>16&255,D[I++]=R>>8&255,D[I++]=R&255;return q===2&&(R=r[A.charCodeAt(G)]<<2|r[A.charCodeAt(G+1)]>>4,D[I++]=R&255),q===1&&(R=r[A.charCodeAt(G)]<<10|r[A.charCodeAt(G+1)]<<4|r[A.charCodeAt(G+2)]>>2,D[I++]=R>>8&255,D[I++]=R&255),D}function h(A){return t[A>>18&63]+t[A>>12&63]+t[A>>6&63]+t[A&63]}function v(A,R,M){for(var F,q=[],D=R;Doe?oe:I+D));return F===1?(R=A[M-1],q.push(t[R>>2]+t[R<<4&63]+"==")):F===2&&(R=(A[M-2]<<8)+A[M-1],q.push(t[R>>10]+t[R>>4&63]+t[R<<2&63]+"=")),q.join("")}}),ca=ri(e=>{e.read=function(t,r,n,i,o){var s,a,l=o*8-i-1,u=(1<>1,h=-7,v=n?o-1:0,S=n?-1:1,A=t[r+v];for(v+=S,s=A&(1<<-h)-1,A>>=-h,h+=l;h>0;s=s*256+t[r+v],v+=S,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+v],v+=S,h-=8);if(s===0)s=1-g;else{if(s===u)return a?NaN:(A?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(A?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,l,u,g=s*8-o-1,h=(1<>1,S=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:s-1,R=i?1:-1,M=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+v>=1?r+=S/u:r+=S*Math.pow(2,1-v),r*u>=2&&(a++,u/=2),a+v>=h?(l=0,a=h):a+v>=1?(l=(r*u-1)*Math.pow(2,o),a=a+v):(l=r*Math.pow(2,v-1)*Math.pow(2,o),a=0));o>=8;t[n+A]=l&255,A+=R,l/=256,o-=8);for(a=a<0;t[n+A]=a&255,A+=R,a/=256,g-=8);t[n+A-R]|=M*128}}),Zr=ua(),Ke=ca(),Zn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ye.Buffer=T;Ye.SlowBuffer=ha;Ye.INSPECT_MAX_BYTES=50;var lr=2147483647;Ye.kMaxLength=lr;T.TYPED_ARRAY_SUPPORT=pa();!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function pa(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function be(e){if(e>lr)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return tn(e)}return ni(e,t,r)}T.poolSize=8192;function ni(e,t,r){if(typeof e=="string")return ma(e,t);if(ArrayBuffer.isView(e))return fa(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(de(e,ArrayBuffer)||e&&de(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(de(e,SharedArrayBuffer)||e&&de(e.buffer,SharedArrayBuffer)))return oi(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return T.from(n,t,r);let i=ga(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}T.from=function(e,t,r){return ni(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function ii(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function da(e,t,r){return ii(e),e<=0?be(e):t!==void 0?typeof r=="string"?be(e).fill(t,r):be(e).fill(t):be(e)}T.alloc=function(e,t,r){return da(e,t,r)};function tn(e){return ii(e),be(e<0?0:rn(e)|0)}T.allocUnsafe=function(e){return tn(e)};T.allocUnsafeSlow=function(e){return tn(e)};function ma(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=si(e,t)|0,n=be(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Xr(e){let t=e.length<0?0:rn(e.length)|0,r=be(t);for(let n=0;n=lr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+lr.toString(16)+" bytes");return e|0}function ha(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(de(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),de(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function si(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||de(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return en(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return gi(e).length;default:if(i)return n?-1:en(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=si;function ya(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ra(this,t,r);case"utf8":case"utf-8":return li(this,t,r);case"ascii":return Ca(this,t,r);case"latin1":case"binary":return Aa(this,t,r);case"base64":return va(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Sa(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function Be(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};Zn&&(T.prototype[Zn]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(de(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,on(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:Xn(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Xn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Xn(e,t,r,n,i){let o=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,r/=2}function l(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let u;if(i){let g=-1;for(u=r;us&&(r=s-a),u=r;u>=0;u--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return wa(this,e,t,r);case"utf8":case"utf-8":return Ea(this,e,t,r);case"ascii":case"latin1":case"binary":return ba(this,e,t,r);case"base64":return xa(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pa(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function va(e,t,r){return t===0&&r===e.length?Zr.fromByteArray(e):Zr.fromByteArray(e.slice(t,r))}function li(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let l,u,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:l=e[i+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(s=h));break;case 3:l=e[i+1],u=e[i+2],(l&192)===128&&(u&192)===128&&(h=(o&15)<<12|(l&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:l=e[i+1],u=e[i+2],g=e[i+3],(l&192)===128&&(u&192)===128&&(g&192)===128&&(h=(o&15)<<18|(l&63)<<12|(u&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Ta(n)}var ei=4096;function Ta(e){let t=e.length;if(t<=ei)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||H(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||H(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||H(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||H(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||H(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||H(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=Re(function(e){e=e>>>0,ze(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&xt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,ze(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&xt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||H(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||H(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||H(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||H(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||H(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=Re(function(e){e=e>>>0,ze(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&xt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,ze(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&xt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||H(e,4,this.length),Ke.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||H(e,4,this.length),Ke.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||H(e,8,this.length),Ke.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||H(e,8,this.length),Ke.read(this,e,!1,52,8)};function re(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;re(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;re(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function ui(e,t,r,n,i){fi(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function ci(e,t,r,n,i){fi(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}T.prototype.writeBigUInt64LE=Re(function(e,t=0){return ui(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=Re(function(e,t=0){return ci(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);re(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);re(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};T.prototype.writeBigInt64LE=Re(function(e,t=0){return ui(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=Re(function(e,t=0){return ci(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function pi(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function di(e,t,r,n,i){return t=+t,r=r>>>0,i||pi(e,t,r,4,34028234663852886e22,-34028234663852886e22),Ke.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return di(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return di(this,e,t,!1,r)};function mi(e,t,r,n,i){return t=+t,r=r>>>0,i||pi(e,t,r,8,17976931348623157e292,-17976931348623157e292),Ke.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return mi(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return mi(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let i;if(typeof e=="number")for(i=t;i2**32?i=ti(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=ti(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function ti(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Ia(e,t,r){ze(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&xt(t,e.length-(r+1))}function fi(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new We.ERR_OUT_OF_RANGE("value",a,e)}Ia(n,i,o)}function ze(e,t){if(typeof e!="number")throw new We.ERR_INVALID_ARG_TYPE(t,"number",e)}function xt(e,t,r){throw Math.floor(e)!==e?(ze(e,r),new We.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new We.ERR_BUFFER_OUT_OF_BOUNDS:new We.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var Oa=/[^+/0-9A-Za-z-_]/g;function ka(e){if(e=e.split("=")[0],e=e.trim().replace(Oa,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function en(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Da(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function gi(e){return Zr.toByteArray(ka(e))}function ur(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function de(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function on(e){return e!==e}var Na=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Re(e){return typeof BigInt>"u"?Fa:e}function Fa(){throw new Error("BigInt not supported")}});var w,f=Ae(()=>{"use strict";w=qe(hi())});function _a(){return!1}var La,qa,Pi,vi=Ae(()=>{"use strict";f();c();p();d();m();La={},qa={existsSync:_a,promises:La},Pi=qa});function Ga(...e){return e.join("/")}function Ja(...e){return e.join("/")}var qi,Qa,Ha,vt,Bi=Ae(()=>{"use strict";f();c();p();d();m();qi="/",Qa={sep:qi},Ha={resolve:Ga,posix:Qa,join:Ja,sep:qi},vt=Ha});var mr,$i=Ae(()=>{"use strict";f();c();p();d();m();mr=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var ji=Le((pm,Vi)=>{"use strict";f();c();p();d();m();Vi.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var Qi=Le((vm,Ji)=>{"use strict";f();c();p();d();m();Ji.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Wi=Le((Im,Hi)=>{"use strict";f();c();p();d();m();var Xa=Qi();Hi.exports=e=>typeof e=="string"?e.replace(Xa(),""):e});var Zi=Le(($h,sl)=>{sl.exports={name:"@prisma/engines-version",version:"5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"bf0e5e8a04cada8225617067eaa03d041e2bba36"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.34",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Xi=Le(()=>{"use strict";f();c();p();d();m()});var jn=Le((_2,ps)=>{"use strict";f();c();p();d();m();ps.exports=function(){function e(t,r,n,i,o){return tn?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;syi,getExtensionContext:()=>wi});f();c();p();d();m();f();c();p();d();m();function yi(e){return typeof e=="function"?e:t=>t.$extends(e)}f();c();p();d();m();function wi(e){return e}var xi={};Yr(xi,{validator:()=>bi});f();c();p();d();m();f();c();p();d();m();function bi(...e){return t=>t}f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();var sn,Ti,Ci,Ai,Ri=!0;typeof y<"u"&&({FORCE_COLOR:sn,NODE_DISABLE_COLORS:Ti,NO_COLOR:Ci,TERM:Ai}=y.env||{},Ri=y.stdout&&y.stdout.isTTY);var Ba={enabled:!Ti&&Ci==null&&Ai!=="dumb"&&(sn!=null&&sn!=="0"||Ri)};function V(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Ba.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Wp=V(0,0),cr=V(1,22),pr=V(2,22),Kp=V(3,23),Si=V(4,24),zp=V(7,27),Yp=V(8,28),Zp=V(9,29),Xp=V(30,39),Ze=V(31,39),Ii=V(32,39),Oi=V(33,39),ki=V(34,39),ed=V(35,39),Di=V(36,39),td=V(37,39),Mi=V(90,39),rd=V(90,39),nd=V(40,49),id=V(41,49),od=V(42,49),sd=V(43,49),ad=V(44,49),ld=V(45,49),ud=V(46,49),cd=V(47,49);f();c();p();d();m();var Ua=100,Ni=["green","yellow","blue","magenta","cyan","red"],dr=[],Fi=Date.now(),$a=0,an=typeof y<"u"?y.env:{};globalThis.DEBUG??=an.DEBUG??"";globalThis.DEBUG_COLORS??=an.DEBUG_COLORS?an.DEBUG_COLORS==="true":!0;var Pt={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function Va(e){let t={color:Ni[$a++%Ni.length],enabled:Pt.enabled(e),namespace:e,log:Pt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&dr.push([o,...n]),dr.length>Ua&&dr.shift(),Pt.enabled(o)||i){let l=n.map(g=>typeof g=="string"?g:ja(g)),u=`+${Date.now()-Fi}ms`;Fi=Date.now(),a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var _i=new Proxy(Va,{get:(e,t)=>Pt[t],set:(e,t,r)=>Pt[t]=r});function ja(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function Li(){dr.length=0}var ee=_i;f();c();p();d();m();f();c();p();d();m();var Ui="library";function Tt(e){let t=Wa();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":Ui)}function Wa(){let e=y.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}f();c();p();d();m();f();c();p();d();m();var Ue;(t=>{let e;(I=>(I.findUnique="findUnique",I.findUniqueOrThrow="findUniqueOrThrow",I.findFirst="findFirst",I.findFirstOrThrow="findFirstOrThrow",I.findMany="findMany",I.create="create",I.createMany="createMany",I.createManyAndReturn="createManyAndReturn",I.update="update",I.updateMany="updateMany",I.upsert="upsert",I.delete="delete",I.deleteMany="deleteMany",I.groupBy="groupBy",I.count="count",I.aggregate="aggregate",I.findRaw="findRaw",I.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(Ue||={});var At={};Yr(At,{error:()=>Ya,info:()=>za,log:()=>Ka,query:()=>Za,should:()=>Gi,tags:()=>Ct,warn:()=>ln});f();c();p();d();m();var Ct={error:Ze("prisma:error"),warn:Oi("prisma:warn"),info:Di("prisma:info"),query:ki("prisma:query")},Gi={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function Ka(...e){console.log(...e)}function ln(e,...t){Gi.warn()&&console.warn(`${Ct.warn} ${e}`,...t)}function za(e,...t){console.info(`${Ct.info} ${e}`,...t)}function Ya(e,...t){console.error(`${Ct.error} ${e}`,...t)}function Za(e,...t){console.log(`${Ct.query} ${e}`,...t)}f();c();p();d();m();function xe(e,t){throw new Error(t)}f();c();p();d();m();function un(e,t){return Object.prototype.hasOwnProperty.call(e,t)}f();c();p();d();m();var cn=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});f();c();p();d();m();function Xe(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}f();c();p();d();m();function pn(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{Ki.has(e)||(Ki.add(e),ln(t,...r))};f();c();p();d();m();var K=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};N(K,"PrismaClientKnownRequestError");var Se=class extends K{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};N(Se,"NotFoundError");f();c();p();d();m();var J=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};N(J,"PrismaClientInitializationError");f();c();p();d();m();var Ie=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};N(Ie,"PrismaClientRustPanicError");f();c();p();d();m();var se=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};N(se,"PrismaClientUnknownRequestError");f();c();p();d();m();var z=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};N(z,"PrismaClientValidationError");f();c();p();d();m();var Rt=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};f();c();p();d();m();f();c();p();d();m();function St(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function el(e,t){let r=St(()=>tl(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function tl(e){return{datamodel:{models:dn(e.models),enums:dn(e.enums),types:dn(e.types)}}}function dn(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}f();c();p();d();m();var gr=Symbol(),mn=new WeakMap,Pe=class{constructor(t){t===gr?mn.set(this,`Prisma.${this._getName()}`):mn.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return mn.get(this)}},It=class extends Pe{_getNamespace(){return"NullTypes"}},Ot=class extends It{};gn(Ot,"DbNull");var kt=class extends It{};gn(kt,"JsonNull");var Dt=class extends It{};gn(Dt,"AnyNull");var fn={classes:{DbNull:Ot,JsonNull:kt,AnyNull:Dt},instances:{DbNull:new Ot(gr),JsonNull:new kt(gr),AnyNull:new Dt(gr)}};function gn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}f();c();p();d();m();var Yi=Symbol(),Mt=class{constructor(t){if(t!==Yi)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?hn:t}},hn=new Mt(Yi);function me(e){return e instanceof Mt}f();c();p();d();m();var yn=new WeakMap,Nt=class{constructor(t,r){yn.set(this,{sql:t,values:r})}get sql(){return yn.get(this).sql}get values(){return yn.get(this).values}};function rl(e){return(...t)=>new Nt(e,t)}f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();function Ft(e){return{ok:!1,error:e,map(){return Ft(e)},flatMap(){return Ft(e)}}}var wn=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},En=e=>{let t=new wn,r=fe(t,e.transactionContext.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:fe(t,e.queryRaw.bind(e)),executeRaw:fe(t,e.executeRaw.bind(e)),provider:e.provider,transactionContext:async(...i)=>(await r(...i)).map(s=>nl(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=ol(t,e.getConnectionInfo.bind(e))),n},nl=(e,t)=>{let r=fe(e,t.startTransaction.bind(t));return{adapterName:t.adapterName,provider:t.provider,queryRaw:fe(e,t.queryRaw.bind(t)),executeRaw:fe(e,t.executeRaw.bind(t)),startTransaction:async(...n)=>(await r(...n)).map(o=>il(e,o))}},il=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:fe(e,t.queryRaw.bind(t)),executeRaw:fe(e,t.executeRaw.bind(t)),commit:fe(e,t.commit.bind(t)),rollback:fe(e,t.rollback.bind(t))});function fe(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return Ft({kind:"GenericJs",id:i})}}}function ol(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return Ft({kind:"GenericJs",id:i})}}}var ra=qe(Zi());var Xk=qe(Xi());$i();vi();Bi();f();c();p();d();m();var ae=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}f();c();p();d();m();f();c();p();d();m();var hr={enumerable:!0,configurable:!0,writable:!0};function yr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>hr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var ro=Symbol.for("nodejs.util.inspect.custom");function he(e,t){let r=ul(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=no(Reflect.ownKeys(o),r),a=no(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{...hr,...l?.getPropertyDescriptor(s)}:hr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[ro]=function(){let o={...this};return delete o[ro],o},i}function ul(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function no(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}f();c();p();d();m();function et(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}f();c();p();d();m();function wr(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}f();c();p();d();m();f();c();p();d();m();var tt=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r,n=(i,o)=>o.write(i)){let i=r.length-1;for(let o=0;o0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};f();c();p();d();m();f();c();p();d();m();function io(e){return e.substring(0,1).toLowerCase()+e.substring(1)}f();c();p();d();m();function rt(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Er(e){return e.toString()!=="Invalid Date"}f();c();p();d();m();f();c();p();d();m();var nt=9e15,Me=1e9,bn="0123456789abcdef",xr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Pr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",xn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-nt,maxE:nt,crypto:!1},lo,ve,_=!0,Tr="[DecimalError] ",De=Tr+"Invalid argument: ",uo=Tr+"Precision limit exceeded",co=Tr+"crypto unavailable",po="[object Decimal]",X=Math.floor,Q=Math.pow,cl=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,pl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,dl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,mo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,pe=1e7,k=7,ml=9007199254740991,fl=xr.length-1,Pn=Pr.length-1,C={toStringTag:po};C.absoluteValue=C.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),O(e)};C.ceil=function(){return O(new this.constructor(this),this.e+1,2)};C.clampedTo=C.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(De+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};C.comparedTo=C.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};C.cosine=C.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+k,n.rounding=1,r=gl(n,wo(n,r)),n.precision=e,n.rounding=t,O(ve==2||ve==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};C.cubeRoot=C.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(_=!1,o=g.s*Q(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=Y(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=Q(r,1/3),e=X((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(g),n=U(u.plus(g).times(a),u.plus(l),s+2,1),Y(a.d).slice(0,s)===(r=Y(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(O(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(O(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return _=!0,O(n,e,h.rounding,t)};C.decimalPlaces=C.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-X(this.e/k))*k,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};C.dividedBy=C.div=function(e){return U(this,new this.constructor(e))};C.dividedToIntegerBy=C.divToInt=function(e){var t=this,r=t.constructor;return O(U(t,new r(e),0,1,1),r.precision,r.rounding)};C.equals=C.eq=function(e){return this.cmp(e)===0};C.floor=function(){return O(new this.constructor(this),this.e+1,3)};C.greaterThan=C.gt=function(e){return this.cmp(e)>0};C.greaterThanOrEqualTo=C.gte=function(e){var t=this.cmp(e);return t==1||t===0};C.hyperbolicCosine=C.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Ar(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=it(s,1,o.times(t),new s(1),!0);for(var l,u=e,g=new s(8);u--;)l=o.times(o),o=a.minus(l.times(g.minus(l.times(g))));return O(o,s.precision=r,s.rounding=n,!0)};C.hyperbolicSine=C.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=it(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Ar(5,e)),i=it(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,O(i,t,r,!0)};C.hyperbolicTangent=C.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,U(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};C.inverseCosine=C.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?ce(r,i,o):new r(0):new r(NaN):t.isZero()?ce(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=ce(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};C.inverseHyperbolicCosine=C.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,_=!1,r=r.times(r).minus(1).sqrt().plus(r),_=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};C.inverseHyperbolicSine=C.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,_=!1,r=r.times(r).plus(1).sqrt().plus(r),_=!0,n.precision=e,n.rounding=t,r.ln())};C.inverseHyperbolicTangent=C.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?O(new o(i),e,t,!0):(o.precision=r=n-i.e,i=U(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};C.inverseSine=C.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=ce(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};C.inverseTangent=C.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,v=g.rounding;if(u.isFinite()){if(u.isZero())return new g(u);if(u.abs().eq(1)&&h+4<=Pn)return s=ce(g,h+4,v).times(.25),s.s=u.s,s}else{if(!u.s)return new g(NaN);if(h+4<=Pn)return s=ce(g,h+4,v).times(.5),s.s=u.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/k+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(_=!1,t=Math.ceil(a/k),n=1,l=u.times(u),s=new g(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};C.isNaN=function(){return!this.s};C.isNegative=C.isNeg=function(){return this.s<0};C.isPositive=C.isPos=function(){return this.s>0};C.isZero=function(){return!!this.d&&this.d[0]===0};C.lessThan=C.lt=function(e){return this.cmp(e)<0};C.lessThanOrEqualTo=C.lte=function(e){return this.cmp(e)<1};C.logarithm=C.log=function(e){var t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,v=g.rounding,S=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new g(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(_=!1,a=h+S,s=ke(u,a),n=t?vr(g,a+10):ke(e,a),l=U(s,n,a,1),Lt(l.d,i=h,v))do if(a+=10,s=ke(u,a),n=t?vr(g,a+10):ke(e,a),l=U(s,n,a,1),!o){+Y(l.d).slice(i+1,i+15)+1==1e14&&(l=O(l,h+1,0));break}while(Lt(l.d,i+=10,v));return _=!0,O(l,h,v)};C.minus=C.sub=function(e){var t,r,n,i,o,s,a,l,u,g,h,v,S=this,A=S.constructor;if(e=new A(e),!S.d||!e.d)return!S.s||!e.s?e=new A(NaN):S.d?e.s=-e.s:e=new A(e.d||S.s!==e.s?S:NaN),e;if(S.s!=e.s)return e.s=-e.s,S.plus(e);if(u=S.d,v=e.d,a=A.precision,l=A.rounding,!u[0]||!v[0]){if(v[0])e.s=-e.s;else if(u[0])e=new A(S);else return new A(l===3?-0:0);return _?O(e,a,l):e}if(r=X(e.e/k),g=X(S.e/k),u=u.slice(),o=g-r,o){for(h=o<0,h?(t=u,o=-o,s=v.length):(t=v,r=g,s=u.length),n=Math.max(Math.ceil(a/k),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=v.length,h=n0;--n)u[s++]=0;for(n=v.length;n>o;){if(u[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=g.length,s-i<0&&(i=s,r=g,g=u,u=r),t=0;i;)t=(u[--i]=u[i]+g[i]+t)/pe|0,u[i]%=pe;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=Cr(u,n),_?O(e,a,l):e};C.precision=C.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(De+e);return r.d?(t=fo(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};C.round=function(){var e=this,t=e.constructor;return O(new t(e),e.e+1,t.rounding)};C.sine=C.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+k,n.rounding=1,r=yl(n,wo(n,r)),n.precision=e,n.rounding=t,O(ve>2?r.neg():r,e,t,!0)):new n(NaN)};C.squareRoot=C.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,g=s.constructor;if(u!==1||!a||!a[0])return new g(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(_=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=Y(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=X((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new g(t)):n=new g(u.toString()),r=(l=g.precision)+3;;)if(o=n,n=o.plus(U(s,o,r+2,1)).times(.5),Y(o.d).slice(0,r)===(t=Y(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(O(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(O(n,l+1,1),e=!n.times(n).eq(s));break}return _=!0,O(n,l,g.rounding,e)};C.tangent=C.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=U(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,O(ve==2||ve==4?r.neg():r,e,t,!0)):new n(NaN)};C.times=C.mul=function(e){var t,r,n,i,o,s,a,l,u,g=this,h=g.constructor,v=g.d,S=(e=new h(e)).d;if(e.s*=g.s,!v||!v[0]||!S||!S[0])return new h(!e.s||v&&!v[0]&&!S||S&&!S[0]&&!v?NaN:!v||!S?e.s/0:e.s*0);for(r=X(g.e/k)+X(e.e/k),l=v.length,u=S.length,l=0;){for(t=0,i=l+n;i>n;)a=o[i]+S[n]*v[i-n-1]+t,o[i--]=a%pe|0,t=a/pe|0;o[i]=(o[i]+t)%pe|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Cr(o,r),_?O(e,h.precision,h.rounding):e};C.toBinary=function(e,t){return Cn(this,2,e,t)};C.toDecimalPlaces=C.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ne(e,0,Me),t===void 0?t=n.rounding:ne(t,0,8),O(r,e+r.e+1,t))};C.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ye(n,!0):(ne(e,0,Me),t===void 0?t=i.rounding:ne(t,0,8),n=O(new i(n),e+1,t),r=ye(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};C.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=ye(i):(ne(e,0,Me),t===void 0?t=o.rounding:ne(t,0,8),n=O(new o(i),e+i.e+1,t),r=ye(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};C.toFraction=function(e){var t,r,n,i,o,s,a,l,u,g,h,v,S=this,A=S.d,R=S.constructor;if(!A)return new R(S);if(u=r=new R(1),n=l=new R(0),t=new R(n),o=t.e=fo(A)-S.e-1,s=o%k,t.d[0]=Q(10,s<0?k+s:s),e==null)e=o>0?t:u;else{if(a=new R(e),!a.isInt()||a.lt(u))throw Error(De+a);e=a.gt(t)?o>0?t:u:a}for(_=!1,a=new R(Y(A)),g=R.precision,R.precision=o=A.length*k*2;h=U(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(h.times(i)),l=i,i=t,t=a.minus(h.times(i)),a=i;return i=U(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=S.s,v=U(u,n,o,1).minus(S).abs().cmp(U(l,r,o,1).minus(S).abs())<1?[u,n]:[l,r],R.precision=g,_=!0,v};C.toHexadecimal=C.toHex=function(e,t){return Cn(this,16,e,t)};C.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:ne(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(_=!1,r=U(r,e,0,t,1).times(e),_=!0,O(r)):(e.s=r.s,r=e),r};C.toNumber=function(){return+this};C.toOctal=function(e,t){return Cn(this,8,e,t)};C.toPower=C.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(Q(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return O(a,n,o);if(t=X(e.e/k),t>=e.d.length-1&&(r=u<0?-u:u)<=ml)return i=go(l,a,r,n),e.s<0?new l(1).div(i):O(i,n,o);if(s=a.s,s<0){if(tl.maxE+1||t0?s/0:0):(_=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=vn(e.times(ke(a,n+r)),n),i.d&&(i=O(i,n+5,1),Lt(i.d,n,o)&&(t=n+10,i=O(vn(e.times(ke(a,t+r)),t),t+5,1),+Y(i.d).slice(n+1,n+15)+1==1e14&&(i=O(i,n+1,0)))),i.s=s,_=!0,l.rounding=o,O(i,n,o))};C.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ye(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ne(e,1,Me),t===void 0?t=i.rounding:ne(t,0,8),n=O(new i(n),e,t),r=ye(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};C.toSignificantDigits=C.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ne(e,1,Me),t===void 0?t=n.rounding:ne(t,0,8)),O(new n(r),e,t)};C.toString=function(){var e=this,t=e.constructor,r=ye(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};C.truncated=C.trunc=function(){return O(new this.constructor(this),this.e+1,1)};C.valueOf=C.toJSON=function(){var e=this,t=e.constructor,r=ye(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Y(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(De+e)}function Lt(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=k,i=0):(i=Math.ceil((t+1)/k),t%=k),o=Q(10,k-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==Q(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==Q(10,t-3)-1,s}function br(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function gl(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Ar(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=it(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var U=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,l){var u,g,h,v,S,A,R,M,F,q,D,I,oe,G,Qr,or,bt,Hr,ue,sr,ar=n.constructor,Wr=n.s==i.s?1:-1,Z=n.d,$=i.d;if(!Z||!Z[0]||!$||!$[0])return new ar(!n.s||!i.s||(Z?$&&Z[0]==$[0]:!$)?NaN:Z&&Z[0]==0||!$?Wr*0:Wr/0);for(l?(S=1,g=n.e-i.e):(l=pe,S=k,g=X(n.e/S)-X(i.e/S)),ue=$.length,bt=Z.length,F=new ar(Wr),q=F.d=[],h=0;$[h]==(Z[h]||0);h++);if($[h]>(Z[h]||0)&&g--,o==null?(G=o=ar.precision,s=ar.rounding):a?G=o+(n.e-i.e)+1:G=o,G<0)q.push(1),A=!0;else{if(G=G/S+2|0,h=0,ue==1){for(v=0,$=$[0],G++;(h1&&($=e($,v,l),Z=e(Z,v,l),ue=$.length,bt=Z.length),or=ue,D=Z.slice(0,ue),I=D.length;I=l/2&&++Hr;do v=0,u=t($,D,ue,I),u<0?(oe=D[0],ue!=I&&(oe=oe*l+(D[1]||0)),v=oe/Hr|0,v>1?(v>=l&&(v=l-1),R=e($,v,l),M=R.length,I=D.length,u=t(R,D,M,I),u==1&&(v--,r(R,ue=10;v/=10)h++;F.e=h+g*S-1,O(F,a?o+F.e+1:o,s,A)}return F}}();function O(e,t,r,n){var i,o,s,a,l,u,g,h,v,S=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=k,s=t,g=h[v=0],l=g/Q(10,i-s-1)%10|0;else if(v=Math.ceil((o+1)/k),a=h.length,v>=a)if(n){for(;a++<=v;)h.push(0);g=l=0,i=1,o%=k,s=o-k+1}else break e;else{for(g=a=h[v],i=1;a>=10;a/=10)i++;o%=k,s=o-k+i,l=s<0?0:g/Q(10,i-s-1)%10|0}if(n=n||t<0||h[v+1]!==void 0||(s<0?g:g%Q(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?g/Q(10,i-s):0:h[v-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,u?(t-=e.e+1,h[0]=Q(10,(k-t%k)%k),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=v,a=1,v--):(h.length=v+1,a=Q(10,k-o),h[v]=s>0?(g/Q(10,i-s)%Q(10,s)|0)*a:0),u)for(;;)if(v==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==pe&&(h[0]=1));break}else{if(h[v]+=a,h[v]!=pe)break;h[v--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return _&&(e.e>S.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Oe(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Oe(-i-1)+o,r&&(n=r-s)>0&&(o+=Oe(n))):i>=s?(o+=Oe(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Oe(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Oe(n))),o}function Cr(e,t){var r=e[0];for(t*=k;r>=10;r/=10)t++;return t}function vr(e,t,r){if(t>fl)throw _=!0,r&&(e.precision=r),Error(uo);return O(new e(xr),t,1,!0)}function ce(e,t,r){if(t>Pn)throw Error(uo);return O(new e(Pr),t,r,!0)}function fo(e){var t=e.length-1,r=t*k+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Oe(e){for(var t="";e--;)t+="0";return t}function go(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/k+4);for(_=!1;;){if(r%2&&(o=o.times(t),so(o.d,s)&&(i=!0)),r=X(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),so(t.d,s)}return _=!0,o}function oo(e){return e.d[e.d.length-1]&1}function ho(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new v(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(_=!1,l=A):l=t,a=new v(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(Q(2,h))/Math.LN10*2+5|0,l+=n,r=o=s=new v(1),v.precision=l;;){if(o=O(o.times(e),l,1),r=r.times(++g),a=s.plus(U(o,r,l,1)),Y(a.d).slice(0,l)===Y(s.d).slice(0,l)){for(i=h;i--;)s=O(s.times(s),l,1);if(t==null)if(u<3&&Lt(s.d,l-n,S,u))v.precision=l+=10,r=o=a=new v(1),g=0,u++;else return O(s,v.precision=A,S,_=!0);else return v.precision=A,s}s=a}}function ke(e,t){var r,n,i,o,s,a,l,u,g,h,v,S=1,A=10,R=e,M=R.d,F=R.constructor,q=F.rounding,D=F.precision;if(R.s<0||!M||!M[0]||!R.e&&M[0]==1&&M.length==1)return new F(M&&!M[0]?-1/0:R.s!=1?NaN:M?0:R);if(t==null?(_=!1,g=D):g=t,F.precision=g+=A,r=Y(M),n=r.charAt(0),Math.abs(o=R.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)R=R.times(e),r=Y(R.d),n=r.charAt(0),S++;o=R.e,n>1?(R=new F("0."+r),o++):R=new F(n+"."+r.slice(1))}else return u=vr(F,g+2,D).times(o+""),R=ke(new F(n+"."+r.slice(1)),g-A).plus(u),F.precision=D,t==null?O(R,D,q,_=!0):R;for(h=R,l=s=R=U(R.minus(1),R.plus(1),g,1),v=O(R.times(R),g,1),i=3;;){if(s=O(s.times(v),g,1),u=l.plus(U(s,new F(i),g,1)),Y(u.d).slice(0,g)===Y(l.d).slice(0,g))if(l=l.times(2),o!==0&&(l=l.plus(vr(F,g+2,D).times(o+""))),l=U(l,new F(S),g,1),t==null)if(Lt(l.d,g-A,q,a))F.precision=g+=A,u=s=R=U(h.minus(1),h.plus(1),g,1),v=O(R.times(R),g,1),i=a=1;else return O(l,F.precision=D,q,_=!0);else return F.precision=D,l;l=u,i+=2}}function yo(e){return String(e.s*e.s/0)}function Tn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%k,r<0&&(n+=k),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),mo.test(t))return Tn(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(pl.test(t))r=16,t=t.toLowerCase();else if(cl.test(t))r=2;else if(dl.test(t))r=8;else throw Error(De+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=go(n,new n(r),o,o*2)),u=br(t,r,pe),g=u.length-1,o=g;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=Cr(u,g),e.d=u,_=!1,s&&(e=U(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?Q(2,l):Ve.pow(2,l))),_=!0,e)}function yl(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:it(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Ar(5,r)),t=it(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function it(e,t,r,n,i){var o,s,a,l,u=1,g=e.precision,h=Math.ceil(g/k);for(_=!1,l=r.times(r),a=new e(n);;){if(s=U(a.times(l),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=U(s.times(l),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return _=!0,s.d.length=h+1,s}function Ar(e,t){for(var r=e;--t;)r*=e;return r}function wo(e,t){var r,n=t.s<0,i=ce(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return ve=n?4:1,t;if(r=t.divToInt(i),r.isZero())ve=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return ve=oo(r)?n?2:3:n?4:1,t;ve=oo(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Cn(e,t,r,n){var i,o,s,a,l,u,g,h,v,S=e.constructor,A=r!==void 0;if(A?(ne(r,1,Me),n===void 0?n=S.rounding:ne(n,0,8)):(r=S.precision,n=S.rounding),!e.isFinite())g=yo(e);else{for(g=ye(e),s=g.indexOf("."),A?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),v=new S(1),v.e=g.length-s,v.d=br(ye(v),10,i),v.e=v.d.length),h=br(g,10,i),o=l=h.length;h[--l]==0;)h.pop();if(!h[0])g=A?"0p+0":"0";else{if(s<0?o--:(e=new S(e),e.d=h,e.e=o,e=U(e,v,r,n,0,i),h=e.d,o=e.e,u=lo),s=h[r],a=i/2,u=u||h[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,u)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)g+="0";for(h=br(g,i,t),l=h.length;!h[l-1];--l);for(s=1,g="1.";sl)for(o-=l;o--;)g+="0";else ot)return e.length=t,!0}function wl(e){return new this(e).abs()}function El(e){return new this(e).acos()}function bl(e){return new this(e).acosh()}function xl(e,t){return new this(e).plus(t)}function Pl(e){return new this(e).asin()}function vl(e){return new this(e).asinh()}function Tl(e){return new this(e).atan()}function Cl(e){return new this(e).atanh()}function Al(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=ce(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ce(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ce(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(U(e,t,o,1)),t=ce(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(U(e,t,o,1)),r}function Rl(e){return new this(e).cbrt()}function Sl(e){return O(e=new this(e),e.e+1,2)}function Il(e,t,r){return new this(e).clamp(t,r)}function Ol(e){if(!e||typeof e!="object")throw Error(Tr+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Me,"rounding",0,8,"toExpNeg",-nt,0,"toExpPos",0,nt,"maxE",0,nt,"minE",-nt,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(De+r+": "+n);if(r="crypto",i&&(this[r]=xn[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(co);else this[r]=!1;else throw Error(De+r+": "+n);return this}function kl(e){return new this(e).cos()}function Dl(e){return new this(e).cosh()}function Eo(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,ao(o)){u.s=o.s,_?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;_?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(co);else for(;o=10;i/=10)n++;n`}};function st(e){return e instanceof qt}f();c();p();d();m();f();c();p();d();m();var Rr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};f();c();p();d();m();var Sr=e=>e,Ir={bold:Sr,red:Sr,green:Sr,dim:Sr,enabled:!1},bo={bold:cr,red:Ze,green:Ii,dim:pr,enabled:!0},at={write(e){e.writeLine(",")}};f();c();p();d();m();var we=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};f();c();p();d();m();var Ne=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var lt=class extends Ne{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new Rr(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new we("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(at,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};f();c();p();d();m();var xo=": ",Or=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+xo.length}write(t){let r=new we(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(xo).write(this.value)}};f();c();p();d();m();var ut=class e extends Ne{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let l;if(s.value instanceof e?l=s.value.getField(a):s.value instanceof lt&&(l=s.value.getField(Number(a))),!l)return;s=l}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new we("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(at,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};f();c();p();d();m();var W=class extends Ne{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new we(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var An=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function ct(e){return new An(Po(e))}function Po(e){let t=new ut;for(let[r,n]of Object.entries(e)){let i=new Or(r,vo(n));t.addField(i)}return t}function vo(e){if(typeof e=="string")return new W(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new W(String(e));if(typeof e=="bigint")return new W(`${e}n`);if(e===null)return new W("null");if(e===void 0)return new W("undefined");if(ot(e))return new W(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new W(`Buffer.alloc(${e.byteLength})`):new W(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Er(e)?e.toISOString():"Invalid Date";return new W(`new Date("${t}")`)}return e instanceof Pe?new W(`Prisma.${e._getName()}`):st(e)?new W(`prisma.${io(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?iu(e):typeof e=="object"?Po(e):new W(Object.prototype.toString.call(e))}function iu(e){let t=new lt;for(let r of e)t.addItem(vo(r));return t}function kr(e,t){let r=t==="pretty"?bo:Ir,n=e.renderAllMessages(r),i=new tt(0,{colors:r}).write(e).toString();return{message:n,args:i}}function To(e){if(e===void 0)return"";let t=ct(e);return new tt(0,{colors:Ir}).write(t).toString()}f();c();p();d();m();var ou="P2037";function Bt({error:e,user_facing_error:t},r,n){return t.error_code?new K(su(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new se(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function su(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===ou&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();var Rn=class{getLocation(){return null}};function Fe(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Rn}f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();var Co={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function pt(e={}){let t=lu(e);return Object.entries(t).reduce((n,[i,o])=>(Co[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function lu(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Dr(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Ao(e,t){let r=Dr(e);return t({action:"aggregate",unpacker:r,argsMapper:pt})(e)}f();c();p();d();m();function uu(e={}){let{select:t,...r}=e;return typeof t=="object"?pt({...r,_count:t}):pt({...r,_count:{_all:!0}})}function cu(e={}){return typeof e.select=="object"?t=>Dr(e)(t)._count:t=>Dr(e)(t)._count._all}function Ro(e,t){return t({action:"count",unpacker:cu(e),argsMapper:uu})(e)}f();c();p();d();m();function pu(e={}){let t=pt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function du(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function So(e,t){return t({action:"groupBy",unpacker:du(e),argsMapper:pu})(e)}function Io(e,t,r){if(t==="aggregate")return n=>Ao(n,r);if(t==="count")return n=>Ro(n,r);if(t==="groupBy")return n=>So(n,r)}f();c();p();d();m();function Oo(e,t){let r=t.fields.filter(i=>!i.relationName),n=cn(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new qt(e,o,s.type,s.isList,s.kind==="enum")},...yr(Object.keys(n))})}f();c();p();d();m();f();c();p();d();m();var ko=e=>Array.isArray(e)?e:e.split("."),Sn=(e,t)=>ko(t).reduce((r,n)=>r&&r[n],e),Do=(e,t,r)=>ko(t).reduceRight((n,i,o,s)=>Object.assign({},Sn(e,s.slice(0,o)),{[i]:n}),r);function mu(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function fu(e,t,r){return t===void 0?e??{}:Do(t,r,e||!0)}function In(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=Fe(e._errorFormat),g=mu(n,i),h=fu(l,o,g),v=r({dataPath:g,callsite:u})(h),S=gu(e,t);return new Proxy(v,{get(A,R){if(!S.includes(R))return A[R];let F=[a[R].type,r,R],q=[g,h];return In(e,...F,...q)},...yr([...S,...Object.getOwnPropertyNames(v)])})}}function gu(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}f();c();p();d();m();f();c();p();d();m();var hu=qe(ji());var yu={red:Ze,gray:Mi,dim:pr,bold:cr,underline:Si,highlightSource:e=>e.highlight()},wu={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Eu({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function bu({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],l=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${l}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${l}`)),t&&a.push(s.underline(xu(t))),i){a.push("");let u=[i.toString()];o&&(u.push(o),u.push(s.dim(")"))),a.push(u.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` -`)}function xu(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function dt(e){let t=e.showColors?yu:wu,r;return typeof $getTemplateParameters<"u"?r=$getTemplateParameters(e,t):r=Eu(e),bu(r,t)}function Mo(e,t,r,n){return e===Ue.ModelAction.findFirstOrThrow||e===Ue.ModelAction.findUniqueOrThrow?Pu(t,r,n):n}function Pu(e,t,r){return async n=>{if("rejectOnNotFound"in n.args){let o=dt({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new z(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof K&&o.code==="P2025"?new Se(`No ${e} found`,t):o})}}f();c();p();d();m();function Ee(e){return e.replace(/^./,t=>t.toLowerCase())}var vu=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Tu=["aggregate","count","groupBy"];function On(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Cu(e,t),Ru(e,t),_t(r),te("name",()=>t),te("$name",()=>t),te("$parent",()=>e._appliedParent)];return he({},n)}function Cu(e,t){let r=Ee(t),n=Object.keys(Ue.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=l=>e._request(l);s=Mo(o,t,e._clientVersion,s);let a=l=>u=>{let g=Fe(e._errorFormat);return e._createPrismaPromise(h=>{let v={args:u,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:g};return s({...v,...l})})};return vu.includes(o)?In(e,t,a):Au(i)?Io(e,i,a):a({})}}}function Au(e){return Tu.includes(e)}function Ru(e,t){return $e(te("fields",()=>{let r=e._runtimeDataModel.models[t];return Oo(t,r)}))}f();c();p();d();m();function No(e){return e.replace(/^./,t=>t.toUpperCase())}var kn=Symbol();function Ut(e){let t=[Su(e),te(kn,()=>e),te("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(_t(r)),he(e,t)}function Su(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Ee),n=[...new Set(t.concat(r))];return $e({getKeys(){return n},getPropertyValue(i){let o=No(i);if(e._runtimeDataModel.models[o]!==void 0)return On(e,o);if(e._runtimeDataModel.models[i]!==void 0)return On(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Fo(e){return e[kn]?e[kn]:e}function _o(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return Ut(t)}f();c();p();d();m();f();c();p();d();m();function Lo({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(g=>n[g]);u.length>0&&a.push(et(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(g=>!r[g]);u.length>0&&a.push(et(u))}Iu(e,l.needs)&&s.push(Ou(l,he(e,s)))}return s.length>0||a.length>0?he(e,[...s,...a]):e}function Iu(e,t){return t.every(r=>un(e,r))}function Ou(e,t){return $e(te(e.name,()=>e.compute(t)))}f();c();p();d();m();f();c();p();d();m();function Mr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sg.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=Mr({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Bo({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Mr({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let g=Ee(l);return Lo({result:a,modelName:g,select:u.select,omit:u.select?void 0:{...o?.[g],...u.omit},extensions:n})}})}f();c();p();d();m();f();c();p();d();m();function Uo(e){if(e instanceof ae)return ku(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Uo(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=Qo(o,l),a.args=s,Vo(e,a,r,n+1)}})})}function jo(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return Vo(e,t,s)}function Go(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Jo(r,n,0,e):e(r)}}function Jo(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=Qo(i,l),Jo(a,t,r+1,n)}})}var $o=e=>e;function Qo(e=$o,t=$o){return r=>e(t(r))}f();c();p();d();m();f();c();p();d();m();function Wo(e,t,r){let n=Ee(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Du({...e,...Ho(t.name,e,t.result.$allModels),...Ho(t.name,e,t.result[n])})}function Du(e){let t=new ge,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return Xe(e,n=>({...n,needs:r(n.name,new Set)}))}function Ho(e,t,r){return r?Xe(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Mu(t,o,i)})):{}}function Mu(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Ko(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function zo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Nr=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new ge;this.modelExtensionsCache=new ge;this.queryCallbacksCache=new ge;this.clientExtensions=St(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=St(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Wo(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=Ee(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Fr=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Nr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Nr(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};f();c();p();d();m();var Yo=ee("prisma:client"),Zo={Vercel:"vercel","Netlify CI":"netlify"};function Xo({postinstall:e,ciName:t,clientVersion:r}){if(Yo("checkPlatformCaching:postinstall",e),Yo("checkPlatformCaching:ciName",t),e===!0&&t&&t in Zo){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${Zo[t]}-build`;throw console.error(n),new J(n,r)}}f();c();p();d();m();function es(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();var Nu="Cloudflare-Workers",Fu="node";function ts(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===Nu?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===Fu?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var _u={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function Dn(){let e=ts();return{id:e,prettyName:_u[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();function mt({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=t[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=r[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw Dn().id==="workerd"?new J(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new J(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new J("error: Missing URL environment variable, value, or override.",n);return i}f();c();p();d();m();f();c();p();d();m();var _r=class extends Error{constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var ie=class extends _r{constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};f();c();p();d();m();f();c();p();d();m();function L(e,t){return{...e,isRetryable:t}}var ft=class extends ie{constructor(r){super("This request must be retried",L(r,!0));this.name="ForcedRetryError";this.code="P5001"}};N(ft,"ForcedRetryError");f();c();p();d();m();var je=class extends ie{constructor(r,n){super(r,L(n,!1));this.name="InvalidDatasourceError";this.code="P6001"}};N(je,"InvalidDatasourceError");f();c();p();d();m();var Ge=class extends ie{constructor(r,n){super(r,L(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};N(Ge,"NotImplementedYetError");f();c();p();d();m();f();c();p();d();m();var j=class extends ie{constructor(t,r){super(t,r),this.response=r.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var Je=class extends j{constructor(r){super("Schema needs to be uploaded",L(r,!0));this.name="SchemaMissingError";this.code="P5005"}};N(Je,"SchemaMissingError");f();c();p();d();m();f();c();p();d();m();var Mn="This request could not be understood by the server",Vt=class extends j{constructor(r,n,i){super(n||Mn,L(r,!1));this.name="BadRequestError";this.code="P5000";i&&(this.code=i)}};N(Vt,"BadRequestError");f();c();p();d();m();var jt=class extends j{constructor(r,n){super("Engine not started: healthcheck timeout",L(r,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};N(jt,"HealthcheckTimeoutError");f();c();p();d();m();var Gt=class extends j{constructor(r,n,i){super(n,L(r,!0));this.name="EngineStartupError";this.code="P5014";this.logs=i}};N(Gt,"EngineStartupError");f();c();p();d();m();var Jt=class extends j{constructor(r){super("Engine version is not supported",L(r,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};N(Jt,"EngineVersionNotSupportedError");f();c();p();d();m();var Nn="Request timed out",Qt=class extends j{constructor(r,n=Nn){super(n,L(r,!1));this.name="GatewayTimeoutError";this.code="P5009"}};N(Qt,"GatewayTimeoutError");f();c();p();d();m();var Lu="Interactive transaction error",Ht=class extends j{constructor(r,n=Lu){super(n,L(r,!1));this.name="InteractiveTransactionError";this.code="P5015"}};N(Ht,"InteractiveTransactionError");f();c();p();d();m();var qu="Request parameters are invalid",Wt=class extends j{constructor(r,n=qu){super(n,L(r,!1));this.name="InvalidRequestError";this.code="P5011"}};N(Wt,"InvalidRequestError");f();c();p();d();m();var Fn="Requested resource does not exist",Kt=class extends j{constructor(r,n=Fn){super(n,L(r,!1));this.name="NotFoundError";this.code="P5003"}};N(Kt,"NotFoundError");f();c();p();d();m();var _n="Unknown server error",gt=class extends j{constructor(r,n,i){super(n||_n,L(r,!0));this.name="ServerError";this.code="P5006";this.logs=i}};N(gt,"ServerError");f();c();p();d();m();var Ln="Unauthorized, check your connection string",zt=class extends j{constructor(r,n=Ln){super(n,L(r,!1));this.name="UnauthorizedError";this.code="P5007"}};N(zt,"UnauthorizedError");f();c();p();d();m();var qn="Usage exceeded, retry again later",Yt=class extends j{constructor(r,n=qn){super(n,L(r,!0));this.name="UsageExceededError";this.code="P5008"}};N(Yt,"UsageExceededError");async function Bu(e){let t;try{t=await e.text()}catch{return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch{return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function Zt(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await Bu(e);if(n.type==="QueryEngineError")throw new K(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new gt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new Je(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Jt(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Gt(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new J(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new jt(r,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Ht(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Wt(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new zt(r,ht(Ln,n));if(e.status===404)return new Kt(r,ht(Fn,n));if(e.status===429)throw new Yt(r,ht(qn,n));if(e.status===504)throw new Qt(r,ht(Nn,n));if(e.status>=500)throw new gt(r,ht(_n,n));if(e.status>=400)throw new Vt(r,ht(Mn,n))}function ht(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}f();c();p();d();m();function rs(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(i=>setTimeout(()=>i(n),n))}f();c();p();d();m();var Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function ns(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,l,u,g;for(let h=0;h>18,a=(g&258048)>>12,l=(g&4032)>>6,u=g&63,r+=Ce[s]+Ce[a]+Ce[l]+Ce[u];return i==1?(g=t[o],s=(g&252)>>2,a=(g&3)<<4,r+=Ce[s]+Ce[a]+"=="):i==2&&(g=t[o]<<8|t[o+1],s=(g&64512)>>10,a=(g&1008)>>4,l=(g&15)<<2,r+=Ce[s]+Ce[a]+Ce[l]+"="),r}f();c();p();d();m();function is(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new J("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}f();c();p();d();m();function Uu(e){return e[0]*1e3+e[1]/1e6}function os(e){return new Date(Uu(e))}f();c();p();d();m();var ss={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};f();c();p();d();m();f();c();p();d();m();var Xt=class extends ie{constructor(r,n){super(`Cannot fetch data from service: -${r}`,L(n,!0));this.name="RequestError";this.code="P5010"}};N(Xt,"RequestError");async function Qe(e,t,r=n=>n){let n=t.clientVersion;try{return typeof fetch=="function"?await r(fetch)(e,t):await r(Bn)(e,t)}catch(i){let o=i.message??"Unknown error";throw new Xt(o,{clientVersion:n})}}function Vu(e){return{...e.headers,"Content-Type":"application/json"}}function ju(e){return{method:e.method,headers:Vu(e)}}function Gu(e,t){return{text:()=>Promise.resolve(w.Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(w.Buffer.concat(e).toString())),ok:t.statusCode>=200&&t.statusCode<=299,status:t.statusCode,url:t.url,headers:new Un(t.headers)}}async function Bn(e,t={}){let r=Ju("https"),n=ju(t),i=[],{origin:o}=new URL(e);return new Promise((s,a)=>{let l=r.request(e,n,u=>{let{statusCode:g,headers:{location:h}}=u;g>=301&&g<=399&&h&&(h.startsWith("http")===!1?s(Bn(`${o}${h}`,t)):s(Bn(h,t))),u.on("data",v=>i.push(v)),u.on("end",()=>s(Gu(i,u))),u.on("error",a)});l.on("error",a),l.end(t.body??"")})}var Ju=typeof zr<"u"?zr:()=>{},Un=class{constructor(t={}){this.headers=new Map;for(let[r,n]of Object.entries(t))if(typeof n=="string")this.headers.set(r,n);else if(Array.isArray(n))for(let i of n)this.headers.set(r,i)}append(t,r){this.headers.set(t,r)}delete(t){this.headers.delete(t)}get(t){return this.headers.get(t)??null}has(t){return this.headers.has(t)}set(t,r){this.headers.set(t,r)}forEach(t,r){for(let[n,i]of this.headers)t.call(r,i,n,this)}};var Qu=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,as=ee("prisma:client:dataproxyEngine");async function Hu(e,t){let r=ss["@prisma/engines-version"],n=t.clientVersion??"unknown";if(y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=n?.split("-")??[];if(o===void 0&&Qu.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[s]=r.split("-")??[],[a,l,u]=s.split("."),g=Wu(`<=${a}.${l}.${u}`),h=await Qe(g,{clientVersion:n});if(!h.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${h.status} ${h.statusText}, response body: ${await h.text()||""}`);let v=await h.text();as("length of body fetched from unpkg.com",v.length);let S;try{S=JSON.parse(v)}catch(A){throw console.error("JSON.parse error: body fetched from unpkg.com: ",v),A}return S.version}throw new Ge("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function ls(e,t){let r=await Hu(e,t);return as("version",r),r}function Wu(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var us=3,$n=ee("prisma:client:dataproxyEngine"),Vn=class{constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:t,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-transaction-id"]=r.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}},er=class{constructor(t){this.name="DataProxyEngine";is(t),this.config=t,this.env={...t.env,...typeof y<"u"?y.env:{}},this.inlineSchema=ns(t.inlineSchema),this.inlineDatasources=t.inlineDatasources,this.inlineSchemaHash=t.inlineSchemaHash,this.clientVersion=t.clientVersion,this.engineHash=t.engineVersion,this.logEmitter=t.logEmitter,this.tracingHelper=t.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[t,r]=this.extractHostAndApiKey();this.host=t,this.headerBuilder=new Vn({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await ls(t,this.config),$n("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){t?.logs?.length&&t.logs.forEach(r=>{switch(r.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let n=typeof r.attributes.query=="string"?r.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[i]=n.split("/* traceparent");n=i}this.logEmitter.emit("query",{query:n,timestamp:os(r.timestamp),duration:Number(r.attributes.duration_ms),params:r.attributes.params,target:r.attributes.target})}}}),t?.traces?.length&&this.tracingHelper.createEngineSpan({span:!0,spans:t.traces})}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await Qe(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||$n("schema response status",r.status);let n=await Zt(r,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(t,{traceparent:r,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:t,traceparent:r,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(t,{traceparent:r,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=wr(t,n),{batchResult:a,elapsed:l}=await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r});return a.map(u=>"errors"in u&&u.errors.length>0?Bt(u.errors[0],this.clientVersion,this.config.activeProvider):{data:u,elapsed:l})}requestInternal({body:t,traceparent:r,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await Qe(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||$n("graphql response status",a.status),await this.handleError(await Zt(a,this.clientVersion));let l=await a.json(),u=l.extensions;if(u&&this.propagateResponseExtensions(u),l.errors)throw l.errors.length===1?Bt(l.errors[0],this.config.clientVersion,this.config.activeProvider):new se(l.errors,{clientVersion:this.config.clientVersion});return l}})}async transaction(t,r,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[t]} transaction`,callback:async({logHttpCall:o})=>{if(t==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await Qe(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Zt(l,this.clientVersion));let u=await l.json(),g=u.extensions;g&&this.propagateResponseExtensions(g);let h=u.id,v=u["data-proxy"].endpoint;return{id:h,payload:{endpoint:v}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await Qe(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Zt(a,this.clientVersion));let u=(await a.json()).extensions;u&&this.propagateResponseExtensions(u);return}}})}extractHostAndApiKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=mt({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new je(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:"&&o!=="prisma+postgres:")throw new je(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t);let l=a.get("api_key");if(l===null||l.length<1)throw new je(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return[s,l]}metrics(){throw new Ge("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){for(let r=0;;r++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${r})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:n})}catch(i){if(!(i instanceof ie)||!i.isRetryable)throw i;if(r>=us)throw i instanceof ft?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${r+1}/${us} failed for ${t.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await rs(r);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof Je)throw await this.uploadSchema(),new ft({clientVersion:this.clientVersion,cause:t});if(t)throw t}applyPendingMigrations(){throw new Error("Method not implemented.")}};function cs({copyEngine:e=!0},t){let r;try{r=mt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||r?.startsWith("prisma+postgres://"));e&&n&&fr("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=Tt(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",l=i==="binary";if(o&&s||s){let u;throw u=["Prisma Client was configured to use the `adapter` option but it was imported via its `/edge` endpoint.","Please either remove the `/edge` endpoint or remove the `adapter` from the Prisma Client constructor."],new z(u.join(` -`),{clientVersion:t.clientVersion})}if(o)return new er(t);throw new z("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}f();c();p();d();m();function Lr({generator:e}){return e?.previewFeatures??[]}f();c();p();d();m();f();c();p();d();m();function yt(e){return e.substring(0,1).toLowerCase()+e.substring(1)}f();c();p();d();m();f();c();p();d();m();var hs=qe(jn());f();c();p();d();m();function fs(e,t,r){let n=gs(e),i=Ku(n),o=Yu(i);o?qr(o,t,r):t.addErrorMessage(()=>"Unknown error")}function gs(e){return e.errors.flatMap(t=>t.kind==="Union"?gs(t):[t])}function Ku(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:zu(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function zu(e,t){return[...new Set(e.concat(t))]}function Yu(e){return pn(e,(t,r)=>{let n=ds(t),i=ds(r);return n!==i?n-i:ms(t)-ms(r)})}function ds(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function ms(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}f();c();p();d();m();var le=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};f();c();p();d();m();var tr=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(at,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function qr(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":Zu(e,t);break;case"IncludeOnScalar":Xu(e,t);break;case"EmptySelection":ec(e,t,r);break;case"UnknownSelectionField":ic(e,t);break;case"InvalidSelectionValue":oc(e,t);break;case"UnknownArgument":sc(e,t);break;case"UnknownInputField":ac(e,t);break;case"RequiredArgumentMissing":lc(e,t);break;case"InvalidArgumentType":uc(e,t);break;case"InvalidArgumentValue":cc(e,t);break;case"ValueTooLarge":pc(e,t);break;case"SomeFieldsMissing":dc(e,t);break;case"TooManyFieldsGiven":mc(e,t);break;case"Union":fs(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Zu(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function Xu(e,t){let[r,n]=rr(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new le(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${nr(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function ec(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){tc(e,t,i);return}if(n.hasField("select")){rc(e,t);return}}if(r?.[yt(e.outputType.name)]){nc(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function tc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new le(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function rc(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),Es(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${nr(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function nc(e,t){let r=new tr;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new le("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=rr(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new ut;l.addSuggestion(n),a.value=l}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function ic(e,t){let r=bs(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":Es(n,e.outputType);break;case"include":fc(n,e.outputType);break;case"omit":gc(n,e.outputType);break}}t.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(nr(n)),i.join(" ")})}function oc(e,t){let r=bs(e.selectionPath,t);r.parentKind!=="unknown"&&r.field.value.markAsError(),t.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`)}function sc(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),hc(n,e.arguments)),t.addErrorMessage(i=>ys(i,r,e.arguments.map(o=>o.name)))}function ac(e,t){let[r,n]=rr(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&xs(o,e.inputType)}t.addErrorMessage(o=>ys(o,n,e.inputType.fields.map(s=>s.name)))}function ys(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=wc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(nr(e)),n.join(" ")}function lc(e,t){let r;t.addErrorMessage(l=>r?.value instanceof W&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=rr(e.argumentPath),s=new tr,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new le(o,s).makeRequired())}else{let l=e.inputTypes.map(ws).join(" | ");a.addSuggestion(new le(o,l).makeRequired())}}function ws(e){return e.kind==="list"?`${ws(e.elementType)}[]`:e.name}function uc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=Br("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function cc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=Br("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function pc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof W&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function dc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&xs(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${Br("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(nr(i)),o.join(" ")})}function mc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${Br("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function Es(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,"true"))}function fc(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new le(r.name,"true"))}function gc(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new le(r.name,"true"))}function hc(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function bs(e,t){let[r,n]=rr(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),l=o?.getField(n);return o&&l?{parentKind:"select",parent:o,field:l,fieldName:n}:(l=s?.getField(n),s&&l?{parentKind:"include",field:l,parent:s,fieldName:n}:(l=a?.getField(n),a&&l?{parentKind:"omit",field:l,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function xs(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function rr(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function nr({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Br(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var yc=3;function wc(e,t){let r=1/0,n;for(let i of t){let o=(0,hs.default)(e,i);o>yc||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[yt(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:xe(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};f();c();p();d();m();var As=e=>({command:e});f();c();p();d();m();f();c();p();d();m();var Rs=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);f();c();p();d();m();function wt(e){try{return Ss(e,"fast")}catch{return Ss(e,"slow")}}function Ss(e,t){return JSON.stringify(e.map(r=>Os(r,t)))}function Os(e,t){return Array.isArray(e)?e.map(r=>Os(r,t)):typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:rt(e)?{prisma__type:"date",prisma__value:e.toJSON()}:Te.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:w.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Sc(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?ks(e):e}function Sc(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function ks(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Is);let t={};for(let r of Object.keys(e))t[r]=Is(e[r]);return t}function Is(e){return typeof e=="bigint"?e.toString():ks(e)}f();c();p();d();m();var Ic=["$connect","$disconnect","$on","$transaction","$use","$extends"],Ds=Ic;var Oc=/^(\s*alter\s)/i,Ms=ee("prisma:client");function Qn(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Oc.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var Hn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(r instanceof Nt)n=r.sql,i={values:wt(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:wt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:wt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:wt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Rs(r),i={values:wt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Ms(`prisma.${e}(${n}, ${i.values})`):Ms(`prisma.${e}(${n})`),{query:n,parameters:i}},Ns={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new ae(t,r)}},Fs={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};f();c();p();d();m();function Wn(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??=_s(r(o)):_s(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function _s(e){return typeof e.then=="function"?e:Promise.resolve(e)}f();c();p();d();m();var Ls={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Kn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??Ls}};function qs(e){return e.includes("tracing")?new Kn:Ls}f();c();p();d();m();function Bs(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}f();c();p();d();m();function Us(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}f();c();p();d();m();var $r=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};f();c();p();d();m();var js=qe(Wi());f();c();p();d();m();function Vr(e){return typeof e.batchRequestIdx=="number"}f();c();p();d();m();function jr(e){return e===null?e:Array.isArray(e)?e.map(jr):typeof e=="object"?kc(e)?Dc(e):Xe(e,jr):e}function kc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Dc({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return w.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new Te(t);case"Json":return JSON.parse(t);default:xe(t,"Unknown tagged value")}}f();c();p();d();m();function $s(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(zn(e.query.arguments)),t.push(zn(e.query.selection)),t.join("")}function zn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${zn(n)})`:r}).join(" ")})`}f();c();p();d();m();var Mc={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Yn(e){return Mc[e]}f();c();p();d();m();var Gr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;iHe("bigint",r));case"bytes-array":return t.map(r=>He("bytes",r));case"decimal-array":return t.map(r=>He("decimal",r));case"datetime-array":return t.map(r=>He("datetime",r));case"date-array":return t.map(r=>He("date",r));case"time-array":return t.map(r=>He("time",r));default:return t}}function Vs(e){let t=[],r=Nc(e);for(let n=0;n{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(h=>Yn(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:_c(o),containsWrite:u,customDataProxyFetch:i})).map((h,v)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[v],h)}catch(S){return S}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Gs(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Yn(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:$s(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(Fc(t),Lc(t,i)||t instanceof Se)throw t;if(t instanceof K&&qc(t)){let u=Js(t.meta);Ur({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=dt({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new K(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new Ie(l,this.client._clientVersion);if(t instanceof se)throw new se(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof J)throw new J(l,this.client._clientVersion);if(t instanceof Ie)throw new Ie(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,js.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(u=>u!=="select"&&u!=="include"),a=Sn(o,s),l=i==="queryRaw"?Vs(a):jr(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function _c(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Gs(e)};xe(e,"Unknown transaction kind")}}function Gs(e){return{id:e.id,payload:e.payload}}function Lc(e,t){return Vr(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function qc(e){return e.code==="P2009"||e.code==="P2012"}function Js(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Js)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}f();c();p();d();m();var Qs="5.21.1";var Hs=Qs;f();c();p();d();m();var Zs=qe(jn());f();c();p();d();m();var B=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};N(B,"PrismaClientConstructorValidationError");var Ws=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],Ks=["pretty","colorless","minimal"],zs=["info","query","warn","error"],Uc={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new B(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=Et(r,t)||` Available datasources: ${t.join(", ")}`;throw new B(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new B(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new B(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new B(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new B('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Lr(t).includes("driverAdapters"))throw new B('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Tt()==="binary")throw new B('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new B(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new B(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Ks.includes(e)){let t=Et(e,Ks);throw new B(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new B(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!zs.includes(r)){let n=Et(r,zs);throw new B(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=Et(i,o);throw new B(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new B(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new B(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new B(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new B('"omit" option is expected to be an object.');if(e===null)throw new B('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=Vc(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(u=>u.name===s);if(!l){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new B(jc(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new B(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=Et(r,t);throw new B(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Xs(e,t){for(let[r,n]of Object.entries(e)){if(!Ws.includes(r)){let i=Et(r,Ws);throw new B(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Uc[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new B('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Et(e,t){if(t.length===0||typeof e!="string")return"";let r=$c(e,t);return r?` Did you mean "${r}"?`:""}function $c(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Zs.default)(e,i)}));r.sort((i,o)=>i.distanceyt(n)===t);if(r)return e[r]}function jc(e,t){let r=ct(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=kr(r,"colorless");return`Error validating "omit" option: - -${i} - -${n}`}f();c();p();d();m();function ea(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u{n[u]=g,a()},g=>{if(!Vr(g)){l(g);return}g.batchRequestIdx===u?l(g):(i||(i=g),a())})})}var _e=ee("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Gc={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Jc=Symbol.for("prisma.client.transaction.id"),Qc={id:0,nextId(){return++this.id}};function Hc(e){class t{constructor(n){this._originalClient=this;this._middlewares=new $r;this._createPrismaPromise=Wn();this.$extends=_o;e=n?.__internal?.configOverride?.(e)??e,Xo(e),n&&Xs(n,e);let i=new mr().on("error",()=>{});this._extensions=Fr.empty(),this._previewFeatures=Lr(e),this._clientVersion=e.clientVersion??Hs,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=qs(this._previewFeatures);let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&vt.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&vt.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=En(n.adapter);let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new J(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new J("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},g=u.debug===!0;g&&ee.enable("prisma:client");let h=vt.resolve(e.dirname,e.relativePath);Pi.existsSync(h)||(h=e.dirname),_e("dirname",e.dirname),_e("relativePath",e.relativePath),_e("cwd",h);let v=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:h,dirname:e.dirname,enableDebugLogs:g,allowTriggerPanic:v.allowTriggerPanic,datamodelPath:vt.join(e.dirname,e.filename??"schema.prisma"),prismaPath:v.binaryPath??void 0,engineEndpoint:v.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Us(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(S=>typeof S=="string"?S==="query":S.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:es(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:mt,getBatchRequestPayload:wr,prismaGraphQLToJSError:Bt,PrismaClientUnknownRequestError:se,PrismaClientInitializationError:J,PrismaClientKnownRequestError:K,debug:ee("prisma:client:accelerateEngine"),engineVersion:ra.version,clientVersion:e.clientVersion}},_e("clientVersion",e.clientVersion),this._engine=cs(e,this._engineConfig),this._requestHandler=new Jr(this,i),l.log)for(let S of l.log){let A=typeof S=="string"?S:S.emit==="stdout"?S.level:null;A&&this.$on(A,R=>{At.log(`${At.tags[A]??""}`,R.message||R.query)})}this._metrics=new Rt(this._engine)}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=Ut(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Li()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Hn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=ta(n,i);return Qn(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new z("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(Qn(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new z(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:As,callsite:Fe(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Hn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...ta(n,i));throw new z("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new z("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Qc.nextId(),s=Bs(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let g=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:u,isolationLevel:g,lock:s};return l.requestTransaction?.(h)??l});return ea(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return Ut(he(Fo(this),[te("_appliedParent",()=>this._appliedParent._createItxClient(n)),te("_createPrismaPromise",()=>Wn(n)),te(Jc,()=>n.id),et(Ds)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Gc,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let g=this._middlewares.get(++a);if(g)return this._tracingHelper.runInChildSpan(s.middleware,M=>g(u,F=>(M?.end(),l(F))));let{runInTransaction:h,args:v,...S}=u,A={...n,...S};v&&(A.args=i.middlewareArgsToRequestArgs(v)),n.transaction!==void 0&&h===!1&&delete A.transaction;let R=await jo(this,A);return A.model?Bo({result:R,modelName:A.model,args:A.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):R};return this._tracingHelper.runInChildSpan(s.operation,()=>l(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:g,unpacker:h,otelParentCtx:v,customDataProxyFetch:S}){try{n=u?u(n):n;let A={name:"serialize"},R=this._tracingHelper.runInChildSpan(A,()=>vs({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return ee.enabled("prisma:client")&&(_e("Prisma Client call:"),_e(`prisma.${i}(${To(n)})`),_e("Generated request:"),_e(JSON.stringify(R,null,2)+` -`)),g?.kind==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:R,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:v,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:S})}catch(A){throw A.clientVersion=this._clientVersion,A}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new z("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function ta(e,t){return Wc(e)?[new ae(e,t),Ns]:[e,Fs]}function Wc(e){return Array.isArray(e)&&Array.isArray(e.raw)}f();c();p();d();m();var Kc=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function zc(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Kc.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}f();c();p();d();m();var export_warnEnvConflicts=void 0;export{_i as Debug,Te as Decimal,Ei as Extensions,Rt as MetricsClient,Se as NotFoundError,J as PrismaClientInitializationError,K as PrismaClientKnownRequestError,Ie as PrismaClientRustPanicError,se as PrismaClientUnknownRequestError,z as PrismaClientValidationError,xi as Public,ae as Sql,el as defineDmmfProperty,ll as empty,Hc as getPrismaClient,Dn as getRuntime,al as join,zc as makeStrictEnum,rl as makeTypedQueryFactory,fn as objectEnumValues,eo as raw,hn as skip,to as sqltag,export_warnEnvConflicts as warnEnvConflicts,fr as warnOnce}; -//# sourceMappingURL=edge-esm.js.map diff --git a/node_modules/@prisma/client/runtime/edge.js b/node_modules/@prisma/client/runtime/edge.js deleted file mode 100644 index c7f4731..0000000 --- a/node_modules/@prisma/client/runtime/edge.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict";var ca=Object.create;var ur=Object.defineProperty;var pa=Object.getOwnPropertyDescriptor;var da=Object.getOwnPropertyNames;var ma=Object.getPrototypeOf,fa=Object.prototype.hasOwnProperty;var Se=(e,t)=>()=>(e&&(t=e(e=0)),t);var Le=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),cr=(e,t)=>{for(var r in t)ur(e,r,{get:t[r],enumerable:!0})},ri=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of da(t))!fa.call(e,i)&&i!==r&&ur(e,i,{get:()=>t[i],enumerable:!(n=pa(t,i))||n.enumerable});return e};var qe=(e,t,r)=>(r=e!=null?ca(ma(e)):{},ri(t||!e||!e.__esModule?ur(r,"default",{value:e,enumerable:!0}):r,e)),ga=e=>ri(ur({},"__esModule",{value:!0}),e);var y,c=Se(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var b,p=Se(()=>{"use strict";b=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,d=Se(()=>{"use strict";E=()=>{};E.prototype=E});var m=Se(()=>{"use strict"});var xi=Le(Ye=>{"use strict";f();c();p();d();m();var ai=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ha=ai(e=>{"use strict";e.byteLength=l,e.toByteArray=g,e.fromByteArray=S;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var M=A.indexOf("=");M===-1&&(M=R);var F=M===R?0:4-M%4;return[M,F]}function l(A){var R=a(A),M=R[0],F=R[1];return(M+F)*3/4-F}function u(A,R,M){return(R+M)*3/4-M}function g(A){var R,M=a(A),F=M[0],q=M[1],D=new n(u(A,F,q)),I=0,ae=q>0?F-4:F,G;for(G=0;G>16&255,D[I++]=R>>8&255,D[I++]=R&255;return q===2&&(R=r[A.charCodeAt(G)]<<2|r[A.charCodeAt(G+1)]>>4,D[I++]=R&255),q===1&&(R=r[A.charCodeAt(G)]<<10|r[A.charCodeAt(G+1)]<<4|r[A.charCodeAt(G+2)]>>2,D[I++]=R>>8&255,D[I++]=R&255),D}function h(A){return t[A>>18&63]+t[A>>12&63]+t[A>>6&63]+t[A&63]}function v(A,R,M){for(var F,q=[],D=R;Dae?ae:I+D));return F===1?(R=A[M-1],q.push(t[R>>2]+t[R<<4&63]+"==")):F===2&&(R=(A[M-2]<<8)+A[M-1],q.push(t[R>>10]+t[R>>4&63]+t[R<<2&63]+"=")),q.join("")}}),ya=ai(e=>{e.read=function(t,r,n,i,o){var s,a,l=o*8-i-1,u=(1<>1,h=-7,v=n?o-1:0,S=n?-1:1,A=t[r+v];for(v+=S,s=A&(1<<-h)-1,A>>=-h,h+=l;h>0;s=s*256+t[r+v],v+=S,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+v],v+=S,h-=8);if(s===0)s=1-g;else{if(s===u)return a?NaN:(A?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(A?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,l,u,g=s*8-o-1,h=(1<>1,S=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:s-1,R=i?1:-1,M=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+v>=1?r+=S/u:r+=S*Math.pow(2,1-v),r*u>=2&&(a++,u/=2),a+v>=h?(l=0,a=h):a+v>=1?(l=(r*u-1)*Math.pow(2,o),a=a+v):(l=r*Math.pow(2,v-1)*Math.pow(2,o),a=0));o>=8;t[n+A]=l&255,A+=R,l/=256,o-=8);for(a=a<0;t[n+A]=a&255,A+=R,a/=256,g-=8);t[n+A-R]|=M*128}}),en=ha(),Ke=ya(),ni=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ye.Buffer=T;Ye.SlowBuffer=va;Ye.INSPECT_MAX_BYTES=50;var pr=2147483647;Ye.kMaxLength=pr;T.TYPED_ARRAY_SUPPORT=wa();!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function wa(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function xe(e){if(e>pr)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return nn(e)}return li(e,t,r)}T.poolSize=8192;function li(e,t,r){if(typeof e=="string")return ba(e,t);if(ArrayBuffer.isView(e))return xa(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(de(e,ArrayBuffer)||e&&de(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(de(e,SharedArrayBuffer)||e&&de(e.buffer,SharedArrayBuffer)))return ci(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return T.from(n,t,r);let i=Pa(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}T.from=function(e,t,r){return li(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function ui(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Ea(e,t,r){return ui(e),e<=0?xe(e):t!==void 0?typeof r=="string"?xe(e).fill(t,r):xe(e).fill(t):xe(e)}T.alloc=function(e,t,r){return Ea(e,t,r)};function nn(e){return ui(e),xe(e<0?0:on(e)|0)}T.allocUnsafe=function(e){return nn(e)};T.allocUnsafeSlow=function(e){return nn(e)};function ba(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=pi(e,t)|0,n=xe(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function tn(e){let t=e.length<0?0:on(e.length)|0,r=xe(t);for(let n=0;n=pr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+pr.toString(16)+" bytes");return e|0}function va(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(de(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),de(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function pi(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||de(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return rn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return bi(e).length;default:if(i)return n?-1:rn(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=pi;function Ta(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Na(this,t,r);case"utf8":case"utf-8":return mi(this,t,r);case"ascii":return Da(this,t,r);case"latin1":case"binary":return Ma(this,t,r);case"base64":return Oa(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fa(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function Be(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};ni&&(T.prototype[ni]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(de(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,an(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:ii(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):ii(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ii(e,t,r,n,i){let o=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,r/=2}function l(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let u;if(i){let g=-1;for(u=r;us&&(r=s-a),u=r;u>=0;u--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return Ca(this,e,t,r);case"utf8":case"utf-8":return Aa(this,e,t,r);case"ascii":case"latin1":case"binary":return Ra(this,e,t,r);case"base64":return Sa(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ia(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Oa(e,t,r){return t===0&&r===e.length?en.fromByteArray(e):en.fromByteArray(e.slice(t,r))}function mi(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let l,u,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:l=e[i+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(s=h));break;case 3:l=e[i+1],u=e[i+2],(l&192)===128&&(u&192)===128&&(h=(o&15)<<12|(l&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:l=e[i+1],u=e[i+2],g=e[i+3],(l&192)===128&&(u&192)===128&&(g&192)===128&&(h=(o&15)<<18|(l&63)<<12|(u&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return ka(n)}var oi=4096;function ka(e){let t=e.length;if(t<=oi)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||H(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||H(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||H(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||H(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||H(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||H(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=Ie(function(e){e=e>>>0,ze(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Pt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,ze(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Pt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||H(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||H(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||H(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||H(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||H(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=Ie(function(e){e=e>>>0,ze(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Pt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,ze(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Pt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||H(e,4,this.length),Ke.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||H(e,4,this.length),Ke.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||H(e,8,this.length),Ke.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||H(e,8,this.length),Ke.read(this,e,!1,52,8)};function re(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;re(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;re(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function fi(e,t,r,n,i){Ei(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function gi(e,t,r,n,i){Ei(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}T.prototype.writeBigUInt64LE=Ie(function(e,t=0){return fi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=Ie(function(e,t=0){return gi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);re(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);re(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||re(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};T.prototype.writeBigInt64LE=Ie(function(e,t=0){return fi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=Ie(function(e,t=0){return gi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function hi(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function yi(e,t,r,n,i){return t=+t,r=r>>>0,i||hi(e,t,r,4,34028234663852886e22,-34028234663852886e22),Ke.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return yi(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return yi(this,e,t,!1,r)};function wi(e,t,r,n,i){return t=+t,r=r>>>0,i||hi(e,t,r,8,17976931348623157e292,-17976931348623157e292),Ke.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return wi(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return wi(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let i;if(typeof e=="number")for(i=t;i2**32?i=si(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=si(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function si(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function _a(e,t,r){ze(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&Pt(t,e.length-(r+1))}function Ei(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new We.ERR_OUT_OF_RANGE("value",a,e)}_a(n,i,o)}function ze(e,t){if(typeof e!="number")throw new We.ERR_INVALID_ARG_TYPE(t,"number",e)}function Pt(e,t,r){throw Math.floor(e)!==e?(ze(e,r),new We.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new We.ERR_BUFFER_OUT_OF_BOUNDS:new We.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var La=/[^+/0-9A-Za-z-_]/g;function qa(e){if(e=e.split("=")[0],e=e.trim().replace(La,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function rn(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Ba(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function bi(e){return en.toByteArray(qa(e))}function dr(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function de(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function an(e){return e!==e}var $a=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Ie(e){return typeof BigInt>"u"?Va:e}function Va(){throw new Error("BigInt not supported")}});var w,f=Se(()=>{"use strict";w=qe(xi())});function ja(){return!1}var Ga,Ja,Ci,Ai=Se(()=>{"use strict";f();c();p();d();m();Ga={},Ja={existsSync:ja,promises:Ga},Ci=Ja});function Ya(...e){return e.join("/")}function Za(...e){return e.join("/")}var Ui,Xa,el,Tt,$i=Se(()=>{"use strict";f();c();p();d();m();Ui="/",Xa={sep:Ui},el={resolve:Ya,posix:Xa,join:Za,sep:Ui},Tt=el});var hr,ji=Se(()=>{"use strict";f();c();p();d();m();hr=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var Ji=Le((dm,Gi)=>{"use strict";f();c();p();d();m();Gi.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var Wi=Le((Tm,Hi)=>{"use strict";f();c();p();d();m();Hi.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var zi=Le((Om,Ki)=>{"use strict";f();c();p();d();m();var sl=Wi();Ki.exports=e=>typeof e=="string"?e.replace(sl(),""):e});var ro=Le((Vh,pl)=>{pl.exports={name:"@prisma/engines-version",version:"5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"bf0e5e8a04cada8225617067eaa03d041e2bba36"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.34",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var no=Le(()=>{"use strict";f();c();p();d();m()});var Hn=Le((_2,gs)=>{"use strict";f();c();p();d();m();gs.exports=function(){function e(t,r,n,i,o){return tn?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;sdn,Decimal:()=>we,Extensions:()=>ln,MetricsClient:()=>et,NotFoundError:()=>ve,PrismaClientInitializationError:()=>J,PrismaClientKnownRequestError:()=>W,PrismaClientRustPanicError:()=>Te,PrismaClientUnknownRequestError:()=>ne,PrismaClientValidationError:()=>K,Public:()=>un,Sql:()=>ie,defineDmmfProperty:()=>Xi,empty:()=>oo,getPrismaClient:()=>aa,getRuntime:()=>Ur,join:()=>io,makeStrictEnum:()=>la,makeTypedQueryFactory:()=>to,objectEnumValues:()=>wr,raw:()=>vn,skip:()=>Er,sqltag:()=>Tn,warnEnvConflicts:()=>void 0,warnOnce:()=>St});module.exports=ga(Zc);f();c();p();d();m();var ln={};cr(ln,{defineExtension:()=>Pi,getExtensionContext:()=>vi});f();c();p();d();m();f();c();p();d();m();function Pi(e){return typeof e=="function"?e:t=>t.$extends(e)}f();c();p();d();m();function vi(e){return e}var un={};cr(un,{validator:()=>Ti});f();c();p();d();m();f();c();p();d();m();function Ti(...e){return t=>t}f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();var cn,Ri,Si,Ii,Oi=!0;typeof y<"u"&&({FORCE_COLOR:cn,NODE_DISABLE_COLORS:Ri,NO_COLOR:Si,TERM:Ii}=y.env||{},Oi=y.stdout&&y.stdout.isTTY);var Qa={enabled:!Ri&&Si==null&&Ii!=="dumb"&&(cn!=null&&cn!=="0"||Oi)};function V(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Qa.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Kp=V(0,0),mr=V(1,22),fr=V(2,22),zp=V(3,23),ki=V(4,24),Yp=V(7,27),Zp=V(8,28),Xp=V(9,29),ed=V(30,39),Ze=V(31,39),Di=V(32,39),Mi=V(33,39),Ni=V(34,39),td=V(35,39),Fi=V(36,39),rd=V(37,39),_i=V(90,39),nd=V(90,39),id=V(40,49),od=V(41,49),sd=V(42,49),ad=V(43,49),ld=V(44,49),ud=V(45,49),cd=V(46,49),pd=V(47,49);f();c();p();d();m();var Ha=100,Li=["green","yellow","blue","magenta","cyan","red"],gr=[],qi=Date.now(),Wa=0,pn=typeof y<"u"?y.env:{};globalThis.DEBUG??=pn.DEBUG??"";globalThis.DEBUG_COLORS??=pn.DEBUG_COLORS?pn.DEBUG_COLORS==="true":!0;var vt={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function Ka(e){let t={color:Li[Wa++%Li.length],enabled:vt.enabled(e),namespace:e,log:vt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&gr.push([o,...n]),gr.length>Ha&&gr.shift(),vt.enabled(o)||i){let l=n.map(g=>typeof g=="string"?g:za(g)),u=`+${Date.now()-qi}ms`;qi=Date.now(),a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var dn=new Proxy(Ka,{get:(e,t)=>vt[t],set:(e,t,r)=>vt[t]=r});function za(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function Bi(){gr.length=0}var ee=dn;f();c();p();d();m();f();c();p();d();m();var Vi="library";function Ct(e){let t=tl();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":Vi)}function tl(){let e=y.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}f();c();p();d();m();f();c();p();d();m();var Ue;(t=>{let e;(I=>(I.findUnique="findUnique",I.findUniqueOrThrow="findUniqueOrThrow",I.findFirst="findFirst",I.findFirstOrThrow="findFirstOrThrow",I.findMany="findMany",I.create="create",I.createMany="createMany",I.createManyAndReturn="createManyAndReturn",I.update="update",I.updateMany="updateMany",I.upsert="upsert",I.delete="delete",I.deleteMany="deleteMany",I.groupBy="groupBy",I.count="count",I.aggregate="aggregate",I.findRaw="findRaw",I.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(Ue||={});var Rt={};cr(Rt,{error:()=>il,info:()=>nl,log:()=>rl,query:()=>ol,should:()=>Qi,tags:()=>At,warn:()=>mn});f();c();p();d();m();var At={error:Ze("prisma:error"),warn:Mi("prisma:warn"),info:Fi("prisma:info"),query:Ni("prisma:query")},Qi={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function rl(...e){console.log(...e)}function mn(e,...t){Qi.warn()&&console.warn(`${At.warn} ${e}`,...t)}function nl(e,...t){console.info(`${At.info} ${e}`,...t)}function il(e,...t){console.error(`${At.error} ${e}`,...t)}function ol(e,...t){console.log(`${At.query} ${e}`,...t)}f();c();p();d();m();function Pe(e,t){throw new Error(t)}f();c();p();d();m();function fn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}f();c();p();d();m();var gn=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});f();c();p();d();m();function Xe(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}f();c();p();d();m();function hn(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{Yi.has(e)||(Yi.add(e),mn(t,...r))};f();c();p();d();m();var W=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};N(W,"PrismaClientKnownRequestError");var ve=class extends W{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};N(ve,"NotFoundError");f();c();p();d();m();var J=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};N(J,"PrismaClientInitializationError");f();c();p();d();m();var Te=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};N(Te,"PrismaClientRustPanicError");f();c();p();d();m();var ne=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};N(ne,"PrismaClientUnknownRequestError");f();c();p();d();m();var K=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};N(K,"PrismaClientValidationError");f();c();p();d();m();var et=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};f();c();p();d();m();f();c();p();d();m();function It(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function Xi(e,t){let r=It(()=>al(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function al(e){return{datamodel:{models:yn(e.models),enums:yn(e.enums),types:yn(e.types)}}}function yn(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}f();c();p();d();m();var yr=Symbol(),wn=new WeakMap,Ce=class{constructor(t){t===yr?wn.set(this,`Prisma.${this._getName()}`):wn.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return wn.get(this)}},Ot=class extends Ce{_getNamespace(){return"NullTypes"}},kt=class extends Ot{};En(kt,"DbNull");var Dt=class extends Ot{};En(Dt,"JsonNull");var Mt=class extends Ot{};En(Mt,"AnyNull");var wr={classes:{DbNull:kt,JsonNull:Dt,AnyNull:Mt},instances:{DbNull:new kt(yr),JsonNull:new Dt(yr),AnyNull:new Mt(yr)}};function En(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}f();c();p();d();m();var eo=Symbol(),Nt=class{constructor(t){if(t!==eo)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?Er:t}},Er=new Nt(eo);function me(e){return e instanceof Nt}f();c();p();d();m();var bn=new WeakMap,Ft=class{constructor(t,r){bn.set(this,{sql:t,values:r})}get sql(){return bn.get(this).sql}get values(){return bn.get(this).values}};function to(e){return(...t)=>new Ft(e,t)}f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();function _t(e){return{ok:!1,error:e,map(){return _t(e)},flatMap(){return _t(e)}}}var xn=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},Pn=e=>{let t=new xn,r=fe(t,e.transactionContext.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:fe(t,e.queryRaw.bind(e)),executeRaw:fe(t,e.executeRaw.bind(e)),provider:e.provider,transactionContext:async(...i)=>(await r(...i)).map(s=>ll(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=cl(t,e.getConnectionInfo.bind(e))),n},ll=(e,t)=>{let r=fe(e,t.startTransaction.bind(t));return{adapterName:t.adapterName,provider:t.provider,queryRaw:fe(e,t.queryRaw.bind(t)),executeRaw:fe(e,t.executeRaw.bind(t)),startTransaction:async(...n)=>(await r(...n)).map(o=>ul(e,o))}},ul=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:fe(e,t.queryRaw.bind(t)),executeRaw:fe(e,t.executeRaw.bind(t)),commit:fe(e,t.commit.bind(t)),rollback:fe(e,t.rollback.bind(t))});function fe(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}function cl(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}var sa=qe(ro());var Xk=qe(no());ji();Ai();$i();f();c();p();d();m();var ie=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}f();c();p();d();m();f();c();p();d();m();var br={enumerable:!0,configurable:!0,writable:!0};function xr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>br,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var so=Symbol.for("nodejs.util.inspect.custom");function he(e,t){let r=dl(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=ao(Reflect.ownKeys(o),r),a=ao(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{...br,...l?.getPropertyDescriptor(s)}:br:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[so]=function(){let o={...this};return delete o[so],o},i}function dl(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function ao(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}f();c();p();d();m();function tt(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}f();c();p();d();m();function Pr(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}f();c();p();d();m();f();c();p();d();m();var rt=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r,n=(i,o)=>o.write(i)){let i=r.length-1;for(let o=0;o0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};f();c();p();d();m();f();c();p();d();m();function lo(e){return e.substring(0,1).toLowerCase()+e.substring(1)}f();c();p();d();m();function nt(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function vr(e){return e.toString()!=="Invalid Date"}f();c();p();d();m();f();c();p();d();m();var it=9e15,Me=1e9,Cn="0123456789abcdef",Cr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ar="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",An={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-it,maxE:it,crypto:!1},mo,Ae,_=!0,Sr="[DecimalError] ",De=Sr+"Invalid argument: ",fo=Sr+"Precision limit exceeded",go=Sr+"crypto unavailable",ho="[object Decimal]",X=Math.floor,Q=Math.pow,ml=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,fl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,gl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,yo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,pe=1e7,k=7,hl=9007199254740991,yl=Cr.length-1,Rn=Ar.length-1,C={toStringTag:ho};C.absoluteValue=C.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),O(e)};C.ceil=function(){return O(new this.constructor(this),this.e+1,2)};C.clampedTo=C.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(De+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};C.comparedTo=C.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};C.cosine=C.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+k,n.rounding=1,r=wl(n,Po(n,r)),n.precision=e,n.rounding=t,O(Ae==2||Ae==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};C.cubeRoot=C.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(_=!1,o=g.s*Q(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=Y(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=Q(r,1/3),e=X((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(g),n=U(u.plus(g).times(a),u.plus(l),s+2,1),Y(a.d).slice(0,s)===(r=Y(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(O(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(O(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return _=!0,O(n,e,h.rounding,t)};C.decimalPlaces=C.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-X(this.e/k))*k,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};C.dividedBy=C.div=function(e){return U(this,new this.constructor(e))};C.dividedToIntegerBy=C.divToInt=function(e){var t=this,r=t.constructor;return O(U(t,new r(e),0,1,1),r.precision,r.rounding)};C.equals=C.eq=function(e){return this.cmp(e)===0};C.floor=function(){return O(new this.constructor(this),this.e+1,3)};C.greaterThan=C.gt=function(e){return this.cmp(e)>0};C.greaterThanOrEqualTo=C.gte=function(e){var t=this.cmp(e);return t==1||t===0};C.hyperbolicCosine=C.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Or(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=ot(s,1,o.times(t),new s(1),!0);for(var l,u=e,g=new s(8);u--;)l=o.times(o),o=a.minus(l.times(g.minus(l.times(g))));return O(o,s.precision=r,s.rounding=n,!0)};C.hyperbolicSine=C.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=ot(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Or(5,e)),i=ot(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,O(i,t,r,!0)};C.hyperbolicTangent=C.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,U(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};C.inverseCosine=C.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?ce(r,i,o):new r(0):new r(NaN):t.isZero()?ce(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=ce(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};C.inverseHyperbolicCosine=C.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,_=!1,r=r.times(r).minus(1).sqrt().plus(r),_=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};C.inverseHyperbolicSine=C.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,_=!1,r=r.times(r).plus(1).sqrt().plus(r),_=!0,n.precision=e,n.rounding=t,r.ln())};C.inverseHyperbolicTangent=C.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?O(new o(i),e,t,!0):(o.precision=r=n-i.e,i=U(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};C.inverseSine=C.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=ce(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};C.inverseTangent=C.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,v=g.rounding;if(u.isFinite()){if(u.isZero())return new g(u);if(u.abs().eq(1)&&h+4<=Rn)return s=ce(g,h+4,v).times(.25),s.s=u.s,s}else{if(!u.s)return new g(NaN);if(h+4<=Rn)return s=ce(g,h+4,v).times(.5),s.s=u.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/k+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(_=!1,t=Math.ceil(a/k),n=1,l=u.times(u),s=new g(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};C.isNaN=function(){return!this.s};C.isNegative=C.isNeg=function(){return this.s<0};C.isPositive=C.isPos=function(){return this.s>0};C.isZero=function(){return!!this.d&&this.d[0]===0};C.lessThan=C.lt=function(e){return this.cmp(e)<0};C.lessThanOrEqualTo=C.lte=function(e){return this.cmp(e)<1};C.logarithm=C.log=function(e){var t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,v=g.rounding,S=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new g(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(_=!1,a=h+S,s=ke(u,a),n=t?Rr(g,a+10):ke(e,a),l=U(s,n,a,1),qt(l.d,i=h,v))do if(a+=10,s=ke(u,a),n=t?Rr(g,a+10):ke(e,a),l=U(s,n,a,1),!o){+Y(l.d).slice(i+1,i+15)+1==1e14&&(l=O(l,h+1,0));break}while(qt(l.d,i+=10,v));return _=!0,O(l,h,v)};C.minus=C.sub=function(e){var t,r,n,i,o,s,a,l,u,g,h,v,S=this,A=S.constructor;if(e=new A(e),!S.d||!e.d)return!S.s||!e.s?e=new A(NaN):S.d?e.s=-e.s:e=new A(e.d||S.s!==e.s?S:NaN),e;if(S.s!=e.s)return e.s=-e.s,S.plus(e);if(u=S.d,v=e.d,a=A.precision,l=A.rounding,!u[0]||!v[0]){if(v[0])e.s=-e.s;else if(u[0])e=new A(S);else return new A(l===3?-0:0);return _?O(e,a,l):e}if(r=X(e.e/k),g=X(S.e/k),u=u.slice(),o=g-r,o){for(h=o<0,h?(t=u,o=-o,s=v.length):(t=v,r=g,s=u.length),n=Math.max(Math.ceil(a/k),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=v.length,h=n0;--n)u[s++]=0;for(n=v.length;n>o;){if(u[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=g.length,s-i<0&&(i=s,r=g,g=u,u=r),t=0;i;)t=(u[--i]=u[i]+g[i]+t)/pe|0,u[i]%=pe;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=Ir(u,n),_?O(e,a,l):e};C.precision=C.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(De+e);return r.d?(t=wo(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};C.round=function(){var e=this,t=e.constructor;return O(new t(e),e.e+1,t.rounding)};C.sine=C.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+k,n.rounding=1,r=bl(n,Po(n,r)),n.precision=e,n.rounding=t,O(Ae>2?r.neg():r,e,t,!0)):new n(NaN)};C.squareRoot=C.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,g=s.constructor;if(u!==1||!a||!a[0])return new g(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(_=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=Y(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=X((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new g(t)):n=new g(u.toString()),r=(l=g.precision)+3;;)if(o=n,n=o.plus(U(s,o,r+2,1)).times(.5),Y(o.d).slice(0,r)===(t=Y(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(O(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(O(n,l+1,1),e=!n.times(n).eq(s));break}return _=!0,O(n,l,g.rounding,e)};C.tangent=C.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=U(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,O(Ae==2||Ae==4?r.neg():r,e,t,!0)):new n(NaN)};C.times=C.mul=function(e){var t,r,n,i,o,s,a,l,u,g=this,h=g.constructor,v=g.d,S=(e=new h(e)).d;if(e.s*=g.s,!v||!v[0]||!S||!S[0])return new h(!e.s||v&&!v[0]&&!S||S&&!S[0]&&!v?NaN:!v||!S?e.s/0:e.s*0);for(r=X(g.e/k)+X(e.e/k),l=v.length,u=S.length,l=0;){for(t=0,i=l+n;i>n;)a=o[i]+S[n]*v[i-n-1]+t,o[i--]=a%pe|0,t=a/pe|0;o[i]=(o[i]+t)%pe|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Ir(o,r),_?O(e,h.precision,h.rounding):e};C.toBinary=function(e,t){return On(this,2,e,t)};C.toDecimalPlaces=C.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(oe(e,0,Me),t===void 0?t=n.rounding:oe(t,0,8),O(r,e+r.e+1,t))};C.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ye(n,!0):(oe(e,0,Me),t===void 0?t=i.rounding:oe(t,0,8),n=O(new i(n),e+1,t),r=ye(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};C.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=ye(i):(oe(e,0,Me),t===void 0?t=o.rounding:oe(t,0,8),n=O(new o(i),e+i.e+1,t),r=ye(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};C.toFraction=function(e){var t,r,n,i,o,s,a,l,u,g,h,v,S=this,A=S.d,R=S.constructor;if(!A)return new R(S);if(u=r=new R(1),n=l=new R(0),t=new R(n),o=t.e=wo(A)-S.e-1,s=o%k,t.d[0]=Q(10,s<0?k+s:s),e==null)e=o>0?t:u;else{if(a=new R(e),!a.isInt()||a.lt(u))throw Error(De+a);e=a.gt(t)?o>0?t:u:a}for(_=!1,a=new R(Y(A)),g=R.precision,R.precision=o=A.length*k*2;h=U(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(h.times(i)),l=i,i=t,t=a.minus(h.times(i)),a=i;return i=U(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=S.s,v=U(u,n,o,1).minus(S).abs().cmp(U(l,r,o,1).minus(S).abs())<1?[u,n]:[l,r],R.precision=g,_=!0,v};C.toHexadecimal=C.toHex=function(e,t){return On(this,16,e,t)};C.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:oe(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(_=!1,r=U(r,e,0,t,1).times(e),_=!0,O(r)):(e.s=r.s,r=e),r};C.toNumber=function(){return+this};C.toOctal=function(e,t){return On(this,8,e,t)};C.toPower=C.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(Q(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return O(a,n,o);if(t=X(e.e/k),t>=e.d.length-1&&(r=u<0?-u:u)<=hl)return i=Eo(l,a,r,n),e.s<0?new l(1).div(i):O(i,n,o);if(s=a.s,s<0){if(tl.maxE+1||t0?s/0:0):(_=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Sn(e.times(ke(a,n+r)),n),i.d&&(i=O(i,n+5,1),qt(i.d,n,o)&&(t=n+10,i=O(Sn(e.times(ke(a,t+r)),t),t+5,1),+Y(i.d).slice(n+1,n+15)+1==1e14&&(i=O(i,n+1,0)))),i.s=s,_=!0,l.rounding=o,O(i,n,o))};C.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ye(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(oe(e,1,Me),t===void 0?t=i.rounding:oe(t,0,8),n=O(new i(n),e,t),r=ye(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};C.toSignificantDigits=C.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(oe(e,1,Me),t===void 0?t=n.rounding:oe(t,0,8)),O(new n(r),e,t)};C.toString=function(){var e=this,t=e.constructor,r=ye(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};C.truncated=C.trunc=function(){return O(new this.constructor(this),this.e+1,1)};C.valueOf=C.toJSON=function(){var e=this,t=e.constructor,r=ye(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Y(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(De+e)}function qt(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=k,i=0):(i=Math.ceil((t+1)/k),t%=k),o=Q(10,k-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==Q(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==Q(10,t-3)-1,s}function Tr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function wl(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Or(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=ot(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var U=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,l){var u,g,h,v,S,A,R,M,F,q,D,I,ae,G,Yr,sr,xt,Zr,ue,ar,lr=n.constructor,Xr=n.s==i.s?1:-1,Z=n.d,$=i.d;if(!Z||!Z[0]||!$||!$[0])return new lr(!n.s||!i.s||(Z?$&&Z[0]==$[0]:!$)?NaN:Z&&Z[0]==0||!$?Xr*0:Xr/0);for(l?(S=1,g=n.e-i.e):(l=pe,S=k,g=X(n.e/S)-X(i.e/S)),ue=$.length,xt=Z.length,F=new lr(Xr),q=F.d=[],h=0;$[h]==(Z[h]||0);h++);if($[h]>(Z[h]||0)&&g--,o==null?(G=o=lr.precision,s=lr.rounding):a?G=o+(n.e-i.e)+1:G=o,G<0)q.push(1),A=!0;else{if(G=G/S+2|0,h=0,ue==1){for(v=0,$=$[0],G++;(h1&&($=e($,v,l),Z=e(Z,v,l),ue=$.length,xt=Z.length),sr=ue,D=Z.slice(0,ue),I=D.length;I=l/2&&++Zr;do v=0,u=t($,D,ue,I),u<0?(ae=D[0],ue!=I&&(ae=ae*l+(D[1]||0)),v=ae/Zr|0,v>1?(v>=l&&(v=l-1),R=e($,v,l),M=R.length,I=D.length,u=t(R,D,M,I),u==1&&(v--,r(R,ue=10;v/=10)h++;F.e=h+g*S-1,O(F,a?o+F.e+1:o,s,A)}return F}}();function O(e,t,r,n){var i,o,s,a,l,u,g,h,v,S=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=k,s=t,g=h[v=0],l=g/Q(10,i-s-1)%10|0;else if(v=Math.ceil((o+1)/k),a=h.length,v>=a)if(n){for(;a++<=v;)h.push(0);g=l=0,i=1,o%=k,s=o-k+1}else break e;else{for(g=a=h[v],i=1;a>=10;a/=10)i++;o%=k,s=o-k+i,l=s<0?0:g/Q(10,i-s-1)%10|0}if(n=n||t<0||h[v+1]!==void 0||(s<0?g:g%Q(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?g/Q(10,i-s):0:h[v-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,u?(t-=e.e+1,h[0]=Q(10,(k-t%k)%k),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=v,a=1,v--):(h.length=v+1,a=Q(10,k-o),h[v]=s>0?(g/Q(10,i-s)%Q(10,s)|0)*a:0),u)for(;;)if(v==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==pe&&(h[0]=1));break}else{if(h[v]+=a,h[v]!=pe)break;h[v--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return _&&(e.e>S.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Oe(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Oe(-i-1)+o,r&&(n=r-s)>0&&(o+=Oe(n))):i>=s?(o+=Oe(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Oe(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Oe(n))),o}function Ir(e,t){var r=e[0];for(t*=k;r>=10;r/=10)t++;return t}function Rr(e,t,r){if(t>yl)throw _=!0,r&&(e.precision=r),Error(fo);return O(new e(Cr),t,1,!0)}function ce(e,t,r){if(t>Rn)throw Error(fo);return O(new e(Ar),t,r,!0)}function wo(e){var t=e.length-1,r=t*k+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Oe(e){for(var t="";e--;)t+="0";return t}function Eo(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/k+4);for(_=!1;;){if(r%2&&(o=o.times(t),co(o.d,s)&&(i=!0)),r=X(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),co(t.d,s)}return _=!0,o}function uo(e){return e.d[e.d.length-1]&1}function bo(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new v(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(_=!1,l=A):l=t,a=new v(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(Q(2,h))/Math.LN10*2+5|0,l+=n,r=o=s=new v(1),v.precision=l;;){if(o=O(o.times(e),l,1),r=r.times(++g),a=s.plus(U(o,r,l,1)),Y(a.d).slice(0,l)===Y(s.d).slice(0,l)){for(i=h;i--;)s=O(s.times(s),l,1);if(t==null)if(u<3&&qt(s.d,l-n,S,u))v.precision=l+=10,r=o=a=new v(1),g=0,u++;else return O(s,v.precision=A,S,_=!0);else return v.precision=A,s}s=a}}function ke(e,t){var r,n,i,o,s,a,l,u,g,h,v,S=1,A=10,R=e,M=R.d,F=R.constructor,q=F.rounding,D=F.precision;if(R.s<0||!M||!M[0]||!R.e&&M[0]==1&&M.length==1)return new F(M&&!M[0]?-1/0:R.s!=1?NaN:M?0:R);if(t==null?(_=!1,g=D):g=t,F.precision=g+=A,r=Y(M),n=r.charAt(0),Math.abs(o=R.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)R=R.times(e),r=Y(R.d),n=r.charAt(0),S++;o=R.e,n>1?(R=new F("0."+r),o++):R=new F(n+"."+r.slice(1))}else return u=Rr(F,g+2,D).times(o+""),R=ke(new F(n+"."+r.slice(1)),g-A).plus(u),F.precision=D,t==null?O(R,D,q,_=!0):R;for(h=R,l=s=R=U(R.minus(1),R.plus(1),g,1),v=O(R.times(R),g,1),i=3;;){if(s=O(s.times(v),g,1),u=l.plus(U(s,new F(i),g,1)),Y(u.d).slice(0,g)===Y(l.d).slice(0,g))if(l=l.times(2),o!==0&&(l=l.plus(Rr(F,g+2,D).times(o+""))),l=U(l,new F(S),g,1),t==null)if(qt(l.d,g-A,q,a))F.precision=g+=A,u=s=R=U(h.minus(1),h.plus(1),g,1),v=O(R.times(R),g,1),i=a=1;else return O(l,F.precision=D,q,_=!0);else return F.precision=D,l;l=u,i+=2}}function xo(e){return String(e.s*e.s/0)}function In(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%k,r<0&&(n+=k),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),yo.test(t))return In(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(fl.test(t))r=16,t=t.toLowerCase();else if(ml.test(t))r=2;else if(gl.test(t))r=8;else throw Error(De+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Eo(n,new n(r),o,o*2)),u=Tr(t,r,pe),g=u.length-1,o=g;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=Ir(u,g),e.d=u,_=!1,s&&(e=U(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?Q(2,l):Ve.pow(2,l))),_=!0,e)}function bl(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:ot(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Or(5,r)),t=ot(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function ot(e,t,r,n,i){var o,s,a,l,u=1,g=e.precision,h=Math.ceil(g/k);for(_=!1,l=r.times(r),a=new e(n);;){if(s=U(a.times(l),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=U(s.times(l),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return _=!0,s.d.length=h+1,s}function Or(e,t){for(var r=e;--t;)r*=e;return r}function Po(e,t){var r,n=t.s<0,i=ce(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Ae=n?4:1,t;if(r=t.divToInt(i),r.isZero())Ae=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Ae=uo(r)?n?2:3:n?4:1,t;Ae=uo(r)?n?1:4:n?3:2}return t.minus(i).abs()}function On(e,t,r,n){var i,o,s,a,l,u,g,h,v,S=e.constructor,A=r!==void 0;if(A?(oe(r,1,Me),n===void 0?n=S.rounding:oe(n,0,8)):(r=S.precision,n=S.rounding),!e.isFinite())g=xo(e);else{for(g=ye(e),s=g.indexOf("."),A?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),v=new S(1),v.e=g.length-s,v.d=Tr(ye(v),10,i),v.e=v.d.length),h=Tr(g,10,i),o=l=h.length;h[--l]==0;)h.pop();if(!h[0])g=A?"0p+0":"0";else{if(s<0?o--:(e=new S(e),e.d=h,e.e=o,e=U(e,v,r,n,0,i),h=e.d,o=e.e,u=mo),s=h[r],a=i/2,u=u||h[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,u)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)g+="0";for(h=Tr(g,i,t),l=h.length;!h[l-1];--l);for(s=1,g="1.";sl)for(o-=l;o--;)g+="0";else ot)return e.length=t,!0}function xl(e){return new this(e).abs()}function Pl(e){return new this(e).acos()}function vl(e){return new this(e).acosh()}function Tl(e,t){return new this(e).plus(t)}function Cl(e){return new this(e).asin()}function Al(e){return new this(e).asinh()}function Rl(e){return new this(e).atan()}function Sl(e){return new this(e).atanh()}function Il(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=ce(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ce(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ce(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(U(e,t,o,1)),t=ce(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(U(e,t,o,1)),r}function Ol(e){return new this(e).cbrt()}function kl(e){return O(e=new this(e),e.e+1,2)}function Dl(e,t,r){return new this(e).clamp(t,r)}function Ml(e){if(!e||typeof e!="object")throw Error(Sr+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Me,"rounding",0,8,"toExpNeg",-it,0,"toExpPos",0,it,"maxE",0,it,"minE",-it,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(De+r+": "+n);if(r="crypto",i&&(this[r]=An[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(go);else this[r]=!1;else throw Error(De+r+": "+n);return this}function Nl(e){return new this(e).cos()}function Fl(e){return new this(e).cosh()}function vo(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,po(o)){u.s=o.s,_?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;_?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(go);else for(;o=10;i/=10)n++;n`}};function at(e){return e instanceof Bt}f();c();p();d();m();f();c();p();d();m();var kr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};f();c();p();d();m();var Dr=e=>e,Mr={bold:Dr,red:Dr,green:Dr,dim:Dr,enabled:!1},To={bold:mr,red:Ze,green:Di,dim:fr,enabled:!0},lt={write(e){e.writeLine(",")}};f();c();p();d();m();var Ee=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};f();c();p();d();m();var Ne=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var ut=class extends Ne{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new kr(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new Ee("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(lt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};f();c();p();d();m();var Co=": ",Nr=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Co.length}write(t){let r=new Ee(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Co).write(this.value)}};f();c();p();d();m();var ct=class e extends Ne{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let l;if(s.value instanceof e?l=s.value.getField(a):s.value instanceof ut&&(l=s.value.getField(Number(a))),!l)return;s=l}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new Ee("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(lt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};f();c();p();d();m();var z=class extends Ne{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Ee(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var kn=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function pt(e){return new kn(Ao(e))}function Ao(e){let t=new ct;for(let[r,n]of Object.entries(e)){let i=new Nr(r,Ro(n));t.addField(i)}return t}function Ro(e){if(typeof e=="string")return new z(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new z(String(e));if(typeof e=="bigint")return new z(`${e}n`);if(e===null)return new z("null");if(e===void 0)return new z("undefined");if(st(e))return new z(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new z(`Buffer.alloc(${e.byteLength})`):new z(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=vr(e)?e.toISOString():"Invalid Date";return new z(`new Date("${t}")`)}return e instanceof Ce?new z(`Prisma.${e._getName()}`):at(e)?new z(`prisma.${lo(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?au(e):typeof e=="object"?Ao(e):new z(Object.prototype.toString.call(e))}function au(e){let t=new ut;for(let r of e)t.addItem(Ro(r));return t}function Fr(e,t){let r=t==="pretty"?To:Mr,n=e.renderAllMessages(r),i=new rt(0,{colors:r}).write(e).toString();return{message:n,args:i}}function So(e){if(e===void 0)return"";let t=pt(e);return new rt(0,{colors:Mr}).write(t).toString()}f();c();p();d();m();var lu="P2037";function Ut({error:e,user_facing_error:t},r,n){return t.error_code?new W(uu(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new ne(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function uu(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===lu&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();var Dn=class{getLocation(){return null}};function Fe(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Dn}f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();var Io={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function dt(e={}){let t=pu(e);return Object.entries(t).reduce((n,[i,o])=>(Io[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function pu(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function _r(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Oo(e,t){let r=_r(e);return t({action:"aggregate",unpacker:r,argsMapper:dt})(e)}f();c();p();d();m();function du(e={}){let{select:t,...r}=e;return typeof t=="object"?dt({...r,_count:t}):dt({...r,_count:{_all:!0}})}function mu(e={}){return typeof e.select=="object"?t=>_r(e)(t)._count:t=>_r(e)(t)._count._all}function ko(e,t){return t({action:"count",unpacker:mu(e),argsMapper:du})(e)}f();c();p();d();m();function fu(e={}){let t=dt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function gu(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Do(e,t){return t({action:"groupBy",unpacker:gu(e),argsMapper:fu})(e)}function Mo(e,t,r){if(t==="aggregate")return n=>Oo(n,r);if(t==="count")return n=>ko(n,r);if(t==="groupBy")return n=>Do(n,r)}f();c();p();d();m();function No(e,t){let r=t.fields.filter(i=>!i.relationName),n=gn(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Bt(e,o,s.type,s.isList,s.kind==="enum")},...xr(Object.keys(n))})}f();c();p();d();m();f();c();p();d();m();var Fo=e=>Array.isArray(e)?e:e.split("."),Mn=(e,t)=>Fo(t).reduce((r,n)=>r&&r[n],e),_o=(e,t,r)=>Fo(t).reduceRight((n,i,o,s)=>Object.assign({},Mn(e,s.slice(0,o)),{[i]:n}),r);function hu(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function yu(e,t,r){return t===void 0?e??{}:_o(t,r,e||!0)}function Nn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=Fe(e._errorFormat),g=hu(n,i),h=yu(l,o,g),v=r({dataPath:g,callsite:u})(h),S=wu(e,t);return new Proxy(v,{get(A,R){if(!S.includes(R))return A[R];let F=[a[R].type,r,R],q=[g,h];return Nn(e,...F,...q)},...xr([...S,...Object.getOwnPropertyNames(v)])})}}function wu(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}f();c();p();d();m();f();c();p();d();m();var Eu=qe(Ji());var bu={red:Ze,gray:_i,dim:fr,bold:mr,underline:ki,highlightSource:e=>e.highlight()},xu={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Pu({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function vu({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],l=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${l}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${l}`)),t&&a.push(s.underline(Tu(t))),i){a.push("");let u=[i.toString()];o&&(u.push(o),u.push(s.dim(")"))),a.push(u.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` -`)}function Tu(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function mt(e){let t=e.showColors?bu:xu,r;return typeof $getTemplateParameters<"u"?r=$getTemplateParameters(e,t):r=Pu(e),vu(r,t)}function Lo(e,t,r,n){return e===Ue.ModelAction.findFirstOrThrow||e===Ue.ModelAction.findUniqueOrThrow?Cu(t,r,n):n}function Cu(e,t,r){return async n=>{if("rejectOnNotFound"in n.args){let o=mt({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new K(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof W&&o.code==="P2025"?new ve(`No ${e} found`,t):o})}}f();c();p();d();m();function be(e){return e.replace(/^./,t=>t.toLowerCase())}var Au=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Ru=["aggregate","count","groupBy"];function Fn(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Su(e,t),Ou(e,t),Lt(r),te("name",()=>t),te("$name",()=>t),te("$parent",()=>e._appliedParent)];return he({},n)}function Su(e,t){let r=be(t),n=Object.keys(Ue.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=l=>e._request(l);s=Lo(o,t,e._clientVersion,s);let a=l=>u=>{let g=Fe(e._errorFormat);return e._createPrismaPromise(h=>{let v={args:u,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:g};return s({...v,...l})})};return Au.includes(o)?Nn(e,t,a):Iu(i)?Mo(e,i,a):a({})}}}function Iu(e){return Ru.includes(e)}function Ou(e,t){return $e(te("fields",()=>{let r=e._runtimeDataModel.models[t];return No(t,r)}))}f();c();p();d();m();function qo(e){return e.replace(/^./,t=>t.toUpperCase())}var _n=Symbol();function $t(e){let t=[ku(e),te(_n,()=>e),te("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(Lt(r)),he(e,t)}function ku(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(be),n=[...new Set(t.concat(r))];return $e({getKeys(){return n},getPropertyValue(i){let o=qo(i);if(e._runtimeDataModel.models[o]!==void 0)return Fn(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Fn(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Bo(e){return e[_n]?e[_n]:e}function Uo(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return $t(t)}f();c();p();d();m();f();c();p();d();m();function $o({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(g=>n[g]);u.length>0&&a.push(tt(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(g=>!r[g]);u.length>0&&a.push(tt(u))}Du(e,l.needs)&&s.push(Mu(l,he(e,s)))}return s.length>0||a.length>0?he(e,[...s,...a]):e}function Du(e,t){return t.every(r=>fn(e,r))}function Mu(e,t){return $e(te(e.name,()=>e.compute(t)))}f();c();p();d();m();f();c();p();d();m();function Lr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sg.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=Lr({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function jo({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Lr({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let g=be(l);return $o({result:a,modelName:g,select:u.select,omit:u.select?void 0:{...o?.[g],...u.omit},extensions:n})}})}f();c();p();d();m();f();c();p();d();m();function Go(e){if(e instanceof ie)return Nu(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Go(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=zo(o,l),a.args=s,Qo(e,a,r,n+1)}})})}function Ho(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return Qo(e,t,s)}function Wo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Ko(r,n,0,e):e(r)}}function Ko(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=zo(i,l),Ko(a,t,r+1,n)}})}var Jo=e=>e;function zo(e=Jo,t=Jo){return r=>e(t(r))}f();c();p();d();m();f();c();p();d();m();function Zo(e,t,r){let n=be(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Fu({...e,...Yo(t.name,e,t.result.$allModels),...Yo(t.name,e,t.result[n])})}function Fu(e){let t=new ge,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return Xe(e,n=>({...n,needs:r(n.name,new Set)}))}function Yo(e,t,r){return r?Xe(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:_u(t,o,i)})):{}}function _u(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Xo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function es(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var qr=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new ge;this.modelExtensionsCache=new ge;this.queryCallbacksCache=new ge;this.clientExtensions=It(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=It(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Zo(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=be(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Br=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new qr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new qr(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};f();c();p();d();m();var ts=ee("prisma:client"),rs={Vercel:"vercel","Netlify CI":"netlify"};function ns({postinstall:e,ciName:t,clientVersion:r}){if(ts("checkPlatformCaching:postinstall",e),ts("checkPlatformCaching:ciName",t),e===!0&&t&&t in rs){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${rs[t]}-build`;throw console.error(n),new J(n,r)}}f();c();p();d();m();function is(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();var Lu="Cloudflare-Workers",qu="node";function os(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===Lu?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===qu?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var Bu={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function Ur(){let e=os();return{id:e,prettyName:Bu[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}f();c();p();d();m();f();c();p();d();m();f();c();p();d();m();function ft({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=t[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=r[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw Ur().id==="workerd"?new J(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new J(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new J("error: Missing URL environment variable, value, or override.",n);return i}f();c();p();d();m();f();c();p();d();m();var $r=class extends Error{constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var se=class extends $r{constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};f();c();p();d();m();f();c();p();d();m();function L(e,t){return{...e,isRetryable:t}}var gt=class extends se{constructor(r){super("This request must be retried",L(r,!0));this.name="ForcedRetryError";this.code="P5001"}};N(gt,"ForcedRetryError");f();c();p();d();m();var je=class extends se{constructor(r,n){super(r,L(n,!1));this.name="InvalidDatasourceError";this.code="P6001"}};N(je,"InvalidDatasourceError");f();c();p();d();m();var Ge=class extends se{constructor(r,n){super(r,L(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};N(Ge,"NotImplementedYetError");f();c();p();d();m();f();c();p();d();m();var j=class extends se{constructor(t,r){super(t,r),this.response=r.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var Je=class extends j{constructor(r){super("Schema needs to be uploaded",L(r,!0));this.name="SchemaMissingError";this.code="P5005"}};N(Je,"SchemaMissingError");f();c();p();d();m();f();c();p();d();m();var Ln="This request could not be understood by the server",jt=class extends j{constructor(r,n,i){super(n||Ln,L(r,!1));this.name="BadRequestError";this.code="P5000";i&&(this.code=i)}};N(jt,"BadRequestError");f();c();p();d();m();var Gt=class extends j{constructor(r,n){super("Engine not started: healthcheck timeout",L(r,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};N(Gt,"HealthcheckTimeoutError");f();c();p();d();m();var Jt=class extends j{constructor(r,n,i){super(n,L(r,!0));this.name="EngineStartupError";this.code="P5014";this.logs=i}};N(Jt,"EngineStartupError");f();c();p();d();m();var Qt=class extends j{constructor(r){super("Engine version is not supported",L(r,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};N(Qt,"EngineVersionNotSupportedError");f();c();p();d();m();var qn="Request timed out",Ht=class extends j{constructor(r,n=qn){super(n,L(r,!1));this.name="GatewayTimeoutError";this.code="P5009"}};N(Ht,"GatewayTimeoutError");f();c();p();d();m();var Uu="Interactive transaction error",Wt=class extends j{constructor(r,n=Uu){super(n,L(r,!1));this.name="InteractiveTransactionError";this.code="P5015"}};N(Wt,"InteractiveTransactionError");f();c();p();d();m();var $u="Request parameters are invalid",Kt=class extends j{constructor(r,n=$u){super(n,L(r,!1));this.name="InvalidRequestError";this.code="P5011"}};N(Kt,"InvalidRequestError");f();c();p();d();m();var Bn="Requested resource does not exist",zt=class extends j{constructor(r,n=Bn){super(n,L(r,!1));this.name="NotFoundError";this.code="P5003"}};N(zt,"NotFoundError");f();c();p();d();m();var Un="Unknown server error",ht=class extends j{constructor(r,n,i){super(n||Un,L(r,!0));this.name="ServerError";this.code="P5006";this.logs=i}};N(ht,"ServerError");f();c();p();d();m();var $n="Unauthorized, check your connection string",Yt=class extends j{constructor(r,n=$n){super(n,L(r,!1));this.name="UnauthorizedError";this.code="P5007"}};N(Yt,"UnauthorizedError");f();c();p();d();m();var Vn="Usage exceeded, retry again later",Zt=class extends j{constructor(r,n=Vn){super(n,L(r,!0));this.name="UsageExceededError";this.code="P5008"}};N(Zt,"UsageExceededError");async function Vu(e){let t;try{t=await e.text()}catch{return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch{return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function Xt(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await Vu(e);if(n.type==="QueryEngineError")throw new W(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new ht(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new Je(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Qt(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Jt(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new J(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Gt(r,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Wt(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Kt(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new Yt(r,yt($n,n));if(e.status===404)return new zt(r,yt(Bn,n));if(e.status===429)throw new Zt(r,yt(Vn,n));if(e.status===504)throw new Ht(r,yt(qn,n));if(e.status>=500)throw new ht(r,yt(Un,n));if(e.status>=400)throw new jt(r,yt(Ln,n))}function yt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}f();c();p();d();m();function ss(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(i=>setTimeout(()=>i(n),n))}f();c();p();d();m();var Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function as(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,l,u,g;for(let h=0;h>18,a=(g&258048)>>12,l=(g&4032)>>6,u=g&63,r+=Re[s]+Re[a]+Re[l]+Re[u];return i==1?(g=t[o],s=(g&252)>>2,a=(g&3)<<4,r+=Re[s]+Re[a]+"=="):i==2&&(g=t[o]<<8|t[o+1],s=(g&64512)>>10,a=(g&1008)>>4,l=(g&15)<<2,r+=Re[s]+Re[a]+Re[l]+"="),r}f();c();p();d();m();function ls(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new J("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}f();c();p();d();m();function ju(e){return e[0]*1e3+e[1]/1e6}function us(e){return new Date(ju(e))}f();c();p();d();m();var cs={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};f();c();p();d();m();f();c();p();d();m();var er=class extends se{constructor(r,n){super(`Cannot fetch data from service: -${r}`,L(n,!0));this.name="RequestError";this.code="P5010"}};N(er,"RequestError");async function Qe(e,t,r=n=>n){let n=t.clientVersion;try{return typeof fetch=="function"?await r(fetch)(e,t):await r(jn)(e,t)}catch(i){let o=i.message??"Unknown error";throw new er(o,{clientVersion:n})}}function Ju(e){return{...e.headers,"Content-Type":"application/json"}}function Qu(e){return{method:e.method,headers:Ju(e)}}function Hu(e,t){return{text:()=>Promise.resolve(w.Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(w.Buffer.concat(e).toString())),ok:t.statusCode>=200&&t.statusCode<=299,status:t.statusCode,url:t.url,headers:new Gn(t.headers)}}async function jn(e,t={}){let r=Wu("https"),n=Qu(t),i=[],{origin:o}=new URL(e);return new Promise((s,a)=>{let l=r.request(e,n,u=>{let{statusCode:g,headers:{location:h}}=u;g>=301&&g<=399&&h&&(h.startsWith("http")===!1?s(jn(`${o}${h}`,t)):s(jn(h,t))),u.on("data",v=>i.push(v)),u.on("end",()=>s(Hu(i,u))),u.on("error",a)});l.on("error",a),l.end(t.body??"")})}var Wu=typeof require<"u"?require:()=>{},Gn=class{constructor(t={}){this.headers=new Map;for(let[r,n]of Object.entries(t))if(typeof n=="string")this.headers.set(r,n);else if(Array.isArray(n))for(let i of n)this.headers.set(r,i)}append(t,r){this.headers.set(t,r)}delete(t){this.headers.delete(t)}get(t){return this.headers.get(t)??null}has(t){return this.headers.has(t)}set(t,r){this.headers.set(t,r)}forEach(t,r){for(let[n,i]of this.headers)t.call(r,i,n,this)}};var Ku=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,ps=ee("prisma:client:dataproxyEngine");async function zu(e,t){let r=cs["@prisma/engines-version"],n=t.clientVersion??"unknown";if(y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=n?.split("-")??[];if(o===void 0&&Ku.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[s]=r.split("-")??[],[a,l,u]=s.split("."),g=Yu(`<=${a}.${l}.${u}`),h=await Qe(g,{clientVersion:n});if(!h.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${h.status} ${h.statusText}, response body: ${await h.text()||""}`);let v=await h.text();ps("length of body fetched from unpkg.com",v.length);let S;try{S=JSON.parse(v)}catch(A){throw console.error("JSON.parse error: body fetched from unpkg.com: ",v),A}return S.version}throw new Ge("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function ds(e,t){let r=await zu(e,t);return ps("version",r),r}function Yu(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var ms=3,Jn=ee("prisma:client:dataproxyEngine"),Qn=class{constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:t,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-transaction-id"]=r.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}},tr=class{constructor(t){this.name="DataProxyEngine";ls(t),this.config=t,this.env={...t.env,...typeof y<"u"?y.env:{}},this.inlineSchema=as(t.inlineSchema),this.inlineDatasources=t.inlineDatasources,this.inlineSchemaHash=t.inlineSchemaHash,this.clientVersion=t.clientVersion,this.engineHash=t.engineVersion,this.logEmitter=t.logEmitter,this.tracingHelper=t.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[t,r]=this.extractHostAndApiKey();this.host=t,this.headerBuilder=new Qn({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await ds(t,this.config),Jn("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){t?.logs?.length&&t.logs.forEach(r=>{switch(r.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let n=typeof r.attributes.query=="string"?r.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[i]=n.split("/* traceparent");n=i}this.logEmitter.emit("query",{query:n,timestamp:us(r.timestamp),duration:Number(r.attributes.duration_ms),params:r.attributes.params,target:r.attributes.target})}}}),t?.traces?.length&&this.tracingHelper.createEngineSpan({span:!0,spans:t.traces})}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await Qe(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||Jn("schema response status",r.status);let n=await Xt(r,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(t,{traceparent:r,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:t,traceparent:r,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(t,{traceparent:r,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Pr(t,n),{batchResult:a,elapsed:l}=await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r});return a.map(u=>"errors"in u&&u.errors.length>0?Ut(u.errors[0],this.clientVersion,this.config.activeProvider):{data:u,elapsed:l})}requestInternal({body:t,traceparent:r,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await Qe(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||Jn("graphql response status",a.status),await this.handleError(await Xt(a,this.clientVersion));let l=await a.json(),u=l.extensions;if(u&&this.propagateResponseExtensions(u),l.errors)throw l.errors.length===1?Ut(l.errors[0],this.config.clientVersion,this.config.activeProvider):new ne(l.errors,{clientVersion:this.config.clientVersion});return l}})}async transaction(t,r,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[t]} transaction`,callback:async({logHttpCall:o})=>{if(t==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await Qe(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Xt(l,this.clientVersion));let u=await l.json(),g=u.extensions;g&&this.propagateResponseExtensions(g);let h=u.id,v=u["data-proxy"].endpoint;return{id:h,payload:{endpoint:v}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await Qe(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Xt(a,this.clientVersion));let u=(await a.json()).extensions;u&&this.propagateResponseExtensions(u);return}}})}extractHostAndApiKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=ft({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new je(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:"&&o!=="prisma+postgres:")throw new je(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t);let l=a.get("api_key");if(l===null||l.length<1)throw new je(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return[s,l]}metrics(){throw new Ge("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){for(let r=0;;r++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${r})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:n})}catch(i){if(!(i instanceof se)||!i.isRetryable)throw i;if(r>=ms)throw i instanceof gt?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${r+1}/${ms} failed for ${t.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await ss(r);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof Je)throw await this.uploadSchema(),new gt({clientVersion:this.clientVersion,cause:t});if(t)throw t}applyPendingMigrations(){throw new Error("Method not implemented.")}};function fs({copyEngine:e=!0},t){let r;try{r=ft({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||r?.startsWith("prisma+postgres://"));e&&n&&St("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=Ct(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",l=i==="binary";if(o&&s||s){let u;throw u=["Prisma Client was configured to use the `adapter` option but it was imported via its `/edge` endpoint.","Please either remove the `/edge` endpoint or remove the `adapter` from the Prisma Client constructor."],new K(u.join(` -`),{clientVersion:t.clientVersion})}if(o)return new tr(t);throw new K("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}f();c();p();d();m();function Vr({generator:e}){return e?.previewFeatures??[]}f();c();p();d();m();f();c();p();d();m();function wt(e){return e.substring(0,1).toLowerCase()+e.substring(1)}f();c();p();d();m();f();c();p();d();m();var bs=qe(Hn());f();c();p();d();m();function ws(e,t,r){let n=Es(e),i=Zu(n),o=ec(i);o?jr(o,t,r):t.addErrorMessage(()=>"Unknown error")}function Es(e){return e.errors.flatMap(t=>t.kind==="Union"?Es(t):[t])}function Zu(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:Xu(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Xu(e,t){return[...new Set(e.concat(t))]}function ec(e){return hn(e,(t,r)=>{let n=hs(t),i=hs(r);return n!==i?n-i:ys(t)-ys(r)})}function hs(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function ys(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}f();c();p();d();m();var le=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};f();c();p();d();m();var rr=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(lt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function jr(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":tc(e,t);break;case"IncludeOnScalar":rc(e,t);break;case"EmptySelection":nc(e,t,r);break;case"UnknownSelectionField":ac(e,t);break;case"InvalidSelectionValue":lc(e,t);break;case"UnknownArgument":uc(e,t);break;case"UnknownInputField":cc(e,t);break;case"RequiredArgumentMissing":pc(e,t);break;case"InvalidArgumentType":dc(e,t);break;case"InvalidArgumentValue":mc(e,t);break;case"ValueTooLarge":fc(e,t);break;case"SomeFieldsMissing":gc(e,t);break;case"TooManyFieldsGiven":hc(e,t);break;case"Union":ws(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function tc(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function rc(e,t){let[r,n]=nr(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new le(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${ir(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function nc(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){ic(e,t,i);return}if(n.hasField("select")){oc(e,t);return}}if(r?.[wt(e.outputType.name)]){sc(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function ic(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new le(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function oc(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),vs(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${ir(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function sc(e,t){let r=new rr;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new le("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=nr(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new ct;l.addSuggestion(n),a.value=l}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function ac(e,t){let r=Ts(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":vs(n,e.outputType);break;case"include":yc(n,e.outputType);break;case"omit":wc(n,e.outputType);break}}t.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(ir(n)),i.join(" ")})}function lc(e,t){let r=Ts(e.selectionPath,t);r.parentKind!=="unknown"&&r.field.value.markAsError(),t.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`)}function uc(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Ec(n,e.arguments)),t.addErrorMessage(i=>xs(i,r,e.arguments.map(o=>o.name)))}function cc(e,t){let[r,n]=nr(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&Cs(o,e.inputType)}t.addErrorMessage(o=>xs(o,n,e.inputType.fields.map(s=>s.name)))}function xs(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=xc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(ir(e)),n.join(" ")}function pc(e,t){let r;t.addErrorMessage(l=>r?.value instanceof z&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=nr(e.argumentPath),s=new rr,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new le(o,s).makeRequired())}else{let l=e.inputTypes.map(Ps).join(" | ");a.addSuggestion(new le(o,l).makeRequired())}}function Ps(e){return e.kind==="list"?`${Ps(e.elementType)}[]`:e.name}function dc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=Gr("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function mc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=Gr("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function fc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof z&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function gc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&Cs(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${Gr("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(ir(i)),o.join(" ")})}function hc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${Gr("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function vs(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,"true"))}function yc(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new le(r.name,"true"))}function wc(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new le(r.name,"true"))}function Ec(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function Ts(e,t){let[r,n]=nr(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),l=o?.getField(n);return o&&l?{parentKind:"select",parent:o,field:l,fieldName:n}:(l=s?.getField(n),s&&l?{parentKind:"include",field:l,parent:s,fieldName:n}:(l=a?.getField(n),a&&l?{parentKind:"omit",field:l,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function Cs(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function nr(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function ir({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Gr(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var bc=3;function xc(e,t){let r=1/0,n;for(let i of t){let o=(0,bs.default)(e,i);o>bc||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[wt(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:Pe(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};f();c();p();d();m();var Os=e=>({command:e});f();c();p();d();m();f();c();p();d();m();var ks=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);f();c();p();d();m();function Et(e){try{return Ds(e,"fast")}catch{return Ds(e,"slow")}}function Ds(e,t){return JSON.stringify(e.map(r=>Ns(r,t)))}function Ns(e,t){return Array.isArray(e)?e.map(r=>Ns(r,t)):typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:nt(e)?{prisma__type:"date",prisma__value:e.toJSON()}:we.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:w.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:kc(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Fs(e):e}function kc(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Fs(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Ms);let t={};for(let r of Object.keys(e))t[r]=Ms(e[r]);return t}function Ms(e){return typeof e=="bigint"?e.toString():Fs(e)}f();c();p();d();m();var Dc=["$connect","$disconnect","$on","$transaction","$use","$extends"],_s=Dc;var Mc=/^(\s*alter\s)/i,Ls=ee("prisma:client");function zn(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Mc.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var Yn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(r instanceof Ft)n=r.sql,i={values:Et(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:Et(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:Et(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:Et(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=ks(r),i={values:Et(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Ls(`prisma.${e}(${n}, ${i.values})`):Ls(`prisma.${e}(${n})`),{query:n,parameters:i}},qs={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new ie(t,r)}},Bs={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};f();c();p();d();m();function Zn(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??=Us(r(o)):Us(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function Us(e){return typeof e.then=="function"?e:Promise.resolve(e)}f();c();p();d();m();var $s={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Xn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??$s}};function Vs(e){return e.includes("tracing")?new Xn:$s}f();c();p();d();m();function js(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}f();c();p();d();m();function Gs(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}f();c();p();d();m();var Qr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};f();c();p();d();m();var Hs=qe(zi());f();c();p();d();m();function Hr(e){return typeof e.batchRequestIdx=="number"}f();c();p();d();m();function Wr(e){return e===null?e:Array.isArray(e)?e.map(Wr):typeof e=="object"?Nc(e)?Fc(e):Xe(e,Wr):e}function Nc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Fc({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return w.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new we(t);case"Json":return JSON.parse(t);default:Pe(t,"Unknown tagged value")}}f();c();p();d();m();function Js(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(ei(e.query.arguments)),t.push(ei(e.query.selection)),t.join("")}function ei(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${ei(n)})`:r}).join(" ")})`}f();c();p();d();m();var _c={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function ti(e){return _c[e]}f();c();p();d();m();var Kr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;iHe("bigint",r));case"bytes-array":return t.map(r=>He("bytes",r));case"decimal-array":return t.map(r=>He("decimal",r));case"datetime-array":return t.map(r=>He("datetime",r));case"date-array":return t.map(r=>He("date",r));case"time-array":return t.map(r=>He("time",r));default:return t}}function Qs(e){let t=[],r=Lc(e);for(let n=0;n{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(h=>ti(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Bc(o),containsWrite:u,customDataProxyFetch:i})).map((h,v)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[v],h)}catch(S){return S}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Ws(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:ti(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Js(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(qc(t),Uc(t,i)||t instanceof ve)throw t;if(t instanceof W&&$c(t)){let u=Ks(t.meta);Jr({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=mt({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new W(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new Te(l,this.client._clientVersion);if(t instanceof ne)throw new ne(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof J)throw new J(l,this.client._clientVersion);if(t instanceof Te)throw new Te(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Hs.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(u=>u!=="select"&&u!=="include"),a=Mn(o,s),l=i==="queryRaw"?Qs(a):Wr(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Bc(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Ws(e)};Pe(e,"Unknown transaction kind")}}function Ws(e){return{id:e.id,payload:e.payload}}function Uc(e,t){return Hr(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function $c(e){return e.code==="P2009"||e.code==="P2012"}function Ks(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Ks)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}f();c();p();d();m();var zs="5.21.1";var Ys=zs;f();c();p();d();m();var ra=qe(Hn());f();c();p();d();m();var B=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};N(B,"PrismaClientConstructorValidationError");var Zs=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],Xs=["pretty","colorless","minimal"],ea=["info","query","warn","error"],jc={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new B(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=bt(r,t)||` Available datasources: ${t.join(", ")}`;throw new B(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new B(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new B(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new B(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new B('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Vr(t).includes("driverAdapters"))throw new B('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Ct()==="binary")throw new B('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new B(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new B(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Xs.includes(e)){let t=bt(e,Xs);throw new B(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new B(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!ea.includes(r)){let n=bt(r,ea);throw new B(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=bt(i,o);throw new B(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new B(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new B(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new B(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new B('"omit" option is expected to be an object.');if(e===null)throw new B('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=Jc(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(u=>u.name===s);if(!l){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new B(Qc(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new B(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=bt(r,t);throw new B(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function na(e,t){for(let[r,n]of Object.entries(e)){if(!Zs.includes(r)){let i=bt(r,Zs);throw new B(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}jc[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new B('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function bt(e,t){if(t.length===0||typeof e!="string")return"";let r=Gc(e,t);return r?` Did you mean "${r}"?`:""}function Gc(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,ra.default)(e,i)}));r.sort((i,o)=>i.distancewt(n)===t);if(r)return e[r]}function Qc(e,t){let r=pt(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=Fr(r,"colorless");return`Error validating "omit" option: - -${i} - -${n}`}f();c();p();d();m();function ia(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u{n[u]=g,a()},g=>{if(!Hr(g)){l(g);return}g.batchRequestIdx===u?l(g):(i||(i=g),a())})})}var _e=ee("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Hc={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Wc=Symbol.for("prisma.client.transaction.id"),Kc={id:0,nextId(){return++this.id}};function aa(e){class t{constructor(n){this._originalClient=this;this._middlewares=new Qr;this._createPrismaPromise=Zn();this.$extends=Uo;e=n?.__internal?.configOverride?.(e)??e,ns(e),n&&na(n,e);let i=new hr().on("error",()=>{});this._extensions=Br.empty(),this._previewFeatures=Vr(e),this._clientVersion=e.clientVersion??Ys,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=Vs(this._previewFeatures);let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&Tt.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&Tt.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=Pn(n.adapter);let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new J(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new J("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},g=u.debug===!0;g&&ee.enable("prisma:client");let h=Tt.resolve(e.dirname,e.relativePath);Ci.existsSync(h)||(h=e.dirname),_e("dirname",e.dirname),_e("relativePath",e.relativePath),_e("cwd",h);let v=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:h,dirname:e.dirname,enableDebugLogs:g,allowTriggerPanic:v.allowTriggerPanic,datamodelPath:Tt.join(e.dirname,e.filename??"schema.prisma"),prismaPath:v.binaryPath??void 0,engineEndpoint:v.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Gs(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(S=>typeof S=="string"?S==="query":S.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:is(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:ft,getBatchRequestPayload:Pr,prismaGraphQLToJSError:Ut,PrismaClientUnknownRequestError:ne,PrismaClientInitializationError:J,PrismaClientKnownRequestError:W,debug:ee("prisma:client:accelerateEngine"),engineVersion:sa.version,clientVersion:e.clientVersion}},_e("clientVersion",e.clientVersion),this._engine=fs(e,this._engineConfig),this._requestHandler=new zr(this,i),l.log)for(let S of l.log){let A=typeof S=="string"?S:S.emit==="stdout"?S.level:null;A&&this.$on(A,R=>{Rt.log(`${Rt.tags[A]??""}`,R.message||R.query)})}this._metrics=new et(this._engine)}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=$t(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Bi()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Yn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=oa(n,i);return zn(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new K("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(zn(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new K(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Os,callsite:Fe(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Yn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...oa(n,i));throw new K("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new K("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Kc.nextId(),s=js(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let g=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:u,isolationLevel:g,lock:s};return l.requestTransaction?.(h)??l});return ia(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return $t(he(Bo(this),[te("_appliedParent",()=>this._appliedParent._createItxClient(n)),te("_createPrismaPromise",()=>Zn(n)),te(Wc,()=>n.id),tt(_s)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Hc,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let g=this._middlewares.get(++a);if(g)return this._tracingHelper.runInChildSpan(s.middleware,M=>g(u,F=>(M?.end(),l(F))));let{runInTransaction:h,args:v,...S}=u,A={...n,...S};v&&(A.args=i.middlewareArgsToRequestArgs(v)),n.transaction!==void 0&&h===!1&&delete A.transaction;let R=await Ho(this,A);return A.model?jo({result:R,modelName:A.model,args:A.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):R};return this._tracingHelper.runInChildSpan(s.operation,()=>l(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:g,unpacker:h,otelParentCtx:v,customDataProxyFetch:S}){try{n=u?u(n):n;let A={name:"serialize"},R=this._tracingHelper.runInChildSpan(A,()=>Rs({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return ee.enabled("prisma:client")&&(_e("Prisma Client call:"),_e(`prisma.${i}(${So(n)})`),_e("Generated request:"),_e(JSON.stringify(R,null,2)+` -`)),g?.kind==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:R,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:v,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:S})}catch(A){throw A.clientVersion=this._clientVersion,A}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new K("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function oa(e,t){return zc(e)?[new ie(e,t),qs]:[e,Bs]}function zc(e){return Array.isArray(e)&&Array.isArray(e.raw)}f();c();p();d();m();var Yc=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function la(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Yc.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}f();c();p();d();m();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,skip,sqltag,warnEnvConflicts,warnOnce}); -//# sourceMappingURL=edge.js.map diff --git a/node_modules/@prisma/client/runtime/index-browser.d.ts b/node_modules/@prisma/client/runtime/index-browser.d.ts deleted file mode 100644 index f033b86..0000000 --- a/node_modules/@prisma/client/runtime/index-browser.d.ts +++ /dev/null @@ -1,365 +0,0 @@ -declare class AnyNull extends NullTypesEnumValue { -} - -declare type Args = T extends { - [K: symbol]: { - types: { - operations: { - [K in F]: { - args: any; - }; - }; - }; - }; -} ? T[symbol]['types']['operations'][F]['args'] : any; - -declare class DbNull extends NullTypesEnumValue { -} - -export declare namespace Decimal { - export type Constructor = typeof Decimal; - export type Instance = Decimal; - export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - export type Modulo = Rounding | 9; - export type Value = string | number | Decimal; - - // http://mikemcl.github.io/decimal.js/#constructor-properties - export interface Config { - precision?: number; - rounding?: Rounding; - toExpNeg?: number; - toExpPos?: number; - minE?: number; - maxE?: number; - crypto?: boolean; - modulo?: Modulo; - defaults?: boolean; - } -} - -export declare class Decimal { - readonly d: number[]; - readonly e: number; - readonly s: number; - - constructor(n: Decimal.Value); - - absoluteValue(): Decimal; - abs(): Decimal; - - ceil(): Decimal; - - clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; - clamp(min: Decimal.Value, max: Decimal.Value): Decimal; - - comparedTo(n: Decimal.Value): number; - cmp(n: Decimal.Value): number; - - cosine(): Decimal; - cos(): Decimal; - - cubeRoot(): Decimal; - cbrt(): Decimal; - - decimalPlaces(): number; - dp(): number; - - dividedBy(n: Decimal.Value): Decimal; - div(n: Decimal.Value): Decimal; - - dividedToIntegerBy(n: Decimal.Value): Decimal; - divToInt(n: Decimal.Value): Decimal; - - equals(n: Decimal.Value): boolean; - eq(n: Decimal.Value): boolean; - - floor(): Decimal; - - greaterThan(n: Decimal.Value): boolean; - gt(n: Decimal.Value): boolean; - - greaterThanOrEqualTo(n: Decimal.Value): boolean; - gte(n: Decimal.Value): boolean; - - hyperbolicCosine(): Decimal; - cosh(): Decimal; - - hyperbolicSine(): Decimal; - sinh(): Decimal; - - hyperbolicTangent(): Decimal; - tanh(): Decimal; - - inverseCosine(): Decimal; - acos(): Decimal; - - inverseHyperbolicCosine(): Decimal; - acosh(): Decimal; - - inverseHyperbolicSine(): Decimal; - asinh(): Decimal; - - inverseHyperbolicTangent(): Decimal; - atanh(): Decimal; - - inverseSine(): Decimal; - asin(): Decimal; - - inverseTangent(): Decimal; - atan(): Decimal; - - isFinite(): boolean; - - isInteger(): boolean; - isInt(): boolean; - - isNaN(): boolean; - - isNegative(): boolean; - isNeg(): boolean; - - isPositive(): boolean; - isPos(): boolean; - - isZero(): boolean; - - lessThan(n: Decimal.Value): boolean; - lt(n: Decimal.Value): boolean; - - lessThanOrEqualTo(n: Decimal.Value): boolean; - lte(n: Decimal.Value): boolean; - - logarithm(n?: Decimal.Value): Decimal; - log(n?: Decimal.Value): Decimal; - - minus(n: Decimal.Value): Decimal; - sub(n: Decimal.Value): Decimal; - - modulo(n: Decimal.Value): Decimal; - mod(n: Decimal.Value): Decimal; - - naturalExponential(): Decimal; - exp(): Decimal; - - naturalLogarithm(): Decimal; - ln(): Decimal; - - negated(): Decimal; - neg(): Decimal; - - plus(n: Decimal.Value): Decimal; - add(n: Decimal.Value): Decimal; - - precision(includeZeros?: boolean): number; - sd(includeZeros?: boolean): number; - - round(): Decimal; - - sine() : Decimal; - sin() : Decimal; - - squareRoot(): Decimal; - sqrt(): Decimal; - - tangent() : Decimal; - tan() : Decimal; - - times(n: Decimal.Value): Decimal; - mul(n: Decimal.Value) : Decimal; - - toBinary(significantDigits?: number): string; - toBinary(significantDigits: number, rounding: Decimal.Rounding): string; - - toDecimalPlaces(decimalPlaces?: number): Decimal; - toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - toDP(decimalPlaces?: number): Decimal; - toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - - toExponential(decimalPlaces?: number): string; - toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFixed(decimalPlaces?: number): string; - toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFraction(max_denominator?: Decimal.Value): Decimal[]; - - toHexadecimal(significantDigits?: number): string; - toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; - toHex(significantDigits?: number): string; - toHex(significantDigits: number, rounding?: Decimal.Rounding): string; - - toJSON(): string; - - toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; - - toNumber(): number; - - toOctal(significantDigits?: number): string; - toOctal(significantDigits: number, rounding: Decimal.Rounding): string; - - toPower(n: Decimal.Value): Decimal; - pow(n: Decimal.Value): Decimal; - - toPrecision(significantDigits?: number): string; - toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; - - toSignificantDigits(significantDigits?: number): Decimal; - toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; - toSD(significantDigits?: number): Decimal; - toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; - - toString(): string; - - truncated(): Decimal; - trunc(): Decimal; - - valueOf(): string; - - static abs(n: Decimal.Value): Decimal; - static acos(n: Decimal.Value): Decimal; - static acosh(n: Decimal.Value): Decimal; - static add(x: Decimal.Value, y: Decimal.Value): Decimal; - static asin(n: Decimal.Value): Decimal; - static asinh(n: Decimal.Value): Decimal; - static atan(n: Decimal.Value): Decimal; - static atanh(n: Decimal.Value): Decimal; - static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; - static cbrt(n: Decimal.Value): Decimal; - static ceil(n: Decimal.Value): Decimal; - static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; - static clone(object?: Decimal.Config): Decimal.Constructor; - static config(object: Decimal.Config): Decimal.Constructor; - static cos(n: Decimal.Value): Decimal; - static cosh(n: Decimal.Value): Decimal; - static div(x: Decimal.Value, y: Decimal.Value): Decimal; - static exp(n: Decimal.Value): Decimal; - static floor(n: Decimal.Value): Decimal; - static hypot(...n: Decimal.Value[]): Decimal; - static isDecimal(object: any): object is Decimal; - static ln(n: Decimal.Value): Decimal; - static log(n: Decimal.Value, base?: Decimal.Value): Decimal; - static log2(n: Decimal.Value): Decimal; - static log10(n: Decimal.Value): Decimal; - static max(...n: Decimal.Value[]): Decimal; - static min(...n: Decimal.Value[]): Decimal; - static mod(x: Decimal.Value, y: Decimal.Value): Decimal; - static mul(x: Decimal.Value, y: Decimal.Value): Decimal; - static noConflict(): Decimal.Constructor; // Browser only - static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; - static random(significantDigits?: number): Decimal; - static round(n: Decimal.Value): Decimal; - static set(object: Decimal.Config): Decimal.Constructor; - static sign(n: Decimal.Value): number; - static sin(n: Decimal.Value): Decimal; - static sinh(n: Decimal.Value): Decimal; - static sqrt(n: Decimal.Value): Decimal; - static sub(x: Decimal.Value, y: Decimal.Value): Decimal; - static sum(...n: Decimal.Value[]): Decimal; - static tan(n: Decimal.Value): Decimal; - static tanh(n: Decimal.Value): Decimal; - static trunc(n: Decimal.Value): Decimal; - - static readonly default?: Decimal.Constructor; - static readonly Decimal?: Decimal.Constructor; - - static readonly precision: number; - static readonly rounding: Decimal.Rounding; - static readonly toExpNeg: number; - static readonly toExpPos: number; - static readonly minE: number; - static readonly maxE: number; - static readonly crypto: boolean; - static readonly modulo: Decimal.Modulo; - - static readonly ROUND_UP: 0; - static readonly ROUND_DOWN: 1; - static readonly ROUND_CEIL: 2; - static readonly ROUND_FLOOR: 3; - static readonly ROUND_HALF_UP: 4; - static readonly ROUND_HALF_DOWN: 5; - static readonly ROUND_HALF_EVEN: 6; - static readonly ROUND_HALF_CEIL: 7; - static readonly ROUND_HALF_FLOOR: 8; - static readonly EUCLID: 9; -} - -declare type Exact = (A extends unknown ? (W extends A ? { - [K in keyof A]: Exact; -} : W) : never) | (A extends Narrowable ? A : never); - -export declare function getRuntime(): GetRuntimeOutput; - -declare type GetRuntimeOutput = { - id: Runtime; - prettyName: string; - isEdge: boolean; -}; - -declare class JsonNull extends NullTypesEnumValue { -} - -/** - * Generates more strict variant of an enum which, unlike regular enum, - * throws on non-existing property access. This can be useful in following situations: - * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input - * - enum values are generated dynamically from DMMF. - * - * In that case, if using normal enums and no compile-time typechecking, using non-existing property - * will result in `undefined` value being used, which will be accepted. Using strict enum - * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. - * - * Note: if you need to check for existence of a value in the enum you can still use either - * `in` operator or `hasOwnProperty` function. - * - * @param definition - * @returns - */ -export declare function makeStrictEnum>(definition: T): T; - -declare type Narrowable = string | number | bigint | boolean | []; - -declare class NullTypesEnumValue extends ObjectEnumValue { - _getNamespace(): string; -} - -/** - * Base class for unique values of object-valued enums. - */ -declare abstract class ObjectEnumValue { - constructor(arg?: symbol); - abstract _getNamespace(): string; - _getName(): string; - toString(): string; -} - -export declare const objectEnumValues: { - classes: { - DbNull: typeof DbNull; - JsonNull: typeof JsonNull; - AnyNull: typeof AnyNull; - }; - instances: { - DbNull: DbNull; - JsonNull: JsonNull; - AnyNull: AnyNull; - }; -}; - -declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; - -declare namespace Public { - export { - validator - } -} -export { Public } - -declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown"; - -declare function validator(): (select: Exact) => S; - -declare function validator, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): (select: Exact>) => S; - -declare function validator, O extends keyof C[M] & Operation, P extends keyof Args>(client: C, model: M, operation: O, prop: P): (select: Exact[P]>) => S; - -export { } diff --git a/node_modules/@prisma/client/runtime/index-browser.js b/node_modules/@prisma/client/runtime/index-browser.js deleted file mode 100644 index 8f0457d..0000000 --- a/node_modules/@prisma/client/runtime/index-browser.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict";var de=Object.defineProperty;var We=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.prototype.hasOwnProperty;var Me=(e,n)=>{for(var i in n)de(e,i,{get:n[i],enumerable:!0})},Xe=(e,n,i,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Ge(n))!Je.call(e,r)&&r!==i&&de(e,r,{get:()=>n[r],enumerable:!(t=We(n,r))||t.enumerable});return e};var Ke=e=>Xe(de({},"__esModule",{value:!0}),e);var Xn={};Me(Xn,{Decimal:()=>je,Public:()=>he,getRuntime:()=>be,makeStrictEnum:()=>Pe,objectEnumValues:()=>Oe});module.exports=Ke(Xn);var he={};Me(he,{validator:()=>Ce});function Ce(...e){return n=>n}var ne=Symbol(),pe=new WeakMap,ge=class{constructor(n){n===ne?pe.set(this,"Prisma.".concat(this._getName())):pe.set(this,"new Prisma.".concat(this._getNamespace(),".").concat(this._getName(),"()"))}_getName(){return this.constructor.name}toString(){return pe.get(this)}},G=class extends ge{_getNamespace(){return"NullTypes"}},J=class extends G{};me(J,"DbNull");var X=class extends G{};me(X,"JsonNull");var K=class extends G{};me(K,"AnyNull");var Oe={classes:{DbNull:J,JsonNull:X,AnyNull:K},instances:{DbNull:new J(ne),JsonNull:new X(ne),AnyNull:new K(ne)}};function me(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0})}var xe=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Pe(e){return new Proxy(e,{get(n,i){if(i in n)return n[i];if(!xe.has(i))throw new TypeError("Invalid enum value: ".concat(String(i)))}})}var Qe="Cloudflare-Workers",Ye="node";function Re(){var e,n,i;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===Qe?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((i=(n=globalThis.process)==null?void 0:n.release)==null?void 0:i.name)===Ye?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var ze={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function be(){let e=Re();return{id:e,prettyName:ze[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var H=9e15,$=1e9,we="0123456789abcdef",te="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",re="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ne={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-H,maxE:H,crypto:!1},Te,Z,w=!0,oe="[DecimalError] ",V=oe+"Invalid argument: ",Le=oe+"Precision limit exceeded",De=oe+"crypto unavailable",Fe="[object Decimal]",b=Math.floor,C=Math.pow,ye=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,en=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,nn=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ie=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,D=1e7,m=7,tn=9007199254740991,rn=te.length-1,ve=re.length-1,h={toStringTag:Fe};h.absoluteValue=h.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),p(e)};h.ceil=function(){return p(new this.constructor(this),this.e+1,2)};h.clampedTo=h.clamp=function(e,n){var i,t=this,r=t.constructor;if(e=new r(e),n=new r(n),!e.s||!n.s)return new r(NaN);if(e.gt(n))throw Error(V+n);return i=t.cmp(e),i<0?e:t.cmp(n)>0?n:new r(t)};h.comparedTo=h.cmp=function(e){var n,i,t,r,s=this,o=s.d,u=(e=new s.constructor(e)).d,l=s.s,f=e.s;if(!o||!u)return!l||!f?NaN:l!==f?l:o===u?0:!o^l<0?1:-1;if(!o[0]||!u[0])return o[0]?l:u[0]?-f:0;if(l!==f)return l;if(s.e!==e.e)return s.e>e.e^l<0?1:-1;for(t=o.length,r=u.length,n=0,i=tu[n]^l<0?1:-1;return t===r?0:t>r^l<0?1:-1};h.cosine=h.cos=function(){var e,n,i=this,t=i.constructor;return i.d?i.d[0]?(e=t.precision,n=t.rounding,t.precision=e+Math.max(i.e,i.sd())+m,t.rounding=1,i=sn(t,$e(t,i)),t.precision=e,t.rounding=n,p(Z==2||Z==3?i.neg():i,e,n,!0)):new t(1):new t(NaN)};h.cubeRoot=h.cbrt=function(){var e,n,i,t,r,s,o,u,l,f,c=this,a=c.constructor;if(!c.isFinite()||c.isZero())return new a(c);for(w=!1,s=c.s*C(c.s*c,1/3),!s||Math.abs(s)==1/0?(i=O(c.d),e=c.e,(s=(e-i.length+1)%3)&&(i+=s==1||s==-2?"0":"00"),s=C(i,1/3),e=b((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?i="5e"+e:(i=s.toExponential(),i=i.slice(0,i.indexOf("e")+1)+e),t=new a(i),t.s=c.s):t=new a(s.toString()),o=(e=a.precision)+3;;)if(u=t,l=u.times(u).times(u),f=l.plus(c),t=S(f.plus(c).times(u),f.plus(l),o+2,1),O(u.d).slice(0,o)===(i=O(t.d)).slice(0,o))if(i=i.slice(o-3,o+1),i=="9999"||!r&&i=="4999"){if(!r&&(p(u,e+1,0),u.times(u).times(u).eq(c))){t=u;break}o+=4,r=1}else{(!+i||!+i.slice(1)&&i.charAt(0)=="5")&&(p(t,e+1,1),n=!t.times(t).times(t).eq(c));break}return w=!0,p(t,e,a.rounding,n)};h.decimalPlaces=h.dp=function(){var e,n=this.d,i=NaN;if(n){if(e=n.length-1,i=(e-b(this.e/m))*m,e=n[e],e)for(;e%10==0;e/=10)i--;i<0&&(i=0)}return i};h.dividedBy=h.div=function(e){return S(this,new this.constructor(e))};h.dividedToIntegerBy=h.divToInt=function(e){var n=this,i=n.constructor;return p(S(n,new i(e),0,1,1),i.precision,i.rounding)};h.equals=h.eq=function(e){return this.cmp(e)===0};h.floor=function(){return p(new this.constructor(this),this.e+1,3)};h.greaterThan=h.gt=function(e){return this.cmp(e)>0};h.greaterThanOrEqualTo=h.gte=function(e){var n=this.cmp(e);return n==1||n===0};h.hyperbolicCosine=h.cosh=function(){var e,n,i,t,r,s=this,o=s.constructor,u=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return u;i=o.precision,t=o.rounding,o.precision=i+Math.max(s.e,s.sd())+4,o.rounding=1,r=s.d.length,r<32?(e=Math.ceil(r/3),n=(1/fe(4,e)).toString()):(e=16,n="2.3283064365386962890625e-10"),s=j(o,1,s.times(n),new o(1),!0);for(var l,f=e,c=new o(8);f--;)l=s.times(s),s=u.minus(l.times(c.minus(l.times(c))));return p(s,o.precision=i,o.rounding=t,!0)};h.hyperbolicSine=h.sinh=function(){var e,n,i,t,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(n=s.precision,i=s.rounding,s.precision=n+Math.max(r.e,r.sd())+4,s.rounding=1,t=r.d.length,t<3)r=j(s,2,r,r,!0);else{e=1.4*Math.sqrt(t),e=e>16?16:e|0,r=r.times(1/fe(5,e)),r=j(s,2,r,r,!0);for(var o,u=new s(5),l=new s(16),f=new s(20);e--;)o=r.times(r),r=r.times(u.plus(o.times(l.times(o).plus(f))))}return s.precision=n,s.rounding=i,p(r,n,i,!0)};h.hyperbolicTangent=h.tanh=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+7,t.rounding=1,S(i.sinh(),i.cosh(),t.precision=e,t.rounding=n)):new t(i.s)};h.inverseCosine=h.acos=function(){var e,n=this,i=n.constructor,t=n.abs().cmp(1),r=i.precision,s=i.rounding;return t!==-1?t===0?n.isNeg()?L(i,r,s):new i(0):new i(NaN):n.isZero()?L(i,r+4,s).times(.5):(i.precision=r+6,i.rounding=1,n=n.asin(),e=L(i,r+4,s).times(.5),i.precision=r,i.rounding=s,e.minus(n))};h.inverseHyperbolicCosine=h.acosh=function(){var e,n,i=this,t=i.constructor;return i.lte(1)?new t(i.eq(1)?0:NaN):i.isFinite()?(e=t.precision,n=t.rounding,t.precision=e+Math.max(Math.abs(i.e),i.sd())+4,t.rounding=1,w=!1,i=i.times(i).minus(1).sqrt().plus(i),w=!0,t.precision=e,t.rounding=n,i.ln()):new t(i)};h.inverseHyperbolicSine=h.asinh=function(){var e,n,i=this,t=i.constructor;return!i.isFinite()||i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+2*Math.max(Math.abs(i.e),i.sd())+6,t.rounding=1,w=!1,i=i.times(i).plus(1).sqrt().plus(i),w=!0,t.precision=e,t.rounding=n,i.ln())};h.inverseHyperbolicTangent=h.atanh=function(){var e,n,i,t,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=s.precision,n=s.rounding,t=r.sd(),Math.max(t,e)<2*-r.e-1?p(new s(r),e,n,!0):(s.precision=i=t-r.e,r=S(r.plus(1),new s(1).minus(r),i+e,1),s.precision=e+4,s.rounding=1,r=r.ln(),s.precision=e,s.rounding=n,r.times(.5))):new s(NaN)};h.inverseSine=h.asin=function(){var e,n,i,t,r=this,s=r.constructor;return r.isZero()?new s(r):(n=r.abs().cmp(1),i=s.precision,t=s.rounding,n!==-1?n===0?(e=L(s,i+4,t).times(.5),e.s=r.s,e):new s(NaN):(s.precision=i+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=i,s.rounding=t,r.times(2)))};h.inverseTangent=h.atan=function(){var e,n,i,t,r,s,o,u,l,f=this,c=f.constructor,a=c.precision,d=c.rounding;if(f.isFinite()){if(f.isZero())return new c(f);if(f.abs().eq(1)&&a+4<=ve)return o=L(c,a+4,d).times(.25),o.s=f.s,o}else{if(!f.s)return new c(NaN);if(a+4<=ve)return o=L(c,a+4,d).times(.5),o.s=f.s,o}for(c.precision=u=a+10,c.rounding=1,i=Math.min(28,u/m+2|0),e=i;e;--e)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(w=!1,n=Math.ceil(u/m),t=1,l=f.times(f),o=new c(f),r=f;e!==-1;)if(r=r.times(l),s=o.minus(r.div(t+=2)),r=r.times(l),o=s.plus(r.div(t+=2)),o.d[n]!==void 0)for(e=n;o.d[e]===s.d[e]&&e--;);return i&&(o=o.times(2<this.d.length-2};h.isNaN=function(){return!this.s};h.isNegative=h.isNeg=function(){return this.s<0};h.isPositive=h.isPos=function(){return this.s>0};h.isZero=function(){return!!this.d&&this.d[0]===0};h.lessThan=h.lt=function(e){return this.cmp(e)<0};h.lessThanOrEqualTo=h.lte=function(e){return this.cmp(e)<1};h.logarithm=h.log=function(e){var n,i,t,r,s,o,u,l,f=this,c=f.constructor,a=c.precision,d=c.rounding,g=5;if(e==null)e=new c(10),n=!0;else{if(e=new c(e),i=e.d,e.s<0||!i||!i[0]||e.eq(1))return new c(NaN);n=e.eq(10)}if(i=f.d,f.s<0||!i||!i[0]||f.eq(1))return new c(i&&!i[0]?-1/0:f.s!=1?NaN:i?0:1/0);if(n)if(i.length>1)s=!0;else{for(r=i[0];r%10===0;)r/=10;s=r!==1}if(w=!1,u=a+g,o=B(f,u),t=n?se(c,u+10):B(e,u),l=S(o,t,u,1),x(l.d,r=a,d))do if(u+=10,o=B(f,u),t=n?se(c,u+10):B(e,u),l=S(o,t,u,1),!s){+O(l.d).slice(r+1,r+15)+1==1e14&&(l=p(l,a+1,0));break}while(x(l.d,r+=10,d));return w=!0,p(l,a,d)};h.minus=h.sub=function(e){var n,i,t,r,s,o,u,l,f,c,a,d,g=this,v=g.constructor;if(e=new v(e),!g.d||!e.d)return!g.s||!e.s?e=new v(NaN):g.d?e.s=-e.s:e=new v(e.d||g.s!==e.s?g:NaN),e;if(g.s!=e.s)return e.s=-e.s,g.plus(e);if(f=g.d,d=e.d,u=v.precision,l=v.rounding,!f[0]||!d[0]){if(d[0])e.s=-e.s;else if(f[0])e=new v(g);else return new v(l===3?-0:0);return w?p(e,u,l):e}if(i=b(e.e/m),c=b(g.e/m),f=f.slice(),s=c-i,s){for(a=s<0,a?(n=f,s=-s,o=d.length):(n=d,i=c,o=f.length),t=Math.max(Math.ceil(u/m),o)+2,s>t&&(s=t,n.length=1),n.reverse(),t=s;t--;)n.push(0);n.reverse()}else{for(t=f.length,o=d.length,a=t0;--t)f[o++]=0;for(t=d.length;t>s;){if(f[--t]o?s+1:o+1,r>o&&(r=o,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for(o=f.length,r=c.length,o-r<0&&(r=o,i=c,c=f,f=i),n=0;r;)n=(f[--r]=f[r]+c[r]+n)/D|0,f[r]%=D;for(n&&(f.unshift(n),++t),o=f.length;f[--o]==0;)f.pop();return e.d=f,e.e=ue(f,t),w?p(e,u,l):e};h.precision=h.sd=function(e){var n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(V+e);return i.d?(n=Ze(i.d),e&&i.e+1>n&&(n=i.e+1)):n=NaN,n};h.round=function(){var e=this,n=e.constructor;return p(new n(e),e.e+1,n.rounding)};h.sine=h.sin=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+Math.max(i.e,i.sd())+m,t.rounding=1,i=un(t,$e(t,i)),t.precision=e,t.rounding=n,p(Z>2?i.neg():i,e,n,!0)):new t(NaN)};h.squareRoot=h.sqrt=function(){var e,n,i,t,r,s,o=this,u=o.d,l=o.e,f=o.s,c=o.constructor;if(f!==1||!u||!u[0])return new c(!f||f<0&&(!u||u[0])?NaN:u?o:1/0);for(w=!1,f=Math.sqrt(+o),f==0||f==1/0?(n=O(u),(n.length+l)%2==0&&(n+="0"),f=Math.sqrt(n),l=b((l+1)/2)-(l<0||l%2),f==1/0?n="5e"+l:(n=f.toExponential(),n=n.slice(0,n.indexOf("e")+1)+l),t=new c(n)):t=new c(f.toString()),i=(l=c.precision)+3;;)if(s=t,t=s.plus(S(o,s,i+2,1)).times(.5),O(s.d).slice(0,i)===(n=O(t.d)).slice(0,i))if(n=n.slice(i-3,i+1),n=="9999"||!r&&n=="4999"){if(!r&&(p(s,l+1,0),s.times(s).eq(o))){t=s;break}i+=4,r=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(p(t,l+1,1),e=!t.times(t).eq(o));break}return w=!0,p(t,l,c.rounding,e)};h.tangent=h.tan=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+10,t.rounding=1,i=i.sin(),i.s=1,i=S(i,new t(1).minus(i.times(i)).sqrt(),e+10,0),t.precision=e,t.rounding=n,p(Z==2||Z==4?i.neg():i,e,n,!0)):new t(NaN)};h.times=h.mul=function(e){var n,i,t,r,s,o,u,l,f,c=this,a=c.constructor,d=c.d,g=(e=new a(e)).d;if(e.s*=c.s,!d||!d[0]||!g||!g[0])return new a(!e.s||d&&!d[0]&&!g||g&&!g[0]&&!d?NaN:!d||!g?e.s/0:e.s*0);for(i=b(c.e/m)+b(e.e/m),l=d.length,f=g.length,l=0;){for(n=0,r=l+t;r>t;)u=s[r]+g[t]*d[r-t-1]+n,s[r--]=u%D|0,n=u/D|0;s[r]=(s[r]+n)%D|0}for(;!s[--o];)s.pop();return n?++i:s.shift(),e.d=s,e.e=ue(s,i),w?p(e,a.precision,a.rounding):e};h.toBinary=function(e,n){return ke(this,2,e,n)};h.toDecimalPlaces=h.toDP=function(e,n){var i=this,t=i.constructor;return i=new t(i),e===void 0?i:(_(e,0,$),n===void 0?n=t.rounding:_(n,0,8),p(i,e+i.e+1,n))};h.toExponential=function(e,n){var i,t=this,r=t.constructor;return e===void 0?i=F(t,!0):(_(e,0,$),n===void 0?n=r.rounding:_(n,0,8),t=p(new r(t),e+1,n),i=F(t,!0,e+1)),t.isNeg()&&!t.isZero()?"-"+i:i};h.toFixed=function(e,n){var i,t,r=this,s=r.constructor;return e===void 0?i=F(r):(_(e,0,$),n===void 0?n=s.rounding:_(n,0,8),t=p(new s(r),e+r.e+1,n),i=F(t,!1,e+t.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i};h.toFraction=function(e){var n,i,t,r,s,o,u,l,f,c,a,d,g=this,v=g.d,N=g.constructor;if(!v)return new N(g);if(f=i=new N(1),t=l=new N(0),n=new N(t),s=n.e=Ze(v)-g.e-1,o=s%m,n.d[0]=C(10,o<0?m+o:o),e==null)e=s>0?n:f;else{if(u=new N(e),!u.isInt()||u.lt(f))throw Error(V+u);e=u.gt(n)?s>0?n:f:u}for(w=!1,u=new N(O(v)),c=N.precision,N.precision=s=v.length*m*2;a=S(u,n,0,1,1),r=i.plus(a.times(t)),r.cmp(e)!=1;)i=t,t=r,r=f,f=l.plus(a.times(r)),l=r,r=n,n=u.minus(a.times(r)),u=r;return r=S(e.minus(i),t,0,1,1),l=l.plus(r.times(f)),i=i.plus(r.times(t)),l.s=f.s=g.s,d=S(f,t,s,1).minus(g).abs().cmp(S(l,i,s,1).minus(g).abs())<1?[f,t]:[l,i],N.precision=c,w=!0,d};h.toHexadecimal=h.toHex=function(e,n){return ke(this,16,e,n)};h.toNearest=function(e,n){var i=this,t=i.constructor;if(i=new t(i),e==null){if(!i.d)return i;e=new t(1),n=t.rounding}else{if(e=new t(e),n===void 0?n=t.rounding:_(n,0,8),!i.d)return e.s?i:e;if(!e.d)return e.s&&(e.s=i.s),e}return e.d[0]?(w=!1,i=S(i,e,0,n,1).times(e),w=!0,p(i)):(e.s=i.s,i=e),i};h.toNumber=function(){return+this};h.toOctal=function(e,n){return ke(this,8,e,n)};h.toPower=h.pow=function(e){var n,i,t,r,s,o,u=this,l=u.constructor,f=+(e=new l(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new l(C(+u,f));if(u=new l(u),u.eq(1))return u;if(t=l.precision,s=l.rounding,e.eq(1))return p(u,t,s);if(n=b(e.e/m),n>=e.d.length-1&&(i=f<0?-f:f)<=tn)return r=Ue(l,u,i,t),e.s<0?new l(1).div(r):p(r,t,s);if(o=u.s,o<0){if(nl.maxE+1||n0?o/0:0):(w=!1,l.rounding=u.s=1,i=Math.min(12,(n+"").length),r=Ee(e.times(B(u,t+i)),t),r.d&&(r=p(r,t+5,1),x(r.d,t,s)&&(n=t+10,r=p(Ee(e.times(B(u,n+i)),n),n+5,1),+O(r.d).slice(t+1,t+15)+1==1e14&&(r=p(r,t+1,0)))),r.s=o,w=!0,l.rounding=s,p(r,t,s))};h.toPrecision=function(e,n){var i,t=this,r=t.constructor;return e===void 0?i=F(t,t.e<=r.toExpNeg||t.e>=r.toExpPos):(_(e,1,$),n===void 0?n=r.rounding:_(n,0,8),t=p(new r(t),e,n),i=F(t,e<=t.e||t.e<=r.toExpNeg,e)),t.isNeg()&&!t.isZero()?"-"+i:i};h.toSignificantDigits=h.toSD=function(e,n){var i=this,t=i.constructor;return e===void 0?(e=t.precision,n=t.rounding):(_(e,1,$),n===void 0?n=t.rounding:_(n,0,8)),p(new t(i),e,n)};h.toString=function(){var e=this,n=e.constructor,i=F(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()&&!e.isZero()?"-"+i:i};h.truncated=h.trunc=function(){return p(new this.constructor(this),this.e+1,1)};h.valueOf=h.toJSON=function(){var e=this,n=e.constructor,i=F(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()?"-"+i:i};function O(e){var n,i,t,r=e.length-1,s="",o=e[0];if(r>0){for(s+=o,n=1;ni)throw Error(V+e)}function x(e,n,i,t){var r,s,o,u;for(s=e[0];s>=10;s/=10)--n;return--n<0?(n+=m,r=0):(r=Math.ceil((n+1)/m),n%=m),s=C(10,m-n),u=e[r]%s|0,t==null?n<3?(n==0?u=u/100|0:n==1&&(u=u/10|0),o=i<4&&u==99999||i>3&&u==49999||u==5e4||u==0):o=(i<4&&u+1==s||i>3&&u+1==s/2)&&(e[r+1]/s/100|0)==C(10,n-2)-1||(u==s/2||u==0)&&(e[r+1]/s/100|0)==0:n<4?(n==0?u=u/1e3|0:n==1?u=u/100|0:n==2&&(u=u/10|0),o=(t||i<4)&&u==9999||!t&&i>3&&u==4999):o=((t||i<4)&&u+1==s||!t&&i>3&&u+1==s/2)&&(e[r+1]/s/1e3|0)==C(10,n-3)-1,o}function ie(e,n,i){for(var t,r=[0],s,o=0,u=e.length;oi-1&&(r[t+1]===void 0&&(r[t+1]=0),r[t+1]+=r[t]/i|0,r[t]%=i)}return r.reverse()}function sn(e,n){var i,t,r;if(n.isZero())return n;t=n.d.length,t<32?(i=Math.ceil(t/3),r=(1/fe(4,i)).toString()):(i=16,r="2.3283064365386962890625e-10"),e.precision+=i,n=j(e,1,n.times(r),new e(1));for(var s=i;s--;){var o=n.times(n);n=o.times(o).minus(o).times(8).plus(1)}return e.precision-=i,n}var S=function(){function e(t,r,s){var o,u=0,l=t.length;for(t=t.slice();l--;)o=t[l]*r+u,t[l]=o%s|0,u=o/s|0;return u&&t.unshift(u),t}function n(t,r,s,o){var u,l;if(s!=o)l=s>o?1:-1;else for(u=l=0;ur[u]?1:-1;break}return l}function i(t,r,s,o){for(var u=0;s--;)t[s]-=u,u=t[s]1;)t.shift()}return function(t,r,s,o,u,l){var f,c,a,d,g,v,N,A,M,q,E,P,Y,I,le,z,W,ce,T,y,ee=t.constructor,ae=t.s==r.s?1:-1,R=t.d,k=r.d;if(!R||!R[0]||!k||!k[0])return new ee(!t.s||!r.s||(R?k&&R[0]==k[0]:!k)?NaN:R&&R[0]==0||!k?ae*0:ae/0);for(l?(g=1,c=t.e-r.e):(l=D,g=m,c=b(t.e/g)-b(r.e/g)),T=k.length,W=R.length,M=new ee(ae),q=M.d=[],a=0;k[a]==(R[a]||0);a++);if(k[a]>(R[a]||0)&&c--,s==null?(I=s=ee.precision,o=ee.rounding):u?I=s+(t.e-r.e)+1:I=s,I<0)q.push(1),v=!0;else{if(I=I/g+2|0,a=0,T==1){for(d=0,k=k[0],I++;(a1&&(k=e(k,d,l),R=e(R,d,l),T=k.length,W=R.length),z=T,E=R.slice(0,T),P=E.length;P=l/2&&++ce;do d=0,f=n(k,E,T,P),f<0?(Y=E[0],T!=P&&(Y=Y*l+(E[1]||0)),d=Y/ce|0,d>1?(d>=l&&(d=l-1),N=e(k,d,l),A=N.length,P=E.length,f=n(N,E,A,P),f==1&&(d--,i(N,T=10;d/=10)a++;M.e=a+c*g-1,p(M,u?s+M.e+1:s,o,v)}return M}}();function p(e,n,i,t){var r,s,o,u,l,f,c,a,d,g=e.constructor;e:if(n!=null){if(a=e.d,!a)return e;for(r=1,u=a[0];u>=10;u/=10)r++;if(s=n-r,s<0)s+=m,o=n,c=a[d=0],l=c/C(10,r-o-1)%10|0;else if(d=Math.ceil((s+1)/m),u=a.length,d>=u)if(t){for(;u++<=d;)a.push(0);c=l=0,r=1,s%=m,o=s-m+1}else break e;else{for(c=u=a[d],r=1;u>=10;u/=10)r++;s%=m,o=s-m+r,l=o<0?0:c/C(10,r-o-1)%10|0}if(t=t||n<0||a[d+1]!==void 0||(o<0?c:c%C(10,r-o-1)),f=i<4?(l||t)&&(i==0||i==(e.s<0?3:2)):l>5||l==5&&(i==4||t||i==6&&(s>0?o>0?c/C(10,r-o):0:a[d-1])%10&1||i==(e.s<0?8:7)),n<1||!a[0])return a.length=0,f?(n-=e.e+1,a[0]=C(10,(m-n%m)%m),e.e=-n||0):a[0]=e.e=0,e;if(s==0?(a.length=d,u=1,d--):(a.length=d+1,u=C(10,m-s),a[d]=o>0?(c/C(10,r-o)%C(10,o)|0)*u:0),f)for(;;)if(d==0){for(s=1,o=a[0];o>=10;o/=10)s++;for(o=a[0]+=u,u=1;o>=10;o/=10)u++;s!=u&&(e.e++,a[0]==D&&(a[0]=1));break}else{if(a[d]+=u,a[d]!=D)break;a[d--]=0,u=1}for(s=a.length;a[--s]===0;)a.pop()}return w&&(e.e>g.maxE?(e.d=null,e.e=NaN):e.e0?s=s.charAt(0)+"."+s.slice(1)+U(t):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):r<0?(s="0."+U(-r-1)+s,i&&(t=i-o)>0&&(s+=U(t))):r>=o?(s+=U(r+1-o),i&&(t=i-r-1)>0&&(s=s+"."+U(t))):((t=r+1)0&&(r+1===o&&(s+="."),s+=U(t))),s}function ue(e,n){var i=e[0];for(n*=m;i>=10;i/=10)n++;return n}function se(e,n,i){if(n>rn)throw w=!0,i&&(e.precision=i),Error(Le);return p(new e(te),n,1,!0)}function L(e,n,i){if(n>ve)throw Error(Le);return p(new e(re),n,i,!0)}function Ze(e){var n=e.length-1,i=n*m+1;if(n=e[n],n){for(;n%10==0;n/=10)i--;for(n=e[0];n>=10;n/=10)i++}return i}function U(e){for(var n="";e--;)n+="0";return n}function Ue(e,n,i,t){var r,s=new e(1),o=Math.ceil(t/m+4);for(w=!1;;){if(i%2&&(s=s.times(n),_e(s.d,o)&&(r=!0)),i=b(i/2),i===0){i=s.d.length-1,r&&s.d[i]===0&&++s.d[i];break}n=n.times(n),_e(n.d,o)}return w=!0,s}function Ae(e){return e.d[e.d.length-1]&1}function Be(e,n,i){for(var t,r=new e(n[0]),s=0;++s17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(n==null?(w=!1,l=v):l=n,u=new d(.03125);e.e>-2;)e=e.times(u),a+=5;for(t=Math.log(C(2,a))/Math.LN10*2+5|0,l+=t,i=s=o=new d(1),d.precision=l;;){if(s=p(s.times(e),l,1),i=i.times(++c),u=o.plus(S(s,i,l,1)),O(u.d).slice(0,l)===O(o.d).slice(0,l)){for(r=a;r--;)o=p(o.times(o),l,1);if(n==null)if(f<3&&x(o.d,l-t,g,f))d.precision=l+=10,i=s=u=new d(1),c=0,f++;else return p(o,d.precision=v,g,w=!0);else return d.precision=v,o}o=u}}function B(e,n){var i,t,r,s,o,u,l,f,c,a,d,g=1,v=10,N=e,A=N.d,M=N.constructor,q=M.rounding,E=M.precision;if(N.s<0||!A||!A[0]||!N.e&&A[0]==1&&A.length==1)return new M(A&&!A[0]?-1/0:N.s!=1?NaN:A?0:N);if(n==null?(w=!1,c=E):c=n,M.precision=c+=v,i=O(A),t=i.charAt(0),Math.abs(s=N.e)<15e14){for(;t<7&&t!=1||t==1&&i.charAt(1)>3;)N=N.times(e),i=O(N.d),t=i.charAt(0),g++;s=N.e,t>1?(N=new M("0."+i),s++):N=new M(t+"."+i.slice(1))}else return f=se(M,c+2,E).times(s+""),N=B(new M(t+"."+i.slice(1)),c-v).plus(f),M.precision=E,n==null?p(N,E,q,w=!0):N;for(a=N,l=o=N=S(N.minus(1),N.plus(1),c,1),d=p(N.times(N),c,1),r=3;;){if(o=p(o.times(d),c,1),f=l.plus(S(o,new M(r),c,1)),O(f.d).slice(0,c)===O(l.d).slice(0,c))if(l=l.times(2),s!==0&&(l=l.plus(se(M,c+2,E).times(s+""))),l=S(l,new M(g),c,1),n==null)if(x(l.d,c-v,q,u))M.precision=c+=v,f=o=N=S(a.minus(1),a.plus(1),c,1),d=p(N.times(N),c,1),r=u=1;else return p(l,M.precision=E,q,w=!0);else return M.precision=E,l;l=f,r+=2}}function Ve(e){return String(e.s*e.s/0)}function Se(e,n){var i,t,r;for((i=n.indexOf("."))>-1&&(n=n.replace(".","")),(t=n.search(/e/i))>0?(i<0&&(i=t),i+=+n.slice(t+1),n=n.substring(0,t)):i<0&&(i=n.length),t=0;n.charCodeAt(t)===48;t++);for(r=n.length;n.charCodeAt(r-1)===48;--r);if(n=n.slice(t,r),n){if(r-=t,e.e=i=i-t-1,e.d=[],t=(i+1)%m,i<0&&(t+=m),te.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),Ie.test(n))return Se(e,n)}else if(n==="Infinity"||n==="NaN")return+n||(e.s=NaN),e.e=NaN,e.d=null,e;if(en.test(n))i=16,n=n.toLowerCase();else if(ye.test(n))i=2;else if(nn.test(n))i=8;else throw Error(V+n);for(s=n.search(/p/i),s>0?(l=+n.slice(s+1),n=n.substring(2,s)):n=n.slice(2),s=n.indexOf("."),o=s>=0,t=e.constructor,o&&(n=n.replace(".",""),u=n.length,s=u-s,r=Ue(t,new t(i),s,s*2)),f=ie(n,i,D),c=f.length-1,s=c;f[s]===0;--s)f.pop();return s<0?new t(e.s*0):(e.e=ue(f,c),e.d=f,w=!1,o&&(e=S(e,r,u*4)),l&&(e=e.times(Math.abs(l)<54?C(2,l):Q.pow(2,l))),w=!0,e)}function un(e,n){var i,t=n.d.length;if(t<3)return n.isZero()?n:j(e,2,n,n);i=1.4*Math.sqrt(t),i=i>16?16:i|0,n=n.times(1/fe(5,i)),n=j(e,2,n,n);for(var r,s=new e(5),o=new e(16),u=new e(20);i--;)r=n.times(n),n=n.times(s.plus(r.times(o.times(r).minus(u))));return n}function j(e,n,i,t,r){var s,o,u,l,f=1,c=e.precision,a=Math.ceil(c/m);for(w=!1,l=i.times(i),u=new e(t);;){if(o=S(u.times(l),new e(n++*n++),c,1),u=r?t.plus(o):t.minus(o),t=S(o.times(l),new e(n++*n++),c,1),o=u.plus(t),o.d[a]!==void 0){for(s=a;o.d[s]===u.d[s]&&s--;);if(s==-1)break}s=u,u=t,t=o,o=s,f++}return w=!0,o.d.length=a+1,o}function fe(e,n){for(var i=e;--n;)i*=e;return i}function $e(e,n){var i,t=n.s<0,r=L(e,e.precision,1),s=r.times(.5);if(n=n.abs(),n.lte(s))return Z=t?4:1,n;if(i=n.divToInt(r),i.isZero())Z=t?3:2;else{if(n=n.minus(i.times(r)),n.lte(s))return Z=Ae(i)?t?2:3:t?4:1,n;Z=Ae(i)?t?1:4:t?3:2}return n.minus(r).abs()}function ke(e,n,i,t){var r,s,o,u,l,f,c,a,d,g=e.constructor,v=i!==void 0;if(v?(_(i,1,$),t===void 0?t=g.rounding:_(t,0,8)):(i=g.precision,t=g.rounding),!e.isFinite())c=Ve(e);else{for(c=F(e),o=c.indexOf("."),v?(r=2,n==16?i=i*4-3:n==8&&(i=i*3-2)):r=n,o>=0&&(c=c.replace(".",""),d=new g(1),d.e=c.length-o,d.d=ie(F(d),10,r),d.e=d.d.length),a=ie(c,10,r),s=l=a.length;a[--l]==0;)a.pop();if(!a[0])c=v?"0p+0":"0";else{if(o<0?s--:(e=new g(e),e.d=a,e.e=s,e=S(e,d,i,t,0,r),a=e.d,s=e.e,f=Te),o=a[i],u=r/2,f=f||a[i+1]!==void 0,f=t<4?(o!==void 0||f)&&(t===0||t===(e.s<0?3:2)):o>u||o===u&&(t===4||f||t===6&&a[i-1]&1||t===(e.s<0?8:7)),a.length=i,f)for(;++a[--i]>r-1;)a[i]=0,i||(++s,a.unshift(1));for(l=a.length;!a[l-1];--l);for(o=0,c="";o1)if(n==16||n==8){for(o=n==16?4:3,--l;l%o;l++)c+="0";for(a=ie(c,r,n),l=a.length;!a[l-1];--l);for(o=1,c="1.";ol)for(s-=l;s--;)c+="0";else sn)return e.length=n,!0}function fn(e){return new this(e).abs()}function ln(e){return new this(e).acos()}function cn(e){return new this(e).acosh()}function an(e,n){return new this(e).plus(n)}function dn(e){return new this(e).asin()}function hn(e){return new this(e).asinh()}function pn(e){return new this(e).atan()}function gn(e){return new this(e).atanh()}function mn(e,n){e=new this(e),n=new this(n);var i,t=this.precision,r=this.rounding,s=t+4;return!e.s||!n.s?i=new this(NaN):!e.d&&!n.d?(i=L(this,s,1).times(n.s>0?.25:.75),i.s=e.s):!n.d||e.isZero()?(i=n.s<0?L(this,t,r):new this(0),i.s=e.s):!e.d||n.isZero()?(i=L(this,s,1).times(.5),i.s=e.s):n.s<0?(this.precision=s,this.rounding=1,i=this.atan(S(e,n,s,1)),n=L(this,s,1),this.precision=t,this.rounding=r,i=e.s<0?i.minus(n):i.plus(n)):i=this.atan(S(e,n,s,1)),i}function wn(e){return new this(e).cbrt()}function Nn(e){return p(e=new this(e),e.e+1,2)}function vn(e,n,i){return new this(e).clamp(n,i)}function En(e){if(!e||typeof e!="object")throw Error(oe+"Object expected");var n,i,t,r=e.defaults===!0,s=["precision",1,$,"rounding",0,8,"toExpNeg",-H,0,"toExpPos",0,H,"maxE",0,H,"minE",-H,0,"modulo",0,9];for(n=0;n=s[n+1]&&t<=s[n+2])this[i]=t;else throw Error(V+i+": "+t);if(i="crypto",r&&(this[i]=Ne[i]),(t=e[i])!==void 0)if(t===!0||t===!1||t===0||t===1)if(t)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[i]=!0;else throw Error(De);else this[i]=!1;else throw Error(V+i+": "+t);return this}function Sn(e){return new this(e).cos()}function kn(e){return new this(e).cosh()}function He(e){var n,i,t;function r(s){var o,u,l,f=this;if(!(f instanceof r))return new r(s);if(f.constructor=r,qe(s)){f.s=s.s,w?!s.d||s.e>r.maxE?(f.e=NaN,f.d=null):s.e=10;u/=10)o++;w?o>r.maxE?(f.e=NaN,f.d=null):o=429e7?n[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=r%1e7;else if(crypto.randomBytes){for(n=crypto.randomBytes(t*=4);s=214e7?crypto.randomBytes(4).copy(n,s):(u.push(r%1e7),s+=4);s=t/4}else throw Error(De);else for(;s=10;r/=10)t++;t - * MIT Licence - *) -*/ -//# sourceMappingURL=index-browser.js.map diff --git a/node_modules/@prisma/client/runtime/library.d.ts b/node_modules/@prisma/client/runtime/library.d.ts deleted file mode 100644 index be22f30..0000000 --- a/node_modules/@prisma/client/runtime/library.d.ts +++ /dev/null @@ -1,3378 +0,0 @@ -/** - * @param this - */ -declare function $extends(this: Client, extension: ExtensionArgs | ((client: Client) => Client)): Client; - -declare type AccelerateEngineConfig = { - inlineSchema: EngineConfig['inlineSchema']; - inlineSchemaHash: EngineConfig['inlineSchemaHash']; - env: EngineConfig['env']; - generator?: { - previewFeatures: string[]; - }; - inlineDatasources: EngineConfig['inlineDatasources']; - overrideDatasources: EngineConfig['overrideDatasources']; - clientVersion: EngineConfig['clientVersion']; - engineVersion: EngineConfig['engineVersion']; - logEmitter: EngineConfig['logEmitter']; - logQueries?: EngineConfig['logQueries']; - logLevel?: EngineConfig['logLevel']; - tracingHelper: EngineConfig['tracingHelper']; - accelerateUtils?: EngineConfig['accelerateUtils']; -}; - -export declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw'; - -declare type ActiveConnectorType = Exclude; - -export declare type Aggregate = '_count' | '_max' | '_min' | '_avg' | '_sum'; - -export declare type AllModelsToStringIndex, K extends PropertyKey> = Args extends { - [P in K]: { - $allModels: infer AllModels; - }; -} ? { - [P in K]: Record; -} : {}; - -declare class AnyNull extends NullTypesEnumValue { -} - -export declare type ApplyOmit = Compute<{ - [K in keyof T as OmitValue extends true ? never : K]: T[K]; -}>; - -export declare type Args = T extends { - [K: symbol]: { - types: { - operations: { - [K in F]: { - args: any; - }; - }; - }; - }; -} ? T[symbol]['types']['operations'][F]['args'] : any; - -export declare type Args_3 = Args; - -/** - * Original `quaint::ValueType` enum tag from Prisma's `quaint`. - * Query arguments marked with this type are sanitized before being sent to the database. - * Notice while a query argument may be `null`, `ArgType` is guaranteed to be defined. - */ -declare type ArgType = 'Int32' | 'Int64' | 'Float' | 'Double' | 'Text' | 'Enum' | 'EnumArray' | 'Bytes' | 'Boolean' | 'Char' | 'Array' | 'Numeric' | 'Json' | 'Xml' | 'Uuid' | 'DateTime' | 'Date' | 'Time'; - -/** - * Attributes is a map from string to attribute values. - * - * Note: only the own enumerable keys are counted as valid attribute keys. - */ -declare interface Attributes { - [attributeKey: string]: AttributeValue | undefined; -} - -/** - * Attribute values may be any non-nullish primitive value except an object. - * - * null or undefined attribute values are invalid and will result in undefined behavior. - */ -declare type AttributeValue = string | number | boolean | Array | Array | Array; - -export declare type BaseDMMF = { - readonly datamodel: Omit; -}; - -declare type BatchArgs = { - queries: BatchQuery[]; - transaction?: { - isolationLevel?: IsolationLevel; - }; -}; - -declare type BatchInternalParams = { - requests: RequestParams[]; - customDataProxyFetch?: CustomDataProxyFetch; -}; - -declare type BatchQuery = { - model: string | undefined; - operation: string; - args: JsArgs | RawQueryArgs; -}; - -declare type BatchQueryEngineResult = QueryEngineResult | Error; - -declare type BatchQueryOptionsCb = (args: BatchQueryOptionsCbArgs) => Promise; - -declare type BatchQueryOptionsCbArgs = { - args: BatchArgs; - query: (args: BatchArgs, __internalParams?: BatchInternalParams) => Promise; - __internalParams: BatchInternalParams; -}; - -declare type BatchTransactionOptions = { - isolationLevel?: Transaction_2.IsolationLevel; -}; - -declare interface BinaryTargetsEnvValue { - fromEnvVar: string | null; - value: string; - native?: boolean; -} - -export declare type Call = (F & { - params: P; -})['returns']; - -declare interface CallSite { - getLocation(): LocationInFile | null; -} - -export declare type Cast = A extends W ? A : W; - -declare type Client = ReturnType extends new () => infer T ? T : never; - -export declare type ClientArg = { - [MethodName in string]: unknown; -}; - -export declare type ClientArgs = { - client: ClientArg; -}; - -export declare type ClientBuiltInProp = keyof DynamicClientExtensionThisBuiltin; - -export declare type ClientOptionDef = undefined | { - [K in string]: any; -}; - -export declare type ClientOtherOps = { - $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise; - $queryRawTyped(query: TypedSql): PrismaPromise; - $queryRawUnsafe(query: string, ...values: any[]): PrismaPromise; - $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise; - $executeRawUnsafe(query: string, ...values: any[]): PrismaPromise; - $runCommandRaw(command: InputJsonObject): PrismaPromise; -}; - -declare type ColumnType = (typeof ColumnTypeEnum)[keyof typeof ColumnTypeEnum]; - -declare const ColumnTypeEnum: { - readonly Int32: 0; - readonly Int64: 1; - readonly Float: 2; - readonly Double: 3; - readonly Numeric: 4; - readonly Boolean: 5; - readonly Character: 6; - readonly Text: 7; - readonly Date: 8; - readonly Time: 9; - readonly DateTime: 10; - readonly Json: 11; - readonly Enum: 12; - readonly Bytes: 13; - readonly Set: 14; - readonly Uuid: 15; - readonly Int32Array: 64; - readonly Int64Array: 65; - readonly FloatArray: 66; - readonly DoubleArray: 67; - readonly NumericArray: 68; - readonly BooleanArray: 69; - readonly CharacterArray: 70; - readonly TextArray: 71; - readonly DateArray: 72; - readonly TimeArray: 73; - readonly DateTimeArray: 74; - readonly JsonArray: 75; - readonly EnumArray: 76; - readonly BytesArray: 77; - readonly UuidArray: 78; - readonly UnknownNumber: 128; -}; - -export declare type Compute = T extends Function ? T : { - [K in keyof T]: T[K]; -} & unknown; - -export declare type ComputeDeep = T extends Function ? T : { - [K in keyof T]: ComputeDeep; -} & unknown; - -declare type ComputedField = { - name: string; - needs: string[]; - compute: ResultArgsFieldCompute; -}; - -declare type ComputedFieldsMap = { - [fieldName: string]: ComputedField; -}; - -declare type ConnectionInfo = { - schemaName?: string; - maxBindValues?: number; -}; - -declare type ConnectorType = 'mysql' | 'mongodb' | 'sqlite' | 'postgresql' | 'postgres' | 'sqlserver' | 'cockroachdb'; - -declare interface Context { - /** - * Get a value from the context. - * - * @param key key which identifies a context value - */ - getValue(key: symbol): unknown; - /** - * Create a new context which inherits from this context and has - * the given key set to the given value. - * - * @param key context key for which to set the value - * @param value value to set for the given key - */ - setValue(key: symbol, value: unknown): Context; - /** - * Return a new context which inherits from this context but does - * not contain a value for the given key. - * - * @param key context key for which to clear a value - */ - deleteValue(key: symbol): Context; -} - -declare type Context_2 = T extends { - [K: symbol]: { - ctx: infer C; - }; -} ? C & T & { - /** - * @deprecated Use `$name` instead. - */ - name?: string; - $name?: string; - $parent?: unknown; -} : T & { - /** - * @deprecated Use `$name` instead. - */ - name?: string; - $name?: string; - $parent?: unknown; -}; - -export declare type Count = { - [K in keyof O]: Count; -} & {}; - -declare type CustomDataProxyFetch = (fetch: Fetch) => Fetch; - -declare class DataLoader { - private options; - batches: { - [key: string]: Job[]; - }; - private tickActive; - constructor(options: DataLoaderOptions); - request(request: T): Promise; - private dispatchBatches; - get [Symbol.toStringTag](): string; -} - -declare type DataLoaderOptions = { - singleLoader: (request: T) => Promise; - batchLoader: (request: T[]) => Promise; - batchBy: (request: T) => string | undefined; - batchOrder: (requestA: T, requestB: T) => number; -}; - -declare type Datasource = { - url?: string; -}; - -declare type Datasources = { - [name in string]: Datasource; -}; - -declare class DbNull extends NullTypesEnumValue { -} - -export declare const Debug: typeof debugCreate & { - enable(namespace: any): void; - disable(): any; - enabled(namespace: string): boolean; - log: (...args: string[]) => void; - formatters: {}; -}; - -/** - * Create a new debug instance with the given namespace. - * - * @example - * ```ts - * import Debug from '@prisma/debug' - * const debug = Debug('prisma:client') - * debug('Hello World') - * ``` - */ -declare function debugCreate(namespace: string): ((...args: any[]) => void) & { - color: string; - enabled: boolean; - namespace: string; - log: (...args: string[]) => void; - extend: () => void; -}; - -export declare namespace Decimal { - export type Constructor = typeof Decimal; - export type Instance = Decimal; - export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - export type Modulo = Rounding | 9; - export type Value = string | number | Decimal; - - // http://mikemcl.github.io/decimal.js/#constructor-properties - export interface Config { - precision?: number; - rounding?: Rounding; - toExpNeg?: number; - toExpPos?: number; - minE?: number; - maxE?: number; - crypto?: boolean; - modulo?: Modulo; - defaults?: boolean; - } -} - -export declare class Decimal { - readonly d: number[]; - readonly e: number; - readonly s: number; - - constructor(n: Decimal.Value); - - absoluteValue(): Decimal; - abs(): Decimal; - - ceil(): Decimal; - - clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; - clamp(min: Decimal.Value, max: Decimal.Value): Decimal; - - comparedTo(n: Decimal.Value): number; - cmp(n: Decimal.Value): number; - - cosine(): Decimal; - cos(): Decimal; - - cubeRoot(): Decimal; - cbrt(): Decimal; - - decimalPlaces(): number; - dp(): number; - - dividedBy(n: Decimal.Value): Decimal; - div(n: Decimal.Value): Decimal; - - dividedToIntegerBy(n: Decimal.Value): Decimal; - divToInt(n: Decimal.Value): Decimal; - - equals(n: Decimal.Value): boolean; - eq(n: Decimal.Value): boolean; - - floor(): Decimal; - - greaterThan(n: Decimal.Value): boolean; - gt(n: Decimal.Value): boolean; - - greaterThanOrEqualTo(n: Decimal.Value): boolean; - gte(n: Decimal.Value): boolean; - - hyperbolicCosine(): Decimal; - cosh(): Decimal; - - hyperbolicSine(): Decimal; - sinh(): Decimal; - - hyperbolicTangent(): Decimal; - tanh(): Decimal; - - inverseCosine(): Decimal; - acos(): Decimal; - - inverseHyperbolicCosine(): Decimal; - acosh(): Decimal; - - inverseHyperbolicSine(): Decimal; - asinh(): Decimal; - - inverseHyperbolicTangent(): Decimal; - atanh(): Decimal; - - inverseSine(): Decimal; - asin(): Decimal; - - inverseTangent(): Decimal; - atan(): Decimal; - - isFinite(): boolean; - - isInteger(): boolean; - isInt(): boolean; - - isNaN(): boolean; - - isNegative(): boolean; - isNeg(): boolean; - - isPositive(): boolean; - isPos(): boolean; - - isZero(): boolean; - - lessThan(n: Decimal.Value): boolean; - lt(n: Decimal.Value): boolean; - - lessThanOrEqualTo(n: Decimal.Value): boolean; - lte(n: Decimal.Value): boolean; - - logarithm(n?: Decimal.Value): Decimal; - log(n?: Decimal.Value): Decimal; - - minus(n: Decimal.Value): Decimal; - sub(n: Decimal.Value): Decimal; - - modulo(n: Decimal.Value): Decimal; - mod(n: Decimal.Value): Decimal; - - naturalExponential(): Decimal; - exp(): Decimal; - - naturalLogarithm(): Decimal; - ln(): Decimal; - - negated(): Decimal; - neg(): Decimal; - - plus(n: Decimal.Value): Decimal; - add(n: Decimal.Value): Decimal; - - precision(includeZeros?: boolean): number; - sd(includeZeros?: boolean): number; - - round(): Decimal; - - sine() : Decimal; - sin() : Decimal; - - squareRoot(): Decimal; - sqrt(): Decimal; - - tangent() : Decimal; - tan() : Decimal; - - times(n: Decimal.Value): Decimal; - mul(n: Decimal.Value) : Decimal; - - toBinary(significantDigits?: number): string; - toBinary(significantDigits: number, rounding: Decimal.Rounding): string; - - toDecimalPlaces(decimalPlaces?: number): Decimal; - toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - toDP(decimalPlaces?: number): Decimal; - toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - - toExponential(decimalPlaces?: number): string; - toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFixed(decimalPlaces?: number): string; - toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFraction(max_denominator?: Decimal.Value): Decimal[]; - - toHexadecimal(significantDigits?: number): string; - toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; - toHex(significantDigits?: number): string; - toHex(significantDigits: number, rounding?: Decimal.Rounding): string; - - toJSON(): string; - - toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; - - toNumber(): number; - - toOctal(significantDigits?: number): string; - toOctal(significantDigits: number, rounding: Decimal.Rounding): string; - - toPower(n: Decimal.Value): Decimal; - pow(n: Decimal.Value): Decimal; - - toPrecision(significantDigits?: number): string; - toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; - - toSignificantDigits(significantDigits?: number): Decimal; - toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; - toSD(significantDigits?: number): Decimal; - toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; - - toString(): string; - - truncated(): Decimal; - trunc(): Decimal; - - valueOf(): string; - - static abs(n: Decimal.Value): Decimal; - static acos(n: Decimal.Value): Decimal; - static acosh(n: Decimal.Value): Decimal; - static add(x: Decimal.Value, y: Decimal.Value): Decimal; - static asin(n: Decimal.Value): Decimal; - static asinh(n: Decimal.Value): Decimal; - static atan(n: Decimal.Value): Decimal; - static atanh(n: Decimal.Value): Decimal; - static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; - static cbrt(n: Decimal.Value): Decimal; - static ceil(n: Decimal.Value): Decimal; - static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; - static clone(object?: Decimal.Config): Decimal.Constructor; - static config(object: Decimal.Config): Decimal.Constructor; - static cos(n: Decimal.Value): Decimal; - static cosh(n: Decimal.Value): Decimal; - static div(x: Decimal.Value, y: Decimal.Value): Decimal; - static exp(n: Decimal.Value): Decimal; - static floor(n: Decimal.Value): Decimal; - static hypot(...n: Decimal.Value[]): Decimal; - static isDecimal(object: any): object is Decimal; - static ln(n: Decimal.Value): Decimal; - static log(n: Decimal.Value, base?: Decimal.Value): Decimal; - static log2(n: Decimal.Value): Decimal; - static log10(n: Decimal.Value): Decimal; - static max(...n: Decimal.Value[]): Decimal; - static min(...n: Decimal.Value[]): Decimal; - static mod(x: Decimal.Value, y: Decimal.Value): Decimal; - static mul(x: Decimal.Value, y: Decimal.Value): Decimal; - static noConflict(): Decimal.Constructor; // Browser only - static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; - static random(significantDigits?: number): Decimal; - static round(n: Decimal.Value): Decimal; - static set(object: Decimal.Config): Decimal.Constructor; - static sign(n: Decimal.Value): number; - static sin(n: Decimal.Value): Decimal; - static sinh(n: Decimal.Value): Decimal; - static sqrt(n: Decimal.Value): Decimal; - static sub(x: Decimal.Value, y: Decimal.Value): Decimal; - static sum(...n: Decimal.Value[]): Decimal; - static tan(n: Decimal.Value): Decimal; - static tanh(n: Decimal.Value): Decimal; - static trunc(n: Decimal.Value): Decimal; - - static readonly default?: Decimal.Constructor; - static readonly Decimal?: Decimal.Constructor; - - static readonly precision: number; - static readonly rounding: Decimal.Rounding; - static readonly toExpNeg: number; - static readonly toExpPos: number; - static readonly minE: number; - static readonly maxE: number; - static readonly crypto: boolean; - static readonly modulo: Decimal.Modulo; - - static readonly ROUND_UP: 0; - static readonly ROUND_DOWN: 1; - static readonly ROUND_CEIL: 2; - static readonly ROUND_FLOOR: 3; - static readonly ROUND_HALF_UP: 4; - static readonly ROUND_HALF_DOWN: 5; - static readonly ROUND_HALF_EVEN: 6; - static readonly ROUND_HALF_CEIL: 7; - static readonly ROUND_HALF_FLOOR: 8; - static readonly EUCLID: 9; -} - -/** - * Interface for any Decimal.js-like library - * Allows us to accept Decimal.js from different - * versions and some compatible alternatives - */ -export declare interface DecimalJsLike { - d: number[]; - e: number; - s: number; - toFixed(): string; -} - -export declare type DefaultArgs = InternalArgs<{}, {}, {}, {}>; - -export declare type DefaultSelection = Args extends { - omit: infer LocalOmit; -} ? ApplyOmit['default'], PatchFlat>>> : ApplyOmit['default'], ExtractGlobalOmit>>; - -export declare function defineDmmfProperty(target: object, runtimeDataModel: RuntimeDataModel): void; - -declare function defineExtension(ext: ExtensionArgs | ((client: Client) => Client)): (client: Client) => Client; - -declare const denylist: readonly ["$connect", "$disconnect", "$on", "$transaction", "$use", "$extends"]; - -export declare type DevTypeMapDef = { - meta: { - modelProps: string; - }; - model: { - [Model in PropertyKey]: { - [Operation in PropertyKey]: DevTypeMapFnDef; - }; - }; - other: { - [Operation in PropertyKey]: DevTypeMapFnDef; - }; -}; - -export declare type DevTypeMapFnDef = { - args: any; - result: any; - payload: OperationPayload; -}; - -export declare namespace DMMF { - export type Document = ReadonlyDeep_2<{ - datamodel: Datamodel; - schema: Schema; - mappings: Mappings; - }>; - export type Mappings = ReadonlyDeep_2<{ - modelOperations: ModelMapping[]; - otherOperations: { - read: string[]; - write: string[]; - }; - }>; - export type OtherOperationMappings = ReadonlyDeep_2<{ - read: string[]; - write: string[]; - }>; - export type DatamodelEnum = ReadonlyDeep_2<{ - name: string; - values: EnumValue[]; - dbName?: string | null; - documentation?: string; - }>; - export type SchemaEnum = ReadonlyDeep_2<{ - name: string; - values: string[]; - }>; - export type EnumValue = ReadonlyDeep_2<{ - name: string; - dbName: string | null; - }>; - export type Datamodel = ReadonlyDeep_2<{ - models: Model[]; - enums: DatamodelEnum[]; - types: Model[]; - indexes: Index[]; - }>; - export type uniqueIndex = ReadonlyDeep_2<{ - name: string; - fields: string[]; - }>; - export type PrimaryKey = ReadonlyDeep_2<{ - name: string | null; - fields: string[]; - }>; - export type Model = ReadonlyDeep_2<{ - name: string; - dbName: string | null; - fields: Field[]; - uniqueFields: string[][]; - uniqueIndexes: uniqueIndex[]; - documentation?: string; - primaryKey: PrimaryKey | null; - isGenerated?: boolean; - }>; - export type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported'; - export type FieldNamespace = 'model' | 'prisma'; - export type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes'; - export type Field = ReadonlyDeep_2<{ - kind: FieldKind; - name: string; - isRequired: boolean; - isList: boolean; - isUnique: boolean; - isId: boolean; - isReadOnly: boolean; - isGenerated?: boolean; - isUpdatedAt?: boolean; - /** - * Describes the data type in the same the way it is defined in the Prisma schema: - * BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName - */ - type: string; - dbName?: string | null; - hasDefaultValue: boolean; - default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[]; - relationFromFields?: string[]; - relationToFields?: string[]; - relationOnDelete?: string; - relationName?: string; - documentation?: string; - }>; - export type FieldDefault = ReadonlyDeep_2<{ - name: string; - args: any[]; - }>; - export type FieldDefaultScalar = string | boolean | number; - export type Index = ReadonlyDeep_2<{ - model: string; - type: IndexType; - isDefinedOnField: boolean; - name?: string; - dbName?: string; - algorithm?: string; - clustered?: boolean; - fields: IndexField[]; - }>; - export type IndexType = 'id' | 'normal' | 'unique' | 'fulltext'; - export type IndexField = ReadonlyDeep_2<{ - name: string; - sortOrder?: SortOrder; - length?: number; - operatorClass?: string; - }>; - export type SortOrder = 'asc' | 'desc'; - export type Schema = ReadonlyDeep_2<{ - rootQueryType?: string; - rootMutationType?: string; - inputObjectTypes: { - model?: InputType[]; - prisma: InputType[]; - }; - outputObjectTypes: { - model: OutputType[]; - prisma: OutputType[]; - }; - enumTypes: { - model?: SchemaEnum[]; - prisma: SchemaEnum[]; - }; - fieldRefTypes: { - prisma?: FieldRefType[]; - }; - }>; - export type Query = ReadonlyDeep_2<{ - name: string; - args: SchemaArg[]; - output: QueryOutput; - }>; - export type QueryOutput = ReadonlyDeep_2<{ - name: string; - isRequired: boolean; - isList: boolean; - }>; - export type TypeRef = { - isList: boolean; - type: string; - location: AllowedLocations; - namespace?: FieldNamespace; - }; - export type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>; - export type SchemaArg = ReadonlyDeep_2<{ - name: string; - comment?: string; - isNullable: boolean; - isRequired: boolean; - inputTypes: InputTypeRef[]; - deprecation?: Deprecation; - }>; - export type OutputType = ReadonlyDeep_2<{ - name: string; - fields: SchemaField[]; - }>; - export type SchemaField = ReadonlyDeep_2<{ - name: string; - isNullable?: boolean; - outputType: OutputTypeRef; - args: SchemaArg[]; - deprecation?: Deprecation; - documentation?: string; - }>; - export type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>; - export type Deprecation = ReadonlyDeep_2<{ - sinceVersion: string; - reason: string; - plannedRemovalVersion?: string; - }>; - export type InputType = ReadonlyDeep_2<{ - name: string; - constraints: { - maxNumFields: number | null; - minNumFields: number | null; - fields?: string[]; - }; - meta?: { - source?: string; - }; - fields: SchemaArg[]; - }>; - export type FieldRefType = ReadonlyDeep_2<{ - name: string; - allowTypes: FieldRefAllowType[]; - fields: SchemaArg[]; - }>; - export type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>; - export type ModelMapping = ReadonlyDeep_2<{ - model: string; - plural: string; - findUnique?: string | null; - findUniqueOrThrow?: string | null; - findFirst?: string | null; - findFirstOrThrow?: string | null; - findMany?: string | null; - create?: string | null; - createMany?: string | null; - createManyAndReturn?: string | null; - update?: string | null; - updateMany?: string | null; - upsert?: string | null; - delete?: string | null; - deleteMany?: string | null; - aggregate?: string | null; - groupBy?: string | null; - count?: string | null; - findRaw?: string | null; - aggregateRaw?: string | null; - }>; - export enum ModelAction { - findUnique = "findUnique", - findUniqueOrThrow = "findUniqueOrThrow", - findFirst = "findFirst", - findFirstOrThrow = "findFirstOrThrow", - findMany = "findMany", - create = "create", - createMany = "createMany", - createManyAndReturn = "createManyAndReturn", - update = "update", - updateMany = "updateMany", - upsert = "upsert", - delete = "delete", - deleteMany = "deleteMany", - groupBy = "groupBy", - count = "count",// TODO: count does not actually exist, why? - aggregate = "aggregate", - findRaw = "findRaw", - aggregateRaw = "aggregateRaw" - } -} - -export declare interface DriverAdapter extends Queryable { - /** - * Starts new transaction. - */ - transactionContext(): Promise>; - /** - * Optional method that returns extra connection info - */ - getConnectionInfo?(): Result_4; -} - -/** Client */ -export declare type DynamicClientExtensionArgs, ClientOptions> = { - [P in keyof C_]: unknown; -} & { - [K: symbol]: { - ctx: Optional, ITXClientDenyList> & { - $parent: Optional, ITXClientDenyList>; - }; - }; -}; - -export declare type DynamicClientExtensionThis, ClientOptions> = { - [P in keyof ExtArgs['client']]: Return; -} & { - [P in Exclude]: DynamicModelExtensionThis, ExtArgs, ClientOptions>; -} & { - [P in Exclude]: P extends keyof ClientOtherOps ? ClientOtherOps[P] : never; -} & { - [P in Exclude]: DynamicClientExtensionThisBuiltin[P]; -} & { - [K: symbol]: { - types: TypeMap['other']; - }; -}; - -export declare type DynamicClientExtensionThisBuiltin, ClientOptions> = { - $extends: ExtendsHook<'extends', TypeMapCb, ExtArgs, Call, ClientOptions>; - $transaction

[]>(arg: [...P], options?: { - isolationLevel?: TypeMap['meta']['txIsolationLevel']; - }): Promise>; - $transaction(fn: (client: Omit, ITXClientDenyList>) => Promise, options?: { - maxWait?: number; - timeout?: number; - isolationLevel?: TypeMap['meta']['txIsolationLevel']; - }): Promise; - $disconnect(): Promise; - $connect(): Promise; -}; - -/** Model */ -export declare type DynamicModelExtensionArgs, ClientOptions> = { - [K in keyof M_]: K extends '$allModels' ? { - [P in keyof M_[K]]?: unknown; - } & { - [K: symbol]: {}; - } : K extends TypeMap['meta']['modelProps'] ? { - [P in keyof M_[K]]?: unknown; - } & { - [K: symbol]: { - ctx: DynamicModelExtensionThis, ExtArgs, ClientOptions> & { - $parent: DynamicClientExtensionThis; - } & { - $name: ModelKey; - } & { - /** - * @deprecated Use `$name` instead. - */ - name: ModelKey; - }; - }; - } : never; -}; - -export declare type DynamicModelExtensionFluentApi = { - [K in keyof TypeMap['model'][M]['payload']['objects']]: (args?: Exact>) => PrismaPromise, [K]> | Null> & DynamicModelExtensionFluentApi, ClientOptions>; -}; - -export declare type DynamicModelExtensionFnResult = P extends FluentOperation ? DynamicModelExtensionFluentApi & PrismaPromise | Null> : PrismaPromise>; - -export declare type DynamicModelExtensionFnResultBase = GetResult; - -export declare type DynamicModelExtensionFnResultNull

= P extends 'findUnique' | 'findFirst' ? null : never; - -export declare type DynamicModelExtensionOperationFn = {} extends TypeMap['model'][M]['operations'][P]['args'] ? (args?: Exact) => DynamicModelExtensionFnResult, ClientOptions> : (args: Exact) => DynamicModelExtensionFnResult, ClientOptions>; - -export declare type DynamicModelExtensionThis, ClientOptions> = { - [P in keyof ExtArgs['model'][Uncapitalize]]: Return][P]>; -} & { - [P in Exclude]>]: DynamicModelExtensionOperationFn; -} & { - [P in Exclude<'fields', keyof ExtArgs['model'][Uncapitalize]>]: TypeMap['model'][M]['fields']; -} & { - [K: symbol]: { - types: TypeMap['model'][M]; - }; -}; - -/** Query */ -export declare type DynamicQueryExtensionArgs = { - [K in keyof Q_]: K extends '$allOperations' ? (args: { - model?: string; - operation: string; - args: any; - query: (args: any) => PrismaPromise; - }) => Promise : K extends '$allModels' ? { - [P in keyof Q_[K] | keyof TypeMap['model'][keyof TypeMap['model']]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb : P extends keyof TypeMap['model'][keyof TypeMap['model']]['operations'] ? DynamicQueryExtensionCb : never; - } : K extends TypeMap['meta']['modelProps'] ? { - [P in keyof Q_[K] | keyof TypeMap['model'][ModelKey]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb, keyof TypeMap['model'][ModelKey]['operations']> : P extends keyof TypeMap['model'][ModelKey]['operations'] ? DynamicQueryExtensionCb, P> : never; - } : K extends keyof TypeMap['other']['operations'] ? DynamicQueryExtensionCb<[TypeMap], 0, 'other', K> : never; -}; - -export declare type DynamicQueryExtensionCb = >(args: A) => Promise; - -export declare type DynamicQueryExtensionCbArgs = (_1 extends unknown ? _2 extends unknown ? { - args: DynamicQueryExtensionCbArgsArgs; - model: _0 extends 0 ? undefined : _1; - operation: _2; - query: >(args: A) => PrismaPromise; -} : never : never) & { - query: (args: DynamicQueryExtensionCbArgsArgs) => PrismaPromise; -}; - -export declare type DynamicQueryExtensionCbArgsArgs = _2 extends '$queryRaw' | '$executeRaw' ? Sql : TypeMap[_0][_1]['operations'][_2]['args']; - -/** Result */ -export declare type DynamicResultExtensionArgs = { - [K in keyof R_]: { - [P in keyof R_[K]]?: { - needs?: DynamicResultExtensionNeeds, R_[K][P]>; - compute(data: DynamicResultExtensionData, R_[K][P]>): any; - }; - }; -}; - -export declare type DynamicResultExtensionData = GetFindResult; - -export declare type DynamicResultExtensionNeeds = { - [K in keyof S]: K extends keyof TypeMap['model'][M]['payload']['scalars'] ? S[K] : never; -} & { - [N in keyof TypeMap['model'][M]['payload']['scalars']]?: boolean; -}; - -/** - * Placeholder value for "no text". - */ -export declare const empty: Sql; - -export declare type EmptyToUnknown = T; - -declare interface Engine { - /** The name of the engine. This is meant to be consumed externally */ - readonly name: string; - onBeforeExit(callback: () => Promise): void; - start(): Promise; - stop(): Promise; - version(forceRun?: boolean): Promise | string; - request(query: JsonQuery, options: RequestOptions_2): Promise>; - requestBatch(queries: JsonQuery[], options: RequestBatchOptions): Promise[]>; - transaction(action: 'start', headers: Transaction_2.TransactionHeaders, options: Transaction_2.Options): Promise>; - transaction(action: 'commit', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo): Promise; - transaction(action: 'rollback', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo): Promise; - metrics(options: MetricsOptionsJson): Promise; - metrics(options: MetricsOptionsPrometheus): Promise; - applyPendingMigrations(): Promise; -} - -declare interface EngineConfig { - cwd: string; - dirname: string; - datamodelPath: string; - enableDebugLogs?: boolean; - allowTriggerPanic?: boolean; - prismaPath?: string; - generator?: GeneratorConfig; - overrideDatasources: Datasources; - showColors?: boolean; - logQueries?: boolean; - logLevel?: 'info' | 'warn'; - env: Record; - flags?: string[]; - clientVersion: string; - engineVersion: string; - previewFeatures?: string[]; - engineEndpoint?: string; - activeProvider?: string; - logEmitter: LogEmitter; - transactionOptions: Transaction_2.Options; - /** - * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`. - * If set, this is only used in the library engine, and all queries would be performed through it, - * rather than Prisma's Rust drivers. - * @remarks only used by LibraryEngine.ts - */ - adapter?: ErrorCapturingDriverAdapter; - /** - * The contents of the schema encoded into a string - * @remarks only used by DataProxyEngine.ts - */ - inlineSchema: string; - /** - * The contents of the datasource url saved in a string - * @remarks only used by DataProxyEngine.ts - */ - inlineDatasources: GetPrismaClientConfig['inlineDatasources']; - /** - * The string hash that was produced for a given schema - * @remarks only used by DataProxyEngine.ts - */ - inlineSchemaHash: string; - /** - * The helper for interaction with OTEL tracing - * @remarks enabling is determined by the client and @prisma/instrumentation package - */ - tracingHelper: TracingHelper; - /** - * Information about whether we have not found a schema.prisma file in the - * default location, and that we fell back to finding the schema.prisma file - * in the current working directory. This usually means it has been bundled. - */ - isBundled?: boolean; - /** - * Web Assembly module loading configuration - */ - engineWasm?: WasmLoadingConfig; - /** - * Allows Accelerate to use runtime utilities from the client. These are - * necessary for the AccelerateEngine to function correctly. - */ - accelerateUtils?: { - resolveDatasourceUrl: typeof resolveDatasourceUrl; - getBatchRequestPayload: typeof getBatchRequestPayload; - prismaGraphQLToJSError: typeof prismaGraphQLToJSError; - PrismaClientUnknownRequestError: typeof PrismaClientUnknownRequestError; - PrismaClientInitializationError: typeof PrismaClientInitializationError; - PrismaClientKnownRequestError: typeof PrismaClientKnownRequestError; - debug: (...args: any[]) => void; - engineVersion: string; - clientVersion: string; - }; -} - -declare type EngineEvent = E extends QueryEventType ? QueryEvent : LogEvent; - -declare type EngineEventType = QueryEventType | LogEventType; - -declare type EngineProtocol = 'graphql' | 'json'; - -declare type EngineSpan = { - span: boolean; - name: string; - trace_id: string; - span_id: string; - parent_span_id: string; - start_time: [number, number]; - end_time: [number, number]; - attributes?: Record; - links?: { - trace_id: string; - span_id: string; - }[]; -}; - -declare type EngineSpanEvent = { - span: boolean; - spans: EngineSpan[]; -}; - -declare type EnvPaths = { - rootEnvPath: string | null; - schemaEnvPath: string | undefined; -}; - -declare interface EnvValue { - fromEnvVar: null | string; - value: null | string; -} - -export declare type Equals = (() => T extends A ? 1 : 2) extends (() => T extends B ? 1 : 2) ? 1 : 0; - -declare type Error_2 = { - kind: 'GenericJs'; - id: number; -} | { - kind: 'UnsupportedNativeDataType'; - type: string; -} | { - kind: 'Postgres'; - code: string; - severity: string; - message: string; - detail: string | undefined; - column: string | undefined; - hint: string | undefined; -} | { - kind: 'Mysql'; - code: number; - message: string; - state: string; -} | { - kind: 'Sqlite'; - /** - * Sqlite extended error code: https://www.sqlite.org/rescode.html - */ - extendedCode: number; - message: string; -}; - -declare interface ErrorCapturingDriverAdapter extends DriverAdapter { - readonly errorRegistry: ErrorRegistry; -} - -declare type ErrorFormat = 'pretty' | 'colorless' | 'minimal'; - -declare type ErrorRecord = { - error: unknown; -}; - -declare interface ErrorRegistry { - consumeError(id: number): ErrorRecord | undefined; -} - -declare interface ErrorWithBatchIndex { - batchRequestIdx?: number; -} - -declare type EventCallback = [E] extends ['beforeExit'] ? () => Promise : [E] extends [LogLevel] ? (event: EngineEvent) => void : never; - -export declare type Exact = (A extends unknown ? (W extends A ? { - [K in keyof A]: Exact; -} : W) : never) | (A extends Narrowable ? A : never); - -/** - * Defines Exception. - * - * string or an object with one of (message or name or code) and optional stack - */ -declare type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string; - -declare interface ExceptionWithCode { - code: string | number; - name?: string; - message?: string; - stack?: string; -} - -declare interface ExceptionWithMessage { - code?: string | number; - message: string; - name?: string; - stack?: string; -} - -declare interface ExceptionWithName { - code?: string | number; - message?: string; - name: string; - stack?: string; -} - -declare type ExtendedEventType = LogLevel | 'beforeExit'; - -declare type ExtendedSpanOptions = SpanOptions & { - /** The name of the span */ - name: string; - internal?: boolean; - middleware?: boolean; - /** Whether it propagates context (?=true) */ - active?: boolean; - /** The context to append the span to */ - context?: Context; -}; - -/** $extends, defineExtension */ -export declare interface ExtendsHook, TypeMap extends TypeMapDef = Call, ClientOptions = {}> { - extArgs: ExtArgs; - , MergedArgs extends InternalArgs = MergeExtArgs>(extension: ((client: DynamicClientExtensionThis) => { - $extends: { - extArgs: Args; - }; - }) | { - name?: string; - query?: DynamicQueryExtensionArgs; - result?: DynamicResultExtensionArgs & R; - model?: DynamicModelExtensionArgs & M; - client?: DynamicClientExtensionArgs & C; - }): { - extends: DynamicClientExtensionThis, TypeMapCb, MergedArgs, ClientOptions>; - define: (client: any) => { - $extends: { - extArgs: Args; - }; - }; - }[Variant]; -} - -export declare type ExtensionArgs = Optional; - -declare namespace Extensions { - export { - defineExtension, - getExtensionContext - } -} -export { Extensions } - -declare namespace Extensions_2 { - export { - InternalArgs, - DefaultArgs, - GetPayloadResultExtensionKeys, - GetPayloadResultExtensionObject, - GetPayloadResult, - GetSelect, - GetOmit, - DynamicQueryExtensionArgs, - DynamicQueryExtensionCb, - DynamicQueryExtensionCbArgs, - DynamicQueryExtensionCbArgsArgs, - DynamicResultExtensionArgs, - DynamicResultExtensionNeeds, - DynamicResultExtensionData, - DynamicModelExtensionArgs, - DynamicModelExtensionThis, - DynamicModelExtensionOperationFn, - DynamicModelExtensionFnResult, - DynamicModelExtensionFnResultBase, - DynamicModelExtensionFluentApi, - DynamicModelExtensionFnResultNull, - DynamicClientExtensionArgs, - DynamicClientExtensionThis, - ClientBuiltInProp, - DynamicClientExtensionThisBuiltin, - ExtendsHook, - MergeExtArgs, - AllModelsToStringIndex, - TypeMapDef, - DevTypeMapDef, - DevTypeMapFnDef, - ClientOptionDef, - ClientOtherOps, - TypeMapCbDef, - ModelKey, - RequiredExtensionArgs as UserArgs - } -} - -export declare type ExtractGlobalOmit = Options extends { - omit: { - [K in ModelName]: infer GlobalOmit; - }; -} ? GlobalOmit : {}; - -declare type Fetch = typeof nodeFetch; - -/** - * A reference to a specific field of a specific model - */ -export declare interface FieldRef { - readonly modelName: Model; - readonly name: string; - readonly typeName: FieldType; - readonly isList: boolean; -} - -export declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete'; - -export declare interface Fn { - params: Params; - returns: Returns; -} - -declare interface GeneratorConfig { - name: string; - output: EnvValue | null; - isCustomOutput?: boolean; - provider: EnvValue; - config: { - /** `output` is a reserved name and will only be available directly at `generator.output` */ - output?: never; - /** `provider` is a reserved name and will only be available directly at `generator.provider` */ - provider?: never; - /** `binaryTargets` is a reserved name and will only be available directly at `generator.binaryTargets` */ - binaryTargets?: never; - /** `previewFeatures` is a reserved name and will only be available directly at `generator.previewFeatures` */ - previewFeatures?: never; - } & { - [key: string]: string | string[] | undefined; - }; - binaryTargets: BinaryTargetsEnvValue[]; - previewFeatures: string[]; - envPaths?: EnvPaths; - sourceFilePath: string; -} - -export declare type GetAggregateResult

= { - [K in keyof A as K extends Aggregate ? K : never]: K extends '_count' ? A[K] extends true ? number : Count : { - [J in keyof A[K] & string]: P['scalars'][J] | null; - }; -}; - -declare function getBatchRequestPayload(batch: JsonQuery[], transaction?: TransactionOptions_2): QueryEngineBatchRequest; - -export declare type GetBatchResult = { - count: number; -}; - -export declare type GetCountResult = A extends { - select: infer S; -} ? (S extends true ? number : Count) : number; - -declare function getExtensionContext(that: T): Context_2; - -export declare type GetFindResult

= Equals extends 1 ? DefaultSelection : A extends { - select: infer S extends object; -} & Record | { - include: infer I extends object; -} & Record ? { - [K in keyof S | keyof I as (S & I)[K] extends false | undefined | Skip | null ? never : K]: (S & I)[K] extends object ? P extends SelectablePayloadFields ? O extends OperationPayload ? GetFindResult[] : never : P extends SelectablePayloadFields ? O extends OperationPayload ? GetFindResult | SelectField & null : never : K extends '_count' ? Count> : never : P extends SelectablePayloadFields ? O extends OperationPayload ? DefaultSelection[] : never : P extends SelectablePayloadFields ? O extends OperationPayload ? DefaultSelection | SelectField & null : never : P extends { - scalars: { - [k in K]: infer O; - }; - } ? O : K extends '_count' ? Count : never; -} & (A extends { - include: any; -} & Record ? DefaultSelection : unknown) : DefaultSelection; - -export declare type GetGroupByResult

= A extends { - by: string[]; -} ? Array & { - [K in A['by'][number]]: P['scalars'][K]; -}> : A extends { - by: string; -} ? Array & { - [K in A['by']]: P['scalars'][K]; -}> : {}[]; - -export declare type GetOmit = { - [K in (string extends keyof R ? never : keyof R) | BaseKeys]?: boolean | ExtraType; -}; - -export declare type GetPayloadResult, R extends InternalArgs['result'][string]> = Omit> & GetPayloadResultExtensionObject; - -export declare type GetPayloadResultExtensionKeys = KR; - -export declare type GetPayloadResultExtensionObject = { - [K in GetPayloadResultExtensionKeys]: R[K] extends () => { - compute: (...args: any) => infer C; - } ? C : never; -}; - -export declare function getPrismaClient(config: GetPrismaClientConfig): { - new (optionsArg?: PrismaClientOptions): { - _originalClient: any; - _runtimeDataModel: RuntimeDataModel; - _requestHandler: RequestHandler; - _connectionPromise?: Promise | undefined; - _disconnectionPromise?: Promise | undefined; - _engineConfig: EngineConfig; - _accelerateEngineConfig: AccelerateEngineConfig; - _clientVersion: string; - _errorFormat: ErrorFormat; - _tracingHelper: TracingHelper; - _metrics: MetricsClient; - _middlewares: MiddlewareHandler; - _previewFeatures: string[]; - _activeProvider: string; - _globalOmit?: GlobalOmitOptions | undefined; - _extensions: MergedExtensionsList; - _engine: Engine; - /** - * A fully constructed/applied Client that references the parent - * PrismaClient. This is used for Client extensions only. - */ - _appliedParent: any; - _createPrismaPromise: PrismaPromiseFactory; - /** - * Hook a middleware into the client - * @param middleware to hook - */ - $use(middleware: QueryMiddleware): void; - $on(eventType: E, callback: EventCallback): void; - $connect(): Promise; - /** - * Disconnect from the database - */ - $disconnect(): Promise; - /** - * Executes a raw query and always returns a number - */ - $executeRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; - /** - * Executes a raw query provided through a safe tag function - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2; - /** - * Unsafe counterpart of `$executeRaw` that is susceptible to SQL injections - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2; - /** - * Executes a raw command only for MongoDB - * - * @param command - * @returns - */ - $runCommandRaw(command: Record): PrismaPromise_2; - /** - * Executes a raw query and returns selected data - */ - $queryRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; - /** - * Executes a raw query provided through a safe tag function - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2; - /** - * Counterpart to $queryRaw, that returns strongly typed results - * @param typedSql - */ - $queryRawTyped(typedSql: UnknownTypedSql): PrismaPromise_2; - /** - * Unsafe counterpart of `$queryRaw` that is susceptible to SQL injections - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2; - /** - * Execute a batch of requests in a transaction - * @param requests - * @param options - */ - _transactionWithArray({ promises, options, }: { - promises: Array>; - options?: BatchTransactionOptions; - }): Promise; - /** - * Perform a long-running transaction - * @param callback - * @param options - * @returns - */ - _transactionWithCallback({ callback, options, }: { - callback: (client: Client) => Promise; - options?: Options; - }): Promise; - _createItxClient(transaction: PrismaPromiseInteractiveTransaction): Client; - /** - * Execute queries within a transaction - * @param input a callback or a query list - * @param options to set timeouts (callback) - * @returns - */ - $transaction(input: any, options?: any): Promise; - /** - * Runs the middlewares over params before executing a request - * @param internalParams - * @returns - */ - _request(internalParams: InternalRequestParams): Promise; - _executeRequest({ args, clientMethod, dataPath, callsite, action, model, argsMapper, transaction, unpacker, otelParentCtx, customDataProxyFetch, }: InternalRequestParams): Promise; - readonly $metrics: MetricsClient; - /** - * Shortcut for checking a preview flag - * @param feature preview flag - * @returns - */ - _hasPreviewFlag(feature: string): boolean; - $applyPendingMigrations(): Promise; - $extends: typeof $extends; - readonly [Symbol.toStringTag]: string; - }; -}; - -/** - * Config that is stored into the generated client. When the generated client is - * loaded, this same config is passed to {@link getPrismaClient} which creates a - * closure with that config around a non-instantiated [[PrismaClient]]. - */ -declare type GetPrismaClientConfig = { - runtimeDataModel: RuntimeDataModel; - generator?: GeneratorConfig; - relativeEnvPaths: { - rootEnvPath?: string | null; - schemaEnvPath?: string | null; - }; - relativePath: string; - dirname: string; - filename?: string; - clientVersion: string; - engineVersion: string; - datasourceNames: string[]; - activeProvider: ActiveConnectorType; - /** - * The contents of the schema encoded into a string - * @remarks only used for the purpose of data proxy - */ - inlineSchema: string; - /** - * A special env object just for the data proxy edge runtime. - * Allows bundlers to inject their own env variables (Vercel). - * Allows platforms to declare global variables as env (Workers). - * @remarks only used for the purpose of data proxy - */ - injectableEdgeEnv?: () => LoadedEnv; - /** - * The contents of the datasource url saved in a string. - * This can either be an env var name or connection string. - * It is needed by the client to connect to the Data Proxy. - * @remarks only used for the purpose of data proxy - */ - inlineDatasources: { - [name in string]: { - url: EnvValue; - }; - }; - /** - * The string hash that was produced for a given schema - * @remarks only used for the purpose of data proxy - */ - inlineSchemaHash: string; - /** - * A marker to indicate that the client was not generated via `prisma - * generate` but was generated via `generate --postinstall` script instead. - * @remarks used to error for Vercel/Netlify for schema caching issues - */ - postinstall?: boolean; - /** - * Information about the CI where the Prisma Client has been generated. The - * name of the CI environment is stored at generation time because CI - * information is not always available at runtime. Moreover, the edge client - * has no notion of environment variables, so this works around that. - * @remarks used to error for Vercel/Netlify for schema caching issues - */ - ciName?: string; - /** - * Information about whether we have not found a schema.prisma file in the - * default location, and that we fell back to finding the schema.prisma file - * in the current working directory. This usually means it has been bundled. - */ - isBundled?: boolean; - /** - * A boolean that is `false` when the client was generated with --no-engine. At - * runtime, this means the client will be bound to be using the Data Proxy. - */ - copyEngine?: boolean; - /** - * Optional wasm loading configuration - */ - engineWasm?: WasmLoadingConfig; -}; - -export declare type GetResult = { - findUnique: GetFindResult | null; - findUniqueOrThrow: GetFindResult; - findFirst: GetFindResult | null; - findFirstOrThrow: GetFindResult; - findMany: GetFindResult[]; - create: GetFindResult; - createMany: GetBatchResult; - createManyAndReturn: GetFindResult[]; - update: GetFindResult; - updateMany: GetBatchResult; - upsert: GetFindResult; - delete: GetFindResult; - deleteMany: GetBatchResult; - aggregate: GetAggregateResult; - count: GetCountResult; - groupBy: GetGroupByResult; - $queryRaw: unknown; - $queryRawTyped: unknown; - $executeRaw: number; - $queryRawUnsafe: unknown; - $executeRawUnsafe: number; - $runCommandRaw: JsonObject; - findRaw: JsonObject; - aggregateRaw: JsonObject; -}[OperationName]; - -export declare function getRuntime(): GetRuntimeOutput; - -declare type GetRuntimeOutput = { - id: Runtime; - prettyName: string; - isEdge: boolean; -}; - -export declare type GetSelect, R extends InternalArgs['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = { - [K in KR | keyof Base]?: K extends KR ? boolean : Base[K]; -}; - -declare type GlobalOmitOptions = { - [modelName: string]: { - [fieldName: string]: boolean; - }; -}; - -declare type HandleErrorParams = { - args: JsArgs; - error: any; - clientMethod: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - modelName?: string; - globalOmit?: GlobalOmitOptions; -}; - -/** - * Defines High-Resolution Time. - * - * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970. - * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds. - * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150. - * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds: - * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210. - * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds: - * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000. - * This is represented in HrTime format as [1609504210, 150000000]. - */ -declare type HrTime = [number, number]; - -/** - * Matches a JSON array. - * Unlike \`JsonArray\`, readonly arrays are assignable to this type. - */ -export declare interface InputJsonArray extends ReadonlyArray { -} - -/** - * Matches a JSON object. - * Unlike \`JsonObject\`, this type allows undefined and read-only properties. - */ -export declare type InputJsonObject = { - readonly [Key in string]?: InputJsonValue | null; -}; - -/** - * Matches any valid value that can be used as an input for operations like - * create and update as the value of a JSON field. Unlike \`JsonValue\`, this - * type allows read-only arrays and read-only object properties and disallows - * \`null\` at the top level. - * - * \`null\` cannot be used as the value of a JSON field because its meaning - * would be ambiguous. Use \`Prisma.JsonNull\` to store the JSON null value or - * \`Prisma.DbNull\` to clear the JSON value and set the field to the database - * NULL value instead. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values - */ -export declare type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray | { - toJSON(): unknown; -}; - -declare type InteractiveTransactionInfo = { - /** - * Transaction ID returned by the query engine. - */ - id: string; - /** - * Arbitrary payload the meaning of which depends on the `Engine` implementation. - * For example, `DataProxyEngine` needs to associate different API endpoints with transactions. - * In `LibraryEngine` and `BinaryEngine` it is currently not used. - */ - payload: Payload; -}; - -declare type InteractiveTransactionOptions = Transaction_2.InteractiveTransactionInfo; - -export declare type InternalArgs = { - result: { - [K in keyof R]: { - [P in keyof R[K]]: () => R[K][P]; - }; - }; - model: { - [K in keyof M]: { - [P in keyof M[K]]: () => M[K][P]; - }; - }; - query: { - [K in keyof Q]: { - [P in keyof Q[K]]: () => Q[K][P]; - }; - }; - client: { - [K in keyof C]: () => C[K]; - }; -}; - -declare type InternalRequestParams = { - /** - * The original client method being called. - * Even though the rootField / operation can be changed, - * this method stays as it is, as it's what the user's - * code looks like - */ - clientMethod: string; - /** - * Name of js model that triggered the request. Might be used - * for warnings or error messages - */ - jsModelName?: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - unpacker?: Unpacker; - otelParentCtx?: Context; - /** Used to "desugar" a user input into an "expanded" one */ - argsMapper?: (args?: UserArgs_2) => UserArgs_2; - /** Used to convert args for middleware and back */ - middlewareArgsMapper?: MiddlewareArgsMapper; - /** Used for Accelerate client extension via Data Proxy */ - customDataProxyFetch?: (fetch: Fetch) => Fetch; -} & Omit; - -declare enum IsolationLevel { - ReadUncommitted = "ReadUncommitted", - ReadCommitted = "ReadCommitted", - RepeatableRead = "RepeatableRead", - Snapshot = "Snapshot", - Serializable = "Serializable" -} - -declare function isSkip(value: unknown): value is Skip; - -export declare type ITXClientDenyList = (typeof denylist)[number]; - -export declare const itxClientDenyList: readonly (string | symbol)[]; - -declare interface Job { - resolve: (data: any) => void; - reject: (data: any) => void; - request: any; -} - -/** - * Create a SQL query for a list of values. - */ -export declare function join(values: readonly RawValue[], separator?: string, prefix?: string, suffix?: string): Sql; - -export declare type JsArgs = { - select?: Selection_2; - include?: Selection_2; - omit?: Omission; - [argName: string]: JsInputValue; -}; - -export declare type JsInputValue = null | undefined | string | number | boolean | bigint | Uint8Array | Date | DecimalJsLike | ObjectEnumValue | RawParameters | JsonConvertible | FieldRef | JsInputValue[] | Skip | { - [key: string]: JsInputValue; -}; - -declare type JsonArgumentValue = number | string | boolean | null | RawTaggedValue | JsonArgumentValue[] | { - [key: string]: JsonArgumentValue; -}; - -/** - * From https://github.com/sindresorhus/type-fest/ - * Matches a JSON array. - */ -export declare interface JsonArray extends Array { -} - -declare type JsonBatchQuery = { - batch: JsonQuery[]; - transaction?: { - isolationLevel?: Transaction_2.IsolationLevel; - }; -}; - -export declare interface JsonConvertible { - toJSON(): unknown; -} - -declare type JsonFieldSelection = { - arguments?: Record | RawTaggedValue; - selection: JsonSelectionSet; -}; - -declare class JsonNull extends NullTypesEnumValue { -} - -/** - * From https://github.com/sindresorhus/type-fest/ - * Matches a JSON object. - * This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. - */ -export declare type JsonObject = { - [Key in string]?: JsonValue; -}; - -declare type JsonQuery = { - modelName?: string; - action: JsonQueryAction; - query: JsonFieldSelection; -}; - -declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'createManyAndReturn' | 'updateOne' | 'updateMany' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw'; - -declare type JsonSelectionSet = { - $scalars?: boolean; - $composites?: boolean; -} & { - [fieldName: string]: boolean | JsonFieldSelection; -}; - -/** - * From https://github.com/sindresorhus/type-fest/ - * Matches any valid JSON value. - */ -export declare type JsonValue = string | number | boolean | JsonObject | JsonArray | null; - -export declare type JsOutputValue = null | string | number | boolean | bigint | Uint8Array | Date | Decimal | JsOutputValue[] | { - [key: string]: JsOutputValue; -}; - -export declare type JsPromise = Promise & {}; - -declare type KnownErrorParams = { - code: string; - clientVersion: string; - meta?: Record; - batchRequestIdx?: number; -}; - -/** - * A pointer from the current {@link Span} to another span in the same trace or - * in a different trace. - * Few examples of Link usage. - * 1. Batch Processing: A batch of elements may contain elements associated - * with one or more traces/spans. Since there can only be one parent - * SpanContext, Link is used to keep reference to SpanContext of all - * elements in the batch. - * 2. Public Endpoint: A SpanContext in incoming client request on a public - * endpoint is untrusted from service provider perspective. In such case it - * is advisable to start a new trace with appropriate sampling decision. - * However, it is desirable to associate incoming SpanContext to new trace - * initiated on service provider side so two traces (from Client and from - * Service Provider) can be correlated. - */ -declare interface Link { - /** The {@link SpanContext} of a linked span. */ - context: SpanContext; - /** A set of {@link SpanAttributes} on the link. */ - attributes?: SpanAttributes; - /** Count of attributes of the link that were dropped due to collection limits */ - droppedAttributesCount?: number; -} - -declare type LoadedEnv = { - message?: string; - parsed: { - [x: string]: string; - }; -} | undefined; - -declare type LocationInFile = { - fileName: string; - lineNumber: number | null; - columnNumber: number | null; -}; - -declare type LogDefinition = { - level: LogLevel; - emit: 'stdout' | 'event'; -}; - -/** - * Typings for the events we emit. - * - * @remarks - * If this is updated, our edge runtime shim needs to be updated as well. - */ -declare type LogEmitter = { - on(event: E, listener: (event: EngineEvent) => void): LogEmitter; - emit(event: QueryEventType, payload: QueryEvent): boolean; - emit(event: LogEventType, payload: LogEvent): boolean; -}; - -declare type LogEvent = { - timestamp: Date; - message: string; - target: string; -}; - -declare type LogEventType = 'info' | 'warn' | 'error'; - -declare type LogLevel = 'info' | 'query' | 'warn' | 'error'; - -/** - * Generates more strict variant of an enum which, unlike regular enum, - * throws on non-existing property access. This can be useful in following situations: - * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input - * - enum values are generated dynamically from DMMF. - * - * In that case, if using normal enums and no compile-time typechecking, using non-existing property - * will result in `undefined` value being used, which will be accepted. Using strict enum - * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. - * - * Note: if you need to check for existence of a value in the enum you can still use either - * `in` operator or `hasOwnProperty` function. - * - * @param definition - * @returns - */ -export declare function makeStrictEnum>(definition: T): T; - -export declare function makeTypedQueryFactory(sql: string): (...values: any[]) => TypedSql; - -/** - * Class that holds the list of all extensions, applied to particular instance, - * as well as resolved versions of the components that need to apply on - * different levels. Main idea of this class: avoid re-resolving as much of the - * stuff as possible when new extensions are added while also delaying the - * resolve until the point it is actually needed. For example, computed fields - * of the model won't be resolved unless the model is actually queried. Neither - * adding extensions with `client` component only cause other components to - * recompute. - */ -declare class MergedExtensionsList { - private head?; - private constructor(); - static empty(): MergedExtensionsList; - static single(extension: ExtensionArgs): MergedExtensionsList; - isEmpty(): boolean; - append(extension: ExtensionArgs): MergedExtensionsList; - getAllComputedFields(dmmfModelName: string): ComputedFieldsMap | undefined; - getAllClientExtensions(): ClientArg | undefined; - getAllModelExtensions(dmmfModelName: string): ModelArg | undefined; - getAllQueryCallbacks(jsModelName: string, operation: string): any; - getAllBatchQueryCallbacks(): BatchQueryOptionsCb[]; -} - -export declare type MergeExtArgs, Args extends Record> = ComputeDeep & AllModelsToStringIndex>; - -export declare type Metric = { - key: string; - value: T; - labels: Record; - description: string; -}; - -export declare type MetricHistogram = { - buckets: MetricHistogramBucket[]; - sum: number; - count: number; -}; - -export declare type MetricHistogramBucket = [maxValue: number, count: number]; - -export declare type Metrics = { - counters: Metric[]; - gauges: Metric[]; - histograms: Metric[]; -}; - -export declare class MetricsClient { - private _engine; - constructor(engine: Engine); - /** - * Returns all metrics gathered up to this point in prometheus format. - * Result of this call can be exposed directly to prometheus scraping endpoint - * - * @param options - * @returns - */ - prometheus(options?: MetricsOptions): Promise; - /** - * Returns all metrics gathered up to this point in prometheus format. - * - * @param options - * @returns - */ - json(options?: MetricsOptions): Promise; -} - -declare type MetricsOptions = { - /** - * Labels to add to every metrics in key-value format - */ - globalLabels?: Record; -}; - -declare type MetricsOptionsCommon = { - globalLabels?: Record; -}; - -declare type MetricsOptionsJson = { - format: 'json'; -} & MetricsOptionsCommon; - -declare type MetricsOptionsPrometheus = { - format: 'prometheus'; -} & MetricsOptionsCommon; - -declare type MiddlewareArgsMapper = { - requestArgsToMiddlewareArgs(requestArgs: RequestArgs): MiddlewareArgs; - middlewareArgsToRequestArgs(middlewareArgs: MiddlewareArgs): RequestArgs; -}; - -declare class MiddlewareHandler { - private _middlewares; - use(middleware: M): void; - get(id: number): M | undefined; - has(id: number): boolean; - length(): number; -} - -export declare type ModelArg = { - [MethodName in string]: unknown; -}; - -export declare type ModelArgs = { - model: { - [ModelName in string]: ModelArg; - }; -}; - -export declare type ModelKey = M extends keyof TypeMap['model'] ? M : Capitalize; - -export declare type ModelQueryOptionsCb = (args: ModelQueryOptionsCbArgs) => Promise; - -export declare type ModelQueryOptionsCbArgs = { - model: string; - operation: string; - args: JsArgs; - query: (args: JsArgs) => Promise; -}; - -export declare type NameArgs = { - name?: string; -}; - -export declare type Narrow = { - [K in keyof A]: A[K] extends Function ? A[K] : Narrow; -} | (A extends Narrowable ? A : never); - -export declare type Narrowable = string | number | bigint | boolean | []; - -export declare type NeverToUnknown = [T] extends [never] ? unknown : T; - -/** - * Imitates `fetch` via `https` to only suit our needs, it does nothing more. - * This is because we cannot bundle `node-fetch` as it uses many other Node.js - * utilities, while also bloating our bundles. This approach is much leaner. - * @param url - * @param options - * @returns - */ -declare function nodeFetch(url: string, options?: RequestOptions): Promise; - -declare class NodeHeaders { - readonly headers: Map; - constructor(init?: Record); - append(name: string, value: string): void; - delete(name: string): void; - get(name: string): string | null; - has(name: string): boolean; - set(name: string, value: string): void; - forEach(callbackfn: (value: string, key: string, parent: this) => void, thisArg?: any): void; -} - -/** - * @deprecated Please don´t rely on type checks to this error anymore. - * This will become a regular `PrismaClientKnownRequestError` with code `P2025` - * in the future major version of the client. - * Instead of `error instanceof Prisma.NotFoundError` use `error.code === "P2025"`. - */ -export declare class NotFoundError extends PrismaClientKnownRequestError { - constructor(message: string, clientVersion: string); -} - -declare class NullTypesEnumValue extends ObjectEnumValue { - _getNamespace(): string; -} - -/** - * List of Prisma enums that must use unique objects instead of strings as their values. - */ -export declare const objectEnumNames: string[]; - -/** - * Base class for unique values of object-valued enums. - */ -export declare abstract class ObjectEnumValue { - constructor(arg?: symbol); - abstract _getNamespace(): string; - _getName(): string; - toString(): string; -} - -export declare const objectEnumValues: { - classes: { - DbNull: typeof DbNull; - JsonNull: typeof JsonNull; - AnyNull: typeof AnyNull; - }; - instances: { - DbNull: DbNull; - JsonNull: JsonNull; - AnyNull: AnyNull; - }; -}; - -declare const officialPrismaAdapters: readonly ["@prisma/adapter-planetscale", "@prisma/adapter-neon", "@prisma/adapter-libsql", "@prisma/adapter-d1", "@prisma/adapter-pg", "@prisma/adapter-pg-worker"]; - -export declare type Omission = Record; - -declare type Omit_2 = { - [P in keyof T as P extends K ? never : P]: T[P]; -}; -export { Omit_2 as Omit } - -export declare type OmitValue = Key extends keyof Omit ? Omit[Key] : false; - -export declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; - -export declare type OperationPayload = { - name: string; - scalars: { - [ScalarName in string]: unknown; - }; - objects: { - [ObjectName in string]: unknown; - }; - composites: { - [CompositeName in string]: unknown; - }; -}; - -export declare type Optional = { - [P in K & keyof O]?: O[P]; -} & { - [P in Exclude]: O[P]; -}; - -export declare type OptionalFlat = { - [K in keyof T]?: T[K]; -}; - -export declare type OptionalKeys = { - [K in keyof O]-?: {} extends Pick_2 ? K : never; -}[keyof O]; - -declare type Options = { - maxWait?: number; - timeout?: number; - isolationLevel?: IsolationLevel; -}; - -declare type Options_2 = { - clientVersion: string; -}; - -export declare type Or = { - 0: { - 0: 0; - 1: 1; - }; - 1: { - 0: 1; - 1: 1; - }; -}[A][B]; - -export declare type PatchFlat = O1 & Omit_2; - -export declare type Path = O extends unknown ? P extends [infer K, ...infer R] ? K extends keyof O ? Path : Default : O : never; - -export declare type Payload = T extends { - [K: symbol]: { - types: { - payload: any; - }; - }; -} ? T[symbol]['types']['payload'] : any; - -export declare type PayloadToResult = RenameAndNestPayloadKeys

> = { - [K in keyof O]?: O[K][K] extends any[] ? PayloadToResult[] : O[K][K] extends object ? PayloadToResult : O[K][K]; -}; - -declare type Pick_2 = { - [P in keyof T as P extends K ? P : never]: T[P]; -}; -export { Pick_2 as Pick } - -export declare class PrismaClientInitializationError extends Error { - clientVersion: string; - errorCode?: string; - retryable?: boolean; - constructor(message: string, clientVersion: string, errorCode?: string); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientKnownRequestError extends Error implements ErrorWithBatchIndex { - code: string; - meta?: Record; - clientVersion: string; - batchRequestIdx?: number; - constructor(message: string, { code, clientVersion, meta, batchRequestIdx }: KnownErrorParams); - get [Symbol.toStringTag](): string; -} - -export declare type PrismaClientOptions = { - /** - * Overwrites the primary datasource url from your schema.prisma file - */ - datasourceUrl?: string; - /** - * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale. - */ - adapter?: DriverAdapter | null; - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasources?: Datasources; - /** - * @default "colorless" - */ - errorFormat?: ErrorFormat; - /** - * The default values for Transaction options - * maxWait ?= 2000 - * timeout ?= 5000 - */ - transactionOptions?: Transaction_2.Options; - /** - * @example - * \`\`\` - * // Defaults to stdout - * log: ['query', 'info', 'warn'] - * - * // Emit as events - * log: [ - * { emit: 'stdout', level: 'query' }, - * { emit: 'stdout', level: 'info' }, - * { emit: 'stdout', level: 'warn' } - * ] - * \`\`\` - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). - */ - log?: Array; - omit?: GlobalOmitOptions; - /** - * @internal - * You probably don't want to use this. \`__internal\` is used by internal tooling. - */ - __internal?: { - debug?: boolean; - engine?: { - cwd?: string; - binaryPath?: string; - endpoint?: string; - allowTriggerPanic?: boolean; - }; - /** This can be used for testing purposes */ - configOverride?: (config: GetPrismaClientConfig) => GetPrismaClientConfig; - }; -}; - -export declare class PrismaClientRustPanicError extends Error { - clientVersion: string; - constructor(message: string, clientVersion: string); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientUnknownRequestError extends Error implements ErrorWithBatchIndex { - clientVersion: string; - batchRequestIdx?: number; - constructor(message: string, { clientVersion, batchRequestIdx }: UnknownErrorParams); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientValidationError extends Error { - name: string; - clientVersion: string; - constructor(message: string, { clientVersion }: Options_2); - get [Symbol.toStringTag](): string; -} - -declare function prismaGraphQLToJSError({ error, user_facing_error }: RequestError, clientVersion: string, activeProvider: string): PrismaClientKnownRequestError | PrismaClientUnknownRequestError; - -export declare interface PrismaPromise extends Promise { - [Symbol.toStringTag]: 'PrismaPromise'; -} - -/** - * Prisma's `Promise` that is backwards-compatible. All additions on top of the - * original `Promise` are optional so that it can be backwards-compatible. - * @see [[createPrismaPromise]] - */ -declare interface PrismaPromise_2 extends Promise { - /** - * Extension of the original `.then` function - * @param onfulfilled same as regular promises - * @param onrejected same as regular promises - * @param transaction transaction options - */ - then(onfulfilled?: (value: A) => R1 | PromiseLike, onrejected?: (error: unknown) => R2 | PromiseLike, transaction?: PrismaPromiseTransaction): Promise; - /** - * Extension of the original `.catch` function - * @param onrejected same as regular promises - * @param transaction transaction options - */ - catch(onrejected?: ((reason: any) => R | PromiseLike) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; - /** - * Extension of the original `.finally` function - * @param onfinally same as regular promises - * @param transaction transaction options - */ - finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; - /** - * Called when executing a batch of regular tx - * @param transaction transaction options for batch tx - */ - requestTransaction?(transaction: PrismaPromiseBatchTransaction): PromiseLike; -} - -declare type PrismaPromiseBatchTransaction = { - kind: 'batch'; - id: number; - isolationLevel?: IsolationLevel; - index: number; - lock: PromiseLike; -}; - -declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => PrismaPromise_2; - -/** - * Creates a [[PrismaPromise]]. It is Prisma's implementation of `Promise` which - * is essentially a proxy for `Promise`. All the transaction-compatible client - * methods return one, this allows for pre-preparing queries without executing - * them until `.then` is called. It's the foundation of Prisma's query batching. - * @param callback that will be wrapped within our promise implementation - * @see [[PrismaPromise]] - * @returns - */ -declare type PrismaPromiseFactory = (callback: PrismaPromiseCallback) => PrismaPromise_2; - -declare type PrismaPromiseInteractiveTransaction = { - kind: 'itx'; - id: string; - payload: PayloadType; -}; - -declare type PrismaPromiseTransaction = PrismaPromiseBatchTransaction | PrismaPromiseInteractiveTransaction; - -export declare const PrivateResultType: unique symbol; - -declare namespace Public { - export { - validator - } -} -export { Public } - -declare namespace Public_2 { - export { - Args, - Result, - Payload, - PrismaPromise, - Operation, - Exact - } -} - -declare type Query = { - sql: string; - args: Array; - argTypes: Array; -}; - -declare interface Queryable { - readonly provider: 'mysql' | 'postgres' | 'sqlite'; - readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {}); - /** - * Execute a query given as SQL, interpolating the given parameters, - * and returning the type-aware result set of the query. - * - * This is the preferred way of executing `SELECT` queries. - */ - queryRaw(params: Query): Promise>; - /** - * Execute a query given as SQL, interpolating the given parameters, - * and returning the number of affected rows. - * - * This is the preferred way of executing `INSERT`, `UPDATE`, `DELETE` queries, - * as well as transactional queries. - */ - executeRaw(params: Query): Promise>; -} - -declare type QueryEngineBatchGraphQLRequest = { - batch: QueryEngineRequest[]; - transaction?: boolean; - isolationLevel?: Transaction_2.IsolationLevel; -}; - -declare type QueryEngineBatchRequest = QueryEngineBatchGraphQLRequest | JsonBatchQuery; - -declare type QueryEngineConfig = { - datamodel: string; - configDir: string; - logQueries: boolean; - ignoreEnvVarErrors: boolean; - datasourceOverrides: Record; - env: Record; - logLevel: QueryEngineLogLevel; - telemetry?: QueryEngineTelemetry; - engineProtocol: EngineProtocol; -}; - -declare interface QueryEngineConstructor { - new (config: QueryEngineConfig, logger: (log: string) => void, adapter?: ErrorCapturingDriverAdapter): QueryEngineInstance; -} - -declare type QueryEngineInstance = { - connect(headers: string): Promise; - disconnect(headers: string): Promise; - /** - * @param requestStr JSON.stringified `QueryEngineRequest | QueryEngineBatchRequest` - * @param headersStr JSON.stringified `QueryEngineRequestHeaders` - */ - query(requestStr: string, headersStr: string, transactionId?: string): Promise; - sdlSchema(): Promise; - dmmf(traceparent: string): Promise; - startTransaction(options: string, traceHeaders: string): Promise; - commitTransaction(id: string, traceHeaders: string): Promise; - rollbackTransaction(id: string, traceHeaders: string): Promise; - metrics(options: string): Promise; - applyPendingMigrations(): Promise; -}; - -declare type QueryEngineLogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off'; - -declare type QueryEngineRequest = { - query: string; - variables: Object; -}; - -declare type QueryEngineResult = { - data: T; - elapsed: number; -}; - -declare type QueryEngineTelemetry = { - enabled: Boolean; - endpoint: string; -}; - -declare type QueryEvent = { - timestamp: Date; - query: string; - params: string; - duration: number; - target: string; -}; - -declare type QueryEventType = 'query'; - -declare type QueryMiddleware = (params: QueryMiddlewareParams, next: (params: QueryMiddlewareParams) => Promise) => Promise; - -declare type QueryMiddlewareParams = { - /** The model this is executed on */ - model?: string; - /** The action that is being handled */ - action: Action; - /** TODO what is this */ - dataPath: string[]; - /** TODO what is this */ - runInTransaction: boolean; - args?: UserArgs_2; -}; - -export declare type QueryOptions = { - query: { - [ModelName in string]: { - [ModelAction in string]: ModelQueryOptionsCb; - } | QueryOptionsCb; - }; -}; - -export declare type QueryOptionsCb = (args: QueryOptionsCbArgs) => Promise; - -export declare type QueryOptionsCbArgs = { - model?: string; - operation: string; - args: JsArgs | RawQueryArgs; - query: (args: JsArgs | RawQueryArgs) => Promise; -}; - -/** - * Create raw SQL statement. - */ -export declare function raw(value: string): Sql; - -export declare type RawParameters = { - __prismaRawParameters__: true; - values: string; -}; - -export declare type RawQueryArgs = Sql | UnknownTypedSql | [query: string, ...values: RawValue[]]; - -declare type RawTaggedValue = { - $type: 'Raw'; - value: unknown; -}; - -/** - * Supported value or SQL instance. - */ -export declare type RawValue = Value | Sql; - -export declare type ReadonlyDeep = { - readonly [K in keyof T]: ReadonlyDeep; -}; - -declare type ReadonlyDeep_2 = { - +readonly [K in keyof O]: ReadonlyDeep_2; -}; - -declare type Record_2 = { - [P in T]: U; -}; -export { Record_2 as Record } - -export declare type RenameAndNestPayloadKeys

= { - [K in keyof P as K extends 'scalars' | 'objects' | 'composites' ? keyof P[K] : never]: P[K]; -}; - -declare type RequestBatchOptions = { - transaction?: TransactionOptions_2; - traceparent?: string; - numTry?: number; - containsWrite: boolean; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare interface RequestError { - error: string; - user_facing_error: { - is_panic: boolean; - message: string; - meta?: Record; - error_code?: string; - batch_request_idx?: number; - }; -} - -declare class RequestHandler { - client: Client; - dataloader: DataLoader; - private logEmitter?; - constructor(client: Client, logEmitter?: LogEmitter); - request(params: RequestParams): Promise; - mapQueryEngineResult({ dataPath, unpacker }: RequestParams, response: QueryEngineResult): any; - /** - * Handles the error and logs it, logging the error is done synchronously waiting for the event - * handlers to finish. - */ - handleAndLogRequestError(params: HandleErrorParams): never; - handleRequestError({ error, clientMethod, callsite, transaction, args, modelName, globalOmit, }: HandleErrorParams): never; - sanitizeMessage(message: any): any; - unpack(data: unknown, dataPath: string[], unpacker?: Unpacker): any; - get [Symbol.toStringTag](): string; -} - -declare type RequestOptions = { - method?: string; - headers?: Record; - body?: string; -}; - -declare type RequestOptions_2 = { - traceparent?: string; - numTry?: number; - interactiveTransaction?: InteractiveTransactionOptions; - isWrite: boolean; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare type RequestParams = { - modelName?: string; - action: Action; - protocolQuery: JsonQuery; - dataPath: string[]; - clientMethod: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - extensions: MergedExtensionsList; - args?: any; - headers?: Record; - unpacker?: Unpacker; - otelParentCtx?: Context; - otelChildCtx?: Context; - globalOmit?: GlobalOmitOptions; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare type RequestResponse = { - ok: boolean; - url: string; - statusText?: string; - status: number; - headers: NodeHeaders; - text: () => Promise; - json: () => Promise; -}; - -declare type RequiredExtensionArgs = NameArgs & ResultArgs & ModelArgs & ClientArgs & QueryOptions; -export { RequiredExtensionArgs } -export { RequiredExtensionArgs as UserArgs } - -export declare type RequiredKeys = { - [K in keyof O]-?: {} extends Pick_2 ? never : K; -}[keyof O]; - -declare function resolveDatasourceUrl({ inlineDatasources, overrideDatasources, env, clientVersion, }: { - inlineDatasources: GetPrismaClientConfig['inlineDatasources']; - overrideDatasources: Datasources; - env: Record; - clientVersion: string; -}): string; - -export declare type Result = T extends { - [K: symbol]: { - types: { - payload: any; - }; - }; -} ? GetResult : GetResult<{ - composites: {}; - objects: {}; - scalars: {}; - name: ''; -}, {}, F>; - -export declare type Result_2 = Result; - -declare namespace Result_3 { - export { - Operation, - FluentOperation, - Count, - GetFindResult, - SelectablePayloadFields, - SelectField, - DefaultSelection, - UnwrapPayload, - ApplyOmit, - OmitValue, - GetCountResult, - Aggregate, - GetAggregateResult, - GetBatchResult, - GetGroupByResult, - GetResult, - ExtractGlobalOmit - } -} - -declare type Result_4 = { - map(fn: (value: T) => U): Result_4; - flatMap(fn: (value: T) => Result_4): Result_4; -} & ({ - readonly ok: true; - readonly value: T; -} | { - readonly ok: false; - readonly error: Error_2; -}); - -export declare type ResultArg = { - [FieldName in string]: ResultFieldDefinition; -}; - -export declare type ResultArgs = { - result: { - [ModelName in string]: ResultArg; - }; -}; - -export declare type ResultArgsFieldCompute = (model: any) => unknown; - -export declare type ResultFieldDefinition = { - needs?: { - [FieldName in string]: boolean; - }; - compute: ResultArgsFieldCompute; -}; - -declare interface ResultSet { - /** - * List of column types appearing in a database query, in the same order as `columnNames`. - * They are used within the Query Engine to convert values from JS to Quaint values. - */ - columnTypes: Array; - /** - * List of column names appearing in a database query, in the same order as `columnTypes`. - */ - columnNames: Array; - /** - * List of rows retrieved from a database query. - * Each row is a list of values, whose length matches `columnNames` and `columnTypes`. - */ - rows: Array>; - /** - * The last ID of an `INSERT` statement, if any. - * This is required for `AUTO_INCREMENT` columns in databases based on MySQL and SQLite. - */ - lastInsertId?: string; -} - -export declare type Return = T extends (...args: any[]) => infer R ? R : T; - -declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown"; - -declare type RuntimeDataModel = { - readonly models: Record; - readonly enums: Record; - readonly types: Record; -}; - -declare type RuntimeEnum = Omit; - -declare type RuntimeModel = Omit; - -export declare type Select = T extends U ? T : never; - -export declare type SelectablePayloadFields = { - objects: { - [k in K]: O; - }; -} | { - composites: { - [k in K]: O; - }; -}; - -export declare type SelectField

, K extends PropertyKey> = P extends { - objects: Record; -} ? P['objects'][K] : P extends { - composites: Record; -} ? P['composites'][K] : never; - -declare type Selection_2 = Record; -export { Selection_2 as Selection } - -declare class Skip { - constructor(param?: symbol); - ifUndefined(value: T | undefined): T | Skip; -} - -export declare const skip: Skip; - -/** - * An interface that represents a span. A span represents a single operation - * within a trace. Examples of span might include remote procedure calls or a - * in-process function calls to sub-components. A Trace has a single, top-level - * "root" Span that in turn may have zero or more child Spans, which in turn - * may have children. - * - * Spans are created by the {@link Tracer.startSpan} method. - */ -declare interface Span { - /** - * Returns the {@link SpanContext} object associated with this Span. - * - * Get an immutable, serializable identifier for this span that can be used - * to create new child spans. Returned SpanContext is usable even after the - * span ends. - * - * @returns the SpanContext object associated with this Span. - */ - spanContext(): SpanContext; - /** - * Sets an attribute to the span. - * - * Sets a single Attribute with the key and value passed as arguments. - * - * @param key the key for this attribute. - * @param value the value for this attribute. Setting a value null or - * undefined is invalid and will result in undefined behavior. - */ - setAttribute(key: string, value: SpanAttributeValue): this; - /** - * Sets attributes to the span. - * - * @param attributes the attributes that will be added. - * null or undefined attribute values - * are invalid and will result in undefined behavior. - */ - setAttributes(attributes: SpanAttributes): this; - /** - * Adds an event to the Span. - * - * @param name the name of the event. - * @param [attributesOrStartTime] the attributes that will be added; these are - * associated with this event. Can be also a start time - * if type is {@type TimeInput} and 3rd param is undefined - * @param [startTime] start time of the event. - */ - addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this; - /** - * Adds a single link to the span. - * - * Links added after the creation will not affect the sampling decision. - * It is preferred span links be added at span creation. - * - * @param link the link to add. - */ - addLink(link: Link): this; - /** - * Adds multiple links to the span. - * - * Links added after the creation will not affect the sampling decision. - * It is preferred span links be added at span creation. - * - * @param links the links to add. - */ - addLinks(links: Link[]): this; - /** - * Sets a status to the span. If used, this will override the default Span - * status. Default is {@link SpanStatusCode.UNSET}. SetStatus overrides the value - * of previous calls to SetStatus on the Span. - * - * @param status the SpanStatus to set. - */ - setStatus(status: SpanStatus): this; - /** - * Updates the Span name. - * - * This will override the name provided via {@link Tracer.startSpan}. - * - * Upon this update, any sampling behavior based on Span name will depend on - * the implementation. - * - * @param name the Span name. - */ - updateName(name: string): this; - /** - * Marks the end of Span execution. - * - * Call to End of a Span MUST not have any effects on child spans. Those may - * still be running and can be ended later. - * - * Do not return `this`. The Span generally should not be used after it - * is ended so chaining is not desired in this context. - * - * @param [endTime] the time to set as Span's end time. If not provided, - * use the current time as the span's end time. - */ - end(endTime?: TimeInput): void; - /** - * Returns the flag whether this span will be recorded. - * - * @returns true if this Span is active and recording information like events - * with the `AddEvent` operation and attributes using `setAttributes`. - */ - isRecording(): boolean; - /** - * Sets exception as a span event - * @param exception the exception the only accepted values are string or Error - * @param [time] the time to set as Span's event time. If not provided, - * use the current time. - */ - recordException(exception: Exception, time?: TimeInput): void; -} - -/** - * @deprecated please use {@link Attributes} - */ -declare type SpanAttributes = Attributes; - -/** - * @deprecated please use {@link AttributeValue} - */ -declare type SpanAttributeValue = AttributeValue; - -declare type SpanCallback = (span?: Span, context?: Context) => R; - -/** - * A SpanContext represents the portion of a {@link Span} which must be - * serialized and propagated along side of a {@link Baggage}. - */ -declare interface SpanContext { - /** - * The ID of the trace that this span belongs to. It is worldwide unique - * with practically sufficient probability by being made as 16 randomly - * generated bytes, encoded as a 32 lowercase hex characters corresponding to - * 128 bits. - */ - traceId: string; - /** - * The ID of the Span. It is globally unique with practically sufficient - * probability by being made as 8 randomly generated bytes, encoded as a 16 - * lowercase hex characters corresponding to 64 bits. - */ - spanId: string; - /** - * Only true if the SpanContext was propagated from a remote parent. - */ - isRemote?: boolean; - /** - * Trace flags to propagate. - * - * It is represented as 1 byte (bitmap). Bit to represent whether trace is - * sampled or not. When set, the least significant bit documents that the - * caller may have recorded trace data. A caller who does not record trace - * data out-of-band leaves this flag unset. - * - * see {@link TraceFlags} for valid flag values. - */ - traceFlags: number; - /** - * Tracing-system-specific info to propagate. - * - * The tracestate field value is a `list` as defined below. The `list` is a - * series of `list-members` separated by commas `,`, and a list-member is a - * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs - * surrounding `list-members` are ignored. There can be a maximum of 32 - * `list-members` in a `list`. - * More Info: https://www.w3.org/TR/trace-context/#tracestate-field - * - * Examples: - * Single tracing system (generic format): - * tracestate: rojo=00f067aa0ba902b7 - * Multiple tracing systems (with different formatting): - * tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE - */ - traceState?: TraceState; -} - -declare enum SpanKind { - /** Default value. Indicates that the span is used internally. */ - INTERNAL = 0, - /** - * Indicates that the span covers server-side handling of an RPC or other - * remote request. - */ - SERVER = 1, - /** - * Indicates that the span covers the client-side wrapper around an RPC or - * other remote request. - */ - CLIENT = 2, - /** - * Indicates that the span describes producer sending a message to a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - PRODUCER = 3, - /** - * Indicates that the span describes consumer receiving a message from a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - CONSUMER = 4 -} - -/** - * Options needed for span creation - */ -declare interface SpanOptions { - /** - * The SpanKind of a span - * @default {@link SpanKind.INTERNAL} - */ - kind?: SpanKind; - /** A span's attributes */ - attributes?: SpanAttributes; - /** {@link Link}s span to other spans */ - links?: Link[]; - /** A manually specified start time for the created `Span` object. */ - startTime?: TimeInput; - /** The new span should be a root span. (Ignore parent from context). */ - root?: boolean; -} - -declare interface SpanStatus { - /** The status code of this message. */ - code: SpanStatusCode; - /** A developer-facing error message. */ - message?: string; -} - -/** - * An enumeration of status codes. - */ -declare enum SpanStatusCode { - /** - * The default status. - */ - UNSET = 0, - /** - * The operation has been validated by an Application developer or - * Operator to have completed successfully. - */ - OK = 1, - /** - * The operation contains an error. - */ - ERROR = 2 -} - -/** - * A SQL instance can be nested within each other to build SQL strings. - */ -export declare class Sql { - readonly values: Value[]; - readonly strings: string[]; - constructor(rawStrings: readonly string[], rawValues: readonly RawValue[]); - get sql(): string; - get statement(): string; - get text(): string; - inspect(): { - sql: string; - statement: string; - text: string; - values: unknown[]; - }; -} - -/** - * Create a SQL object from a template string. - */ -export declare function sqltag(strings: readonly string[], ...values: readonly RawValue[]): Sql; - -/** - * Defines TimeInput. - * - * hrtime, epoch milliseconds, performance.now() or Date - */ -declare type TimeInput = HrTime | number | Date; - -export declare type ToTuple = T extends any[] ? T : [T]; - -declare interface TraceState { - /** - * Create a new TraceState which inherits from this TraceState and has the - * given key set. - * The new entry will always be added in the front of the list of states. - * - * @param key key of the TraceState entry. - * @param value value of the TraceState entry. - */ - set(key: string, value: string): TraceState; - /** - * Return a new TraceState which inherits from this TraceState but does not - * contain the given key. - * - * @param key the key for the TraceState entry to be removed. - */ - unset(key: string): TraceState; - /** - * Returns the value to which the specified key is mapped, or `undefined` if - * this map contains no mapping for the key. - * - * @param key with which the specified value is to be associated. - * @returns the value to which the specified key is mapped, or `undefined` if - * this map contains no mapping for the key. - */ - get(key: string): string | undefined; - /** - * Serializes the TraceState to a `list` as defined below. The `list` is a - * series of `list-members` separated by commas `,`, and a list-member is a - * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs - * surrounding `list-members` are ignored. There can be a maximum of 32 - * `list-members` in a `list`. - * - * @returns the serialized string. - */ - serialize(): string; -} - -declare interface TracingHelper { - isEnabled(): boolean; - getTraceParent(context?: Context): string; - createEngineSpan(engineSpanEvent: EngineSpanEvent): void; - getActiveContext(): Context | undefined; - runInChildSpan(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback): R; -} - -declare interface Transaction extends Queryable { - /** - * Transaction options. - */ - readonly options: TransactionOptions; - /** - * Commit the transaction. - */ - commit(): Promise>; - /** - * Rolls back the transaction. - */ - rollback(): Promise>; -} - -declare namespace Transaction_2 { - export { - IsolationLevel, - Options, - InteractiveTransactionInfo, - TransactionHeaders - } -} - -declare interface TransactionContext extends Queryable { - /** - * Starts new transaction. - */ - startTransaction(): Promise>; -} - -declare type TransactionHeaders = { - traceparent?: string; -}; - -declare type TransactionOptions = { - usePhantomQuery: boolean; -}; - -declare type TransactionOptions_2 = { - kind: 'itx'; - options: InteractiveTransactionOptions; -} | { - kind: 'batch'; - options: BatchTransactionOptions; -}; - -export declare class TypedSql { - [PrivateResultType]: Result; - constructor(sql: string, values: Values); - get sql(): string; - get values(): Values; -} - -export declare type TypeMapCbDef = Fn<{ - extArgs: InternalArgs; - clientOptions: ClientOptionDef; -}, TypeMapDef>; - -/** Shared */ -export declare type TypeMapDef = Record; - -declare namespace Types { - export { - Result_3 as Result, - Extensions_2 as Extensions, - Utils, - Public_2 as Public, - isSkip, - Skip, - skip, - UnknownTypedSql, - OperationPayload as Payload - } -} -export { Types } - -declare type UnknownErrorParams = { - clientVersion: string; - batchRequestIdx?: number; -}; - -export declare type UnknownTypedSql = TypedSql; - -declare type Unpacker = (data: any) => any; - -export declare type UnwrapPayload

= {} extends P ? unknown : { - [K in keyof P]: P[K] extends { - scalars: infer S; - composites: infer C; - }[] ? Array> : P[K] extends { - scalars: infer S; - composites: infer C; - } | null ? S & UnwrapPayload | Select : never; -}; - -export declare type UnwrapPromise

= P extends Promise ? R : P; - -export declare type UnwrapTuple = { - [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise ? X : UnwrapPromise : UnwrapPromise; -}; - -/** - * Input that flows from the user into the Client. - */ -declare type UserArgs_2 = any; - -declare namespace Utils { - export { - EmptyToUnknown, - NeverToUnknown, - PatchFlat, - Omit_2 as Omit, - Pick_2 as Pick, - ComputeDeep, - Compute, - OptionalFlat, - ReadonlyDeep, - Narrowable, - Narrow, - Exact, - Cast, - Record_2 as Record, - UnwrapPromise, - UnwrapTuple, - Path, - Fn, - Call, - RequiredKeys, - OptionalKeys, - Optional, - Return, - ToTuple, - RenameAndNestPayloadKeys, - PayloadToResult, - Select, - Equals, - Or, - JsPromise - } -} - -declare function validator(): (select: Exact) => S; - -declare function validator, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): (select: Exact>) => S; - -declare function validator, O extends keyof C[M] & Operation, P extends keyof Args>(client: C, model: M, operation: O, prop: P): (select: Exact[P]>) => S; - -/** - * Values supported by SQL engine. - */ -export declare type Value = unknown; - -export declare function warnEnvConflicts(envPaths: any): void; - -export declare const warnOnce: (key: string, message: string, ...args: unknown[]) => void; - -declare type WasmLoadingConfig = { - /** - * WASM-bindgen runtime for corresponding module - */ - getRuntime: () => { - __wbg_set_wasm(exports: unknown): any; - QueryEngine: QueryEngineConstructor; - }; - /** - * Loads the raw wasm module for the wasm query engine. This configuration is - * generated specifically for each type of client, eg. Node.js client and Edge - * clients will have different implementations. - * @remarks this is a callback on purpose, we only load the wasm if needed. - * @remarks only used by LibraryEngine.ts - */ - getQueryEngineWasmModule: () => Promise; -}; - -export { } diff --git a/node_modules/@prisma/client/runtime/library.js b/node_modules/@prisma/client/runtime/library.js deleted file mode 100644 index 65671b1..0000000 --- a/node_modules/@prisma/client/runtime/library.js +++ /dev/null @@ -1,143 +0,0 @@ -"use strict";var zl=Object.create;var Lr=Object.defineProperty;var Yl=Object.getOwnPropertyDescriptor;var Zl=Object.getOwnPropertyNames;var Xl=Object.getPrototypeOf,eu=Object.prototype.hasOwnProperty;var Z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Vt=(e,t)=>{for(var r in t)Lr(e,r,{get:t[r],enumerable:!0})},mo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zl(t))!eu.call(e,i)&&i!==r&&Lr(e,i,{get:()=>t[i],enumerable:!(n=Yl(t,i))||n.enumerable});return e};var k=(e,t,r)=>(r=e!=null?zl(Xl(e)):{},mo(t||!e||!e.__esModule?Lr(r,"default",{value:e,enumerable:!0}):r,e)),tu=e=>mo(Lr({},"__esModule",{value:!0}),e);var Mo=Z((af,Yn)=>{"use strict";var v=Yn.exports;Yn.exports.default=v;var D="\x1B[",Jt="\x1B]",ft="\x07",Qr=";",No=process.env.TERM_PROGRAM==="Apple_Terminal";v.cursorTo=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?D+(e+1)+"G":D+(t+1)+";"+(e+1)+"H"};v.cursorMove=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=D+-e+"D":e>0&&(r+=D+e+"C"),t<0?r+=D+-t+"A":t>0&&(r+=D+t+"B"),r};v.cursorUp=(e=1)=>D+e+"A";v.cursorDown=(e=1)=>D+e+"B";v.cursorForward=(e=1)=>D+e+"C";v.cursorBackward=(e=1)=>D+e+"D";v.cursorLeft=D+"G";v.cursorSavePosition=No?"\x1B7":D+"s";v.cursorRestorePosition=No?"\x1B8":D+"u";v.cursorGetPosition=D+"6n";v.cursorNextLine=D+"E";v.cursorPrevLine=D+"F";v.cursorHide=D+"?25l";v.cursorShow=D+"?25h";v.eraseLines=e=>{let t="";for(let r=0;r[Jt,"8",Qr,Qr,t,ft,e,Jt,"8",Qr,Qr,ft].join("");v.image=(e,t={})=>{let r=`${Jt}1337;File=inline=1`;return t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+e.toString("base64")+ft};v.iTerm={setCwd:(e=process.cwd())=>`${Jt}50;CurrentDir=${e}${ft}`,annotation:(e,t={})=>{let r=`${Jt}1337;`,n=typeof t.x<"u",i=typeof t.y<"u";if((n||i)&&!(n&&i&&typeof t.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(n?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,r+ft}}});var Zn=Z((lf,$o)=>{"use strict";$o.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n{"use strict";var ju=require("os"),qo=require("tty"),de=Zn(),{env:Q}=process,Qe;de("no-color")||de("no-colors")||de("color=false")||de("color=never")?Qe=0:(de("color")||de("colors")||de("color=true")||de("color=always"))&&(Qe=1);"FORCE_COLOR"in Q&&(Q.FORCE_COLOR==="true"?Qe=1:Q.FORCE_COLOR==="false"?Qe=0:Qe=Q.FORCE_COLOR.length===0?1:Math.min(parseInt(Q.FORCE_COLOR,10),3));function Xn(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ei(e,t){if(Qe===0)return 0;if(de("color=16m")||de("color=full")||de("color=truecolor"))return 3;if(de("color=256"))return 2;if(e&&!t&&Qe===void 0)return 0;let r=Qe||0;if(Q.TERM==="dumb")return r;if(process.platform==="win32"){let n=ju.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Q)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in Q)||Q.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in Q)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Q.TEAMCITY_VERSION)?1:0;if(Q.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Q){let n=parseInt((Q.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Q.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Q.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Q.TERM)||"COLORTERM"in Q?1:r}function Vu(e){let t=ei(e,e&&e.isTTY);return Xn(t)}jo.exports={supportsColor:Vu,stdout:Xn(ei(!0,qo.isatty(1))),stderr:Xn(ei(!0,qo.isatty(2)))}});var Go=Z((cf,Uo)=>{"use strict";var Bu=Vo(),gt=Zn();function Bo(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}function ti(e){let{env:t}=process;if("FORCE_HYPERLINK"in t)return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0);if(gt("no-hyperlink")||gt("no-hyperlinks")||gt("hyperlink=false")||gt("hyperlink=never"))return!1;if(gt("hyperlink=true")||gt("hyperlink=always")||"NETLIFY"in t)return!0;if(!Bu.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in t||"TEAMCITY_VERSION"in t)return!1;if("TERM_PROGRAM"in t){let r=Bo(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case"iTerm.app":return r.major===3?r.minor>=1:r.major>3;case"WezTerm":return r.major>=20200620;case"vscode":return r.major>1||r.major===1&&r.minor>=72}}if("VTE_VERSION"in t){if(t.VTE_VERSION==="0.50.0")return!1;let r=Bo(t.VTE_VERSION);return r.major>0||r.minor>=50}return!1}Uo.exports={supportsHyperlink:ti,stdout:ti(process.stdout),stderr:ti(process.stderr)}});var Jo=Z((pf,Wt)=>{"use strict";var Uu=Mo(),ri=Go(),Qo=(e,t,{target:r="stdout",...n}={})=>ri[r]?Uu.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`;Wt.exports=(e,t,r={})=>Qo(e,t,r);Wt.exports.stderr=(e,t,r={})=>Qo(e,t,{target:"stderr",...r});Wt.exports.isSupported=ri.stdout;Wt.exports.stderr.isSupported=ri.stderr});var ii=Z((xf,Gu)=>{Gu.exports={name:"@prisma/engines-version",version:"5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"bf0e5e8a04cada8225617067eaa03d041e2bba36"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.34",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var oi=Z(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.enginesVersion=void 0;Jr.enginesVersion=ii().prisma.enginesVersion});var zo=Z((jf,Wu)=>{Wu.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var Zo=Z((Vf,Hr)=>{"use strict";var Hu=require("fs"),Yo=require("path"),Ku=require("os"),zu=zo(),Yu=zu.version,Zu=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Xu(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,` -`);let n;for(;(n=Zu.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,` -`),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function ui(e){console.log(`[dotenv@${Yu}][DEBUG] ${e}`)}function ec(e){return e[0]==="~"?Yo.join(Ku.homedir(),e.slice(1)):e}function tc(e){let t=Yo.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug),i=!!(e&&e.override);e&&(e.path!=null&&(t=ec(e.path)),e.encoding!=null&&(r=e.encoding));try{let o=Wr.parse(Hu.readFileSync(t,{encoding:r}));return Object.keys(o).forEach(function(s){Object.prototype.hasOwnProperty.call(process.env,s)?(i===!0&&(process.env[s]=o[s]),n&&ui(i===!0?`"${s}" is already defined in \`process.env\` and WAS overwritten`:`"${s}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[s]=o[s]}),{parsed:o}}catch(o){return n&&ui(`Failed to load ${t} ${o.message}`),{error:o}}}var Wr={config:tc,parse:Xu};Hr.exports.config=Wr.config;Hr.exports.parse=Wr.parse;Hr.exports=Wr});var is=Z((Hf,ns)=>{"use strict";ns.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var ss=Z((Kf,os)=>{"use strict";var oc=is();os.exports=e=>{let t=oc(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}});var mi=Z((tg,as)=>{"use strict";as.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var ps=Z((ig,cs)=>{"use strict";cs.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var yi=Z((og,ds)=>{"use strict";var mc=ps();ds.exports=e=>typeof e=="string"?e.replace(mc(),""):e});var ms=Z((lg,Yr)=>{"use strict";Yr.exports=(e={})=>{let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let r=new URL(`${t}/issues/new`),n=["body","title","labels","template","milestone","assignee","projects"];for(let i of n){let o=e[i];if(o!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(o))throw new TypeError(`The \`${i}\` option should be an array`);o=o.join(",")}r.searchParams.set(i,o)}}return r.toString()};Yr.exports.default=Yr.exports});var no=Z((av,Za)=>{"use strict";Za.exports=function(){function e(t,r,n,i,o){return tn?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;sUn,Decimal:()=>Re,Extensions:()=>qn,MetricsClient:()=>bt,NotFoundError:()=>Le,PrismaClientInitializationError:()=>R,PrismaClientKnownRequestError:()=>V,PrismaClientRustPanicError:()=>le,PrismaClientUnknownRequestError:()=>B,PrismaClientValidationError:()=>J,Public:()=>jn,Sql:()=>ie,defineDmmfProperty:()=>gs,empty:()=>Es,getPrismaClient:()=>Wl,getRuntime:()=>Tn,join:()=>bs,makeStrictEnum:()=>Hl,makeTypedQueryFactory:()=>ys,objectEnumValues:()=>en,raw:()=>Si,skip:()=>tn,sqltag:()=>Ai,warnEnvConflicts:()=>Kl,warnOnce:()=>Xt});module.exports=tu(Dm);var qn={};Vt(qn,{defineExtension:()=>fo,getExtensionContext:()=>go});function fo(e){return typeof e=="function"?e:t=>t.$extends(e)}function go(e){return e}var jn={};Vt(jn,{validator:()=>ho});function ho(...e){return t=>t}var Nr={};Vt(Nr,{$:()=>xo,bgBlack:()=>pu,bgBlue:()=>gu,bgCyan:()=>yu,bgGreen:()=>mu,bgMagenta:()=>hu,bgRed:()=>du,bgWhite:()=>bu,bgYellow:()=>fu,black:()=>au,blue:()=>rt,bold:()=>H,cyan:()=>De,dim:()=>Oe,gray:()=>Bt,green:()=>qe,grey:()=>cu,hidden:()=>ou,inverse:()=>iu,italic:()=>nu,magenta:()=>lu,red:()=>ce,reset:()=>ru,strikethrough:()=>su,underline:()=>X,white:()=>uu,yellow:()=>ke});var Vn,yo,bo,Eo,wo=!0;typeof process<"u"&&({FORCE_COLOR:Vn,NODE_DISABLE_COLORS:yo,NO_COLOR:bo,TERM:Eo}=process.env||{},wo=process.stdout&&process.stdout.isTTY);var xo={enabled:!yo&&bo==null&&Eo!=="dumb"&&(Vn!=null&&Vn!=="0"||wo)};function M(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!xo.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var ru=M(0,0),H=M(1,22),Oe=M(2,22),nu=M(3,23),X=M(4,24),iu=M(7,27),ou=M(8,28),su=M(9,29),au=M(30,39),ce=M(31,39),qe=M(32,39),ke=M(33,39),rt=M(34,39),lu=M(35,39),De=M(36,39),uu=M(37,39),Bt=M(90,39),cu=M(90,39),pu=M(40,49),du=M(41,49),mu=M(42,49),fu=M(43,49),gu=M(44,49),hu=M(45,49),yu=M(46,49),bu=M(47,49);var Eu=100,Po=["green","yellow","blue","magenta","cyan","red"],Ut=[],vo=Date.now(),wu=0,Bn=typeof process<"u"?process.env:{};globalThis.DEBUG??=Bn.DEBUG??"";globalThis.DEBUG_COLORS??=Bn.DEBUG_COLORS?Bn.DEBUG_COLORS==="true":!0;var Gt={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function xu(e){let t={color:Po[wu++%Po.length],enabled:Gt.enabled(e),namespace:e,log:Gt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Ut.push([o,...n]),Ut.length>Eu&&Ut.shift(),Gt.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:Pu(c)),u=`+${Date.now()-vo}ms`;vo=Date.now(),globalThis.DEBUG_COLORS?a(Nr[s](H(o)),...l,Nr[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var Un=new Proxy(xu,{get:(e,t)=>Gt[t],set:(e,t,r)=>Gt[t]=r});function Pu(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function To(e=7500){let t=Ut.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(` -`);return t.length!!(e&&typeof e=="object"),qr=e=>e&&!!e[_e],Ee=(e,t,r)=>{if(qr(e)){let n=e[_e](),{matched:i,selections:o}=n.match(t);return i&&o&&Object.keys(o).forEach(s=>r(s,o[s])),i}if(Jn(e)){if(!Jn(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],o=[];for(let s of e.keys()){let a=e[s];qr(a)&&a[vu]?o.push(a):o.length?i.push(a):n.push(a)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.lengthEe(u,s[c],r))&&i.every((u,c)=>Ee(u,a[c],r))&&(o.length===0||Ee(o[0],l,r))}return e.length===t.length&&e.every((s,a)=>Ee(s,t[a],r))}return Object.keys(e).every(n=>{let i=e[n];return(n in t||qr(o=i)&&o[_e]().matcherType==="optional")&&Ee(i,t[n],r);var o})}return Object.is(t,e)},Ge=e=>{var t,r,n;return Jn(e)?qr(e)?(t=(r=(n=e[_e]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Qt(e,Ge):Qt(Object.values(e),Ge):[]},Qt=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function pe(e){return Object.assign(e,{optional:()=>Tu(e),and:t=>j(e,t),or:t=>Ru(e,t),select:t=>t===void 0?So(e):So(t,e)})}function Tu(e){return pe({[_e]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return t===void 0?(Ge(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Ee(e,t,n),selections:r}},getSelectionKeys:()=>Ge(e),matcherType:"optional"})})}function j(...e){return pe({[_e]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return{matched:e.every(i=>Ee(i,t,n)),selections:r}},getSelectionKeys:()=>Qt(e,Ge),matcherType:"and"})})}function Ru(...e){return pe({[_e]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return Qt(e,Ge).forEach(i=>n(i,void 0)),{matched:e.some(i=>Ee(i,t,n)),selections:r}},getSelectionKeys:()=>Qt(e,Ge),matcherType:"or"})})}function I(e){return{[_e]:()=>({match:t=>({matched:!!e(t)})})}}function So(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return pe({[_e]:()=>({match:n=>{let i={[t??jr]:n};return{matched:r===void 0||Ee(r,n,(o,s)=>{i[o]=s}),selections:i}},getSelectionKeys:()=>[t??jr].concat(r===void 0?[]:Ge(r))})})}function ye(e){return typeof e=="number"}function je(e){return typeof e=="string"}function Ve(e){return typeof e=="bigint"}var Qm=pe(I(function(e){return!0}));var Be=e=>Object.assign(pe(e),{startsWith:t=>{return Be(j(e,(r=t,I(n=>je(n)&&n.startsWith(r)))));var r},endsWith:t=>{return Be(j(e,(r=t,I(n=>je(n)&&n.endsWith(r)))));var r},minLength:t=>Be(j(e,(r=>I(n=>je(n)&&n.length>=r))(t))),length:t=>Be(j(e,(r=>I(n=>je(n)&&n.length===r))(t))),maxLength:t=>Be(j(e,(r=>I(n=>je(n)&&n.length<=r))(t))),includes:t=>{return Be(j(e,(r=t,I(n=>je(n)&&n.includes(r)))));var r},regex:t=>{return Be(j(e,(r=t,I(n=>je(n)&&!!n.match(r)))));var r}}),Jm=Be(I(je)),be=e=>Object.assign(pe(e),{between:(t,r)=>be(j(e,((n,i)=>I(o=>ye(o)&&n<=o&&i>=o))(t,r))),lt:t=>be(j(e,(r=>I(n=>ye(n)&&nbe(j(e,(r=>I(n=>ye(n)&&n>r))(t))),lte:t=>be(j(e,(r=>I(n=>ye(n)&&n<=r))(t))),gte:t=>be(j(e,(r=>I(n=>ye(n)&&n>=r))(t))),int:()=>be(j(e,I(t=>ye(t)&&Number.isInteger(t)))),finite:()=>be(j(e,I(t=>ye(t)&&Number.isFinite(t)))),positive:()=>be(j(e,I(t=>ye(t)&&t>0))),negative:()=>be(j(e,I(t=>ye(t)&&t<0)))}),Wm=be(I(ye)),Ue=e=>Object.assign(pe(e),{between:(t,r)=>Ue(j(e,((n,i)=>I(o=>Ve(o)&&n<=o&&i>=o))(t,r))),lt:t=>Ue(j(e,(r=>I(n=>Ve(n)&&nUe(j(e,(r=>I(n=>Ve(n)&&n>r))(t))),lte:t=>Ue(j(e,(r=>I(n=>Ve(n)&&n<=r))(t))),gte:t=>Ue(j(e,(r=>I(n=>Ve(n)&&n>=r))(t))),positive:()=>Ue(j(e,I(t=>Ve(t)&&t>0))),negative:()=>Ue(j(e,I(t=>Ve(t)&&t<0)))}),Hm=Ue(I(Ve)),Km=pe(I(function(e){return typeof e=="boolean"})),zm=pe(I(function(e){return typeof e=="symbol"})),Ym=pe(I(function(e){return e==null})),Zm=pe(I(function(e){return e!=null}));var Wn={matched:!1,value:void 0};function mt(e){return new Hn(e,Wn)}var Hn=class e{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let o=!1,s={},a=(u,c)=>{o=!0,s[u]=c},l=!n.some(u=>Ee(u,this.input,a))||i&&!i(this.input)?Wn:{matched:!0,value:r(o?jr in s?s[jr]:s:this.input,this.input)};return new e(this.input,l)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new e(this.input,n?{matched:!0,value:r(this.input,this.input)}:Wn)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let t;try{t=JSON.stringify(this.input)}catch{t=this.input}throw new Error(`Pattern matching error: no pattern matches value ${t}`)}run(){return this.exhaustive()}returnType(){return this}};var ko=require("util");var Cu={warn:ke("prisma:warn")},Su={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Vr(e,...t){Su.warn()&&console.warn(`${Cu.warn} ${e}`,...t)}var Au=(0,ko.promisify)(Oo.default.exec),te=L("prisma:get-platform"),Iu=["1.0.x","1.1.x","3.0.x"];async function Do(){let e=Ur.default.platform(),t=process.arch;if(e==="freebsd"){let s=await Gr("freebsd-version");if(s&&s.trim().length>0){let l=/^(\d+)\.?/.exec(s);if(l)return{platform:"freebsd",targetDistro:`freebsd${l[1]}`,arch:t}}}if(e!=="linux")return{platform:e,arch:t};let r=await ku(),n=await qu(),i=_u({arch:t,archFromUname:n,familyDistro:r.familyDistro}),{libssl:o}=await Fu(i);return{platform:"linux",libssl:o,arch:t,archFromUname:n,...r}}function Ou(e){let t=/^ID="?([^"\n]*)"?$/im,r=/^ID_LIKE="?([^"\n]*)"?$/im,n=t.exec(e),i=n&&n[1]&&n[1].toLowerCase()||"",o=r.exec(e),s=o&&o[1]&&o[1].toLowerCase()||"",a=mt({id:i,idLike:s}).with({id:"alpine"},({id:l})=>({targetDistro:"musl",familyDistro:l,originalDistro:l})).with({id:"raspbian"},({id:l})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:l})).with({id:"nixos"},({id:l})=>({targetDistro:"nixos",originalDistro:l,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).when(({idLike:l})=>l.includes("debian")||l.includes("ubuntu"),({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).when(({idLike:l})=>i==="arch"||l.includes("arch"),({id:l})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:l})).when(({idLike:l})=>l.includes("centos")||l.includes("fedora")||l.includes("rhel")||l.includes("suse"),({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).otherwise(({id:l})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:l}));return te(`Found distro info: -${JSON.stringify(a,null,2)}`),a}async function ku(){let e="/etc/os-release";try{let t=await Kn.default.readFile(e,{encoding:"utf-8"});return Ou(t)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function Du(e){let t=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(t){let r=`${t[1]}.x`;return _o(r)}}function Ao(e){let t=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(t){let r=`${t[1]}${t[2]??".0"}.x`;return _o(r)}}function _o(e){let t=(()=>{if(Lo(e))return e;let r=e.split(".");return r[1]="0",r.join(".")})();if(Iu.includes(t))return t}function _u(e){return mt(e).with({familyDistro:"musl"},()=>(te('Trying platform-specific paths for "alpine"'),["/lib"])).with({familyDistro:"debian"},({archFromUname:t})=>(te('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${t}-linux-gnu`,`/lib/${t}-linux-gnu`])).with({familyDistro:"rhel"},()=>(te('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:t,arch:r,archFromUname:n})=>(te(`Don't know any platform-specific paths for "${t}" on ${r} (${n})`),[]))}async function Fu(e){let t='grep -v "libssl.so.0"',r=await Io(e);if(r){te(`Found libssl.so file using platform-specific paths: ${r}`);let o=Ao(r);if(te(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}te('Falling back to "ldconfig" and other generic paths');let n=await Gr(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${t}`);if(n||(n=await Io(["/lib64","/usr/lib64","/lib"])),n){te(`Found libssl.so file using "ldconfig" or other generic paths: ${n}`);let o=Ao(n);if(te(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let i=await Gr("openssl version -v");if(i){te(`Found openssl binary with version: ${i}`);let o=Du(i);if(te(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return te("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function Io(e){for(let t of e){let r=await Lu(t);if(r)return r}}async function Lu(e){try{return(await Kn.default.readdir(e)).find(r=>r.startsWith("libssl.so.")&&!r.startsWith("libssl.so.0"))}catch(t){if(t.code==="ENOENT")return;throw t}}async function nt(){let{binaryTarget:e}=await Fo();return e}function Nu(e){return e.binaryTarget!==void 0}async function zn(){let{memoized:e,...t}=await Fo();return t}var Br={};async function Fo(){if(Nu(Br))return Promise.resolve({...Br,memoized:!0});let e=await Do(),t=Mu(e);return Br={...e,binaryTarget:t},{...Br,memoized:!1}}function Mu(e){let{platform:t,arch:r,archFromUname:n,libssl:i,targetDistro:o,familyDistro:s,originalDistro:a}=e;t==="linux"&&!["x64","arm64"].includes(r)&&Vr(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${r}" instead). If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${n}".`);let l="1.1.x";if(t==="linux"&&i===void 0){let c=mt({familyDistro:s}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");Vr(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${l}". -${c}`)}let u="debian";if(t==="linux"&&o===void 0&&te(`Distro is "${a}". Falling back to Prisma engines built for "${u}".`),t==="darwin"&&r==="arm64")return"darwin-arm64";if(t==="darwin")return"darwin";if(t==="win32")return"windows";if(t==="freebsd")return o;if(t==="openbsd")return"openbsd";if(t==="netbsd")return"netbsd";if(t==="linux"&&o==="nixos")return"linux-nixos";if(t==="linux"&&r==="arm64")return`${o==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${i||l}`;if(t==="linux"&&r==="arm")return`linux-arm-openssl-${i||l}`;if(t==="linux"&&o==="musl"){let c="linux-musl";return!i||Lo(i)?c:`${c}-openssl-${i}`}return t==="linux"&&o&&i?`${o}-openssl-${i}`:(t!=="linux"&&Vr(`Prisma detected unknown OS "${t}" and may not work as expected. Defaulting to "linux".`),i?`${u}-openssl-${i}`:o?`${o}-openssl-${l}`:`${u}-openssl-${l}`)}async function $u(e){try{return await e()}catch{return}}function Gr(e){return $u(async()=>{let t=await Au(e);return te(`Command "${e}" successfully returned "${t.stdout}"`),t.stdout})}async function qu(){return typeof Ur.default.machine=="function"?Ur.default.machine():(await Gr("uname -m"))?.trim()}function Lo(e){return e.startsWith("1.")}var Wo=k(Jo());function ni(e){return(0,Wo.default)(e,e,{fallback:X})}var Qu=k(oi());var $=k(require("path")),Ju=k(oi()),kf=L("prisma:engines");function Ho(){return $.default.join(__dirname,"../")}var Df="libquery-engine";$.default.join(__dirname,"../query-engine-darwin");$.default.join(__dirname,"../query-engine-darwin-arm64");$.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");$.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");$.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");$.default.join(__dirname,"../query-engine-linux-static-x64");$.default.join(__dirname,"../query-engine-linux-static-arm64");$.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");$.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");$.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");$.default.join(__dirname,"../libquery_engine-darwin.dylib.node");$.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");$.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");$.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");$.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");$.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");$.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");$.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");$.default.join(__dirname,"../libquery_engine-linux-musl.so.node");$.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");$.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");$.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");$.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");$.default.join(__dirname,"../query_engine-windows.dll.node");var si=k(require("fs")),Ko=L("chmodPlusX");function ai(e){if(process.platform==="win32")return;let t=si.default.statSync(e),r=t.mode|64|8|1;if(t.mode===r){Ko(`Execution permissions of ${e} are fine`);return}let n=r.toString(8).slice(-3);Ko(`Have to call chmodPlusX on ${e}`),si.default.chmodSync(e,n)}function li(e){let t=e.e,r=a=>`Prisma cannot find the required \`${a}\` system library in your system`,n=t.message.includes("cannot open shared object file"),i=`Please refer to the documentation about Prisma's system requirements: ${ni("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${Oe(e.id)}\`).`,s=mt({message:t.message,code:t.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:a})=>n&&a.includes("libz"),()=>`${r("libz")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libgcc_s"),()=>`${r("libgcc_s")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libssl"),()=>{let a=e.platformInfo.libssl?`openssl-${e.platformInfo.libssl}`:"openssl";return`${r("libssl")}. Please install ${a} and try again.`}).when(({message:a})=>a.includes("GLIBC"),()=>`Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${i}`).when(({message:a})=>e.platformInfo.platform==="linux"&&a.includes("symbol not found"),()=>`The Prisma engines are not compatible with your system ${e.platformInfo.originalDistro} on (${e.platformInfo.archFromUname}) which uses the \`${e.platformInfo.binaryTarget}\` binaryTarget by default. ${i}`).otherwise(()=>`The Prisma engines do not seem to be compatible with your system. ${i}`);return`${o} -${s} - -Details: ${t.message}`}var pi=k(Zo()),Kr=k(require("fs"));var ht=k(require("path"));function Xo(e){let t=e.ignoreProcessEnv?{}:process.env,r=n=>n.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,s){let a=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!a)return o;let l=a[1],u,c;if(l==="\\")c=a[0],u=c.replace("\\$","$");else{let p=a[2];c=a[0].substring(l.length),u=Object.hasOwnProperty.call(t,p)?t[p]:e.parsed[p]||"",u=r(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=r(i)}for(let n in e.parsed)t[n]=e.parsed[n];return e}var ci=L("prisma:tryLoadEnv");function Ht({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=es(e);r.conflictCheck!=="none"&&rc(n,t,r.conflictCheck);let i=null;return ts(n?.path,t)||(i=es(t)),!n&&!i&&ci("No Environment variables loaded"),i?.dotenvResult.error?console.error(ce(H("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(` -`),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function rc(e,t,r){let n=e?.dotenvResult.parsed,i=!ts(e?.path,t);if(n&&t&&i&&Kr.default.existsSync(t)){let o=pi.default.parse(Kr.default.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=ht.default.relative(process.cwd(),e.path),l=ht.default.relative(process.cwd(),t);if(r==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${X(a)} and ${X(l)} -Conflicting env vars: -${s.map(c=>` ${H(c)}`).join(` -`)} - -We suggest to move the contents of ${X(l)} to ${X(a)} to consolidate your env vars. -`;throw new Error(u)}else if(r==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>H(c)).join(", ")} in ${X(a)} and ${X(l)} -Env vars from ${X(l)} overwrite the ones from ${X(a)} - `;console.warn(`${ke("warn(prisma)")} ${u}`)}}}}function es(e){if(nc(e)){ci(`Environment variables loaded from ${e}`);let t=pi.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Xo(t),message:Oe(`Environment variables loaded from ${ht.default.relative(process.cwd(),e)}`),path:e}}else ci(`Environment variables not found at ${e}`);return null}function ts(e,t){return e&&t&&ht.default.resolve(e)===ht.default.resolve(t)}function nc(e){return!!(e&&Kr.default.existsSync(e))}var rs="library";function Kt(e){let t=ic();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":rs)}function ic(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}var Je;(t=>{let e;(E=>(E.findUnique="findUnique",E.findUniqueOrThrow="findUniqueOrThrow",E.findFirst="findFirst",E.findFirstOrThrow="findFirstOrThrow",E.findMany="findMany",E.create="create",E.createMany="createMany",E.createManyAndReturn="createManyAndReturn",E.update="update",E.updateMany="updateMany",E.upsert="upsert",E.delete="delete",E.deleteMany="deleteMany",E.groupBy="groupBy",E.count="count",E.aggregate="aggregate",E.findRaw="findRaw",E.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(Je||={});var zt=k(require("path"));function di(e){return zt.default.sep===zt.default.posix.sep?e:e.split(zt.default.sep).join(zt.default.posix.sep)}var ls=k(mi());function gi(e){return String(new fi(e))}var fi=class{constructor(t){this.config=t}toString(){let{config:t}=this,r=t.provider.fromEnvVar?`env("${t.provider.fromEnvVar}")`:t.provider.value,n=JSON.parse(JSON.stringify({provider:r,binaryTargets:sc(t.binaryTargets)}));return`generator ${t.name} { -${(0,ls.default)(ac(n),2)} -}`}};function sc(e){let t;if(e.length>0){let r=e.find(n=>n.fromEnvVar!==null);r?t=`env("${r.fromEnvVar}")`:t=e.map(n=>n.native?"native":n.value)}else t=void 0;return t}function ac(e){let t=Object.keys(e).reduce((r,n)=>Math.max(r,n.length),0);return Object.entries(e).map(([r,n])=>`${r.padEnd(t)} = ${lc(n)}`).join(` -`)}function lc(e){return JSON.parse(JSON.stringify(e,(t,r)=>Array.isArray(r)?`[${r.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(r)))}var Zt={};Vt(Zt,{error:()=>pc,info:()=>cc,log:()=>uc,query:()=>dc,should:()=>us,tags:()=>Yt,warn:()=>hi});var Yt={error:ce("prisma:error"),warn:ke("prisma:warn"),info:De("prisma:info"),query:rt("prisma:query")},us={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function uc(...e){console.log(...e)}function hi(e,...t){us.warn()&&console.warn(`${Yt.warn} ${e}`,...t)}function cc(e,...t){console.info(`${Yt.info} ${e}`,...t)}function pc(e,...t){console.error(`${Yt.error} ${e}`,...t)}function dc(e,...t){console.log(`${Yt.query} ${e}`,...t)}function zr(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}function Fe(e,t){throw new Error(t)}function bi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Ei=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});function yt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function wi(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{fs.has(e)||(fs.add(e),hi(t,...r))};var V=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};w(V,"PrismaClientKnownRequestError");var Le=class extends V{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};w(Le,"NotFoundError");var R=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};w(R,"PrismaClientInitializationError");var le=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};w(le,"PrismaClientRustPanicError");var B=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};w(B,"PrismaClientUnknownRequestError");var J=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};w(J,"PrismaClientValidationError");var bt=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};function er(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function gs(e,t){let r=er(()=>fc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function fc(e){return{datamodel:{models:xi(e.models),enums:xi(e.enums),types:xi(e.types)}}}function xi(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}var Xr=Symbol(),Pi=new WeakMap,Ne=class{constructor(t){t===Xr?Pi.set(this,`Prisma.${this._getName()}`):Pi.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Pi.get(this)}},tr=class extends Ne{_getNamespace(){return"NullTypes"}},rr=class extends tr{};vi(rr,"DbNull");var nr=class extends tr{};vi(nr,"JsonNull");var ir=class extends tr{};vi(ir,"AnyNull");var en={classes:{DbNull:rr,JsonNull:nr,AnyNull:ir},instances:{DbNull:new rr(Xr),JsonNull:new nr(Xr),AnyNull:new ir(Xr)}};function vi(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var hs=Symbol(),or=class{constructor(t){if(t!==hs)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?tn:t}},tn=new or(hs);function we(e){return e instanceof or}var Ti=new WeakMap,sr=class{constructor(t,r){Ti.set(this,{sql:t,values:r})}get sql(){return Ti.get(this).sql}get values(){return Ti.get(this).values}};function ys(e){return(...t)=>new sr(e,t)}function ar(e){return{ok:!1,error:e,map(){return ar(e)},flatMap(){return ar(e)}}}var Ri=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},Ci=e=>{let t=new Ri,r=xe(t,e.transactionContext.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:xe(t,e.queryRaw.bind(e)),executeRaw:xe(t,e.executeRaw.bind(e)),provider:e.provider,transactionContext:async(...i)=>(await r(...i)).map(s=>gc(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=yc(t,e.getConnectionInfo.bind(e))),n},gc=(e,t)=>{let r=xe(e,t.startTransaction.bind(t));return{adapterName:t.adapterName,provider:t.provider,queryRaw:xe(e,t.queryRaw.bind(t)),executeRaw:xe(e,t.executeRaw.bind(t)),startTransaction:async(...n)=>(await r(...n)).map(o=>hc(e,o))}},hc=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:xe(e,t.queryRaw.bind(t)),executeRaw:xe(e,t.executeRaw.bind(t)),commit:xe(e,t.commit.bind(t)),rollback:xe(e,t.rollback.bind(t))});function xe(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return ar({kind:"GenericJs",id:i})}}}function yc(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return ar({kind:"GenericJs",id:i})}}}var Ul=k(ii());var Gl=require("async_hooks"),Ql=require("events"),Jl=k(require("fs")),_r=k(require("path"));var ie=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var rn={enumerable:!0,configurable:!0,writable:!0};function nn(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>rn,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var ws=Symbol.for("nodejs.util.inspect.custom");function ve(e,t){let r=bc(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=xs(Reflect.ownKeys(o),r),a=xs(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{...rn,...l?.getPropertyDescriptor(s)}:rn:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[ws]=function(){let o={...this};return delete o[ws],o},i}function bc(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function xs(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function Et(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function wt(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}var xt=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r,n=(i,o)=>o.write(i)){let i=r.length-1;for(let o=0;o0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};function Ps(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Pt(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function on(e){return e.toString()!=="Invalid Date"}var vt=9e15,ze=1e9,Ii="0123456789abcdef",an="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",ln="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Oi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-vt,maxE:vt,crypto:!1},Cs,Me,x=!0,cn="[DecimalError] ",Ke=cn+"Invalid argument: ",Ss=cn+"Precision limit exceeded",As=cn+"crypto unavailable",Is="[object Decimal]",ee=Math.floor,G=Math.pow,Ec=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,wc=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,xc=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Os=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ge=1e7,b=7,Pc=9007199254740991,vc=an.length-1,ki=ln.length-1,m={toStringTag:Is};m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),y(e)};m.ceil=function(){return y(new this.constructor(this),this.e+1,2)};m.clampedTo=m.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Ke+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};m.comparedTo=m.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};m.cosine=m.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+b,n.rounding=1,r=Tc(n,Ls(n,r)),n.precision=e,n.rounding=t,y(Me==2||Me==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};m.cubeRoot=m.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(x=!1,o=c.s*G(c.s*c,1/3),!o||Math.abs(o)==1/0?(r=K(c.d),e=c.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=G(r,1/3),e=ee((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=c.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(c),n=N(u.plus(c).times(a),u.plus(l),s+2,1),K(a.d).slice(0,s)===(r=K(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(y(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(y(n,e+1,1),t=!n.times(n).times(n).eq(c));break}return x=!0,y(n,e,p.rounding,t)};m.decimalPlaces=m.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-ee(this.e/b))*b,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};m.dividedBy=m.div=function(e){return N(this,new this.constructor(e))};m.dividedToIntegerBy=m.divToInt=function(e){var t=this,r=t.constructor;return y(N(t,new r(e),0,1,1),r.precision,r.rounding)};m.equals=m.eq=function(e){return this.cmp(e)===0};m.floor=function(){return y(new this.constructor(this),this.e+1,3)};m.greaterThan=m.gt=function(e){return this.cmp(e)>0};m.greaterThanOrEqualTo=m.gte=function(e){var t=this.cmp(e);return t==1||t===0};m.hyperbolicCosine=m.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/dn(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=Tt(s,1,o.times(t),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return y(o,s.precision=r,s.rounding=n,!0)};m.hyperbolicSine=m.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=Tt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/dn(5,e)),i=Tt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,y(i,t,r,!0)};m.hyperbolicTangent=m.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,N(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};m.inverseCosine=m.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?fe(r,i,o):new r(0):new r(NaN):t.isZero()?fe(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=fe(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};m.inverseHyperbolicCosine=m.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,x=!1,r=r.times(r).minus(1).sqrt().plus(r),x=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};m.inverseHyperbolicSine=m.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,x=!1,r=r.times(r).plus(1).sqrt().plus(r),x=!0,n.precision=e,n.rounding=t,r.ln())};m.inverseHyperbolicTangent=m.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?y(new o(i),e,t,!0):(o.precision=r=n-i.e,i=N(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};m.inverseSine=m.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=fe(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};m.inverseTangent=m.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&p+4<=ki)return s=fe(c,p+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=ki)return s=fe(c,p+4,d).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,r=Math.min(28,a/b+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(x=!1,t=Math.ceil(a/b),n=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};m.isNaN=function(){return!this.s};m.isNegative=m.isNeg=function(){return this.s<0};m.isPositive=m.isPos=function(){return this.s>0};m.isZero=function(){return!!this.d&&this.d[0]===0};m.lessThan=m.lt=function(e){return this.cmp(e)<0};m.lessThanOrEqualTo=m.lte=function(e){return this.cmp(e)<1};m.logarithm=m.log=function(e){var t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding,f=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(x=!1,a=p+f,s=He(u,a),n=t?un(c,a+10):He(e,a),l=N(s,n,a,1),ur(l.d,i=p,d))do if(a+=10,s=He(u,a),n=t?un(c,a+10):He(e,a),l=N(s,n,a,1),!o){+K(l.d).slice(i+1,i+15)+1==1e14&&(l=y(l,p+1,0));break}while(ur(l.d,i+=10,d));return x=!0,y(l,p,d)};m.minus=m.sub=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,f=this,g=f.constructor;if(e=new g(e),!f.d||!e.d)return!f.s||!e.s?e=new g(NaN):f.d?e.s=-e.s:e=new g(e.d||f.s!==e.s?f:NaN),e;if(f.s!=e.s)return e.s=-e.s,f.plus(e);if(u=f.d,d=e.d,a=g.precision,l=g.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else if(u[0])e=new g(f);else return new g(l===3?-0:0);return x?y(e,a,l):e}if(r=ee(e.e/b),c=ee(f.e/b),u=u.slice(),o=c-r,o){for(p=o<0,p?(t=u,o=-o,s=d.length):(t=d,r=c,s=u.length),n=Math.max(Math.ceil(a/b),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=d.length,p=n0;--n)u[s++]=0;for(n=d.length;n>o;){if(u[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,r=c,c=u,u=r),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/ge|0,u[i]%=ge;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=pn(u,n),x?y(e,a,l):e};m.precision=m.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ke+e);return r.d?(t=ks(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};m.round=function(){var e=this,t=e.constructor;return y(new t(e),e.e+1,t.rounding)};m.sine=m.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+b,n.rounding=1,r=Cc(n,Ls(n,r)),n.precision=e,n.rounding=t,y(Me>2?r.neg():r,e,t,!0)):new n(NaN)};m.squareRoot=m.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(x=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=K(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=ee((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new c(t)):n=new c(u.toString()),r=(l=c.precision)+3;;)if(o=n,n=o.plus(N(s,o,r+2,1)).times(.5),K(o.d).slice(0,r)===(t=K(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(y(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(y(n,l+1,1),e=!n.times(n).eq(s));break}return x=!0,y(n,l,c.rounding,e)};m.tangent=m.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=N(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,y(Me==2||Me==4?r.neg():r,e,t,!0)):new n(NaN)};m.times=m.mul=function(e){var t,r,n,i,o,s,a,l,u,c=this,p=c.constructor,d=c.d,f=(e=new p(e)).d;if(e.s*=c.s,!d||!d[0]||!f||!f[0])return new p(!e.s||d&&!d[0]&&!f||f&&!f[0]&&!d?NaN:!d||!f?e.s/0:e.s*0);for(r=ee(c.e/b)+ee(e.e/b),l=d.length,u=f.length,l=0;){for(t=0,i=l+n;i>n;)a=o[i]+f[n]*d[i-n-1]+t,o[i--]=a%ge|0,t=a/ge|0;o[i]=(o[i]+t)%ge|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=pn(o,r),x?y(e,p.precision,p.rounding):e};m.toBinary=function(e,t){return Fi(this,2,e,t)};m.toDecimalPlaces=m.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(oe(e,0,ze),t===void 0?t=n.rounding:oe(t,0,8),y(r,e+r.e+1,t))};m.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Te(n,!0):(oe(e,0,ze),t===void 0?t=i.rounding:oe(t,0,8),n=y(new i(n),e+1,t),r=Te(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};m.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=Te(i):(oe(e,0,ze),t===void 0?t=o.rounding:oe(t,0,8),n=y(new o(i),e+i.e+1,t),r=Te(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};m.toFraction=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,f=this,g=f.d,h=f.constructor;if(!g)return new h(f);if(u=r=new h(1),n=l=new h(0),t=new h(n),o=t.e=ks(g)-f.e-1,s=o%b,t.d[0]=G(10,s<0?b+s:s),e==null)e=o>0?t:u;else{if(a=new h(e),!a.isInt()||a.lt(u))throw Error(Ke+a);e=a.gt(t)?o>0?t:u:a}for(x=!1,a=new h(K(g)),c=h.precision,h.precision=o=g.length*b*2;p=N(a,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=t,t=a.minus(p.times(i)),a=i;return i=N(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=f.s,d=N(u,n,o,1).minus(f).abs().cmp(N(l,r,o,1).minus(f).abs())<1?[u,n]:[l,r],h.precision=c,x=!0,d};m.toHexadecimal=m.toHex=function(e,t){return Fi(this,16,e,t)};m.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:oe(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(x=!1,r=N(r,e,0,t,1).times(e),x=!0,y(r)):(e.s=r.s,r=e),r};m.toNumber=function(){return+this};m.toOctal=function(e,t){return Fi(this,8,e,t)};m.toPower=m.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(G(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return y(a,n,o);if(t=ee(e.e/b),t>=e.d.length-1&&(r=u<0?-u:u)<=Pc)return i=Ds(l,a,r,n),e.s<0?new l(1).div(i):y(i,n,o);if(s=a.s,s<0){if(tl.maxE+1||t0?s/0:0):(x=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Di(e.times(He(a,n+r)),n),i.d&&(i=y(i,n+5,1),ur(i.d,n,o)&&(t=n+10,i=y(Di(e.times(He(a,t+r)),t),t+5,1),+K(i.d).slice(n+1,n+15)+1==1e14&&(i=y(i,n+1,0)))),i.s=s,x=!0,l.rounding=o,y(i,n,o))};m.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Te(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(oe(e,1,ze),t===void 0?t=i.rounding:oe(t,0,8),n=y(new i(n),e,t),r=Te(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};m.toSignificantDigits=m.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(oe(e,1,ze),t===void 0?t=n.rounding:oe(t,0,8)),y(new n(r),e,t)};m.toString=function(){var e=this,t=e.constructor,r=Te(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};m.truncated=m.trunc=function(){return y(new this.constructor(this),this.e+1,1)};m.valueOf=m.toJSON=function(){var e=this,t=e.constructor,r=Te(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function K(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(Ke+e)}function ur(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=b,i=0):(i=Math.ceil((t+1)/b),t%=b),o=G(10,b-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==G(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==G(10,t-3)-1,s}function sn(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Tc(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/dn(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=Tt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var N=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,l){var u,c,p,d,f,g,h,O,T,S,C,E,me,ae,jt,U,ne,Ie,z,dt,Fr=n.constructor,$n=n.s==i.s?1:-1,Y=n.d,_=i.d;if(!Y||!Y[0]||!_||!_[0])return new Fr(!n.s||!i.s||(Y?_&&Y[0]==_[0]:!_)?NaN:Y&&Y[0]==0||!_?$n*0:$n/0);for(l?(f=1,c=n.e-i.e):(l=ge,f=b,c=ee(n.e/f)-ee(i.e/f)),z=_.length,ne=Y.length,T=new Fr($n),S=T.d=[],p=0;_[p]==(Y[p]||0);p++);if(_[p]>(Y[p]||0)&&c--,o==null?(ae=o=Fr.precision,s=Fr.rounding):a?ae=o+(n.e-i.e)+1:ae=o,ae<0)S.push(1),g=!0;else{if(ae=ae/f+2|0,p=0,z==1){for(d=0,_=_[0],ae++;(p1&&(_=e(_,d,l),Y=e(Y,d,l),z=_.length,ne=Y.length),U=z,C=Y.slice(0,z),E=C.length;E=l/2&&++Ie;do d=0,u=t(_,C,z,E),u<0?(me=C[0],z!=E&&(me=me*l+(C[1]||0)),d=me/Ie|0,d>1?(d>=l&&(d=l-1),h=e(_,d,l),O=h.length,E=C.length,u=t(h,C,O,E),u==1&&(d--,r(h,z=10;d/=10)p++;T.e=p+c*f-1,y(T,a?o+T.e+1:o,s,g)}return T}}();function y(e,t,r,n){var i,o,s,a,l,u,c,p,d,f=e.constructor;e:if(t!=null){if(p=e.d,!p)return e;for(i=1,a=p[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=b,s=t,c=p[d=0],l=c/G(10,i-s-1)%10|0;else if(d=Math.ceil((o+1)/b),a=p.length,d>=a)if(n){for(;a++<=d;)p.push(0);c=l=0,i=1,o%=b,s=o-b+1}else break e;else{for(c=a=p[d],i=1;a>=10;a/=10)i++;o%=b,s=o-b+i,l=s<0?0:c/G(10,i-s-1)%10|0}if(n=n||t<0||p[d+1]!==void 0||(s<0?c:c%G(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?c/G(10,i-s):0:p[d-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,u?(t-=e.e+1,p[0]=G(10,(b-t%b)%b),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=d,a=1,d--):(p.length=d+1,a=G(10,b-o),p[d]=s>0?(c/G(10,i-s)%G(10,s)|0)*a:0),u)for(;;)if(d==0){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,p[0]==ge&&(p[0]=1));break}else{if(p[d]+=a,p[d]!=ge)break;p[d--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return x&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+We(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+We(-i-1)+o,r&&(n=r-s)>0&&(o+=We(n))):i>=s?(o+=We(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+We(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=We(n))),o}function pn(e,t){var r=e[0];for(t*=b;r>=10;r/=10)t++;return t}function un(e,t,r){if(t>vc)throw x=!0,r&&(e.precision=r),Error(Ss);return y(new e(an),t,1,!0)}function fe(e,t,r){if(t>ki)throw Error(Ss);return y(new e(ln),t,r,!0)}function ks(e){var t=e.length-1,r=t*b+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function We(e){for(var t="";e--;)t+="0";return t}function Ds(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/b+4);for(x=!1;;){if(r%2&&(o=o.times(t),Ts(o.d,s)&&(i=!0)),r=ee(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),Ts(t.d,s)}return x=!0,o}function vs(e){return e.d[e.d.length-1]&1}function _s(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(x=!1,l=g):l=t,a=new d(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(G(2,p))/Math.LN10*2+5|0,l+=n,r=o=s=new d(1),d.precision=l;;){if(o=y(o.times(e),l,1),r=r.times(++c),a=s.plus(N(o,r,l,1)),K(a.d).slice(0,l)===K(s.d).slice(0,l)){for(i=p;i--;)s=y(s.times(s),l,1);if(t==null)if(u<3&&ur(s.d,l-n,f,u))d.precision=l+=10,r=o=a=new d(1),c=0,u++;else return y(s,d.precision=g,f,x=!0);else return d.precision=g,s}s=a}}function He(e,t){var r,n,i,o,s,a,l,u,c,p,d,f=1,g=10,h=e,O=h.d,T=h.constructor,S=T.rounding,C=T.precision;if(h.s<0||!O||!O[0]||!h.e&&O[0]==1&&O.length==1)return new T(O&&!O[0]?-1/0:h.s!=1?NaN:O?0:h);if(t==null?(x=!1,c=C):c=t,T.precision=c+=g,r=K(O),n=r.charAt(0),Math.abs(o=h.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=K(h.d),n=r.charAt(0),f++;o=h.e,n>1?(h=new T("0."+r),o++):h=new T(n+"."+r.slice(1))}else return u=un(T,c+2,C).times(o+""),h=He(new T(n+"."+r.slice(1)),c-g).plus(u),T.precision=C,t==null?y(h,C,S,x=!0):h;for(p=h,l=s=h=N(h.minus(1),h.plus(1),c,1),d=y(h.times(h),c,1),i=3;;){if(s=y(s.times(d),c,1),u=l.plus(N(s,new T(i),c,1)),K(u.d).slice(0,c)===K(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(un(T,c+2,C).times(o+""))),l=N(l,new T(f),c,1),t==null)if(ur(l.d,c-g,S,a))T.precision=c+=g,u=s=h=N(p.minus(1),p.plus(1),c,1),d=y(h.times(h),c,1),i=a=1;else return y(l,T.precision=C,S,x=!0);else return T.precision=C,l;l=u,i+=2}}function Fs(e){return String(e.s*e.s/0)}function _i(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%b,r<0&&(n+=b),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Os.test(t))return _i(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(wc.test(t))r=16,t=t.toLowerCase();else if(Ec.test(t))r=2;else if(xc.test(t))r=8;else throw Error(Ke+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Ds(n,new n(r),o,o*2)),u=sn(t,r,ge),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=pn(u,c),e.d=u,x=!1,s&&(e=N(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?G(2,l):ot.pow(2,l))),x=!0,e)}function Cc(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:Tt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/dn(5,r)),t=Tt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function Tt(e,t,r,n,i){var o,s,a,l,u=1,c=e.precision,p=Math.ceil(c/b);for(x=!1,l=r.times(r),a=new e(n);;){if(s=N(a.times(l),new e(t++*t++),c,1),a=i?n.plus(s):n.minus(s),n=N(s.times(l),new e(t++*t++),c,1),s=a.plus(n),s.d[p]!==void 0){for(o=p;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return x=!0,s.d.length=p+1,s}function dn(e,t){for(var r=e;--t;)r*=e;return r}function Ls(e,t){var r,n=t.s<0,i=fe(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Me=n?4:1,t;if(r=t.divToInt(i),r.isZero())Me=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Me=vs(r)?n?2:3:n?4:1,t;Me=vs(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Fi(e,t,r,n){var i,o,s,a,l,u,c,p,d,f=e.constructor,g=r!==void 0;if(g?(oe(r,1,ze),n===void 0?n=f.rounding:oe(n,0,8)):(r=f.precision,n=f.rounding),!e.isFinite())c=Fs(e);else{for(c=Te(e),s=c.indexOf("."),g?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(c=c.replace(".",""),d=new f(1),d.e=c.length-s,d.d=sn(Te(d),10,i),d.e=d.d.length),p=sn(c,10,i),o=l=p.length;p[--l]==0;)p.pop();if(!p[0])c=g?"0p+0":"0";else{if(s<0?o--:(e=new f(e),e.d=p,e.e=o,e=N(e,d,r,n,0,i),p=e.d,o=e.e,u=Cs),s=p[r],a=i/2,u=u||p[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&p[r-1]&1||n===(e.s<0?8:7)),p.length=r,u)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(l=p.length;!p[l-1];--l);for(s=0,c="";s1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)c+="0";for(p=sn(c,i,t),l=p.length;!p[l-1];--l);for(s=1,c="1.";sl)for(o-=l;o--;)c+="0";else ot)return e.length=t,!0}function Sc(e){return new this(e).abs()}function Ac(e){return new this(e).acos()}function Ic(e){return new this(e).acosh()}function Oc(e,t){return new this(e).plus(t)}function kc(e){return new this(e).asin()}function Dc(e){return new this(e).asinh()}function _c(e){return new this(e).atan()}function Fc(e){return new this(e).atanh()}function Lc(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=fe(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?fe(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=fe(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(N(e,t,o,1)),t=fe(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(N(e,t,o,1)),r}function Nc(e){return new this(e).cbrt()}function Mc(e){return y(e=new this(e),e.e+1,2)}function $c(e,t,r){return new this(e).clamp(t,r)}function qc(e){if(!e||typeof e!="object")throw Error(cn+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,ze,"rounding",0,8,"toExpNeg",-vt,0,"toExpPos",0,vt,"maxE",0,vt,"minE",-vt,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Ke+r+": "+n);if(r="crypto",i&&(this[r]=Oi[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(As);else this[r]=!1;else throw Error(Ke+r+": "+n);return this}function jc(e){return new this(e).cos()}function Vc(e){return new this(e).cosh()}function Ns(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,Rs(o)){u.s=o.s,x?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;x?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(As);else for(;o=10;i/=10)n++;n`}};function Ct(e){return e instanceof cr}var mn=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};var fn=e=>e,gn={bold:fn,red:fn,green:fn,dim:fn,enabled:!1},Ms={bold:H,red:ce,green:qe,dim:Oe,enabled:!0},St={write(e){e.writeLine(",")}};var Ce=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};var Ye=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var At=class extends Ye{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new mn(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new Ce("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(St,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var $s=": ",hn=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+$s.length}write(t){let r=new Ce(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write($s).write(this.value)}};var It=class e extends Ye{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let l;if(s.value instanceof e?l=s.value.getField(a):s.value instanceof At&&(l=s.value.getField(Number(a))),!l)return;s=l}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new Ce("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(St,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};var W=class extends Ye{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Ce(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var Li=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function Ot(e){return new Li(qs(e))}function qs(e){let t=new It;for(let[r,n]of Object.entries(e)){let i=new hn(r,js(n));t.addField(i)}return t}function js(e){if(typeof e=="string")return new W(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new W(String(e));if(typeof e=="bigint")return new W(`${e}n`);if(e===null)return new W("null");if(e===void 0)return new W("undefined");if(Rt(e))return new W(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new W(`Buffer.alloc(${e.byteLength})`):new W(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=on(e)?e.toISOString():"Invalid Date";return new W(`new Date("${t}")`)}return e instanceof Ne?new W(`Prisma.${e._getName()}`):Ct(e)?new W(`prisma.${Ps(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?mp(e):typeof e=="object"?qs(e):new W(Object.prototype.toString.call(e))}function mp(e){let t=new At;for(let r of e)t.addItem(js(r));return t}function yn(e,t){let r=t==="pretty"?Ms:gn,n=e.renderAllMessages(r),i=new xt(0,{colors:r}).write(e).toString();return{message:n,args:i}}function Vs(e){if(e===void 0)return"";let t=Ot(e);return new xt(0,{colors:gn}).write(t).toString()}var fp="P2037";function st({error:e,user_facing_error:t},r,n){return t.error_code?new V(gp(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new B(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function gp(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===fp&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}var pr="";function Bs(e){var t=e.split(` -`);return t.reduce(function(r,n){var i=bp(n)||wp(n)||vp(n)||Sp(n)||Rp(n);return i&&r.push(i),r},[])}var hp=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,yp=/\((\S*)(?::(\d+))(?::(\d+))\)/;function bp(e){var t=hp.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=yp.exec(t[2]);return n&&i!=null&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:r?null:t[2],methodName:t[1]||pr,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var Ep=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function wp(e){var t=Ep.exec(e);return t?{file:t[2],methodName:t[1]||pr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var xp=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Pp=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function vp(e){var t=xp.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Pp.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||pr,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Tp=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Rp(e){var t=Tp.exec(e);return t?{file:t[3],methodName:t[1]||pr,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var Cp=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Sp(e){var t=Cp.exec(e);return t?{file:t[2],methodName:t[1]||pr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Ni=class{getLocation(){return null}},Mi=class{constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=Bs(t).find(i=>{if(!i.file)return!1;let o=di(i.file);return o!==""&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function Ze(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Ni:new Mi}var Us={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function kt(e={}){let t=Ip(e);return Object.entries(t).reduce((n,[i,o])=>(Us[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Ip(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function bn(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Gs(e,t){let r=bn(e);return t({action:"aggregate",unpacker:r,argsMapper:kt})(e)}function Op(e={}){let{select:t,...r}=e;return typeof t=="object"?kt({...r,_count:t}):kt({...r,_count:{_all:!0}})}function kp(e={}){return typeof e.select=="object"?t=>bn(e)(t)._count:t=>bn(e)(t)._count._all}function Qs(e,t){return t({action:"count",unpacker:kp(e),argsMapper:Op})(e)}function Dp(e={}){let t=kt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function _p(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Js(e,t){return t({action:"groupBy",unpacker:_p(e),argsMapper:Dp})(e)}function Ws(e,t,r){if(t==="aggregate")return n=>Gs(n,r);if(t==="count")return n=>Qs(n,r);if(t==="groupBy")return n=>Js(n,r)}function Hs(e,t){let r=t.fields.filter(i=>!i.relationName),n=Ei(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new cr(e,o,s.type,s.isList,s.kind==="enum")},...nn(Object.keys(n))})}var Ks=e=>Array.isArray(e)?e:e.split("."),$i=(e,t)=>Ks(t).reduce((r,n)=>r&&r[n],e),zs=(e,t,r)=>Ks(t).reduceRight((n,i,o,s)=>Object.assign({},$i(e,s.slice(0,o)),{[i]:n}),r);function Fp(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Lp(e,t,r){return t===void 0?e??{}:zs(t,r,e||!0)}function qi(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=Ze(e._errorFormat),c=Fp(n,i),p=Lp(l,o,c),d=r({dataPath:c,callsite:u})(p),f=Np(e,t);return new Proxy(d,{get(g,h){if(!f.includes(h))return g[h];let T=[a[h].type,r,h],S=[c,p];return qi(e,...T,...S)},...nn([...f,...Object.getOwnPropertyNames(d)])})}}function Np(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var ra=k(mi());var ta=k(require("fs"));var Ys={keyword:De,entity:De,value:e=>H(rt(e)),punctuation:rt,directive:De,function:De,variable:e=>H(rt(e)),string:e=>H(qe(e)),boolean:ke,number:De,comment:Bt};var Mp=e=>e,En={},$p=0,P={manual:En.Prism&&En.Prism.manual,disableWorkerMessageHandler:En.Prism&&En.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof he){let t=e;return new he(t.type,P.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(P.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(Ie instanceof he)continue;if(me&&U!=t.length-1){S.lastIndex=ne;var p=S.exec(e);if(!p)break;var c=p.index+(E?p[1].length:0),d=p.index+p[0].length,a=U,l=ne;for(let _=t.length;a<_&&(l=l&&(++U,ne=l);if(t[U]instanceof he)continue;u=a-U,Ie=e.slice(ne,l),p.index-=ne}else{S.lastIndex=0;var p=S.exec(Ie),u=1}if(!p){if(o)break;continue}E&&(ae=p[1]?p[1].length:0);var c=p.index+ae,p=p[0].slice(ae),d=c+p.length,f=Ie.slice(0,c),g=Ie.slice(d);let z=[U,u];f&&(++U,ne+=f.length,z.push(f));let dt=new he(h,C?P.tokenize(p,C):p,jt,p,me);if(z.push(dt),g&&z.push(g),Array.prototype.splice.apply(t,z),u!=1&&P.matchGrammar(e,t,r,U,ne,!0,h),o)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let i in n)t[i]=n[i];delete t.rest}return P.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=P.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=P.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:he};P.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};P.languages.javascript=P.languages.extend("clike",{"class-name":[P.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});P.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;P.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:P.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:P.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:P.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:P.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});P.languages.markup&&P.languages.markup.tag.addInlined("script","javascript");P.languages.js=P.languages.javascript;P.languages.typescript=P.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});P.languages.ts=P.languages.typescript;function he(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}he.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return he.stringify(r,t)}).join(""):qp(e.type)(e.content)};function qp(e){return Ys[e]||Mp}function Zs(e){return jp(e,P.languages.javascript)}function jp(e,t){return P.tokenize(e,t).map(n=>he.stringify(n)).join("")}var Xs=k(ss());function ea(e){return(0,Xs.default)(e)}var wn=class e{static read(t){let r;try{r=ta.default.readFileSync(t,"utf-8")}catch{return null}return e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(tthis.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,i=[...this.lines];return i[n]=r(i[n]),new e(this.firstLineNumber,i)}mapLines(t){return new e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,i)=>i===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(` -`);return new e(t,ea(n).split(` -`))}highlight(){let t=Zs(this.toString());return new e(this.firstLineNumber,t.split(` -`))}toString(){return this.lines.join(` -`)}};var Vp={red:ce,gray:Bt,dim:Oe,bold:H,underline:X,highlightSource:e=>e.highlight()},Bp={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Up({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Gp({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=Up({message:t,originalMethod:r,isPanic:n,callArguments:i});if(!e||typeof window<"u"||process.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=wn.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=Jp(c),d=Qp(c);if(!d)return s;s.functionName=`${d.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,g=>g.slice(0,d.openingBraceIndex))),u=o.highlightSource(u);let f=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((g,h)=>o.gray(String(h).padStart(f))+" "+g).mapLines(g=>o.dim(g)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let g=p+f+1;g+=2,s.callArguments=(0,ra.default)(i,g).slice(g)}}return s}function Qp(e){let t=Object.keys(Je.ModelAction).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function Jp(e){let t=0;for(let r=0;r{if("rejectOnNotFound"in n.args){let o=Dt({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new J(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof V&&o.code==="P2025"?new Le(`No ${e} found`,t):o})}}function Se(e){return e.replace(/^./,t=>t.toLowerCase())}var zp=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Yp=["aggregate","count","groupBy"];function ji(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Zp(e,t),ed(e,t),lr(r),re("name",()=>t),re("$name",()=>t),re("$parent",()=>e._appliedParent)];return ve({},n)}function Zp(e,t){let r=Se(t),n=Object.keys(Je.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=l=>e._request(l);s=na(o,t,e._clientVersion,s);let a=l=>u=>{let c=Ze(e._errorFormat);return e._createPrismaPromise(p=>{let d={args:u,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:p,callsite:c};return s({...d,...l})})};return zp.includes(o)?qi(e,t,a):Xp(i)?Ws(e,i,a):a({})}}}function Xp(e){return Yp.includes(e)}function ed(e,t){return it(re("fields",()=>{let r=e._runtimeDataModel.models[t];return Hs(t,r)}))}function ia(e){return e.replace(/^./,t=>t.toUpperCase())}var Vi=Symbol();function dr(e){let t=[td(e),re(Vi,()=>e),re("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(lr(r)),ve(e,t)}function td(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Se),n=[...new Set(t.concat(r))];return it({getKeys(){return n},getPropertyValue(i){let o=ia(i);if(e._runtimeDataModel.models[o]!==void 0)return ji(e,o);if(e._runtimeDataModel.models[i]!==void 0)return ji(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function oa(e){return e[Vi]?e[Vi]:e}function sa(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return dr(t)}function aa({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(c=>n[c]);u.length>0&&a.push(Et(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(c=>!r[c]);u.length>0&&a.push(Et(u))}rd(e,l.needs)&&s.push(nd(l,ve(e,s)))}return s.length>0||a.length>0?ve(e,[...s,...a]):e}function rd(e,t){return t.every(r=>bi(e,r))}function nd(e,t){return it(re(e.name,()=>e.compute(t)))}function xn({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sc.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=xn({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function ua({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:xn({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let c=Se(l);return aa({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}function ca(e){if(e instanceof ie)return id(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:ca(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=ha(o,l),a.args=s,da(e,a,r,n+1)}})})}function ma(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return da(e,t,s)}function fa(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?ga(r,n,0,e):e(r)}}function ga(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=ha(i,l),ga(a,t,r+1,n)}})}var pa=e=>e;function ha(e=pa,t=pa){return r=>e(t(r))}function ba(e,t,r){let n=Se(r);return!t.result||!(t.result.$allModels||t.result[n])?e:od({...e,...ya(t.name,e,t.result.$allModels),...ya(t.name,e,t.result[n])})}function od(e){let t=new Pe,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return yt(e,n=>({...n,needs:r(n.name,new Set)}))}function ya(e,t,r){return r?yt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:sd(t,o,i)})):{}}function sd(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Ea(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function wa(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Pn=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new Pe;this.modelExtensionsCache=new Pe;this.queryCallbacksCache=new Pe;this.clientExtensions=er(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=er(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>ba(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=Se(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},vn=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Pn(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Pn(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var xa=L("prisma:client"),Pa={Vercel:"vercel","Netlify CI":"netlify"};function va({postinstall:e,ciName:t,clientVersion:r}){if(xa("checkPlatformCaching:postinstall",e),xa("checkPlatformCaching:ciName",t),e===!0&&t&&t in Pa){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${Pa[t]}-build`;throw console.error(n),new R(n,r)}}function Ta(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}var ad="Cloudflare-Workers",ld="node";function Ra(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===ad?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===ld?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var ud={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function Tn(){let e=Ra();return{id:e,prettyName:ud[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var Oa=k(require("fs")),fr=k(require("path"));function Rn(e){let{runtimeBinaryTarget:t}=e;return`Add "${t}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it: - -${cd(e)}`}function cd(e){let{generator:t,generatorBinaryTargets:r,runtimeBinaryTarget:n}=e,i={fromEnvVar:null,value:n},o=[...r,i];return gi({...t,binaryTargets:o})}function Xe(e){let{runtimeBinaryTarget:t}=e;return`Prisma Client could not locate the Query Engine for runtime "${t}".`}function et(e){let{searchedLocations:t}=e;return`The following locations have been searched: -${[...new Set(t)].map(i=>` ${i}`).join(` -`)}`}function Ca(e){let{runtimeBinaryTarget:t}=e;return`${Xe(e)} - -This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${t}". -${Rn(e)} - -${et(e)}`}function Cn(e){return`We would appreciate if you could take the time to share some information with us. -Please help us by answering a few questions: https://pris.ly/${e}`}function Sn(e){let{errorStack:t}=e;return t?.match(/\/\.next|\/next@|\/next\//)?` - -We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.`:""}function Sa(e){let{queryEngineName:t}=e;return`${Xe(e)}${Sn(e)} - -This is likely caused by a bundler that has not copied "${t}" next to the resulting bundle. -Ensure that "${t}" has been copied next to the bundle or in "${e.expectedLocation}". - -${Cn("engine-not-found-bundler-investigation")} - -${et(e)}`}function Aa(e){let{runtimeBinaryTarget:t,generatorBinaryTargets:r}=e,n=r.find(i=>i.native);return`${Xe(e)} - -This happened because Prisma Client was generated for "${n?.value??"unknown"}", but the actual deployment required "${t}". -${Rn(e)} - -${et(e)}`}function Ia(e){let{queryEngineName:t}=e;return`${Xe(e)}${Sn(e)} - -This is likely caused by tooling that has not copied "${t}" to the deployment folder. -Ensure that you ran \`prisma generate\` and that "${t}" has been copied to "${e.expectedLocation}". - -${Cn("engine-not-found-tooling-investigation")} - -${et(e)}`}var pd=L("prisma:client:engines:resolveEnginePath"),dd=()=>new RegExp("runtime[\\\\/]library\\.m?js$");async function ka(e,t){let r={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??t.prismaPath;if(r!==void 0)return r;let{enginePath:n,searchedLocations:i}=await md(e,t);if(pd("enginePath",n),n!==void 0&&e==="binary"&&ai(n),n!==void 0)return t.prismaPath=n;let o=await nt(),s=t.generator?.binaryTargets??[],a=s.some(d=>d.native),l=!s.some(d=>d.value===o),u=__filename.match(dd())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:t.generator,runtimeBinaryTarget:o,queryEngineName:Da(e,o),expectedLocation:fr.default.relative(process.cwd(),t.dirname),errorStack:new Error().stack},p;throw a&&l?p=Aa(c):l?p=Ca(c):u?p=Sa(c):p=Ia(c),new R(p,t.clientVersion)}async function md(engineType,config){let binaryTarget=await nt(),searchedLocations=[],dirname=eval("__dirname"),searchLocations=[config.dirname,fr.default.resolve(dirname,".."),config.generator?.output?.value??dirname,fr.default.resolve(dirname,"../../../.prisma/client"),"/tmp/prisma-engines",config.cwd];__filename.includes("resolveEnginePath")&&searchLocations.push(Ho());for(let e of searchLocations){let t=Da(engineType,binaryTarget),r=fr.default.join(e,t);if(searchedLocations.push(e),Oa.default.existsSync(r))return{enginePath:r,searchedLocations}}return{enginePath:void 0,searchedLocations}}function Da(e,t){return e==="library"?$r(t,"fs"):`query-engine-${t}${t==="windows"?".exe":""}`}var Bi=k(yi());function _a(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function Fa(e){return e.split(` -`).map(t=>t.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(` -`)}var La=k(ms());function Na({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,La.default)({user:t,repo:r,template:n,title:e,body:i})}function Ma({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=To(6e3-(s?.length??0)),l=Fa((0,Bi.default)(a)),u=n?`# Description -\`\`\` -${n} -\`\`\``:"",c=(0,Bi.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report: -## Versions - -| Name | Version | -|-----------------|--------------------| -| Node | ${process.version?.padEnd(19)}| -| OS | ${t?.padEnd(19)}| -| Prisma Client | ${e?.padEnd(19)}| -| Query Engine | ${i?.padEnd(19)}| -| Database | ${o?.padEnd(19)}| - -${u} - -## Logs -\`\`\` -${l} -\`\`\` - -## Client Snippet -\`\`\`ts -// PLEASE FILL YOUR CODE SNIPPET HERE -\`\`\` - -## Schema -\`\`\`prisma -// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE -\`\`\` - -## Prisma Engine Query -\`\`\` -${s?_a(s):""} -\`\`\` -`),p=Na({title:r,body:c});return`${r} - -This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. - -${X(p)} - -If you want the Prisma team to look into it, please open the link above \u{1F64F} -To increase the chance of success, please post your schema and a snippet of -how you used Prisma Client in the issue. -`}function _t({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=t[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=r[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new R(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new R("error: Missing URL environment variable, value, or override.",n);return i}var An=class extends Error{constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var se=class extends An{constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};function A(e,t){return{...e,isRetryable:t}}var Ft=class extends se{constructor(r){super("This request must be retried",A(r,!0));this.name="ForcedRetryError";this.code="P5001"}};w(Ft,"ForcedRetryError");var at=class extends se{constructor(r,n){super(r,A(n,!1));this.name="InvalidDatasourceError";this.code="P6001"}};w(at,"InvalidDatasourceError");var lt=class extends se{constructor(r,n){super(r,A(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};w(lt,"NotImplementedYetError");var q=class extends se{constructor(t,r){super(t,r),this.response=r.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var ut=class extends q{constructor(r){super("Schema needs to be uploaded",A(r,!0));this.name="SchemaMissingError";this.code="P5005"}};w(ut,"SchemaMissingError");var Ui="This request could not be understood by the server",gr=class extends q{constructor(r,n,i){super(n||Ui,A(r,!1));this.name="BadRequestError";this.code="P5000";i&&(this.code=i)}};w(gr,"BadRequestError");var hr=class extends q{constructor(r,n){super("Engine not started: healthcheck timeout",A(r,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};w(hr,"HealthcheckTimeoutError");var yr=class extends q{constructor(r,n,i){super(n,A(r,!0));this.name="EngineStartupError";this.code="P5014";this.logs=i}};w(yr,"EngineStartupError");var br=class extends q{constructor(r){super("Engine version is not supported",A(r,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};w(br,"EngineVersionNotSupportedError");var Gi="Request timed out",Er=class extends q{constructor(r,n=Gi){super(n,A(r,!1));this.name="GatewayTimeoutError";this.code="P5009"}};w(Er,"GatewayTimeoutError");var fd="Interactive transaction error",wr=class extends q{constructor(r,n=fd){super(n,A(r,!1));this.name="InteractiveTransactionError";this.code="P5015"}};w(wr,"InteractiveTransactionError");var gd="Request parameters are invalid",xr=class extends q{constructor(r,n=gd){super(n,A(r,!1));this.name="InvalidRequestError";this.code="P5011"}};w(xr,"InvalidRequestError");var Qi="Requested resource does not exist",Pr=class extends q{constructor(r,n=Qi){super(n,A(r,!1));this.name="NotFoundError";this.code="P5003"}};w(Pr,"NotFoundError");var Ji="Unknown server error",Lt=class extends q{constructor(r,n,i){super(n||Ji,A(r,!0));this.name="ServerError";this.code="P5006";this.logs=i}};w(Lt,"ServerError");var Wi="Unauthorized, check your connection string",vr=class extends q{constructor(r,n=Wi){super(n,A(r,!1));this.name="UnauthorizedError";this.code="P5007"}};w(vr,"UnauthorizedError");var Hi="Usage exceeded, retry again later",Tr=class extends q{constructor(r,n=Hi){super(n,A(r,!0));this.name="UsageExceededError";this.code="P5008"}};w(Tr,"UsageExceededError");async function hd(e){let t;try{t=await e.text()}catch{return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch{return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function Rr(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await hd(e);if(n.type==="QueryEngineError")throw new V(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Lt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new ut(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new br(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new yr(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new R(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new hr(r,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new wr(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new xr(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new vr(r,Nt(Wi,n));if(e.status===404)return new Pr(r,Nt(Qi,n));if(e.status===429)throw new Tr(r,Nt(Hi,n));if(e.status===504)throw new Er(r,Nt(Gi,n));if(e.status>=500)throw new Lt(r,Nt(Ji,n));if(e.status>=400)throw new gr(r,Nt(Ui,n))}function Nt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}function $a(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(i=>setTimeout(()=>i(n),n))}var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function qa(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,r+=$e[s]+$e[a]+$e[l]+$e[u];return i==1?(c=t[o],s=(c&252)>>2,a=(c&3)<<4,r+=$e[s]+$e[a]+"=="):i==2&&(c=t[o]<<8|t[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,r+=$e[s]+$e[a]+$e[l]+"="),r}function ja(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new R("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}function yd(e){return e[0]*1e3+e[1]/1e6}function Va(e){return new Date(yd(e))}var Ba={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var Cr=class extends se{constructor(r,n){super(`Cannot fetch data from service: -${r}`,A(n,!0));this.name="RequestError";this.code="P5010"}};w(Cr,"RequestError");async function ct(e,t,r=n=>n){let n=t.clientVersion;try{return typeof fetch=="function"?await r(fetch)(e,t):await r(Ki)(e,t)}catch(i){let o=i.message??"Unknown error";throw new Cr(o,{clientVersion:n})}}function Ed(e){return{...e.headers,"Content-Type":"application/json"}}function wd(e){return{method:e.method,headers:Ed(e)}}function xd(e,t){return{text:()=>Promise.resolve(Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(Buffer.concat(e).toString())),ok:t.statusCode>=200&&t.statusCode<=299,status:t.statusCode,url:t.url,headers:new zi(t.headers)}}async function Ki(e,t={}){let r=Pd("https"),n=wd(t),i=[],{origin:o}=new URL(e);return new Promise((s,a)=>{let l=r.request(e,n,u=>{let{statusCode:c,headers:{location:p}}=u;c>=301&&c<=399&&p&&(p.startsWith("http")===!1?s(Ki(`${o}${p}`,t)):s(Ki(p,t))),u.on("data",d=>i.push(d)),u.on("end",()=>s(xd(i,u))),u.on("error",a)});l.on("error",a),l.end(t.body??"")})}var Pd=typeof require<"u"?require:()=>{},zi=class{constructor(t={}){this.headers=new Map;for(let[r,n]of Object.entries(t))if(typeof n=="string")this.headers.set(r,n);else if(Array.isArray(n))for(let i of n)this.headers.set(r,i)}append(t,r){this.headers.set(t,r)}delete(t){this.headers.delete(t)}get(t){return this.headers.get(t)??null}has(t){return this.headers.has(t)}set(t,r){this.headers.set(t,r)}forEach(t,r){for(let[n,i]of this.headers)t.call(r,i,n,this)}};var vd=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Ua=L("prisma:client:dataproxyEngine");async function Td(e,t){let r=Ba["@prisma/engines-version"],n=t.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=n?.split("-")??[];if(o===void 0&&vd.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[s]=r.split("-")??[],[a,l,u]=s.split("."),c=Rd(`<=${a}.${l}.${u}`),p=await ct(c,{clientVersion:n});if(!p.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${p.status} ${p.statusText}, response body: ${await p.text()||""}`);let d=await p.text();Ua("length of body fetched from unpkg.com",d.length);let f;try{f=JSON.parse(d)}catch(g){throw console.error("JSON.parse error: body fetched from unpkg.com: ",d),g}return f.version}throw new lt("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Ga(e,t){let r=await Td(e,t);return Ua("version",r),r}function Rd(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var Qa=3,Yi=L("prisma:client:dataproxyEngine"),Zi=class{constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:t,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-transaction-id"]=r.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}},Sr=class{constructor(t){this.name="DataProxyEngine";ja(t),this.config=t,this.env={...t.env,...typeof process<"u"?process.env:{}},this.inlineSchema=qa(t.inlineSchema),this.inlineDatasources=t.inlineDatasources,this.inlineSchemaHash=t.inlineSchemaHash,this.clientVersion=t.clientVersion,this.engineHash=t.engineVersion,this.logEmitter=t.logEmitter,this.tracingHelper=t.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[t,r]=this.extractHostAndApiKey();this.host=t,this.headerBuilder=new Zi({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await Ga(t,this.config),Yi("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){t?.logs?.length&&t.logs.forEach(r=>{switch(r.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let n=typeof r.attributes.query=="string"?r.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[i]=n.split("/* traceparent");n=i}this.logEmitter.emit("query",{query:n,timestamp:Va(r.timestamp),duration:Number(r.attributes.duration_ms),params:r.attributes.params,target:r.attributes.target})}}}),t?.traces?.length&&this.tracingHelper.createEngineSpan({span:!0,spans:t.traces})}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await ct(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||Yi("schema response status",r.status);let n=await Rr(r,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(t,{traceparent:r,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:t,traceparent:r,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(t,{traceparent:r,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=wt(t,n),{batchResult:a,elapsed:l}=await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r});return a.map(u=>"errors"in u&&u.errors.length>0?st(u.errors[0],this.clientVersion,this.config.activeProvider):{data:u,elapsed:l})}requestInternal({body:t,traceparent:r,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await ct(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||Yi("graphql response status",a.status),await this.handleError(await Rr(a,this.clientVersion));let l=await a.json(),u=l.extensions;if(u&&this.propagateResponseExtensions(u),l.errors)throw l.errors.length===1?st(l.errors[0],this.config.clientVersion,this.config.activeProvider):new B(l.errors,{clientVersion:this.config.clientVersion});return l}})}async transaction(t,r,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[t]} transaction`,callback:async({logHttpCall:o})=>{if(t==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await ct(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Rr(l,this.clientVersion));let u=await l.json(),c=u.extensions;c&&this.propagateResponseExtensions(c);let p=u.id,d=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:d}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await ct(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Rr(a,this.clientVersion));let u=(await a.json()).extensions;u&&this.propagateResponseExtensions(u);return}}})}extractHostAndApiKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=_t({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new at(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:"&&o!=="prisma+postgres:")throw new at(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t);let l=a.get("api_key");if(l===null||l.length<1)throw new at(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return[s,l]}metrics(){throw new lt("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){for(let r=0;;r++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${r})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:n})}catch(i){if(!(i instanceof se)||!i.isRetryable)throw i;if(r>=Qa)throw i instanceof Ft?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${r+1}/${Qa} failed for ${t.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await $a(r);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof ut)throw await this.uploadSchema(),new Ft({clientVersion:this.clientVersion,cause:t});if(t)throw t}applyPendingMigrations(){throw new Error("Method not implemented.")}};function Ja(e){if(e?.kind==="itx")return e.options.id}var eo=k(require("os")),Wa=k(require("path"));var Xi=Symbol("PrismaLibraryEngineCache");function Cd(){let e=globalThis;return e[Xi]===void 0&&(e[Xi]={}),e[Xi]}function Sd(e){let t=Cd();if(t[e]!==void 0)return t[e];let r=Wa.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=eo.default.constants.dlopen.RTLD_LAZY|eo.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,r,i),t[e]=n.exports,n.exports}var Ha={async loadLibrary(e){let t=await zn(),r=await ka("library",e);try{return e.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>Sd(r))}catch(n){let i=li({e:n,platformInfo:t,id:r});throw new R(i,e.clientVersion)}}};var to,Ka={async loadLibrary(e){let{clientVersion:t,adapter:r,engineWasm:n}=e;if(r===void 0)throw new R(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Tn().prettyName})`,t);if(n===void 0)throw new R("WASM engine was unexpectedly `undefined`",t);to===void 0&&(to=(async()=>{let o=n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new R("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let a={"./query_engine_bg.js":o},l=new WebAssembly.Instance(s,a);return o.__wbg_set_wasm(l.exports),o.QueryEngine})());let i=await to;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var Ad="P2036",Ae=L("prisma:client:libraryEngine");function Id(e){return e.item_type==="query"&&"query"in e}function Od(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var za=[...Qn,"native"],Ar=class{constructor(t,r){this.name="LibraryEngine";this.libraryLoader=r??Ha,t.engineWasm!==void 0&&(this.libraryLoader=r??Ka),this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,t.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary()}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(t,r,n){await this.start();let i=JSON.stringify(r),o;if(t==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else t==="commit"?o=await this.engine?.commitTransaction(n.id,i):t==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(kd(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new V(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(Ae("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;Gn(),this.binaryTarget=await this.getCurrentBinaryTarget(),await this.loadEngine(),this.version()}async getCurrentBinaryTarget(){{if(this.binaryTarget)return this.binaryTarget;let t=await nt();if(!za.includes(t))throw new R(`Unknown ${ce("PRISMA_QUERY_ENGINE_LIBRARY")} ${ce(H(t))}. Possible binaryTargets: ${qe(za.join(", "))} or a path to the query engine library. -You may have to run ${qe("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return t}}parseEngineResponse(t){if(!t)throw new B("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new B("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new WeakRef(this),{adapter:r}=this.config;r&&Ae("Using driver adapter: %O",r),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:process.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{t.deref()?.logger(n)},r)}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new R(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);if(r){if("span"in r){this.config.tracingHelper.createEngineSpan(r);return}r.level=r?.level.toLowerCase()??"unknown",Id(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):Od(r)?this.loggerRustPanic=new le(ro(this,`${r.message}: ${r.reason} in ${r.file}:${r.line}:${r.column}`),this.config.clientVersion):this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path})}}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Ae(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{Ae("library starting");try{let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,Ae("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new R(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Ae("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),Ae("library stopping");let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,Ae("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){Ae(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new B(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s,elapsed:0}}catch(s){if(s instanceof R)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new le(ro(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new B(`${a.message} -${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){Ae("requestBatch");let i=wt(t,r);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),Ja(r));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new B(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:l}=s;if(Array.isArray(a))return a.map(u=>u.errors&&u.errors.length>0?this.loggerRustPanic??this.buildQueryError(u.errors[0]):{data:u,elapsed:0});throw l&&l.length===1?new Error(l[0].error):new Error(JSON.stringify(s))}buildQueryError(t){if(t.user_facing_error.is_panic)return new le(ro(this,t.user_facing_error.message),this.config.clientVersion);let r=this.getExternalAdapterError(t.user_facing_error);return r?r.error:st(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t){if(t.error_code===Ad&&this.config.adapter){let r=t.meta?.id;zr(typeof r=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(r);return zr(n,"External error with reported id was not registered"),n}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function kd(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function ro(e,t){return Ma({binaryTarget:e.binaryTarget,title:t,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function Ya({copyEngine:e=!0},t){let r;try{r=_t({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...process.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||r?.startsWith("prisma+postgres://"));e&&n&&Xt("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=Kt(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",l=i==="binary";if(o&&s||s&&!1){let u;throw e?r?.startsWith("prisma://")?u=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:u=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:u=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new J(u.join(` -`),{clientVersion:t.clientVersion})}if(o)return new Sr(t);if(a)return new Ar(t);throw new J("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}function In({generator:e}){return e?.previewFeatures??[]}function Mt(e){return e.substring(0,1).toLowerCase()+e.substring(1)}var nl=k(no());function tl(e,t,r){let n=rl(e),i=Dd(n),o=Fd(i);o?On(o,t,r):t.addErrorMessage(()=>"Unknown error")}function rl(e){return e.errors.flatMap(t=>t.kind==="Union"?rl(t):[t])}function Dd(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:_d(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function _d(e,t){return[...new Set(e.concat(t))]}function Fd(e){return wi(e,(t,r)=>{let n=Xa(t),i=Xa(r);return n!==i?n-i:el(t)-el(r)})}function Xa(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function el(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var ue=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};var Ir=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(St,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function On(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":Ld(e,t);break;case"IncludeOnScalar":Nd(e,t);break;case"EmptySelection":Md(e,t,r);break;case"UnknownSelectionField":Vd(e,t);break;case"InvalidSelectionValue":Bd(e,t);break;case"UnknownArgument":Ud(e,t);break;case"UnknownInputField":Gd(e,t);break;case"RequiredArgumentMissing":Qd(e,t);break;case"InvalidArgumentType":Jd(e,t);break;case"InvalidArgumentValue":Wd(e,t);break;case"ValueTooLarge":Hd(e,t);break;case"SomeFieldsMissing":Kd(e,t);break;case"TooManyFieldsGiven":zd(e,t);break;case"Union":tl(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Ld(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function Nd(e,t){let[r,n]=Or(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new ue(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${kr(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Md(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){$d(e,t,i);return}if(n.hasField("select")){qd(e,t);return}}if(r?.[Mt(e.outputType.name)]){jd(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function $d(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new ue(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function qd(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),sl(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${kr(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function jd(e,t){let r=new Ir;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new ue("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=Or(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new It;l.addSuggestion(n),a.value=l}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function Vd(e,t){let r=al(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":sl(n,e.outputType);break;case"include":Yd(n,e.outputType);break;case"omit":Zd(n,e.outputType);break}}t.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(kr(n)),i.join(" ")})}function Bd(e,t){let r=al(e.selectionPath,t);r.parentKind!=="unknown"&&r.field.value.markAsError(),t.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`)}function Ud(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Xd(n,e.arguments)),t.addErrorMessage(i=>il(i,r,e.arguments.map(o=>o.name)))}function Gd(e,t){let[r,n]=Or(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&ll(o,e.inputType)}t.addErrorMessage(o=>il(o,n,e.inputType.fields.map(s=>s.name)))}function il(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=tm(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(kr(e)),n.join(" ")}function Qd(e,t){let r;t.addErrorMessage(l=>r?.value instanceof W&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=Or(e.argumentPath),s=new Ir,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new ue(o,s).makeRequired())}else{let l=e.inputTypes.map(ol).join(" | ");a.addSuggestion(new ue(o,l).makeRequired())}}function ol(e){return e.kind==="list"?`${ol(e.elementType)}[]`:e.name}function Jd(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=kn("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function Wd(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=kn("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Hd(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof W&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function Kd(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&ll(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${kn("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(kr(i)),o.join(" ")})}function zd(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${kn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function sl(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ue(r.name,"true"))}function Yd(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new ue(r.name,"true"))}function Zd(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new ue(r.name,"true"))}function Xd(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new ue(r.name,r.typeNames.join(" | ")))}function al(e,t){let[r,n]=Or(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),l=o?.getField(n);return o&&l?{parentKind:"select",parent:o,field:l,fieldName:n}:(l=s?.getField(n),s&&l?{parentKind:"include",field:l,parent:s,fieldName:n}:(l=a?.getField(n),a&&l?{parentKind:"omit",field:l,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function ll(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ue(r.name,r.typeNames.join(" | ")))}function Or(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function kr({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function kn(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var em=3;function tm(e,t){let r=1/0,n;for(let i of t){let o=(0,nl.default)(e,i);o>em||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[Mt(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:Fe(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};var ml=e=>({command:e});var fl=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);function $t(e){try{return gl(e,"fast")}catch{return gl(e,"slow")}}function gl(e,t){return JSON.stringify(e.map(r=>yl(r,t)))}function yl(e,t){return Array.isArray(e)?e.map(r=>yl(r,t)):typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:Pt(e)?{prisma__type:"date",prisma__value:e.toJSON()}:Re.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:pm(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?bl(e):e}function pm(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function bl(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(hl);let t={};for(let r of Object.keys(e))t[r]=hl(e[r]);return t}function hl(e){return typeof e=="bigint"?e.toString():bl(e)}var dm=["$connect","$disconnect","$on","$transaction","$use","$extends"],El=dm;var mm=/^(\s*alter\s)/i,wl=L("prisma:client");function so(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&mm.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var ao=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(r instanceof sr)n=r.sql,i={values:$t(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:$t(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:$t(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:$t(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=fl(r),i={values:$t(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?wl(`prisma.${e}(${n}, ${i.values})`):wl(`prisma.${e}(${n})`),{query:n,parameters:i}},xl={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new ie(t,r)}},Pl={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function lo(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??=vl(r(o)):vl(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function vl(e){return typeof e.then=="function"?e:Promise.resolve(e)}var Tl={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},uo=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??Tl}};function Rl(e){return e.includes("tracing")?new uo:Tl}function Cl(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function Sl(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}var _n=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};var Ol=k(yi());function Fn(e){return typeof e.batchRequestIdx=="number"}function Ln(e){return e===null?e:Array.isArray(e)?e.map(Ln):typeof e=="object"?fm(e)?gm(e):yt(e,Ln):e}function fm(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function gm({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new Re(t);case"Json":return JSON.parse(t);default:Fe(t,"Unknown tagged value")}}function Al(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(co(e.query.arguments)),t.push(co(e.query.selection)),t.join("")}function co(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${co(n)})`:r}).join(" ")})`}var hm={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function po(e){return hm[e]}var Nn=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;ipt("bigint",r));case"bytes-array":return t.map(r=>pt("bytes",r));case"decimal-array":return t.map(r=>pt("decimal",r));case"datetime-array":return t.map(r=>pt("datetime",r));case"date-array":return t.map(r=>pt("date",r));case"time-array":return t.map(r=>pt("time",r));default:return t}}function Il(e){let t=[],r=ym(e);for(let n=0;n{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(p=>po(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Em(o),containsWrite:u,customDataProxyFetch:i})).map((p,d)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[d],p)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?kl(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:po(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Al(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,t,r);return process.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(bm(t),wm(t,i)||t instanceof Le)throw t;if(t instanceof V&&xm(t)){let u=Dl(t.meta);Dn({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=Dt({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new V(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new le(l,this.client._clientVersion);if(t instanceof B)throw new B(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof R)throw new R(l,this.client._clientVersion);if(t instanceof le)throw new le(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Ol.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(u=>u!=="select"&&u!=="include"),a=$i(o,s),l=i==="queryRaw"?Il(a):Ln(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Em(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:kl(e)};Fe(e,"Unknown transaction kind")}}function kl(e){return{id:e.id,payload:e.payload}}function wm(e,t){return Fn(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function xm(e){return e.code==="P2009"||e.code==="P2012"}function Dl(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Dl)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var _l="5.21.1";var Fl=_l;var ql=k(no());var F=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};w(F,"PrismaClientConstructorValidationError");var Ll=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],Nl=["pretty","colorless","minimal"],Ml=["info","query","warn","error"],vm={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new F(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=qt(r,t)||` Available datasources: ${t.join(", ")}`;throw new F(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new F(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new F(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new F(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new F('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!In(t).includes("driverAdapters"))throw new F('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Kt()==="binary")throw new F('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new F(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new F(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Nl.includes(e)){let t=qt(e,Nl);throw new F(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new F(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Ml.includes(r)){let n=qt(r,Ml);throw new F(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=qt(i,o);throw new F(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new F(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new F(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new F(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new F('"omit" option is expected to be an object.');if(e===null)throw new F('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=Rm(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(u=>u.name===s);if(!l){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new F(Cm(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new F(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=qt(r,t);throw new F(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function jl(e,t){for(let[r,n]of Object.entries(e)){if(!Ll.includes(r)){let i=qt(r,Ll);throw new F(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}vm[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new F('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function qt(e,t){if(t.length===0||typeof e!="string")return"";let r=Tm(e,t);return r?` Did you mean "${r}"?`:""}function Tm(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,ql.default)(e,i)}));r.sort((i,o)=>i.distanceMt(n)===t);if(r)return e[r]}function Cm(e,t){let r=Ot(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=yn(r,"colorless");return`Error validating "omit" option: - -${i} - -${n}`}function Vl(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u{n[u]=c,a()},c=>{if(!Fn(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var tt=L("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Sm={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Am=Symbol.for("prisma.client.transaction.id"),Im={id:0,nextId(){return++this.id}};function Wl(e){class t{constructor(n){this._originalClient=this;this._middlewares=new _n;this._createPrismaPromise=lo();this.$extends=sa;e=n?.__internal?.configOverride?.(e)??e,va(e),n&&jl(n,e);let i=new Ql.EventEmitter().on("error",()=>{});this._extensions=vn.empty(),this._previewFeatures=In(e),this._clientVersion=e.clientVersion??Fl,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=Rl(this._previewFeatures);let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&_r.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&_r.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=Ci(n.adapter);let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new R(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new R("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=!s&&Ht(o,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},c=u.debug===!0;c&&L.enable("prisma:client");let p=_r.default.resolve(e.dirname,e.relativePath);Jl.default.existsSync(p)||(p=e.dirname),tt("dirname",e.dirname),tt("relativePath",e.relativePath),tt("cwd",p);let d=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:p,dirname:e.dirname,enableDebugLogs:c,allowTriggerPanic:d.allowTriggerPanic,datamodelPath:_r.default.join(e.dirname,e.filename??"schema.prisma"),prismaPath:d.binaryPath??void 0,engineEndpoint:d.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Sl(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(f=>typeof f=="string"?f==="query":f.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:Ta(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:_t,getBatchRequestPayload:wt,prismaGraphQLToJSError:st,PrismaClientUnknownRequestError:B,PrismaClientInitializationError:R,PrismaClientKnownRequestError:V,debug:L("prisma:client:accelerateEngine"),engineVersion:Ul.version,clientVersion:e.clientVersion}},tt("clientVersion",e.clientVersion),this._engine=Ya(e,this._engineConfig),this._requestHandler=new Mn(this,i),l.log)for(let f of l.log){let g=typeof f=="string"?f:f.emit==="stdout"?f.level:null;g&&this.$on(g,h=>{Zt.log(`${Zt.tags[g]??""}`,h.message||h.query)})}this._metrics=new bt(this._engine)}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=dr(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Ro()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:ao({clientMethod:i,activeProvider:a}),callsite:Ze(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Bl(n,i);return so(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new J("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(so(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new J(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:ml,callsite:Ze(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:ao({clientMethod:i,activeProvider:a}),callsite:Ze(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Bl(n,i));throw new J("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new J("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Im.nextId(),s=Cl(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let c=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return Vl(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return dr(ve(oa(this),[re("_appliedParent",()=>this._appliedParent._createItxClient(n)),re("_createPrismaPromise",()=>lo(n)),re(Am,()=>n.id),Et(El)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Sm,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let c=this._middlewares.get(++a);if(c)return this._tracingHelper.runInChildSpan(s.middleware,O=>c(u,T=>(O?.end(),l(T))));let{runInTransaction:p,args:d,...f}=u,g={...n,...f};d&&(g.args=i.middlewareArgsToRequestArgs(d)),n.transaction!==void 0&&p===!1&&delete g.transaction;let h=await ma(this,g);return g.model?ua({result:h,modelName:g.model,args:g.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):h};return this._tracingHelper.runInChildSpan(s.operation,()=>new Gl.AsyncResource("prisma-client-request").runInAsyncScope(()=>l(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:d,customDataProxyFetch:f}){try{n=u?u(n):n;let g={name:"serialize"},h=this._tracingHelper.runInChildSpan(g,()=>cl({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return L.enabled("prisma:client")&&(tt("Prisma Client call:"),tt(`prisma.${i}(${Vs(n)})`),tt("Generated request:"),tt(JSON.stringify(h,null,2)+` -`)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:h,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:d,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:f})}catch(g){throw g.clientVersion=this._clientVersion,g}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new J("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function Bl(e,t){return Om(e)?[new ie(e,t),xl]:[e,Pl]}function Om(e){return Array.isArray(e)&&Array.isArray(e.raw)}var km=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Hl(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!km.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}function Kl(e){Ht(e,{conflictCheck:"warn"})}0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,skip,sqltag,warnEnvConflicts,warnOnce}); -/*! Bundled license information: - -decimal.js/decimal.mjs: - (*! - * decimal.js v10.4.3 - * An arbitrary-precision Decimal type for JavaScript. - * https://github.com/MikeMcl/decimal.js - * Copyright (c) 2022 Michael Mclaughlin - * MIT Licence - *) -*/ -//# sourceMappingURL=library.js.map diff --git a/node_modules/@prisma/client/runtime/query_engine_bg.mysql.js b/node_modules/@prisma/client/runtime/query_engine_bg.mysql.js deleted file mode 100644 index ec81d71..0000000 --- a/node_modules/@prisma/client/runtime/query_engine_bg.mysql.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";var F=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var D=(n,t)=>{for(var e in t)F(n,e,{get:t[e],enumerable:!0})},N=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let _ of B(t))!U.call(n,_)&&_!==e&&F(n,_,{get:()=>t[_],enumerable:!(o=R(t,_))||o.enumerable});return n};var C=n=>N(F({},"__esModule",{value:!0}),n);var Et={};D(Et,{QueryEngine:()=>Z,__wbg_String_88810dfeb4021902:()=>Un,__wbg_buffer_344d9b41efe96da7:()=>Nn,__wbg_call_53fc3abd42e24ec8:()=>gt,__wbg_call_669127b9d730c650:()=>Zn,__wbg_crypto_58f13aa23ffcb166:()=>Wn,__wbg_done_bc26bf4ada718266:()=>rt,__wbg_entries_6d727b73ee02b7ce:()=>At,__wbg_getRandomValues_504510b5564925af:()=>Pn,__wbg_getTime_ed6ee333b702f8fc:()=>an,__wbg_get_2aff440840bb6202:()=>ct,__wbg_get_4a9aa5157afeb382:()=>nt,__wbg_get_94990005bd6ca07c:()=>Bn,__wbg_getwithrefkey_5e6d9547403deab8:()=>Mn,__wbg_globalThis_17eff828815f7d84:()=>st,__wbg_global_46f939f6541643c5:()=>ft,__wbg_has_cdf8b85f6e903c80:()=>un,__wbg_instanceof_ArrayBuffer_c7cc317e5c29cc0d:()=>Tt,__wbg_instanceof_Promise_cfbcc42300367513:()=>dn,__wbg_instanceof_Uint8Array_19e6f142a5e7e1e1:()=>ht,__wbg_isArray_38525be7442aa21e:()=>bt,__wbg_isSafeInteger_c38b0a16d0c7cef7:()=>lt,__wbg_iterator_7ee1a391d310f8e4:()=>pn,__wbg_length_a5587d6cd79ab197:()=>yt,__wbg_length_cace2e0b3ddc0502:()=>wn,__wbg_msCrypto_abcb1295e768d1f2:()=>Gn,__wbg_new0_ad75dd38f92424e2:()=>fn,__wbg_new_08236689f0afb357:()=>On,__wbg_new_1b94180eeb48f2a2:()=>Fn,__wbg_new_c728d68b8b34487e:()=>In,__wbg_new_d8a000788389a31e:()=>Ln,__wbg_new_feb65b865d980ae2:()=>en,__wbg_newnoargs_ccdcae30fd002262:()=>at,__wbg_newwithbyteoffsetandlength_2dc04d99088b15e3:()=>Cn,__wbg_newwithlength_13b5319ab422dcf6:()=>Kn,__wbg_next_15da6a3df9290720:()=>_t,__wbg_next_1989a20442400aaa:()=>et,__wbg_node_523d7bd03ef69fba:()=>Qn,__wbg_now_28a6b413aca4a96a:()=>xt,__wbg_now_4579335d3581594c:()=>gn,__wbg_now_8ed1a4454e40ecd1:()=>bn,__wbg_parse_3f0cb48976ca4123:()=>sn,__wbg_process_5b786e71d465a513:()=>Jn,__wbg_push_fd3233d09cf81821:()=>Rn,__wbg_randomFillSync_a0d98aa11c81fe89:()=>$n,__wbg_require_2784e593a4674877:()=>Hn,__wbg_resolve_a3252b2860f0a09e:()=>kt,__wbg_self_3fad056edded10bd:()=>it,__wbg_setTimeout_631fe61f31fa2fad:()=>rn,__wbg_set_0ac78a2bc07da03c:()=>qn,__wbg_set_3355b9f2d3092e3b:()=>kn,__wbg_set_40f7786a25a9cc7e:()=>dt,__wbg_set_841ac57cff3d672b:()=>En,__wbg_set_dcfd613a3420f908:()=>pt,__wbg_set_wasm:()=>L,__wbg_stringify_4039297315a25b00:()=>wt,__wbg_subarray_6ca5cfa7fbb9abbe:()=>zn,__wbg_then_1bbc9edafd859b06:()=>It,__wbg_then_89e1c559530b85cf:()=>Ft,__wbg_valueOf_ff4b62641803432a:()=>tt,__wbg_value_0570714ff7d75f35:()=>ot,__wbg_versions_c2ab80650590b6a2:()=>Vn,__wbg_window_a4f46c98a61d4089:()=>ut,__wbindgen_bigint_from_i64:()=>hn,__wbindgen_bigint_from_u64:()=>An,__wbindgen_bigint_get_as_i64:()=>St,__wbindgen_boolean_get:()=>yn,__wbindgen_cb_drop:()=>qt,__wbindgen_closure_wrapper7129:()=>vt,__wbindgen_debug_string:()=>jt,__wbindgen_error_new:()=>tn,__wbindgen_in:()=>Tn,__wbindgen_is_bigint:()=>xn,__wbindgen_is_function:()=>Xn,__wbindgen_is_object:()=>ln,__wbindgen_is_string:()=>vn,__wbindgen_is_undefined:()=>cn,__wbindgen_jsval_eq:()=>Sn,__wbindgen_jsval_loose_eq:()=>mt,__wbindgen_memory:()=>Dn,__wbindgen_number_get:()=>mn,__wbindgen_number_new:()=>jn,__wbindgen_object_clone_ref:()=>_n,__wbindgen_object_drop_ref:()=>Yn,__wbindgen_string_get:()=>nn,__wbindgen_string_new:()=>on,__wbindgen_throw:()=>Ot,debug_panic:()=>K,getBuildTimeInfo:()=>G});module.exports=C(Et);var h=()=>{};h.prototype=h;let c;function L(n){c=n}const w=new Array(128).fill(void 0);w.push(void 0,null,!0,!1);function r(n){return w[n]}let a=0,T=null;function A(){return(T===null||T.byteLength===0)&&(T=new Uint8Array(c.memory.buffer)),T}const $=typeof TextEncoder>"u"?(0,module.require)("util").TextEncoder:TextEncoder;let S=new $("utf-8");const z=typeof S.encodeInto=="function"?function(n,t){return S.encodeInto(n,t)}:function(n,t){const e=S.encode(n);return t.set(e),{read:n.length,written:e.length}};function l(n,t,e){if(e===void 0){const s=S.encode(n),p=t(s.length,1)>>>0;return A().subarray(p,p+s.length).set(s),a=s.length,p}let o=n.length,_=t(o,1)>>>0;const f=A();let u=0;for(;u127)break;f[_+u]=s}if(u!==o){u!==0&&(n=n.slice(u)),_=e(_,o,o=u+n.length*3,1)>>>0;const s=A().subarray(_+u,_+o),p=z(n,s);u+=p.written,_=e(_,o,u,1)>>>0}return a=u,_}function y(n){return n==null}let j=null;function d(){return(j===null||j.byteLength===0)&&(j=new Int32Array(c.memory.buffer)),j}const P=typeof TextDecoder>"u"?(0,module.require)("util").TextDecoder:TextDecoder;let k=new P("utf-8",{ignoreBOM:!0,fatal:!0});k.decode();function x(n,t){return n=n>>>0,k.decode(A().subarray(n,n+t))}let m=w.length;function i(n){m===w.length&&w.push(w.length+1);const t=m;return m=w[t],w[t]=n,t}let O=null;function W(){return(O===null||O.byteLength===0)&&(O=new Float64Array(c.memory.buffer)),O}function J(n){n<132||(w[n]=m,m=n)}function b(n){const t=r(n);return J(n),t}let q=null;function V(){return(q===null||q.byteLength===0)&&(q=new BigInt64Array(c.memory.buffer)),q}function I(n){const t=typeof n;if(t=="number"||t=="boolean"||n==null)return`${n}`;if(t=="string")return`"${n}"`;if(t=="symbol"){const _=n.description;return _==null?"Symbol":`Symbol(${_})`}if(t=="function"){const _=n.name;return typeof _=="string"&&_.length>0?`Function(${_})`:"Function"}if(Array.isArray(n)){const _=n.length;let f="[";_>0&&(f+=I(n[0]));for(let u=1;u<_;u++)f+=", "+I(n[u]);return f+="]",f}const e=/\[object ([^\]]+)\]/.exec(toString.call(n));let o;if(e.length>1)o=e[1];else return toString.call(n);if(o=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} -${n.stack}`:o}const v=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>{c.__wbindgen_export_2.get(n.dtor)(n.a,n.b)});function Q(n,t,e,o){const _={a:n,b:t,cnt:1,dtor:e},f=(...u)=>{_.cnt++;const s=_.a;_.a=0;try{return o(s,_.b,...u)}finally{--_.cnt===0?(c.__wbindgen_export_2.get(_.dtor)(s,_.b),v.unregister(_)):_.a=s}};return f.original=_,v.register(f,_,_),f}function H(n,t,e){c._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1d1ce90a2538b281(n,t,i(e))}function G(){const n=c.getBuildTimeInfo();return b(n)}function K(n){try{const f=c.__wbindgen_add_to_stack_pointer(-16);var t=y(n)?0:l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),e=a;c.debug_panic(f,t,e);var o=d()[f/4+0],_=d()[f/4+1];if(_)throw b(o)}finally{c.__wbindgen_add_to_stack_pointer(16)}}function g(n,t){try{return n.apply(this,t)}catch(e){c.__wbindgen_exn_store(i(e))}}function X(n,t,e,o){c.wasm_bindgen__convert__closures__invoke2_mut__h46a92896c95d64ae(n,t,i(e),i(o))}const Y=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>c.__wbg_queryengine_free(n>>>0));class Z{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Y.unregister(this),t}free(){const t=this.__destroy_into_raw();c.__wbg_queryengine_free(t)}constructor(t,e,o){try{const s=c.__wbindgen_add_to_stack_pointer(-16);c.queryengine_new(s,i(t),i(e),i(o));var _=d()[s/4+0],f=d()[s/4+1],u=d()[s/4+2];if(u)throw b(f);return this.__wbg_ptr=_>>>0,this}finally{c.__wbindgen_add_to_stack_pointer(16)}}connect(t){const e=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),o=a,_=c.queryengine_connect(this.__wbg_ptr,e,o);return b(_)}disconnect(t){const e=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),o=a,_=c.queryengine_disconnect(this.__wbg_ptr,e,o);return b(_)}query(t,e,o){const _=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),f=a,u=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),s=a;var p=y(o)?0:l(o,c.__wbindgen_malloc,c.__wbindgen_realloc),E=a;const M=c.queryengine_query(this.__wbg_ptr,_,f,u,s,p,E);return b(M)}startTransaction(t,e){const o=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a,f=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),u=a,s=c.queryengine_startTransaction(this.__wbg_ptr,o,_,f,u);return b(s)}commitTransaction(t,e){const o=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a,f=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),u=a,s=c.queryengine_commitTransaction(this.__wbg_ptr,o,_,f,u);return b(s)}rollbackTransaction(t,e){const o=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a,f=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),u=a,s=c.queryengine_rollbackTransaction(this.__wbg_ptr,o,_,f,u);return b(s)}metrics(t){const e=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),o=a,_=c.queryengine_metrics(this.__wbg_ptr,e,o);return b(_)}}function nn(n,t){const e=r(t),o=typeof e=="string"?e:void 0;var _=y(o)?0:l(o,c.__wbindgen_malloc,c.__wbindgen_realloc),f=a;d()[n/4+1]=f,d()[n/4+0]=_}function tn(n,t){const e=new Error(x(n,t));return i(e)}function en(n,t){try{var e={a:n,b:t},o=(f,u)=>{const s=e.a;e.a=0;try{return X(s,e.b,f,u)}finally{e.a=s}};const _=new Promise(o);return i(_)}finally{e.a=e.b=0}}function rn(n,t){return setTimeout(r(n),t>>>0)}function on(n,t){const e=x(n,t);return i(e)}function _n(n){const t=r(n);return i(t)}function cn(n){return r(n)===void 0}function un(){return g(function(n,t){return Reflect.has(r(n),r(t))},arguments)}function sn(){return g(function(n,t){const e=JSON.parse(x(n,t));return i(e)},arguments)}function fn(){return i(new Date)}function an(n){return r(n).getTime()}function bn(n){return r(n).now()}function gn(){return Date.now()}function ln(n){const t=r(n);return typeof t=="object"&&t!==null}function dn(n){let t;try{t=r(n)instanceof Promise}catch{t=!1}return t}function wn(n){return r(n).length}function pn(){return i(Symbol.iterator)}function yn(n){const t=r(n);return typeof t=="boolean"?t?1:0:2}function xn(n){return typeof r(n)=="bigint"}function mn(n,t){const e=r(t),o=typeof e=="number"?e:void 0;W()[n/8+1]=y(o)?0:o,d()[n/4+0]=!y(o)}function hn(n){return i(n)}function Tn(n,t){return r(n)in r(t)}function An(n){const t=BigInt.asUintN(64,n);return i(t)}function Sn(n,t){return r(n)===r(t)}function jn(n){return i(n)}function On(){const n=new Array;return i(n)}function qn(n,t,e){r(n)[t>>>0]=b(e)}function Fn(){return i(new Map)}function In(){const n=new Object;return i(n)}function kn(n,t,e){const o=r(n).set(r(t),r(e));return i(o)}function vn(n){return typeof r(n)=="string"}function En(n,t,e){r(n)[b(t)]=b(e)}function Mn(n,t){const e=r(n)[r(t)];return i(e)}function Rn(n,t){return r(n).push(r(t))}function Bn(){return g(function(n,t){const e=r(n)[b(t)];return i(e)},arguments)}function Un(n,t){const e=String(r(t)),o=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a;d()[n/4+1]=_,d()[n/4+0]=o}function Dn(){const n=c.memory;return i(n)}function Nn(n){const t=r(n).buffer;return i(t)}function Cn(n,t,e){const o=new Uint8Array(r(n),t>>>0,e>>>0);return i(o)}function Ln(n){const t=new Uint8Array(r(n));return i(t)}function $n(){return g(function(n,t){r(n).randomFillSync(b(t))},arguments)}function zn(n,t,e){const o=r(n).subarray(t>>>0,e>>>0);return i(o)}function Pn(){return g(function(n,t){r(n).getRandomValues(r(t))},arguments)}function Wn(n){const t=r(n).crypto;return i(t)}function Jn(n){const t=r(n).process;return i(t)}function Vn(n){const t=r(n).versions;return i(t)}function Qn(n){const t=r(n).node;return i(t)}function Hn(){return g(function(){const n=module.require;return i(n)},arguments)}function Gn(n){const t=r(n).msCrypto;return i(t)}function Kn(n){const t=new Uint8Array(n>>>0);return i(t)}function Xn(n){return typeof r(n)=="function"}function Yn(n){b(n)}function Zn(){return g(function(n,t){const e=r(n).call(r(t));return i(e)},arguments)}function nt(n,t){const e=r(n)[t>>>0];return i(e)}function tt(n){return r(n).valueOf()}function et(){return g(function(n){const t=r(n).next();return i(t)},arguments)}function rt(n){return r(n).done}function ot(n){const t=r(n).value;return i(t)}function _t(n){const t=r(n).next;return i(t)}function ct(){return g(function(n,t){const e=Reflect.get(r(n),r(t));return i(e)},arguments)}function it(){return g(function(){const n=self.self;return i(n)},arguments)}function ut(){return g(function(){const n=window.window;return i(n)},arguments)}function st(){return g(function(){const n=globalThis.globalThis;return i(n)},arguments)}function ft(){return g(function(){const n=global.global;return i(n)},arguments)}function at(n,t){const e=new h(x(n,t));return i(e)}function bt(n){return Array.isArray(r(n))}function gt(){return g(function(n,t,e){const o=r(n).call(r(t),r(e));return i(o)},arguments)}function lt(n){return Number.isSafeInteger(r(n))}function dt(){return g(function(n,t,e){return Reflect.set(r(n),r(t),r(e))},arguments)}function wt(){return g(function(n){const t=JSON.stringify(r(n));return i(t)},arguments)}function pt(n,t,e){r(n).set(r(t),e>>>0)}function yt(n){return r(n).length}function xt(){return g(function(){return Date.now()},arguments)}function mt(n,t){return r(n)==r(t)}function ht(n){let t;try{t=r(n)instanceof Uint8Array}catch{t=!1}return t}function Tt(n){let t;try{t=r(n)instanceof ArrayBuffer}catch{t=!1}return t}function At(n){const t=Object.entries(r(n));return i(t)}function St(n,t){const e=r(t),o=typeof e=="bigint"?e:void 0;V()[n/8+1]=y(o)?BigInt(0):o,d()[n/4+0]=!y(o)}function jt(n,t){const e=I(r(t)),o=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a;d()[n/4+1]=_,d()[n/4+0]=o}function Ot(n,t){throw new Error(x(n,t))}function qt(n){const t=b(n).original;return t.cnt--==1?(t.a=0,!0):!1}function Ft(n,t){const e=r(n).then(r(t));return i(e)}function It(n,t,e){const o=r(n).then(r(t),r(e));return i(o)}function kt(n){const t=Promise.resolve(r(n));return i(t)}function vt(n,t,e){const o=Q(n,t,325,H);return i(o)}0&&(module.exports={QueryEngine,__wbg_String_88810dfeb4021902,__wbg_buffer_344d9b41efe96da7,__wbg_call_53fc3abd42e24ec8,__wbg_call_669127b9d730c650,__wbg_crypto_58f13aa23ffcb166,__wbg_done_bc26bf4ada718266,__wbg_entries_6d727b73ee02b7ce,__wbg_getRandomValues_504510b5564925af,__wbg_getTime_ed6ee333b702f8fc,__wbg_get_2aff440840bb6202,__wbg_get_4a9aa5157afeb382,__wbg_get_94990005bd6ca07c,__wbg_getwithrefkey_5e6d9547403deab8,__wbg_globalThis_17eff828815f7d84,__wbg_global_46f939f6541643c5,__wbg_has_cdf8b85f6e903c80,__wbg_instanceof_ArrayBuffer_c7cc317e5c29cc0d,__wbg_instanceof_Promise_cfbcc42300367513,__wbg_instanceof_Uint8Array_19e6f142a5e7e1e1,__wbg_isArray_38525be7442aa21e,__wbg_isSafeInteger_c38b0a16d0c7cef7,__wbg_iterator_7ee1a391d310f8e4,__wbg_length_a5587d6cd79ab197,__wbg_length_cace2e0b3ddc0502,__wbg_msCrypto_abcb1295e768d1f2,__wbg_new0_ad75dd38f92424e2,__wbg_new_08236689f0afb357,__wbg_new_1b94180eeb48f2a2,__wbg_new_c728d68b8b34487e,__wbg_new_d8a000788389a31e,__wbg_new_feb65b865d980ae2,__wbg_newnoargs_ccdcae30fd002262,__wbg_newwithbyteoffsetandlength_2dc04d99088b15e3,__wbg_newwithlength_13b5319ab422dcf6,__wbg_next_15da6a3df9290720,__wbg_next_1989a20442400aaa,__wbg_node_523d7bd03ef69fba,__wbg_now_28a6b413aca4a96a,__wbg_now_4579335d3581594c,__wbg_now_8ed1a4454e40ecd1,__wbg_parse_3f0cb48976ca4123,__wbg_process_5b786e71d465a513,__wbg_push_fd3233d09cf81821,__wbg_randomFillSync_a0d98aa11c81fe89,__wbg_require_2784e593a4674877,__wbg_resolve_a3252b2860f0a09e,__wbg_self_3fad056edded10bd,__wbg_setTimeout_631fe61f31fa2fad,__wbg_set_0ac78a2bc07da03c,__wbg_set_3355b9f2d3092e3b,__wbg_set_40f7786a25a9cc7e,__wbg_set_841ac57cff3d672b,__wbg_set_dcfd613a3420f908,__wbg_set_wasm,__wbg_stringify_4039297315a25b00,__wbg_subarray_6ca5cfa7fbb9abbe,__wbg_then_1bbc9edafd859b06,__wbg_then_89e1c559530b85cf,__wbg_valueOf_ff4b62641803432a,__wbg_value_0570714ff7d75f35,__wbg_versions_c2ab80650590b6a2,__wbg_window_a4f46c98a61d4089,__wbindgen_bigint_from_i64,__wbindgen_bigint_from_u64,__wbindgen_bigint_get_as_i64,__wbindgen_boolean_get,__wbindgen_cb_drop,__wbindgen_closure_wrapper7129,__wbindgen_debug_string,__wbindgen_error_new,__wbindgen_in,__wbindgen_is_bigint,__wbindgen_is_function,__wbindgen_is_object,__wbindgen_is_string,__wbindgen_is_undefined,__wbindgen_jsval_eq,__wbindgen_jsval_loose_eq,__wbindgen_memory,__wbindgen_number_get,__wbindgen_number_new,__wbindgen_object_clone_ref,__wbindgen_object_drop_ref,__wbindgen_string_get,__wbindgen_string_new,__wbindgen_throw,debug_panic,getBuildTimeInfo}); diff --git a/node_modules/@prisma/client/runtime/query_engine_bg.mysql.wasm b/node_modules/@prisma/client/runtime/query_engine_bg.mysql.wasm deleted file mode 100644 index 3cd3b4f..0000000 Binary files a/node_modules/@prisma/client/runtime/query_engine_bg.mysql.wasm and /dev/null differ diff --git a/node_modules/@prisma/client/runtime/query_engine_bg.postgresql.js b/node_modules/@prisma/client/runtime/query_engine_bg.postgresql.js deleted file mode 100644 index 096b62f..0000000 --- a/node_modules/@prisma/client/runtime/query_engine_bg.postgresql.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";var F=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var D=(n,e)=>{for(var t in e)F(n,t,{get:e[t],enumerable:!0})},N=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let _ of B(e))!U.call(n,_)&&_!==t&&F(n,_,{get:()=>e[_],enumerable:!(o=R(e,_))||o.enumerable});return n};var C=n=>N(F({},"__esModule",{value:!0}),n);var Re={};D(Re,{QueryEngine:()=>Z,__wbg_String_88810dfeb4021902:()=>Cn,__wbg_buffer_344d9b41efe96da7:()=>$n,__wbg_call_53fc3abd42e24ec8:()=>de,__wbg_call_669127b9d730c650:()=>ee,__wbg_crypto_58f13aa23ffcb166:()=>Qn,__wbg_done_bc26bf4ada718266:()=>_e,__wbg_entries_6d727b73ee02b7ce:()=>je,__wbg_exec_393fa168a3695345:()=>Dn,__wbg_getRandomValues_504510b5564925af:()=>Vn,__wbg_getTime_ed6ee333b702f8fc:()=>an,__wbg_get_2aff440840bb6202:()=>ue,__wbg_get_4a9aa5157afeb382:()=>te,__wbg_get_94990005bd6ca07c:()=>Nn,__wbg_getwithrefkey_5e6d9547403deab8:()=>Rn,__wbg_globalThis_17eff828815f7d84:()=>ae,__wbg_global_46f939f6541643c5:()=>be,__wbg_has_cdf8b85f6e903c80:()=>un,__wbg_instanceof_ArrayBuffer_c7cc317e5c29cc0d:()=>Se,__wbg_instanceof_Promise_cfbcc42300367513:()=>dn,__wbg_instanceof_Uint8Array_19e6f142a5e7e1e1:()=>Ae,__wbg_isArray_38525be7442aa21e:()=>le,__wbg_isSafeInteger_c38b0a16d0c7cef7:()=>we,__wbg_iterator_7ee1a391d310f8e4:()=>xn,__wbg_length_a5587d6cd79ab197:()=>me,__wbg_length_cace2e0b3ddc0502:()=>pn,__wbg_msCrypto_abcb1295e768d1f2:()=>Yn,__wbg_new0_ad75dd38f92424e2:()=>fn,__wbg_new_00f9fd9cefd9f65c:()=>Un,__wbg_new_08236689f0afb357:()=>qn,__wbg_new_1b94180eeb48f2a2:()=>En,__wbg_new_c728d68b8b34487e:()=>In,__wbg_new_d8a000788389a31e:()=>Pn,__wbg_new_feb65b865d980ae2:()=>tn,__wbg_newnoargs_ccdcae30fd002262:()=>ge,__wbg_newwithbyteoffsetandlength_2dc04d99088b15e3:()=>zn,__wbg_newwithlength_13b5319ab422dcf6:()=>Zn,__wbg_next_15da6a3df9290720:()=>ie,__wbg_next_1989a20442400aaa:()=>oe,__wbg_node_523d7bd03ef69fba:()=>Kn,__wbg_now_28a6b413aca4a96a:()=>he,__wbg_now_4579335d3581594c:()=>ln,__wbg_now_8ed1a4454e40ecd1:()=>gn,__wbg_parse_3f0cb48976ca4123:()=>sn,__wbg_process_5b786e71d465a513:()=>Hn,__wbg_push_fd3233d09cf81821:()=>Bn,__wbg_randomFillSync_a0d98aa11c81fe89:()=>Wn,__wbg_require_2784e593a4674877:()=>Xn,__wbg_resolve_a3252b2860f0a09e:()=>ve,__wbg_self_3fad056edded10bd:()=>se,__wbg_setTimeout_631fe61f31fa2fad:()=>rn,__wbg_set_0ac78a2bc07da03c:()=>Fn,__wbg_set_3355b9f2d3092e3b:()=>kn,__wbg_set_40f7786a25a9cc7e:()=>pe,__wbg_set_841ac57cff3d672b:()=>Mn,__wbg_set_dcfd613a3420f908:()=>ye,__wbg_set_wasm:()=>L,__wbg_stringify_4039297315a25b00:()=>xe,__wbg_subarray_6ca5cfa7fbb9abbe:()=>Jn,__wbg_then_1bbc9edafd859b06:()=>ke,__wbg_then_89e1c559530b85cf:()=>Ie,__wbg_valueOf_ff4b62641803432a:()=>re,__wbg_value_0570714ff7d75f35:()=>ce,__wbg_versions_c2ab80650590b6a2:()=>Gn,__wbg_window_a4f46c98a61d4089:()=>fe,__wbindgen_bigint_from_i64:()=>Tn,__wbindgen_bigint_from_u64:()=>Sn,__wbindgen_bigint_get_as_i64:()=>Oe,__wbindgen_boolean_get:()=>yn,__wbindgen_cb_drop:()=>Ee,__wbindgen_closure_wrapper7164:()=>Me,__wbindgen_debug_string:()=>qe,__wbindgen_error_new:()=>en,__wbindgen_in:()=>An,__wbindgen_is_bigint:()=>mn,__wbindgen_is_function:()=>ne,__wbindgen_is_object:()=>wn,__wbindgen_is_string:()=>vn,__wbindgen_is_undefined:()=>cn,__wbindgen_jsval_eq:()=>jn,__wbindgen_jsval_loose_eq:()=>Te,__wbindgen_memory:()=>Ln,__wbindgen_number_get:()=>hn,__wbindgen_number_new:()=>On,__wbindgen_object_clone_ref:()=>_n,__wbindgen_object_drop_ref:()=>bn,__wbindgen_string_get:()=>nn,__wbindgen_string_new:()=>on,__wbindgen_throw:()=>Fe,debug_panic:()=>K,getBuildTimeInfo:()=>G});module.exports=C(Re);var h=()=>{};h.prototype=h;let c;function L(n){c=n}const w=new Array(128).fill(void 0);w.push(void 0,null,!0,!1);function r(n){return w[n]}let a=0,T=null;function A(){return(T===null||T.byteLength===0)&&(T=new Uint8Array(c.memory.buffer)),T}const $=typeof TextEncoder>"u"?(0,module.require)("util").TextEncoder:TextEncoder;let S=new $("utf-8");const z=typeof S.encodeInto=="function"?function(n,e){return S.encodeInto(n,e)}:function(n,e){const t=S.encode(n);return e.set(t),{read:n.length,written:t.length}};function l(n,e,t){if(t===void 0){const s=S.encode(n),y=e(s.length,1)>>>0;return A().subarray(y,y+s.length).set(s),a=s.length,y}let o=n.length,_=e(o,1)>>>0;const f=A();let u=0;for(;u127)break;f[_+u]=s}if(u!==o){u!==0&&(n=n.slice(u)),_=t(_,o,o=u+n.length*3,1)>>>0;const s=A().subarray(_+u,_+o),y=z(n,s);u+=y.written,_=t(_,o,u,1)>>>0}return a=u,_}function p(n){return n==null}let j=null;function d(){return(j===null||j.byteLength===0)&&(j=new Int32Array(c.memory.buffer)),j}const P=typeof TextDecoder>"u"?(0,module.require)("util").TextDecoder:TextDecoder;let I=new P("utf-8",{ignoreBOM:!0,fatal:!0});I.decode();function x(n,e){return n=n>>>0,I.decode(A().subarray(n,n+e))}let m=w.length;function i(n){m===w.length&&w.push(w.length+1);const e=m;return m=w[e],w[e]=n,e}function W(n){n<132||(w[n]=m,m=n)}function b(n){const e=r(n);return W(n),e}let O=null;function J(){return(O===null||O.byteLength===0)&&(O=new Float64Array(c.memory.buffer)),O}let q=null;function V(){return(q===null||q.byteLength===0)&&(q=new BigInt64Array(c.memory.buffer)),q}function E(n){const e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){const _=n.description;return _==null?"Symbol":`Symbol(${_})`}if(e=="function"){const _=n.name;return typeof _=="string"&&_.length>0?`Function(${_})`:"Function"}if(Array.isArray(n)){const _=n.length;let f="[";_>0&&(f+=E(n[0]));for(let u=1;u<_;u++)f+=", "+E(n[u]);return f+="]",f}const t=/\[object ([^\]]+)\]/.exec(toString.call(n));let o;if(t.length>1)o=t[1];else return toString.call(n);if(o=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} -${n.stack}`:o}const k=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>{c.__wbindgen_export_2.get(n.dtor)(n.a,n.b)});function Q(n,e,t,o){const _={a:n,b:e,cnt:1,dtor:t},f=(...u)=>{_.cnt++;const s=_.a;_.a=0;try{return o(s,_.b,...u)}finally{--_.cnt===0?(c.__wbindgen_export_2.get(_.dtor)(s,_.b),k.unregister(_)):_.a=s}};return f.original=_,k.register(f,_,_),f}function H(n,e,t){c._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1d1ce90a2538b281(n,e,i(t))}function G(){const n=c.getBuildTimeInfo();return b(n)}function K(n){try{const f=c.__wbindgen_add_to_stack_pointer(-16);var e=p(n)?0:l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),t=a;c.debug_panic(f,e,t);var o=d()[f/4+0],_=d()[f/4+1];if(_)throw b(o)}finally{c.__wbindgen_add_to_stack_pointer(16)}}function g(n,e){try{return n.apply(this,e)}catch(t){c.__wbindgen_exn_store(i(t))}}function X(n,e,t,o){c.wasm_bindgen__convert__closures__invoke2_mut__h46a92896c95d64ae(n,e,i(t),i(o))}const Y=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>c.__wbg_queryengine_free(n>>>0));class Z{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Y.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_queryengine_free(e)}constructor(e,t,o){try{const s=c.__wbindgen_add_to_stack_pointer(-16);c.queryengine_new(s,i(e),i(t),i(o));var _=d()[s/4+0],f=d()[s/4+1],u=d()[s/4+2];if(u)throw b(f);return this.__wbg_ptr=_>>>0,this}finally{c.__wbindgen_add_to_stack_pointer(16)}}connect(e){const t=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),o=a,_=c.queryengine_connect(this.__wbg_ptr,t,o);return b(_)}disconnect(e){const t=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),o=a,_=c.queryengine_disconnect(this.__wbg_ptr,t,o);return b(_)}query(e,t,o){const _=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),f=a,u=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),s=a;var y=p(o)?0:l(o,c.__wbindgen_malloc,c.__wbindgen_realloc),v=a;const M=c.queryengine_query(this.__wbg_ptr,_,f,u,s,y,v);return b(M)}startTransaction(e,t){const o=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a,f=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),u=a,s=c.queryengine_startTransaction(this.__wbg_ptr,o,_,f,u);return b(s)}commitTransaction(e,t){const o=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a,f=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),u=a,s=c.queryengine_commitTransaction(this.__wbg_ptr,o,_,f,u);return b(s)}rollbackTransaction(e,t){const o=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a,f=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),u=a,s=c.queryengine_rollbackTransaction(this.__wbg_ptr,o,_,f,u);return b(s)}metrics(e){const t=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),o=a,_=c.queryengine_metrics(this.__wbg_ptr,t,o);return b(_)}}function nn(n,e){const t=r(e),o=typeof t=="string"?t:void 0;var _=p(o)?0:l(o,c.__wbindgen_malloc,c.__wbindgen_realloc),f=a;d()[n/4+1]=f,d()[n/4+0]=_}function en(n,e){const t=new Error(x(n,e));return i(t)}function tn(n,e){try{var t={a:n,b:e},o=(f,u)=>{const s=t.a;t.a=0;try{return X(s,t.b,f,u)}finally{t.a=s}};const _=new Promise(o);return i(_)}finally{t.a=t.b=0}}function rn(n,e){return setTimeout(r(n),e>>>0)}function on(n,e){const t=x(n,e);return i(t)}function _n(n){const e=r(n);return i(e)}function cn(n){return r(n)===void 0}function un(){return g(function(n,e){return Reflect.has(r(n),r(e))},arguments)}function sn(){return g(function(n,e){const t=JSON.parse(x(n,e));return i(t)},arguments)}function fn(){return i(new Date)}function an(n){return r(n).getTime()}function bn(n){b(n)}function gn(n){return r(n).now()}function ln(){return Date.now()}function dn(n){let e;try{e=r(n)instanceof Promise}catch{e=!1}return e}function wn(n){const e=r(n);return typeof e=="object"&&e!==null}function pn(n){return r(n).length}function xn(){return i(Symbol.iterator)}function yn(n){const e=r(n);return typeof e=="boolean"?e?1:0:2}function mn(n){return typeof r(n)=="bigint"}function hn(n,e){const t=r(e),o=typeof t=="number"?t:void 0;J()[n/8+1]=p(o)?0:o,d()[n/4+0]=!p(o)}function Tn(n){return i(n)}function An(n,e){return r(n)in r(e)}function Sn(n){const e=BigInt.asUintN(64,n);return i(e)}function jn(n,e){return r(n)===r(e)}function On(n){return i(n)}function qn(){const n=new Array;return i(n)}function Fn(n,e,t){r(n)[e>>>0]=b(t)}function En(){return i(new Map)}function In(){const n=new Object;return i(n)}function kn(n,e,t){const o=r(n).set(r(e),r(t));return i(o)}function vn(n){return typeof r(n)=="string"}function Mn(n,e,t){r(n)[b(e)]=b(t)}function Rn(n,e){const t=r(n)[r(e)];return i(t)}function Bn(n,e){return r(n).push(r(e))}function Un(n,e,t,o){const _=new RegExp(x(n,e),x(t,o));return i(_)}function Dn(n,e,t){const o=r(n).exec(x(e,t));return p(o)?0:i(o)}function Nn(){return g(function(n,e){const t=r(n)[b(e)];return i(t)},arguments)}function Cn(n,e){const t=String(r(e)),o=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a;d()[n/4+1]=_,d()[n/4+0]=o}function Ln(){const n=c.memory;return i(n)}function $n(n){const e=r(n).buffer;return i(e)}function zn(n,e,t){const o=new Uint8Array(r(n),e>>>0,t>>>0);return i(o)}function Pn(n){const e=new Uint8Array(r(n));return i(e)}function Wn(){return g(function(n,e){r(n).randomFillSync(b(e))},arguments)}function Jn(n,e,t){const o=r(n).subarray(e>>>0,t>>>0);return i(o)}function Vn(){return g(function(n,e){r(n).getRandomValues(r(e))},arguments)}function Qn(n){const e=r(n).crypto;return i(e)}function Hn(n){const e=r(n).process;return i(e)}function Gn(n){const e=r(n).versions;return i(e)}function Kn(n){const e=r(n).node;return i(e)}function Xn(){return g(function(){const n=module.require;return i(n)},arguments)}function Yn(n){const e=r(n).msCrypto;return i(e)}function Zn(n){const e=new Uint8Array(n>>>0);return i(e)}function ne(n){return typeof r(n)=="function"}function ee(){return g(function(n,e){const t=r(n).call(r(e));return i(t)},arguments)}function te(n,e){const t=r(n)[e>>>0];return i(t)}function re(n){return r(n).valueOf()}function oe(){return g(function(n){const e=r(n).next();return i(e)},arguments)}function _e(n){return r(n).done}function ce(n){const e=r(n).value;return i(e)}function ie(n){const e=r(n).next;return i(e)}function ue(){return g(function(n,e){const t=Reflect.get(r(n),r(e));return i(t)},arguments)}function se(){return g(function(){const n=self.self;return i(n)},arguments)}function fe(){return g(function(){const n=window.window;return i(n)},arguments)}function ae(){return g(function(){const n=globalThis.globalThis;return i(n)},arguments)}function be(){return g(function(){const n=global.global;return i(n)},arguments)}function ge(n,e){const t=new h(x(n,e));return i(t)}function le(n){return Array.isArray(r(n))}function de(){return g(function(n,e,t){const o=r(n).call(r(e),r(t));return i(o)},arguments)}function we(n){return Number.isSafeInteger(r(n))}function pe(){return g(function(n,e,t){return Reflect.set(r(n),r(e),r(t))},arguments)}function xe(){return g(function(n){const e=JSON.stringify(r(n));return i(e)},arguments)}function ye(n,e,t){r(n).set(r(e),t>>>0)}function me(n){return r(n).length}function he(){return g(function(){return Date.now()},arguments)}function Te(n,e){return r(n)==r(e)}function Ae(n){let e;try{e=r(n)instanceof Uint8Array}catch{e=!1}return e}function Se(n){let e;try{e=r(n)instanceof ArrayBuffer}catch{e=!1}return e}function je(n){const e=Object.entries(r(n));return i(e)}function Oe(n,e){const t=r(e),o=typeof t=="bigint"?t:void 0;V()[n/8+1]=p(o)?BigInt(0):o,d()[n/4+0]=!p(o)}function qe(n,e){const t=E(r(e)),o=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a;d()[n/4+1]=_,d()[n/4+0]=o}function Fe(n,e){throw new Error(x(n,e))}function Ee(n){const e=b(n).original;return e.cnt--==1?(e.a=0,!0):!1}function Ie(n,e){const t=r(n).then(r(e));return i(t)}function ke(n,e,t){const o=r(n).then(r(e),r(t));return i(o)}function ve(n){const e=Promise.resolve(r(n));return i(e)}function Me(n,e,t){const o=Q(n,e,327,H);return i(o)}0&&(module.exports={QueryEngine,__wbg_String_88810dfeb4021902,__wbg_buffer_344d9b41efe96da7,__wbg_call_53fc3abd42e24ec8,__wbg_call_669127b9d730c650,__wbg_crypto_58f13aa23ffcb166,__wbg_done_bc26bf4ada718266,__wbg_entries_6d727b73ee02b7ce,__wbg_exec_393fa168a3695345,__wbg_getRandomValues_504510b5564925af,__wbg_getTime_ed6ee333b702f8fc,__wbg_get_2aff440840bb6202,__wbg_get_4a9aa5157afeb382,__wbg_get_94990005bd6ca07c,__wbg_getwithrefkey_5e6d9547403deab8,__wbg_globalThis_17eff828815f7d84,__wbg_global_46f939f6541643c5,__wbg_has_cdf8b85f6e903c80,__wbg_instanceof_ArrayBuffer_c7cc317e5c29cc0d,__wbg_instanceof_Promise_cfbcc42300367513,__wbg_instanceof_Uint8Array_19e6f142a5e7e1e1,__wbg_isArray_38525be7442aa21e,__wbg_isSafeInteger_c38b0a16d0c7cef7,__wbg_iterator_7ee1a391d310f8e4,__wbg_length_a5587d6cd79ab197,__wbg_length_cace2e0b3ddc0502,__wbg_msCrypto_abcb1295e768d1f2,__wbg_new0_ad75dd38f92424e2,__wbg_new_00f9fd9cefd9f65c,__wbg_new_08236689f0afb357,__wbg_new_1b94180eeb48f2a2,__wbg_new_c728d68b8b34487e,__wbg_new_d8a000788389a31e,__wbg_new_feb65b865d980ae2,__wbg_newnoargs_ccdcae30fd002262,__wbg_newwithbyteoffsetandlength_2dc04d99088b15e3,__wbg_newwithlength_13b5319ab422dcf6,__wbg_next_15da6a3df9290720,__wbg_next_1989a20442400aaa,__wbg_node_523d7bd03ef69fba,__wbg_now_28a6b413aca4a96a,__wbg_now_4579335d3581594c,__wbg_now_8ed1a4454e40ecd1,__wbg_parse_3f0cb48976ca4123,__wbg_process_5b786e71d465a513,__wbg_push_fd3233d09cf81821,__wbg_randomFillSync_a0d98aa11c81fe89,__wbg_require_2784e593a4674877,__wbg_resolve_a3252b2860f0a09e,__wbg_self_3fad056edded10bd,__wbg_setTimeout_631fe61f31fa2fad,__wbg_set_0ac78a2bc07da03c,__wbg_set_3355b9f2d3092e3b,__wbg_set_40f7786a25a9cc7e,__wbg_set_841ac57cff3d672b,__wbg_set_dcfd613a3420f908,__wbg_set_wasm,__wbg_stringify_4039297315a25b00,__wbg_subarray_6ca5cfa7fbb9abbe,__wbg_then_1bbc9edafd859b06,__wbg_then_89e1c559530b85cf,__wbg_valueOf_ff4b62641803432a,__wbg_value_0570714ff7d75f35,__wbg_versions_c2ab80650590b6a2,__wbg_window_a4f46c98a61d4089,__wbindgen_bigint_from_i64,__wbindgen_bigint_from_u64,__wbindgen_bigint_get_as_i64,__wbindgen_boolean_get,__wbindgen_cb_drop,__wbindgen_closure_wrapper7164,__wbindgen_debug_string,__wbindgen_error_new,__wbindgen_in,__wbindgen_is_bigint,__wbindgen_is_function,__wbindgen_is_object,__wbindgen_is_string,__wbindgen_is_undefined,__wbindgen_jsval_eq,__wbindgen_jsval_loose_eq,__wbindgen_memory,__wbindgen_number_get,__wbindgen_number_new,__wbindgen_object_clone_ref,__wbindgen_object_drop_ref,__wbindgen_string_get,__wbindgen_string_new,__wbindgen_throw,debug_panic,getBuildTimeInfo}); diff --git a/node_modules/@prisma/client/runtime/query_engine_bg.postgresql.wasm b/node_modules/@prisma/client/runtime/query_engine_bg.postgresql.wasm deleted file mode 100644 index 4e24751..0000000 Binary files a/node_modules/@prisma/client/runtime/query_engine_bg.postgresql.wasm and /dev/null differ diff --git a/node_modules/@prisma/client/runtime/query_engine_bg.sqlite.js b/node_modules/@prisma/client/runtime/query_engine_bg.sqlite.js deleted file mode 100644 index e44c7a7..0000000 --- a/node_modules/@prisma/client/runtime/query_engine_bg.sqlite.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";var F=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var D=(n,t)=>{for(var e in t)F(n,e,{get:t[e],enumerable:!0})},N=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let _ of B(t))!U.call(n,_)&&_!==e&&F(n,_,{get:()=>t[_],enumerable:!(o=R(t,_))||o.enumerable});return n};var C=n=>N(F({},"__esModule",{value:!0}),n);var Et={};D(Et,{QueryEngine:()=>Z,__wbg_String_88810dfeb4021902:()=>Dn,__wbg_buffer_344d9b41efe96da7:()=>Cn,__wbg_call_53fc3abd42e24ec8:()=>gt,__wbg_call_669127b9d730c650:()=>Zn,__wbg_crypto_58f13aa23ffcb166:()=>Jn,__wbg_done_bc26bf4ada718266:()=>rt,__wbg_entries_6d727b73ee02b7ce:()=>At,__wbg_getRandomValues_504510b5564925af:()=>Wn,__wbg_getTime_ed6ee333b702f8fc:()=>an,__wbg_get_2aff440840bb6202:()=>ct,__wbg_get_4a9aa5157afeb382:()=>nt,__wbg_get_94990005bd6ca07c:()=>Un,__wbg_getwithrefkey_5e6d9547403deab8:()=>Rn,__wbg_globalThis_17eff828815f7d84:()=>st,__wbg_global_46f939f6541643c5:()=>ft,__wbg_has_cdf8b85f6e903c80:()=>un,__wbg_instanceof_ArrayBuffer_c7cc317e5c29cc0d:()=>Tt,__wbg_instanceof_Promise_cfbcc42300367513:()=>dn,__wbg_instanceof_Uint8Array_19e6f142a5e7e1e1:()=>ht,__wbg_isArray_38525be7442aa21e:()=>bt,__wbg_isSafeInteger_c38b0a16d0c7cef7:()=>lt,__wbg_iterator_7ee1a391d310f8e4:()=>yn,__wbg_length_a5587d6cd79ab197:()=>yt,__wbg_length_cace2e0b3ddc0502:()=>pn,__wbg_msCrypto_abcb1295e768d1f2:()=>Kn,__wbg_new0_ad75dd38f92424e2:()=>fn,__wbg_new_08236689f0afb357:()=>qn,__wbg_new_1b94180eeb48f2a2:()=>In,__wbg_new_c728d68b8b34487e:()=>kn,__wbg_new_d8a000788389a31e:()=>$n,__wbg_new_feb65b865d980ae2:()=>en,__wbg_newnoargs_ccdcae30fd002262:()=>at,__wbg_newwithbyteoffsetandlength_2dc04d99088b15e3:()=>Ln,__wbg_newwithlength_13b5319ab422dcf6:()=>Xn,__wbg_next_15da6a3df9290720:()=>_t,__wbg_next_1989a20442400aaa:()=>et,__wbg_node_523d7bd03ef69fba:()=>Hn,__wbg_now_28a6b413aca4a96a:()=>xt,__wbg_now_4579335d3581594c:()=>gn,__wbg_now_8ed1a4454e40ecd1:()=>bn,__wbg_parse_3f0cb48976ca4123:()=>sn,__wbg_process_5b786e71d465a513:()=>Vn,__wbg_push_fd3233d09cf81821:()=>Bn,__wbg_randomFillSync_a0d98aa11c81fe89:()=>zn,__wbg_require_2784e593a4674877:()=>Gn,__wbg_resolve_a3252b2860f0a09e:()=>kt,__wbg_self_3fad056edded10bd:()=>it,__wbg_setTimeout_631fe61f31fa2fad:()=>rn,__wbg_set_0ac78a2bc07da03c:()=>Fn,__wbg_set_3355b9f2d3092e3b:()=>vn,__wbg_set_40f7786a25a9cc7e:()=>dt,__wbg_set_841ac57cff3d672b:()=>Mn,__wbg_set_dcfd613a3420f908:()=>pt,__wbg_set_wasm:()=>L,__wbg_stringify_4039297315a25b00:()=>wt,__wbg_subarray_6ca5cfa7fbb9abbe:()=>Pn,__wbg_then_1bbc9edafd859b06:()=>It,__wbg_then_89e1c559530b85cf:()=>Ft,__wbg_valueOf_ff4b62641803432a:()=>tt,__wbg_value_0570714ff7d75f35:()=>ot,__wbg_versions_c2ab80650590b6a2:()=>Qn,__wbg_window_a4f46c98a61d4089:()=>ut,__wbindgen_bigint_from_i64:()=>Tn,__wbindgen_bigint_from_u64:()=>Sn,__wbindgen_bigint_get_as_i64:()=>St,__wbindgen_boolean_get:()=>xn,__wbindgen_cb_drop:()=>qt,__wbindgen_closure_wrapper6830:()=>vt,__wbindgen_debug_string:()=>jt,__wbindgen_error_new:()=>tn,__wbindgen_in:()=>An,__wbindgen_is_bigint:()=>mn,__wbindgen_is_function:()=>Yn,__wbindgen_is_object:()=>ln,__wbindgen_is_string:()=>En,__wbindgen_is_undefined:()=>cn,__wbindgen_jsval_eq:()=>jn,__wbindgen_jsval_loose_eq:()=>mt,__wbindgen_memory:()=>Nn,__wbindgen_number_get:()=>hn,__wbindgen_number_new:()=>On,__wbindgen_object_clone_ref:()=>_n,__wbindgen_object_drop_ref:()=>wn,__wbindgen_string_get:()=>nn,__wbindgen_string_new:()=>on,__wbindgen_throw:()=>Ot,debug_panic:()=>K,getBuildTimeInfo:()=>G});module.exports=C(Et);var h=()=>{};h.prototype=h;let c;function L(n){c=n}const w=new Array(128).fill(void 0);w.push(void 0,null,!0,!1);function r(n){return w[n]}let a=0,T=null;function A(){return(T===null||T.byteLength===0)&&(T=new Uint8Array(c.memory.buffer)),T}const $=typeof TextEncoder>"u"?(0,module.require)("util").TextEncoder:TextEncoder;let S=new $("utf-8");const z=typeof S.encodeInto=="function"?function(n,t){return S.encodeInto(n,t)}:function(n,t){const e=S.encode(n);return t.set(e),{read:n.length,written:e.length}};function l(n,t,e){if(e===void 0){const s=S.encode(n),p=t(s.length,1)>>>0;return A().subarray(p,p+s.length).set(s),a=s.length,p}let o=n.length,_=t(o,1)>>>0;const f=A();let u=0;for(;u127)break;f[_+u]=s}if(u!==o){u!==0&&(n=n.slice(u)),_=e(_,o,o=u+n.length*3,1)>>>0;const s=A().subarray(_+u,_+o),p=z(n,s);u+=p.written,_=e(_,o,u,1)>>>0}return a=u,_}function y(n){return n==null}let j=null;function d(){return(j===null||j.byteLength===0)&&(j=new Int32Array(c.memory.buffer)),j}const P=typeof TextDecoder>"u"?(0,module.require)("util").TextDecoder:TextDecoder;let k=new P("utf-8",{ignoreBOM:!0,fatal:!0});k.decode();function x(n,t){return n=n>>>0,k.decode(A().subarray(n,n+t))}let m=w.length;function i(n){m===w.length&&w.push(w.length+1);const t=m;return m=w[t],w[t]=n,t}function W(n){n<132||(w[n]=m,m=n)}function b(n){const t=r(n);return W(n),t}let O=null;function J(){return(O===null||O.byteLength===0)&&(O=new Float64Array(c.memory.buffer)),O}let q=null;function V(){return(q===null||q.byteLength===0)&&(q=new BigInt64Array(c.memory.buffer)),q}function I(n){const t=typeof n;if(t=="number"||t=="boolean"||n==null)return`${n}`;if(t=="string")return`"${n}"`;if(t=="symbol"){const _=n.description;return _==null?"Symbol":`Symbol(${_})`}if(t=="function"){const _=n.name;return typeof _=="string"&&_.length>0?`Function(${_})`:"Function"}if(Array.isArray(n)){const _=n.length;let f="[";_>0&&(f+=I(n[0]));for(let u=1;u<_;u++)f+=", "+I(n[u]);return f+="]",f}const e=/\[object ([^\]]+)\]/.exec(toString.call(n));let o;if(e.length>1)o=e[1];else return toString.call(n);if(o=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} -${n.stack}`:o}const v=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>{c.__wbindgen_export_2.get(n.dtor)(n.a,n.b)});function Q(n,t,e,o){const _={a:n,b:t,cnt:1,dtor:e},f=(...u)=>{_.cnt++;const s=_.a;_.a=0;try{return o(s,_.b,...u)}finally{--_.cnt===0?(c.__wbindgen_export_2.get(_.dtor)(s,_.b),v.unregister(_)):_.a=s}};return f.original=_,v.register(f,_,_),f}function H(n,t,e){c._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1d1ce90a2538b281(n,t,i(e))}function G(){const n=c.getBuildTimeInfo();return b(n)}function K(n){try{const f=c.__wbindgen_add_to_stack_pointer(-16);var t=y(n)?0:l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),e=a;c.debug_panic(f,t,e);var o=d()[f/4+0],_=d()[f/4+1];if(_)throw b(o)}finally{c.__wbindgen_add_to_stack_pointer(16)}}function g(n,t){try{return n.apply(this,t)}catch(e){c.__wbindgen_exn_store(i(e))}}function X(n,t,e,o){c.wasm_bindgen__convert__closures__invoke2_mut__h46a92896c95d64ae(n,t,i(e),i(o))}const Y=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>c.__wbg_queryengine_free(n>>>0));class Z{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Y.unregister(this),t}free(){const t=this.__destroy_into_raw();c.__wbg_queryengine_free(t)}constructor(t,e,o){try{const s=c.__wbindgen_add_to_stack_pointer(-16);c.queryengine_new(s,i(t),i(e),i(o));var _=d()[s/4+0],f=d()[s/4+1],u=d()[s/4+2];if(u)throw b(f);return this.__wbg_ptr=_>>>0,this}finally{c.__wbindgen_add_to_stack_pointer(16)}}connect(t){const e=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),o=a,_=c.queryengine_connect(this.__wbg_ptr,e,o);return b(_)}disconnect(t){const e=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),o=a,_=c.queryengine_disconnect(this.__wbg_ptr,e,o);return b(_)}query(t,e,o){const _=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),f=a,u=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),s=a;var p=y(o)?0:l(o,c.__wbindgen_malloc,c.__wbindgen_realloc),E=a;const M=c.queryengine_query(this.__wbg_ptr,_,f,u,s,p,E);return b(M)}startTransaction(t,e){const o=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a,f=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),u=a,s=c.queryengine_startTransaction(this.__wbg_ptr,o,_,f,u);return b(s)}commitTransaction(t,e){const o=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a,f=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),u=a,s=c.queryengine_commitTransaction(this.__wbg_ptr,o,_,f,u);return b(s)}rollbackTransaction(t,e){const o=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a,f=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),u=a,s=c.queryengine_rollbackTransaction(this.__wbg_ptr,o,_,f,u);return b(s)}metrics(t){const e=l(t,c.__wbindgen_malloc,c.__wbindgen_realloc),o=a,_=c.queryengine_metrics(this.__wbg_ptr,e,o);return b(_)}}function nn(n,t){const e=r(t),o=typeof e=="string"?e:void 0;var _=y(o)?0:l(o,c.__wbindgen_malloc,c.__wbindgen_realloc),f=a;d()[n/4+1]=f,d()[n/4+0]=_}function tn(n,t){const e=new Error(x(n,t));return i(e)}function en(n,t){try{var e={a:n,b:t},o=(f,u)=>{const s=e.a;e.a=0;try{return X(s,e.b,f,u)}finally{e.a=s}};const _=new Promise(o);return i(_)}finally{e.a=e.b=0}}function rn(n,t){return setTimeout(r(n),t>>>0)}function on(n,t){const e=x(n,t);return i(e)}function _n(n){const t=r(n);return i(t)}function cn(n){return r(n)===void 0}function un(){return g(function(n,t){return Reflect.has(r(n),r(t))},arguments)}function sn(){return g(function(n,t){const e=JSON.parse(x(n,t));return i(e)},arguments)}function fn(){return i(new Date)}function an(n){return r(n).getTime()}function bn(n){return r(n).now()}function gn(){return Date.now()}function ln(n){const t=r(n);return typeof t=="object"&&t!==null}function dn(n){let t;try{t=r(n)instanceof Promise}catch{t=!1}return t}function wn(n){b(n)}function pn(n){return r(n).length}function yn(){return i(Symbol.iterator)}function xn(n){const t=r(n);return typeof t=="boolean"?t?1:0:2}function mn(n){return typeof r(n)=="bigint"}function hn(n,t){const e=r(t),o=typeof e=="number"?e:void 0;J()[n/8+1]=y(o)?0:o,d()[n/4+0]=!y(o)}function Tn(n){return i(n)}function An(n,t){return r(n)in r(t)}function Sn(n){const t=BigInt.asUintN(64,n);return i(t)}function jn(n,t){return r(n)===r(t)}function On(n){return i(n)}function qn(){const n=new Array;return i(n)}function Fn(n,t,e){r(n)[t>>>0]=b(e)}function In(){return i(new Map)}function kn(){const n=new Object;return i(n)}function vn(n,t,e){const o=r(n).set(r(t),r(e));return i(o)}function En(n){return typeof r(n)=="string"}function Mn(n,t,e){r(n)[b(t)]=b(e)}function Rn(n,t){const e=r(n)[r(t)];return i(e)}function Bn(n,t){return r(n).push(r(t))}function Un(){return g(function(n,t){const e=r(n)[b(t)];return i(e)},arguments)}function Dn(n,t){const e=String(r(t)),o=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a;d()[n/4+1]=_,d()[n/4+0]=o}function Nn(){const n=c.memory;return i(n)}function Cn(n){const t=r(n).buffer;return i(t)}function Ln(n,t,e){const o=new Uint8Array(r(n),t>>>0,e>>>0);return i(o)}function $n(n){const t=new Uint8Array(r(n));return i(t)}function zn(){return g(function(n,t){r(n).randomFillSync(b(t))},arguments)}function Pn(n,t,e){const o=r(n).subarray(t>>>0,e>>>0);return i(o)}function Wn(){return g(function(n,t){r(n).getRandomValues(r(t))},arguments)}function Jn(n){const t=r(n).crypto;return i(t)}function Vn(n){const t=r(n).process;return i(t)}function Qn(n){const t=r(n).versions;return i(t)}function Hn(n){const t=r(n).node;return i(t)}function Gn(){return g(function(){const n=module.require;return i(n)},arguments)}function Kn(n){const t=r(n).msCrypto;return i(t)}function Xn(n){const t=new Uint8Array(n>>>0);return i(t)}function Yn(n){return typeof r(n)=="function"}function Zn(){return g(function(n,t){const e=r(n).call(r(t));return i(e)},arguments)}function nt(n,t){const e=r(n)[t>>>0];return i(e)}function tt(n){return r(n).valueOf()}function et(){return g(function(n){const t=r(n).next();return i(t)},arguments)}function rt(n){return r(n).done}function ot(n){const t=r(n).value;return i(t)}function _t(n){const t=r(n).next;return i(t)}function ct(){return g(function(n,t){const e=Reflect.get(r(n),r(t));return i(e)},arguments)}function it(){return g(function(){const n=self.self;return i(n)},arguments)}function ut(){return g(function(){const n=window.window;return i(n)},arguments)}function st(){return g(function(){const n=globalThis.globalThis;return i(n)},arguments)}function ft(){return g(function(){const n=global.global;return i(n)},arguments)}function at(n,t){const e=new h(x(n,t));return i(e)}function bt(n){return Array.isArray(r(n))}function gt(){return g(function(n,t,e){const o=r(n).call(r(t),r(e));return i(o)},arguments)}function lt(n){return Number.isSafeInteger(r(n))}function dt(){return g(function(n,t,e){return Reflect.set(r(n),r(t),r(e))},arguments)}function wt(){return g(function(n){const t=JSON.stringify(r(n));return i(t)},arguments)}function pt(n,t,e){r(n).set(r(t),e>>>0)}function yt(n){return r(n).length}function xt(){return g(function(){return Date.now()},arguments)}function mt(n,t){return r(n)==r(t)}function ht(n){let t;try{t=r(n)instanceof Uint8Array}catch{t=!1}return t}function Tt(n){let t;try{t=r(n)instanceof ArrayBuffer}catch{t=!1}return t}function At(n){const t=Object.entries(r(n));return i(t)}function St(n,t){const e=r(t),o=typeof e=="bigint"?e:void 0;V()[n/8+1]=y(o)?BigInt(0):o,d()[n/4+0]=!y(o)}function jt(n,t){const e=I(r(t)),o=l(e,c.__wbindgen_malloc,c.__wbindgen_realloc),_=a;d()[n/4+1]=_,d()[n/4+0]=o}function Ot(n,t){throw new Error(x(n,t))}function qt(n){const t=b(n).original;return t.cnt--==1?(t.a=0,!0):!1}function Ft(n,t){const e=r(n).then(r(t));return i(e)}function It(n,t,e){const o=r(n).then(r(t),r(e));return i(o)}function kt(n){const t=Promise.resolve(r(n));return i(t)}function vt(n,t,e){const o=Q(n,t,315,H);return i(o)}0&&(module.exports={QueryEngine,__wbg_String_88810dfeb4021902,__wbg_buffer_344d9b41efe96da7,__wbg_call_53fc3abd42e24ec8,__wbg_call_669127b9d730c650,__wbg_crypto_58f13aa23ffcb166,__wbg_done_bc26bf4ada718266,__wbg_entries_6d727b73ee02b7ce,__wbg_getRandomValues_504510b5564925af,__wbg_getTime_ed6ee333b702f8fc,__wbg_get_2aff440840bb6202,__wbg_get_4a9aa5157afeb382,__wbg_get_94990005bd6ca07c,__wbg_getwithrefkey_5e6d9547403deab8,__wbg_globalThis_17eff828815f7d84,__wbg_global_46f939f6541643c5,__wbg_has_cdf8b85f6e903c80,__wbg_instanceof_ArrayBuffer_c7cc317e5c29cc0d,__wbg_instanceof_Promise_cfbcc42300367513,__wbg_instanceof_Uint8Array_19e6f142a5e7e1e1,__wbg_isArray_38525be7442aa21e,__wbg_isSafeInteger_c38b0a16d0c7cef7,__wbg_iterator_7ee1a391d310f8e4,__wbg_length_a5587d6cd79ab197,__wbg_length_cace2e0b3ddc0502,__wbg_msCrypto_abcb1295e768d1f2,__wbg_new0_ad75dd38f92424e2,__wbg_new_08236689f0afb357,__wbg_new_1b94180eeb48f2a2,__wbg_new_c728d68b8b34487e,__wbg_new_d8a000788389a31e,__wbg_new_feb65b865d980ae2,__wbg_newnoargs_ccdcae30fd002262,__wbg_newwithbyteoffsetandlength_2dc04d99088b15e3,__wbg_newwithlength_13b5319ab422dcf6,__wbg_next_15da6a3df9290720,__wbg_next_1989a20442400aaa,__wbg_node_523d7bd03ef69fba,__wbg_now_28a6b413aca4a96a,__wbg_now_4579335d3581594c,__wbg_now_8ed1a4454e40ecd1,__wbg_parse_3f0cb48976ca4123,__wbg_process_5b786e71d465a513,__wbg_push_fd3233d09cf81821,__wbg_randomFillSync_a0d98aa11c81fe89,__wbg_require_2784e593a4674877,__wbg_resolve_a3252b2860f0a09e,__wbg_self_3fad056edded10bd,__wbg_setTimeout_631fe61f31fa2fad,__wbg_set_0ac78a2bc07da03c,__wbg_set_3355b9f2d3092e3b,__wbg_set_40f7786a25a9cc7e,__wbg_set_841ac57cff3d672b,__wbg_set_dcfd613a3420f908,__wbg_set_wasm,__wbg_stringify_4039297315a25b00,__wbg_subarray_6ca5cfa7fbb9abbe,__wbg_then_1bbc9edafd859b06,__wbg_then_89e1c559530b85cf,__wbg_valueOf_ff4b62641803432a,__wbg_value_0570714ff7d75f35,__wbg_versions_c2ab80650590b6a2,__wbg_window_a4f46c98a61d4089,__wbindgen_bigint_from_i64,__wbindgen_bigint_from_u64,__wbindgen_bigint_get_as_i64,__wbindgen_boolean_get,__wbindgen_cb_drop,__wbindgen_closure_wrapper6830,__wbindgen_debug_string,__wbindgen_error_new,__wbindgen_in,__wbindgen_is_bigint,__wbindgen_is_function,__wbindgen_is_object,__wbindgen_is_string,__wbindgen_is_undefined,__wbindgen_jsval_eq,__wbindgen_jsval_loose_eq,__wbindgen_memory,__wbindgen_number_get,__wbindgen_number_new,__wbindgen_object_clone_ref,__wbindgen_object_drop_ref,__wbindgen_string_get,__wbindgen_string_new,__wbindgen_throw,debug_panic,getBuildTimeInfo}); diff --git a/node_modules/@prisma/client/runtime/query_engine_bg.sqlite.wasm b/node_modules/@prisma/client/runtime/query_engine_bg.sqlite.wasm deleted file mode 100644 index 0ad19d5..0000000 Binary files a/node_modules/@prisma/client/runtime/query_engine_bg.sqlite.wasm and /dev/null differ diff --git a/node_modules/@prisma/client/runtime/react-native.d.ts b/node_modules/@prisma/client/runtime/react-native.d.ts deleted file mode 100644 index be22f30..0000000 --- a/node_modules/@prisma/client/runtime/react-native.d.ts +++ /dev/null @@ -1,3378 +0,0 @@ -/** - * @param this - */ -declare function $extends(this: Client, extension: ExtensionArgs | ((client: Client) => Client)): Client; - -declare type AccelerateEngineConfig = { - inlineSchema: EngineConfig['inlineSchema']; - inlineSchemaHash: EngineConfig['inlineSchemaHash']; - env: EngineConfig['env']; - generator?: { - previewFeatures: string[]; - }; - inlineDatasources: EngineConfig['inlineDatasources']; - overrideDatasources: EngineConfig['overrideDatasources']; - clientVersion: EngineConfig['clientVersion']; - engineVersion: EngineConfig['engineVersion']; - logEmitter: EngineConfig['logEmitter']; - logQueries?: EngineConfig['logQueries']; - logLevel?: EngineConfig['logLevel']; - tracingHelper: EngineConfig['tracingHelper']; - accelerateUtils?: EngineConfig['accelerateUtils']; -}; - -export declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw'; - -declare type ActiveConnectorType = Exclude; - -export declare type Aggregate = '_count' | '_max' | '_min' | '_avg' | '_sum'; - -export declare type AllModelsToStringIndex, K extends PropertyKey> = Args extends { - [P in K]: { - $allModels: infer AllModels; - }; -} ? { - [P in K]: Record; -} : {}; - -declare class AnyNull extends NullTypesEnumValue { -} - -export declare type ApplyOmit = Compute<{ - [K in keyof T as OmitValue extends true ? never : K]: T[K]; -}>; - -export declare type Args = T extends { - [K: symbol]: { - types: { - operations: { - [K in F]: { - args: any; - }; - }; - }; - }; -} ? T[symbol]['types']['operations'][F]['args'] : any; - -export declare type Args_3 = Args; - -/** - * Original `quaint::ValueType` enum tag from Prisma's `quaint`. - * Query arguments marked with this type are sanitized before being sent to the database. - * Notice while a query argument may be `null`, `ArgType` is guaranteed to be defined. - */ -declare type ArgType = 'Int32' | 'Int64' | 'Float' | 'Double' | 'Text' | 'Enum' | 'EnumArray' | 'Bytes' | 'Boolean' | 'Char' | 'Array' | 'Numeric' | 'Json' | 'Xml' | 'Uuid' | 'DateTime' | 'Date' | 'Time'; - -/** - * Attributes is a map from string to attribute values. - * - * Note: only the own enumerable keys are counted as valid attribute keys. - */ -declare interface Attributes { - [attributeKey: string]: AttributeValue | undefined; -} - -/** - * Attribute values may be any non-nullish primitive value except an object. - * - * null or undefined attribute values are invalid and will result in undefined behavior. - */ -declare type AttributeValue = string | number | boolean | Array | Array | Array; - -export declare type BaseDMMF = { - readonly datamodel: Omit; -}; - -declare type BatchArgs = { - queries: BatchQuery[]; - transaction?: { - isolationLevel?: IsolationLevel; - }; -}; - -declare type BatchInternalParams = { - requests: RequestParams[]; - customDataProxyFetch?: CustomDataProxyFetch; -}; - -declare type BatchQuery = { - model: string | undefined; - operation: string; - args: JsArgs | RawQueryArgs; -}; - -declare type BatchQueryEngineResult = QueryEngineResult | Error; - -declare type BatchQueryOptionsCb = (args: BatchQueryOptionsCbArgs) => Promise; - -declare type BatchQueryOptionsCbArgs = { - args: BatchArgs; - query: (args: BatchArgs, __internalParams?: BatchInternalParams) => Promise; - __internalParams: BatchInternalParams; -}; - -declare type BatchTransactionOptions = { - isolationLevel?: Transaction_2.IsolationLevel; -}; - -declare interface BinaryTargetsEnvValue { - fromEnvVar: string | null; - value: string; - native?: boolean; -} - -export declare type Call = (F & { - params: P; -})['returns']; - -declare interface CallSite { - getLocation(): LocationInFile | null; -} - -export declare type Cast = A extends W ? A : W; - -declare type Client = ReturnType extends new () => infer T ? T : never; - -export declare type ClientArg = { - [MethodName in string]: unknown; -}; - -export declare type ClientArgs = { - client: ClientArg; -}; - -export declare type ClientBuiltInProp = keyof DynamicClientExtensionThisBuiltin; - -export declare type ClientOptionDef = undefined | { - [K in string]: any; -}; - -export declare type ClientOtherOps = { - $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise; - $queryRawTyped(query: TypedSql): PrismaPromise; - $queryRawUnsafe(query: string, ...values: any[]): PrismaPromise; - $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise; - $executeRawUnsafe(query: string, ...values: any[]): PrismaPromise; - $runCommandRaw(command: InputJsonObject): PrismaPromise; -}; - -declare type ColumnType = (typeof ColumnTypeEnum)[keyof typeof ColumnTypeEnum]; - -declare const ColumnTypeEnum: { - readonly Int32: 0; - readonly Int64: 1; - readonly Float: 2; - readonly Double: 3; - readonly Numeric: 4; - readonly Boolean: 5; - readonly Character: 6; - readonly Text: 7; - readonly Date: 8; - readonly Time: 9; - readonly DateTime: 10; - readonly Json: 11; - readonly Enum: 12; - readonly Bytes: 13; - readonly Set: 14; - readonly Uuid: 15; - readonly Int32Array: 64; - readonly Int64Array: 65; - readonly FloatArray: 66; - readonly DoubleArray: 67; - readonly NumericArray: 68; - readonly BooleanArray: 69; - readonly CharacterArray: 70; - readonly TextArray: 71; - readonly DateArray: 72; - readonly TimeArray: 73; - readonly DateTimeArray: 74; - readonly JsonArray: 75; - readonly EnumArray: 76; - readonly BytesArray: 77; - readonly UuidArray: 78; - readonly UnknownNumber: 128; -}; - -export declare type Compute = T extends Function ? T : { - [K in keyof T]: T[K]; -} & unknown; - -export declare type ComputeDeep = T extends Function ? T : { - [K in keyof T]: ComputeDeep; -} & unknown; - -declare type ComputedField = { - name: string; - needs: string[]; - compute: ResultArgsFieldCompute; -}; - -declare type ComputedFieldsMap = { - [fieldName: string]: ComputedField; -}; - -declare type ConnectionInfo = { - schemaName?: string; - maxBindValues?: number; -}; - -declare type ConnectorType = 'mysql' | 'mongodb' | 'sqlite' | 'postgresql' | 'postgres' | 'sqlserver' | 'cockroachdb'; - -declare interface Context { - /** - * Get a value from the context. - * - * @param key key which identifies a context value - */ - getValue(key: symbol): unknown; - /** - * Create a new context which inherits from this context and has - * the given key set to the given value. - * - * @param key context key for which to set the value - * @param value value to set for the given key - */ - setValue(key: symbol, value: unknown): Context; - /** - * Return a new context which inherits from this context but does - * not contain a value for the given key. - * - * @param key context key for which to clear a value - */ - deleteValue(key: symbol): Context; -} - -declare type Context_2 = T extends { - [K: symbol]: { - ctx: infer C; - }; -} ? C & T & { - /** - * @deprecated Use `$name` instead. - */ - name?: string; - $name?: string; - $parent?: unknown; -} : T & { - /** - * @deprecated Use `$name` instead. - */ - name?: string; - $name?: string; - $parent?: unknown; -}; - -export declare type Count = { - [K in keyof O]: Count; -} & {}; - -declare type CustomDataProxyFetch = (fetch: Fetch) => Fetch; - -declare class DataLoader { - private options; - batches: { - [key: string]: Job[]; - }; - private tickActive; - constructor(options: DataLoaderOptions); - request(request: T): Promise; - private dispatchBatches; - get [Symbol.toStringTag](): string; -} - -declare type DataLoaderOptions = { - singleLoader: (request: T) => Promise; - batchLoader: (request: T[]) => Promise; - batchBy: (request: T) => string | undefined; - batchOrder: (requestA: T, requestB: T) => number; -}; - -declare type Datasource = { - url?: string; -}; - -declare type Datasources = { - [name in string]: Datasource; -}; - -declare class DbNull extends NullTypesEnumValue { -} - -export declare const Debug: typeof debugCreate & { - enable(namespace: any): void; - disable(): any; - enabled(namespace: string): boolean; - log: (...args: string[]) => void; - formatters: {}; -}; - -/** - * Create a new debug instance with the given namespace. - * - * @example - * ```ts - * import Debug from '@prisma/debug' - * const debug = Debug('prisma:client') - * debug('Hello World') - * ``` - */ -declare function debugCreate(namespace: string): ((...args: any[]) => void) & { - color: string; - enabled: boolean; - namespace: string; - log: (...args: string[]) => void; - extend: () => void; -}; - -export declare namespace Decimal { - export type Constructor = typeof Decimal; - export type Instance = Decimal; - export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - export type Modulo = Rounding | 9; - export type Value = string | number | Decimal; - - // http://mikemcl.github.io/decimal.js/#constructor-properties - export interface Config { - precision?: number; - rounding?: Rounding; - toExpNeg?: number; - toExpPos?: number; - minE?: number; - maxE?: number; - crypto?: boolean; - modulo?: Modulo; - defaults?: boolean; - } -} - -export declare class Decimal { - readonly d: number[]; - readonly e: number; - readonly s: number; - - constructor(n: Decimal.Value); - - absoluteValue(): Decimal; - abs(): Decimal; - - ceil(): Decimal; - - clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; - clamp(min: Decimal.Value, max: Decimal.Value): Decimal; - - comparedTo(n: Decimal.Value): number; - cmp(n: Decimal.Value): number; - - cosine(): Decimal; - cos(): Decimal; - - cubeRoot(): Decimal; - cbrt(): Decimal; - - decimalPlaces(): number; - dp(): number; - - dividedBy(n: Decimal.Value): Decimal; - div(n: Decimal.Value): Decimal; - - dividedToIntegerBy(n: Decimal.Value): Decimal; - divToInt(n: Decimal.Value): Decimal; - - equals(n: Decimal.Value): boolean; - eq(n: Decimal.Value): boolean; - - floor(): Decimal; - - greaterThan(n: Decimal.Value): boolean; - gt(n: Decimal.Value): boolean; - - greaterThanOrEqualTo(n: Decimal.Value): boolean; - gte(n: Decimal.Value): boolean; - - hyperbolicCosine(): Decimal; - cosh(): Decimal; - - hyperbolicSine(): Decimal; - sinh(): Decimal; - - hyperbolicTangent(): Decimal; - tanh(): Decimal; - - inverseCosine(): Decimal; - acos(): Decimal; - - inverseHyperbolicCosine(): Decimal; - acosh(): Decimal; - - inverseHyperbolicSine(): Decimal; - asinh(): Decimal; - - inverseHyperbolicTangent(): Decimal; - atanh(): Decimal; - - inverseSine(): Decimal; - asin(): Decimal; - - inverseTangent(): Decimal; - atan(): Decimal; - - isFinite(): boolean; - - isInteger(): boolean; - isInt(): boolean; - - isNaN(): boolean; - - isNegative(): boolean; - isNeg(): boolean; - - isPositive(): boolean; - isPos(): boolean; - - isZero(): boolean; - - lessThan(n: Decimal.Value): boolean; - lt(n: Decimal.Value): boolean; - - lessThanOrEqualTo(n: Decimal.Value): boolean; - lte(n: Decimal.Value): boolean; - - logarithm(n?: Decimal.Value): Decimal; - log(n?: Decimal.Value): Decimal; - - minus(n: Decimal.Value): Decimal; - sub(n: Decimal.Value): Decimal; - - modulo(n: Decimal.Value): Decimal; - mod(n: Decimal.Value): Decimal; - - naturalExponential(): Decimal; - exp(): Decimal; - - naturalLogarithm(): Decimal; - ln(): Decimal; - - negated(): Decimal; - neg(): Decimal; - - plus(n: Decimal.Value): Decimal; - add(n: Decimal.Value): Decimal; - - precision(includeZeros?: boolean): number; - sd(includeZeros?: boolean): number; - - round(): Decimal; - - sine() : Decimal; - sin() : Decimal; - - squareRoot(): Decimal; - sqrt(): Decimal; - - tangent() : Decimal; - tan() : Decimal; - - times(n: Decimal.Value): Decimal; - mul(n: Decimal.Value) : Decimal; - - toBinary(significantDigits?: number): string; - toBinary(significantDigits: number, rounding: Decimal.Rounding): string; - - toDecimalPlaces(decimalPlaces?: number): Decimal; - toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - toDP(decimalPlaces?: number): Decimal; - toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - - toExponential(decimalPlaces?: number): string; - toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFixed(decimalPlaces?: number): string; - toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFraction(max_denominator?: Decimal.Value): Decimal[]; - - toHexadecimal(significantDigits?: number): string; - toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; - toHex(significantDigits?: number): string; - toHex(significantDigits: number, rounding?: Decimal.Rounding): string; - - toJSON(): string; - - toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; - - toNumber(): number; - - toOctal(significantDigits?: number): string; - toOctal(significantDigits: number, rounding: Decimal.Rounding): string; - - toPower(n: Decimal.Value): Decimal; - pow(n: Decimal.Value): Decimal; - - toPrecision(significantDigits?: number): string; - toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; - - toSignificantDigits(significantDigits?: number): Decimal; - toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; - toSD(significantDigits?: number): Decimal; - toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; - - toString(): string; - - truncated(): Decimal; - trunc(): Decimal; - - valueOf(): string; - - static abs(n: Decimal.Value): Decimal; - static acos(n: Decimal.Value): Decimal; - static acosh(n: Decimal.Value): Decimal; - static add(x: Decimal.Value, y: Decimal.Value): Decimal; - static asin(n: Decimal.Value): Decimal; - static asinh(n: Decimal.Value): Decimal; - static atan(n: Decimal.Value): Decimal; - static atanh(n: Decimal.Value): Decimal; - static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; - static cbrt(n: Decimal.Value): Decimal; - static ceil(n: Decimal.Value): Decimal; - static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; - static clone(object?: Decimal.Config): Decimal.Constructor; - static config(object: Decimal.Config): Decimal.Constructor; - static cos(n: Decimal.Value): Decimal; - static cosh(n: Decimal.Value): Decimal; - static div(x: Decimal.Value, y: Decimal.Value): Decimal; - static exp(n: Decimal.Value): Decimal; - static floor(n: Decimal.Value): Decimal; - static hypot(...n: Decimal.Value[]): Decimal; - static isDecimal(object: any): object is Decimal; - static ln(n: Decimal.Value): Decimal; - static log(n: Decimal.Value, base?: Decimal.Value): Decimal; - static log2(n: Decimal.Value): Decimal; - static log10(n: Decimal.Value): Decimal; - static max(...n: Decimal.Value[]): Decimal; - static min(...n: Decimal.Value[]): Decimal; - static mod(x: Decimal.Value, y: Decimal.Value): Decimal; - static mul(x: Decimal.Value, y: Decimal.Value): Decimal; - static noConflict(): Decimal.Constructor; // Browser only - static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; - static random(significantDigits?: number): Decimal; - static round(n: Decimal.Value): Decimal; - static set(object: Decimal.Config): Decimal.Constructor; - static sign(n: Decimal.Value): number; - static sin(n: Decimal.Value): Decimal; - static sinh(n: Decimal.Value): Decimal; - static sqrt(n: Decimal.Value): Decimal; - static sub(x: Decimal.Value, y: Decimal.Value): Decimal; - static sum(...n: Decimal.Value[]): Decimal; - static tan(n: Decimal.Value): Decimal; - static tanh(n: Decimal.Value): Decimal; - static trunc(n: Decimal.Value): Decimal; - - static readonly default?: Decimal.Constructor; - static readonly Decimal?: Decimal.Constructor; - - static readonly precision: number; - static readonly rounding: Decimal.Rounding; - static readonly toExpNeg: number; - static readonly toExpPos: number; - static readonly minE: number; - static readonly maxE: number; - static readonly crypto: boolean; - static readonly modulo: Decimal.Modulo; - - static readonly ROUND_UP: 0; - static readonly ROUND_DOWN: 1; - static readonly ROUND_CEIL: 2; - static readonly ROUND_FLOOR: 3; - static readonly ROUND_HALF_UP: 4; - static readonly ROUND_HALF_DOWN: 5; - static readonly ROUND_HALF_EVEN: 6; - static readonly ROUND_HALF_CEIL: 7; - static readonly ROUND_HALF_FLOOR: 8; - static readonly EUCLID: 9; -} - -/** - * Interface for any Decimal.js-like library - * Allows us to accept Decimal.js from different - * versions and some compatible alternatives - */ -export declare interface DecimalJsLike { - d: number[]; - e: number; - s: number; - toFixed(): string; -} - -export declare type DefaultArgs = InternalArgs<{}, {}, {}, {}>; - -export declare type DefaultSelection = Args extends { - omit: infer LocalOmit; -} ? ApplyOmit['default'], PatchFlat>>> : ApplyOmit['default'], ExtractGlobalOmit>>; - -export declare function defineDmmfProperty(target: object, runtimeDataModel: RuntimeDataModel): void; - -declare function defineExtension(ext: ExtensionArgs | ((client: Client) => Client)): (client: Client) => Client; - -declare const denylist: readonly ["$connect", "$disconnect", "$on", "$transaction", "$use", "$extends"]; - -export declare type DevTypeMapDef = { - meta: { - modelProps: string; - }; - model: { - [Model in PropertyKey]: { - [Operation in PropertyKey]: DevTypeMapFnDef; - }; - }; - other: { - [Operation in PropertyKey]: DevTypeMapFnDef; - }; -}; - -export declare type DevTypeMapFnDef = { - args: any; - result: any; - payload: OperationPayload; -}; - -export declare namespace DMMF { - export type Document = ReadonlyDeep_2<{ - datamodel: Datamodel; - schema: Schema; - mappings: Mappings; - }>; - export type Mappings = ReadonlyDeep_2<{ - modelOperations: ModelMapping[]; - otherOperations: { - read: string[]; - write: string[]; - }; - }>; - export type OtherOperationMappings = ReadonlyDeep_2<{ - read: string[]; - write: string[]; - }>; - export type DatamodelEnum = ReadonlyDeep_2<{ - name: string; - values: EnumValue[]; - dbName?: string | null; - documentation?: string; - }>; - export type SchemaEnum = ReadonlyDeep_2<{ - name: string; - values: string[]; - }>; - export type EnumValue = ReadonlyDeep_2<{ - name: string; - dbName: string | null; - }>; - export type Datamodel = ReadonlyDeep_2<{ - models: Model[]; - enums: DatamodelEnum[]; - types: Model[]; - indexes: Index[]; - }>; - export type uniqueIndex = ReadonlyDeep_2<{ - name: string; - fields: string[]; - }>; - export type PrimaryKey = ReadonlyDeep_2<{ - name: string | null; - fields: string[]; - }>; - export type Model = ReadonlyDeep_2<{ - name: string; - dbName: string | null; - fields: Field[]; - uniqueFields: string[][]; - uniqueIndexes: uniqueIndex[]; - documentation?: string; - primaryKey: PrimaryKey | null; - isGenerated?: boolean; - }>; - export type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported'; - export type FieldNamespace = 'model' | 'prisma'; - export type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes'; - export type Field = ReadonlyDeep_2<{ - kind: FieldKind; - name: string; - isRequired: boolean; - isList: boolean; - isUnique: boolean; - isId: boolean; - isReadOnly: boolean; - isGenerated?: boolean; - isUpdatedAt?: boolean; - /** - * Describes the data type in the same the way it is defined in the Prisma schema: - * BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName - */ - type: string; - dbName?: string | null; - hasDefaultValue: boolean; - default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[]; - relationFromFields?: string[]; - relationToFields?: string[]; - relationOnDelete?: string; - relationName?: string; - documentation?: string; - }>; - export type FieldDefault = ReadonlyDeep_2<{ - name: string; - args: any[]; - }>; - export type FieldDefaultScalar = string | boolean | number; - export type Index = ReadonlyDeep_2<{ - model: string; - type: IndexType; - isDefinedOnField: boolean; - name?: string; - dbName?: string; - algorithm?: string; - clustered?: boolean; - fields: IndexField[]; - }>; - export type IndexType = 'id' | 'normal' | 'unique' | 'fulltext'; - export type IndexField = ReadonlyDeep_2<{ - name: string; - sortOrder?: SortOrder; - length?: number; - operatorClass?: string; - }>; - export type SortOrder = 'asc' | 'desc'; - export type Schema = ReadonlyDeep_2<{ - rootQueryType?: string; - rootMutationType?: string; - inputObjectTypes: { - model?: InputType[]; - prisma: InputType[]; - }; - outputObjectTypes: { - model: OutputType[]; - prisma: OutputType[]; - }; - enumTypes: { - model?: SchemaEnum[]; - prisma: SchemaEnum[]; - }; - fieldRefTypes: { - prisma?: FieldRefType[]; - }; - }>; - export type Query = ReadonlyDeep_2<{ - name: string; - args: SchemaArg[]; - output: QueryOutput; - }>; - export type QueryOutput = ReadonlyDeep_2<{ - name: string; - isRequired: boolean; - isList: boolean; - }>; - export type TypeRef = { - isList: boolean; - type: string; - location: AllowedLocations; - namespace?: FieldNamespace; - }; - export type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>; - export type SchemaArg = ReadonlyDeep_2<{ - name: string; - comment?: string; - isNullable: boolean; - isRequired: boolean; - inputTypes: InputTypeRef[]; - deprecation?: Deprecation; - }>; - export type OutputType = ReadonlyDeep_2<{ - name: string; - fields: SchemaField[]; - }>; - export type SchemaField = ReadonlyDeep_2<{ - name: string; - isNullable?: boolean; - outputType: OutputTypeRef; - args: SchemaArg[]; - deprecation?: Deprecation; - documentation?: string; - }>; - export type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>; - export type Deprecation = ReadonlyDeep_2<{ - sinceVersion: string; - reason: string; - plannedRemovalVersion?: string; - }>; - export type InputType = ReadonlyDeep_2<{ - name: string; - constraints: { - maxNumFields: number | null; - minNumFields: number | null; - fields?: string[]; - }; - meta?: { - source?: string; - }; - fields: SchemaArg[]; - }>; - export type FieldRefType = ReadonlyDeep_2<{ - name: string; - allowTypes: FieldRefAllowType[]; - fields: SchemaArg[]; - }>; - export type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>; - export type ModelMapping = ReadonlyDeep_2<{ - model: string; - plural: string; - findUnique?: string | null; - findUniqueOrThrow?: string | null; - findFirst?: string | null; - findFirstOrThrow?: string | null; - findMany?: string | null; - create?: string | null; - createMany?: string | null; - createManyAndReturn?: string | null; - update?: string | null; - updateMany?: string | null; - upsert?: string | null; - delete?: string | null; - deleteMany?: string | null; - aggregate?: string | null; - groupBy?: string | null; - count?: string | null; - findRaw?: string | null; - aggregateRaw?: string | null; - }>; - export enum ModelAction { - findUnique = "findUnique", - findUniqueOrThrow = "findUniqueOrThrow", - findFirst = "findFirst", - findFirstOrThrow = "findFirstOrThrow", - findMany = "findMany", - create = "create", - createMany = "createMany", - createManyAndReturn = "createManyAndReturn", - update = "update", - updateMany = "updateMany", - upsert = "upsert", - delete = "delete", - deleteMany = "deleteMany", - groupBy = "groupBy", - count = "count",// TODO: count does not actually exist, why? - aggregate = "aggregate", - findRaw = "findRaw", - aggregateRaw = "aggregateRaw" - } -} - -export declare interface DriverAdapter extends Queryable { - /** - * Starts new transaction. - */ - transactionContext(): Promise>; - /** - * Optional method that returns extra connection info - */ - getConnectionInfo?(): Result_4; -} - -/** Client */ -export declare type DynamicClientExtensionArgs, ClientOptions> = { - [P in keyof C_]: unknown; -} & { - [K: symbol]: { - ctx: Optional, ITXClientDenyList> & { - $parent: Optional, ITXClientDenyList>; - }; - }; -}; - -export declare type DynamicClientExtensionThis, ClientOptions> = { - [P in keyof ExtArgs['client']]: Return; -} & { - [P in Exclude]: DynamicModelExtensionThis, ExtArgs, ClientOptions>; -} & { - [P in Exclude]: P extends keyof ClientOtherOps ? ClientOtherOps[P] : never; -} & { - [P in Exclude]: DynamicClientExtensionThisBuiltin[P]; -} & { - [K: symbol]: { - types: TypeMap['other']; - }; -}; - -export declare type DynamicClientExtensionThisBuiltin, ClientOptions> = { - $extends: ExtendsHook<'extends', TypeMapCb, ExtArgs, Call, ClientOptions>; - $transaction

[]>(arg: [...P], options?: { - isolationLevel?: TypeMap['meta']['txIsolationLevel']; - }): Promise>; - $transaction(fn: (client: Omit, ITXClientDenyList>) => Promise, options?: { - maxWait?: number; - timeout?: number; - isolationLevel?: TypeMap['meta']['txIsolationLevel']; - }): Promise; - $disconnect(): Promise; - $connect(): Promise; -}; - -/** Model */ -export declare type DynamicModelExtensionArgs, ClientOptions> = { - [K in keyof M_]: K extends '$allModels' ? { - [P in keyof M_[K]]?: unknown; - } & { - [K: symbol]: {}; - } : K extends TypeMap['meta']['modelProps'] ? { - [P in keyof M_[K]]?: unknown; - } & { - [K: symbol]: { - ctx: DynamicModelExtensionThis, ExtArgs, ClientOptions> & { - $parent: DynamicClientExtensionThis; - } & { - $name: ModelKey; - } & { - /** - * @deprecated Use `$name` instead. - */ - name: ModelKey; - }; - }; - } : never; -}; - -export declare type DynamicModelExtensionFluentApi = { - [K in keyof TypeMap['model'][M]['payload']['objects']]: (args?: Exact>) => PrismaPromise, [K]> | Null> & DynamicModelExtensionFluentApi, ClientOptions>; -}; - -export declare type DynamicModelExtensionFnResult = P extends FluentOperation ? DynamicModelExtensionFluentApi & PrismaPromise | Null> : PrismaPromise>; - -export declare type DynamicModelExtensionFnResultBase = GetResult; - -export declare type DynamicModelExtensionFnResultNull

= P extends 'findUnique' | 'findFirst' ? null : never; - -export declare type DynamicModelExtensionOperationFn = {} extends TypeMap['model'][M]['operations'][P]['args'] ? (args?: Exact) => DynamicModelExtensionFnResult, ClientOptions> : (args: Exact) => DynamicModelExtensionFnResult, ClientOptions>; - -export declare type DynamicModelExtensionThis, ClientOptions> = { - [P in keyof ExtArgs['model'][Uncapitalize]]: Return][P]>; -} & { - [P in Exclude]>]: DynamicModelExtensionOperationFn; -} & { - [P in Exclude<'fields', keyof ExtArgs['model'][Uncapitalize]>]: TypeMap['model'][M]['fields']; -} & { - [K: symbol]: { - types: TypeMap['model'][M]; - }; -}; - -/** Query */ -export declare type DynamicQueryExtensionArgs = { - [K in keyof Q_]: K extends '$allOperations' ? (args: { - model?: string; - operation: string; - args: any; - query: (args: any) => PrismaPromise; - }) => Promise : K extends '$allModels' ? { - [P in keyof Q_[K] | keyof TypeMap['model'][keyof TypeMap['model']]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb : P extends keyof TypeMap['model'][keyof TypeMap['model']]['operations'] ? DynamicQueryExtensionCb : never; - } : K extends TypeMap['meta']['modelProps'] ? { - [P in keyof Q_[K] | keyof TypeMap['model'][ModelKey]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb, keyof TypeMap['model'][ModelKey]['operations']> : P extends keyof TypeMap['model'][ModelKey]['operations'] ? DynamicQueryExtensionCb, P> : never; - } : K extends keyof TypeMap['other']['operations'] ? DynamicQueryExtensionCb<[TypeMap], 0, 'other', K> : never; -}; - -export declare type DynamicQueryExtensionCb = >(args: A) => Promise; - -export declare type DynamicQueryExtensionCbArgs = (_1 extends unknown ? _2 extends unknown ? { - args: DynamicQueryExtensionCbArgsArgs; - model: _0 extends 0 ? undefined : _1; - operation: _2; - query: >(args: A) => PrismaPromise; -} : never : never) & { - query: (args: DynamicQueryExtensionCbArgsArgs) => PrismaPromise; -}; - -export declare type DynamicQueryExtensionCbArgsArgs = _2 extends '$queryRaw' | '$executeRaw' ? Sql : TypeMap[_0][_1]['operations'][_2]['args']; - -/** Result */ -export declare type DynamicResultExtensionArgs = { - [K in keyof R_]: { - [P in keyof R_[K]]?: { - needs?: DynamicResultExtensionNeeds, R_[K][P]>; - compute(data: DynamicResultExtensionData, R_[K][P]>): any; - }; - }; -}; - -export declare type DynamicResultExtensionData = GetFindResult; - -export declare type DynamicResultExtensionNeeds = { - [K in keyof S]: K extends keyof TypeMap['model'][M]['payload']['scalars'] ? S[K] : never; -} & { - [N in keyof TypeMap['model'][M]['payload']['scalars']]?: boolean; -}; - -/** - * Placeholder value for "no text". - */ -export declare const empty: Sql; - -export declare type EmptyToUnknown = T; - -declare interface Engine { - /** The name of the engine. This is meant to be consumed externally */ - readonly name: string; - onBeforeExit(callback: () => Promise): void; - start(): Promise; - stop(): Promise; - version(forceRun?: boolean): Promise | string; - request(query: JsonQuery, options: RequestOptions_2): Promise>; - requestBatch(queries: JsonQuery[], options: RequestBatchOptions): Promise[]>; - transaction(action: 'start', headers: Transaction_2.TransactionHeaders, options: Transaction_2.Options): Promise>; - transaction(action: 'commit', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo): Promise; - transaction(action: 'rollback', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo): Promise; - metrics(options: MetricsOptionsJson): Promise; - metrics(options: MetricsOptionsPrometheus): Promise; - applyPendingMigrations(): Promise; -} - -declare interface EngineConfig { - cwd: string; - dirname: string; - datamodelPath: string; - enableDebugLogs?: boolean; - allowTriggerPanic?: boolean; - prismaPath?: string; - generator?: GeneratorConfig; - overrideDatasources: Datasources; - showColors?: boolean; - logQueries?: boolean; - logLevel?: 'info' | 'warn'; - env: Record; - flags?: string[]; - clientVersion: string; - engineVersion: string; - previewFeatures?: string[]; - engineEndpoint?: string; - activeProvider?: string; - logEmitter: LogEmitter; - transactionOptions: Transaction_2.Options; - /** - * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`. - * If set, this is only used in the library engine, and all queries would be performed through it, - * rather than Prisma's Rust drivers. - * @remarks only used by LibraryEngine.ts - */ - adapter?: ErrorCapturingDriverAdapter; - /** - * The contents of the schema encoded into a string - * @remarks only used by DataProxyEngine.ts - */ - inlineSchema: string; - /** - * The contents of the datasource url saved in a string - * @remarks only used by DataProxyEngine.ts - */ - inlineDatasources: GetPrismaClientConfig['inlineDatasources']; - /** - * The string hash that was produced for a given schema - * @remarks only used by DataProxyEngine.ts - */ - inlineSchemaHash: string; - /** - * The helper for interaction with OTEL tracing - * @remarks enabling is determined by the client and @prisma/instrumentation package - */ - tracingHelper: TracingHelper; - /** - * Information about whether we have not found a schema.prisma file in the - * default location, and that we fell back to finding the schema.prisma file - * in the current working directory. This usually means it has been bundled. - */ - isBundled?: boolean; - /** - * Web Assembly module loading configuration - */ - engineWasm?: WasmLoadingConfig; - /** - * Allows Accelerate to use runtime utilities from the client. These are - * necessary for the AccelerateEngine to function correctly. - */ - accelerateUtils?: { - resolveDatasourceUrl: typeof resolveDatasourceUrl; - getBatchRequestPayload: typeof getBatchRequestPayload; - prismaGraphQLToJSError: typeof prismaGraphQLToJSError; - PrismaClientUnknownRequestError: typeof PrismaClientUnknownRequestError; - PrismaClientInitializationError: typeof PrismaClientInitializationError; - PrismaClientKnownRequestError: typeof PrismaClientKnownRequestError; - debug: (...args: any[]) => void; - engineVersion: string; - clientVersion: string; - }; -} - -declare type EngineEvent = E extends QueryEventType ? QueryEvent : LogEvent; - -declare type EngineEventType = QueryEventType | LogEventType; - -declare type EngineProtocol = 'graphql' | 'json'; - -declare type EngineSpan = { - span: boolean; - name: string; - trace_id: string; - span_id: string; - parent_span_id: string; - start_time: [number, number]; - end_time: [number, number]; - attributes?: Record; - links?: { - trace_id: string; - span_id: string; - }[]; -}; - -declare type EngineSpanEvent = { - span: boolean; - spans: EngineSpan[]; -}; - -declare type EnvPaths = { - rootEnvPath: string | null; - schemaEnvPath: string | undefined; -}; - -declare interface EnvValue { - fromEnvVar: null | string; - value: null | string; -} - -export declare type Equals = (() => T extends A ? 1 : 2) extends (() => T extends B ? 1 : 2) ? 1 : 0; - -declare type Error_2 = { - kind: 'GenericJs'; - id: number; -} | { - kind: 'UnsupportedNativeDataType'; - type: string; -} | { - kind: 'Postgres'; - code: string; - severity: string; - message: string; - detail: string | undefined; - column: string | undefined; - hint: string | undefined; -} | { - kind: 'Mysql'; - code: number; - message: string; - state: string; -} | { - kind: 'Sqlite'; - /** - * Sqlite extended error code: https://www.sqlite.org/rescode.html - */ - extendedCode: number; - message: string; -}; - -declare interface ErrorCapturingDriverAdapter extends DriverAdapter { - readonly errorRegistry: ErrorRegistry; -} - -declare type ErrorFormat = 'pretty' | 'colorless' | 'minimal'; - -declare type ErrorRecord = { - error: unknown; -}; - -declare interface ErrorRegistry { - consumeError(id: number): ErrorRecord | undefined; -} - -declare interface ErrorWithBatchIndex { - batchRequestIdx?: number; -} - -declare type EventCallback = [E] extends ['beforeExit'] ? () => Promise : [E] extends [LogLevel] ? (event: EngineEvent) => void : never; - -export declare type Exact = (A extends unknown ? (W extends A ? { - [K in keyof A]: Exact; -} : W) : never) | (A extends Narrowable ? A : never); - -/** - * Defines Exception. - * - * string or an object with one of (message or name or code) and optional stack - */ -declare type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string; - -declare interface ExceptionWithCode { - code: string | number; - name?: string; - message?: string; - stack?: string; -} - -declare interface ExceptionWithMessage { - code?: string | number; - message: string; - name?: string; - stack?: string; -} - -declare interface ExceptionWithName { - code?: string | number; - message?: string; - name: string; - stack?: string; -} - -declare type ExtendedEventType = LogLevel | 'beforeExit'; - -declare type ExtendedSpanOptions = SpanOptions & { - /** The name of the span */ - name: string; - internal?: boolean; - middleware?: boolean; - /** Whether it propagates context (?=true) */ - active?: boolean; - /** The context to append the span to */ - context?: Context; -}; - -/** $extends, defineExtension */ -export declare interface ExtendsHook, TypeMap extends TypeMapDef = Call, ClientOptions = {}> { - extArgs: ExtArgs; - , MergedArgs extends InternalArgs = MergeExtArgs>(extension: ((client: DynamicClientExtensionThis) => { - $extends: { - extArgs: Args; - }; - }) | { - name?: string; - query?: DynamicQueryExtensionArgs; - result?: DynamicResultExtensionArgs & R; - model?: DynamicModelExtensionArgs & M; - client?: DynamicClientExtensionArgs & C; - }): { - extends: DynamicClientExtensionThis, TypeMapCb, MergedArgs, ClientOptions>; - define: (client: any) => { - $extends: { - extArgs: Args; - }; - }; - }[Variant]; -} - -export declare type ExtensionArgs = Optional; - -declare namespace Extensions { - export { - defineExtension, - getExtensionContext - } -} -export { Extensions } - -declare namespace Extensions_2 { - export { - InternalArgs, - DefaultArgs, - GetPayloadResultExtensionKeys, - GetPayloadResultExtensionObject, - GetPayloadResult, - GetSelect, - GetOmit, - DynamicQueryExtensionArgs, - DynamicQueryExtensionCb, - DynamicQueryExtensionCbArgs, - DynamicQueryExtensionCbArgsArgs, - DynamicResultExtensionArgs, - DynamicResultExtensionNeeds, - DynamicResultExtensionData, - DynamicModelExtensionArgs, - DynamicModelExtensionThis, - DynamicModelExtensionOperationFn, - DynamicModelExtensionFnResult, - DynamicModelExtensionFnResultBase, - DynamicModelExtensionFluentApi, - DynamicModelExtensionFnResultNull, - DynamicClientExtensionArgs, - DynamicClientExtensionThis, - ClientBuiltInProp, - DynamicClientExtensionThisBuiltin, - ExtendsHook, - MergeExtArgs, - AllModelsToStringIndex, - TypeMapDef, - DevTypeMapDef, - DevTypeMapFnDef, - ClientOptionDef, - ClientOtherOps, - TypeMapCbDef, - ModelKey, - RequiredExtensionArgs as UserArgs - } -} - -export declare type ExtractGlobalOmit = Options extends { - omit: { - [K in ModelName]: infer GlobalOmit; - }; -} ? GlobalOmit : {}; - -declare type Fetch = typeof nodeFetch; - -/** - * A reference to a specific field of a specific model - */ -export declare interface FieldRef { - readonly modelName: Model; - readonly name: string; - readonly typeName: FieldType; - readonly isList: boolean; -} - -export declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete'; - -export declare interface Fn { - params: Params; - returns: Returns; -} - -declare interface GeneratorConfig { - name: string; - output: EnvValue | null; - isCustomOutput?: boolean; - provider: EnvValue; - config: { - /** `output` is a reserved name and will only be available directly at `generator.output` */ - output?: never; - /** `provider` is a reserved name and will only be available directly at `generator.provider` */ - provider?: never; - /** `binaryTargets` is a reserved name and will only be available directly at `generator.binaryTargets` */ - binaryTargets?: never; - /** `previewFeatures` is a reserved name and will only be available directly at `generator.previewFeatures` */ - previewFeatures?: never; - } & { - [key: string]: string | string[] | undefined; - }; - binaryTargets: BinaryTargetsEnvValue[]; - previewFeatures: string[]; - envPaths?: EnvPaths; - sourceFilePath: string; -} - -export declare type GetAggregateResult

= { - [K in keyof A as K extends Aggregate ? K : never]: K extends '_count' ? A[K] extends true ? number : Count : { - [J in keyof A[K] & string]: P['scalars'][J] | null; - }; -}; - -declare function getBatchRequestPayload(batch: JsonQuery[], transaction?: TransactionOptions_2): QueryEngineBatchRequest; - -export declare type GetBatchResult = { - count: number; -}; - -export declare type GetCountResult = A extends { - select: infer S; -} ? (S extends true ? number : Count) : number; - -declare function getExtensionContext(that: T): Context_2; - -export declare type GetFindResult

= Equals extends 1 ? DefaultSelection : A extends { - select: infer S extends object; -} & Record | { - include: infer I extends object; -} & Record ? { - [K in keyof S | keyof I as (S & I)[K] extends false | undefined | Skip | null ? never : K]: (S & I)[K] extends object ? P extends SelectablePayloadFields ? O extends OperationPayload ? GetFindResult[] : never : P extends SelectablePayloadFields ? O extends OperationPayload ? GetFindResult | SelectField & null : never : K extends '_count' ? Count> : never : P extends SelectablePayloadFields ? O extends OperationPayload ? DefaultSelection[] : never : P extends SelectablePayloadFields ? O extends OperationPayload ? DefaultSelection | SelectField & null : never : P extends { - scalars: { - [k in K]: infer O; - }; - } ? O : K extends '_count' ? Count : never; -} & (A extends { - include: any; -} & Record ? DefaultSelection : unknown) : DefaultSelection; - -export declare type GetGroupByResult

= A extends { - by: string[]; -} ? Array & { - [K in A['by'][number]]: P['scalars'][K]; -}> : A extends { - by: string; -} ? Array & { - [K in A['by']]: P['scalars'][K]; -}> : {}[]; - -export declare type GetOmit = { - [K in (string extends keyof R ? never : keyof R) | BaseKeys]?: boolean | ExtraType; -}; - -export declare type GetPayloadResult, R extends InternalArgs['result'][string]> = Omit> & GetPayloadResultExtensionObject; - -export declare type GetPayloadResultExtensionKeys = KR; - -export declare type GetPayloadResultExtensionObject = { - [K in GetPayloadResultExtensionKeys]: R[K] extends () => { - compute: (...args: any) => infer C; - } ? C : never; -}; - -export declare function getPrismaClient(config: GetPrismaClientConfig): { - new (optionsArg?: PrismaClientOptions): { - _originalClient: any; - _runtimeDataModel: RuntimeDataModel; - _requestHandler: RequestHandler; - _connectionPromise?: Promise | undefined; - _disconnectionPromise?: Promise | undefined; - _engineConfig: EngineConfig; - _accelerateEngineConfig: AccelerateEngineConfig; - _clientVersion: string; - _errorFormat: ErrorFormat; - _tracingHelper: TracingHelper; - _metrics: MetricsClient; - _middlewares: MiddlewareHandler; - _previewFeatures: string[]; - _activeProvider: string; - _globalOmit?: GlobalOmitOptions | undefined; - _extensions: MergedExtensionsList; - _engine: Engine; - /** - * A fully constructed/applied Client that references the parent - * PrismaClient. This is used for Client extensions only. - */ - _appliedParent: any; - _createPrismaPromise: PrismaPromiseFactory; - /** - * Hook a middleware into the client - * @param middleware to hook - */ - $use(middleware: QueryMiddleware): void; - $on(eventType: E, callback: EventCallback): void; - $connect(): Promise; - /** - * Disconnect from the database - */ - $disconnect(): Promise; - /** - * Executes a raw query and always returns a number - */ - $executeRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; - /** - * Executes a raw query provided through a safe tag function - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2; - /** - * Unsafe counterpart of `$executeRaw` that is susceptible to SQL injections - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2; - /** - * Executes a raw command only for MongoDB - * - * @param command - * @returns - */ - $runCommandRaw(command: Record): PrismaPromise_2; - /** - * Executes a raw query and returns selected data - */ - $queryRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; - /** - * Executes a raw query provided through a safe tag function - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2; - /** - * Counterpart to $queryRaw, that returns strongly typed results - * @param typedSql - */ - $queryRawTyped(typedSql: UnknownTypedSql): PrismaPromise_2; - /** - * Unsafe counterpart of `$queryRaw` that is susceptible to SQL injections - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2; - /** - * Execute a batch of requests in a transaction - * @param requests - * @param options - */ - _transactionWithArray({ promises, options, }: { - promises: Array>; - options?: BatchTransactionOptions; - }): Promise; - /** - * Perform a long-running transaction - * @param callback - * @param options - * @returns - */ - _transactionWithCallback({ callback, options, }: { - callback: (client: Client) => Promise; - options?: Options; - }): Promise; - _createItxClient(transaction: PrismaPromiseInteractiveTransaction): Client; - /** - * Execute queries within a transaction - * @param input a callback or a query list - * @param options to set timeouts (callback) - * @returns - */ - $transaction(input: any, options?: any): Promise; - /** - * Runs the middlewares over params before executing a request - * @param internalParams - * @returns - */ - _request(internalParams: InternalRequestParams): Promise; - _executeRequest({ args, clientMethod, dataPath, callsite, action, model, argsMapper, transaction, unpacker, otelParentCtx, customDataProxyFetch, }: InternalRequestParams): Promise; - readonly $metrics: MetricsClient; - /** - * Shortcut for checking a preview flag - * @param feature preview flag - * @returns - */ - _hasPreviewFlag(feature: string): boolean; - $applyPendingMigrations(): Promise; - $extends: typeof $extends; - readonly [Symbol.toStringTag]: string; - }; -}; - -/** - * Config that is stored into the generated client. When the generated client is - * loaded, this same config is passed to {@link getPrismaClient} which creates a - * closure with that config around a non-instantiated [[PrismaClient]]. - */ -declare type GetPrismaClientConfig = { - runtimeDataModel: RuntimeDataModel; - generator?: GeneratorConfig; - relativeEnvPaths: { - rootEnvPath?: string | null; - schemaEnvPath?: string | null; - }; - relativePath: string; - dirname: string; - filename?: string; - clientVersion: string; - engineVersion: string; - datasourceNames: string[]; - activeProvider: ActiveConnectorType; - /** - * The contents of the schema encoded into a string - * @remarks only used for the purpose of data proxy - */ - inlineSchema: string; - /** - * A special env object just for the data proxy edge runtime. - * Allows bundlers to inject their own env variables (Vercel). - * Allows platforms to declare global variables as env (Workers). - * @remarks only used for the purpose of data proxy - */ - injectableEdgeEnv?: () => LoadedEnv; - /** - * The contents of the datasource url saved in a string. - * This can either be an env var name or connection string. - * It is needed by the client to connect to the Data Proxy. - * @remarks only used for the purpose of data proxy - */ - inlineDatasources: { - [name in string]: { - url: EnvValue; - }; - }; - /** - * The string hash that was produced for a given schema - * @remarks only used for the purpose of data proxy - */ - inlineSchemaHash: string; - /** - * A marker to indicate that the client was not generated via `prisma - * generate` but was generated via `generate --postinstall` script instead. - * @remarks used to error for Vercel/Netlify for schema caching issues - */ - postinstall?: boolean; - /** - * Information about the CI where the Prisma Client has been generated. The - * name of the CI environment is stored at generation time because CI - * information is not always available at runtime. Moreover, the edge client - * has no notion of environment variables, so this works around that. - * @remarks used to error for Vercel/Netlify for schema caching issues - */ - ciName?: string; - /** - * Information about whether we have not found a schema.prisma file in the - * default location, and that we fell back to finding the schema.prisma file - * in the current working directory. This usually means it has been bundled. - */ - isBundled?: boolean; - /** - * A boolean that is `false` when the client was generated with --no-engine. At - * runtime, this means the client will be bound to be using the Data Proxy. - */ - copyEngine?: boolean; - /** - * Optional wasm loading configuration - */ - engineWasm?: WasmLoadingConfig; -}; - -export declare type GetResult = { - findUnique: GetFindResult | null; - findUniqueOrThrow: GetFindResult; - findFirst: GetFindResult | null; - findFirstOrThrow: GetFindResult; - findMany: GetFindResult[]; - create: GetFindResult; - createMany: GetBatchResult; - createManyAndReturn: GetFindResult[]; - update: GetFindResult; - updateMany: GetBatchResult; - upsert: GetFindResult; - delete: GetFindResult; - deleteMany: GetBatchResult; - aggregate: GetAggregateResult; - count: GetCountResult; - groupBy: GetGroupByResult; - $queryRaw: unknown; - $queryRawTyped: unknown; - $executeRaw: number; - $queryRawUnsafe: unknown; - $executeRawUnsafe: number; - $runCommandRaw: JsonObject; - findRaw: JsonObject; - aggregateRaw: JsonObject; -}[OperationName]; - -export declare function getRuntime(): GetRuntimeOutput; - -declare type GetRuntimeOutput = { - id: Runtime; - prettyName: string; - isEdge: boolean; -}; - -export declare type GetSelect, R extends InternalArgs['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = { - [K in KR | keyof Base]?: K extends KR ? boolean : Base[K]; -}; - -declare type GlobalOmitOptions = { - [modelName: string]: { - [fieldName: string]: boolean; - }; -}; - -declare type HandleErrorParams = { - args: JsArgs; - error: any; - clientMethod: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - modelName?: string; - globalOmit?: GlobalOmitOptions; -}; - -/** - * Defines High-Resolution Time. - * - * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970. - * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds. - * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150. - * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds: - * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210. - * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds: - * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000. - * This is represented in HrTime format as [1609504210, 150000000]. - */ -declare type HrTime = [number, number]; - -/** - * Matches a JSON array. - * Unlike \`JsonArray\`, readonly arrays are assignable to this type. - */ -export declare interface InputJsonArray extends ReadonlyArray { -} - -/** - * Matches a JSON object. - * Unlike \`JsonObject\`, this type allows undefined and read-only properties. - */ -export declare type InputJsonObject = { - readonly [Key in string]?: InputJsonValue | null; -}; - -/** - * Matches any valid value that can be used as an input for operations like - * create and update as the value of a JSON field. Unlike \`JsonValue\`, this - * type allows read-only arrays and read-only object properties and disallows - * \`null\` at the top level. - * - * \`null\` cannot be used as the value of a JSON field because its meaning - * would be ambiguous. Use \`Prisma.JsonNull\` to store the JSON null value or - * \`Prisma.DbNull\` to clear the JSON value and set the field to the database - * NULL value instead. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values - */ -export declare type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray | { - toJSON(): unknown; -}; - -declare type InteractiveTransactionInfo = { - /** - * Transaction ID returned by the query engine. - */ - id: string; - /** - * Arbitrary payload the meaning of which depends on the `Engine` implementation. - * For example, `DataProxyEngine` needs to associate different API endpoints with transactions. - * In `LibraryEngine` and `BinaryEngine` it is currently not used. - */ - payload: Payload; -}; - -declare type InteractiveTransactionOptions = Transaction_2.InteractiveTransactionInfo; - -export declare type InternalArgs = { - result: { - [K in keyof R]: { - [P in keyof R[K]]: () => R[K][P]; - }; - }; - model: { - [K in keyof M]: { - [P in keyof M[K]]: () => M[K][P]; - }; - }; - query: { - [K in keyof Q]: { - [P in keyof Q[K]]: () => Q[K][P]; - }; - }; - client: { - [K in keyof C]: () => C[K]; - }; -}; - -declare type InternalRequestParams = { - /** - * The original client method being called. - * Even though the rootField / operation can be changed, - * this method stays as it is, as it's what the user's - * code looks like - */ - clientMethod: string; - /** - * Name of js model that triggered the request. Might be used - * for warnings or error messages - */ - jsModelName?: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - unpacker?: Unpacker; - otelParentCtx?: Context; - /** Used to "desugar" a user input into an "expanded" one */ - argsMapper?: (args?: UserArgs_2) => UserArgs_2; - /** Used to convert args for middleware and back */ - middlewareArgsMapper?: MiddlewareArgsMapper; - /** Used for Accelerate client extension via Data Proxy */ - customDataProxyFetch?: (fetch: Fetch) => Fetch; -} & Omit; - -declare enum IsolationLevel { - ReadUncommitted = "ReadUncommitted", - ReadCommitted = "ReadCommitted", - RepeatableRead = "RepeatableRead", - Snapshot = "Snapshot", - Serializable = "Serializable" -} - -declare function isSkip(value: unknown): value is Skip; - -export declare type ITXClientDenyList = (typeof denylist)[number]; - -export declare const itxClientDenyList: readonly (string | symbol)[]; - -declare interface Job { - resolve: (data: any) => void; - reject: (data: any) => void; - request: any; -} - -/** - * Create a SQL query for a list of values. - */ -export declare function join(values: readonly RawValue[], separator?: string, prefix?: string, suffix?: string): Sql; - -export declare type JsArgs = { - select?: Selection_2; - include?: Selection_2; - omit?: Omission; - [argName: string]: JsInputValue; -}; - -export declare type JsInputValue = null | undefined | string | number | boolean | bigint | Uint8Array | Date | DecimalJsLike | ObjectEnumValue | RawParameters | JsonConvertible | FieldRef | JsInputValue[] | Skip | { - [key: string]: JsInputValue; -}; - -declare type JsonArgumentValue = number | string | boolean | null | RawTaggedValue | JsonArgumentValue[] | { - [key: string]: JsonArgumentValue; -}; - -/** - * From https://github.com/sindresorhus/type-fest/ - * Matches a JSON array. - */ -export declare interface JsonArray extends Array { -} - -declare type JsonBatchQuery = { - batch: JsonQuery[]; - transaction?: { - isolationLevel?: Transaction_2.IsolationLevel; - }; -}; - -export declare interface JsonConvertible { - toJSON(): unknown; -} - -declare type JsonFieldSelection = { - arguments?: Record | RawTaggedValue; - selection: JsonSelectionSet; -}; - -declare class JsonNull extends NullTypesEnumValue { -} - -/** - * From https://github.com/sindresorhus/type-fest/ - * Matches a JSON object. - * This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. - */ -export declare type JsonObject = { - [Key in string]?: JsonValue; -}; - -declare type JsonQuery = { - modelName?: string; - action: JsonQueryAction; - query: JsonFieldSelection; -}; - -declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'createManyAndReturn' | 'updateOne' | 'updateMany' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw'; - -declare type JsonSelectionSet = { - $scalars?: boolean; - $composites?: boolean; -} & { - [fieldName: string]: boolean | JsonFieldSelection; -}; - -/** - * From https://github.com/sindresorhus/type-fest/ - * Matches any valid JSON value. - */ -export declare type JsonValue = string | number | boolean | JsonObject | JsonArray | null; - -export declare type JsOutputValue = null | string | number | boolean | bigint | Uint8Array | Date | Decimal | JsOutputValue[] | { - [key: string]: JsOutputValue; -}; - -export declare type JsPromise = Promise & {}; - -declare type KnownErrorParams = { - code: string; - clientVersion: string; - meta?: Record; - batchRequestIdx?: number; -}; - -/** - * A pointer from the current {@link Span} to another span in the same trace or - * in a different trace. - * Few examples of Link usage. - * 1. Batch Processing: A batch of elements may contain elements associated - * with one or more traces/spans. Since there can only be one parent - * SpanContext, Link is used to keep reference to SpanContext of all - * elements in the batch. - * 2. Public Endpoint: A SpanContext in incoming client request on a public - * endpoint is untrusted from service provider perspective. In such case it - * is advisable to start a new trace with appropriate sampling decision. - * However, it is desirable to associate incoming SpanContext to new trace - * initiated on service provider side so two traces (from Client and from - * Service Provider) can be correlated. - */ -declare interface Link { - /** The {@link SpanContext} of a linked span. */ - context: SpanContext; - /** A set of {@link SpanAttributes} on the link. */ - attributes?: SpanAttributes; - /** Count of attributes of the link that were dropped due to collection limits */ - droppedAttributesCount?: number; -} - -declare type LoadedEnv = { - message?: string; - parsed: { - [x: string]: string; - }; -} | undefined; - -declare type LocationInFile = { - fileName: string; - lineNumber: number | null; - columnNumber: number | null; -}; - -declare type LogDefinition = { - level: LogLevel; - emit: 'stdout' | 'event'; -}; - -/** - * Typings for the events we emit. - * - * @remarks - * If this is updated, our edge runtime shim needs to be updated as well. - */ -declare type LogEmitter = { - on(event: E, listener: (event: EngineEvent) => void): LogEmitter; - emit(event: QueryEventType, payload: QueryEvent): boolean; - emit(event: LogEventType, payload: LogEvent): boolean; -}; - -declare type LogEvent = { - timestamp: Date; - message: string; - target: string; -}; - -declare type LogEventType = 'info' | 'warn' | 'error'; - -declare type LogLevel = 'info' | 'query' | 'warn' | 'error'; - -/** - * Generates more strict variant of an enum which, unlike regular enum, - * throws on non-existing property access. This can be useful in following situations: - * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input - * - enum values are generated dynamically from DMMF. - * - * In that case, if using normal enums and no compile-time typechecking, using non-existing property - * will result in `undefined` value being used, which will be accepted. Using strict enum - * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. - * - * Note: if you need to check for existence of a value in the enum you can still use either - * `in` operator or `hasOwnProperty` function. - * - * @param definition - * @returns - */ -export declare function makeStrictEnum>(definition: T): T; - -export declare function makeTypedQueryFactory(sql: string): (...values: any[]) => TypedSql; - -/** - * Class that holds the list of all extensions, applied to particular instance, - * as well as resolved versions of the components that need to apply on - * different levels. Main idea of this class: avoid re-resolving as much of the - * stuff as possible when new extensions are added while also delaying the - * resolve until the point it is actually needed. For example, computed fields - * of the model won't be resolved unless the model is actually queried. Neither - * adding extensions with `client` component only cause other components to - * recompute. - */ -declare class MergedExtensionsList { - private head?; - private constructor(); - static empty(): MergedExtensionsList; - static single(extension: ExtensionArgs): MergedExtensionsList; - isEmpty(): boolean; - append(extension: ExtensionArgs): MergedExtensionsList; - getAllComputedFields(dmmfModelName: string): ComputedFieldsMap | undefined; - getAllClientExtensions(): ClientArg | undefined; - getAllModelExtensions(dmmfModelName: string): ModelArg | undefined; - getAllQueryCallbacks(jsModelName: string, operation: string): any; - getAllBatchQueryCallbacks(): BatchQueryOptionsCb[]; -} - -export declare type MergeExtArgs, Args extends Record> = ComputeDeep & AllModelsToStringIndex>; - -export declare type Metric = { - key: string; - value: T; - labels: Record; - description: string; -}; - -export declare type MetricHistogram = { - buckets: MetricHistogramBucket[]; - sum: number; - count: number; -}; - -export declare type MetricHistogramBucket = [maxValue: number, count: number]; - -export declare type Metrics = { - counters: Metric[]; - gauges: Metric[]; - histograms: Metric[]; -}; - -export declare class MetricsClient { - private _engine; - constructor(engine: Engine); - /** - * Returns all metrics gathered up to this point in prometheus format. - * Result of this call can be exposed directly to prometheus scraping endpoint - * - * @param options - * @returns - */ - prometheus(options?: MetricsOptions): Promise; - /** - * Returns all metrics gathered up to this point in prometheus format. - * - * @param options - * @returns - */ - json(options?: MetricsOptions): Promise; -} - -declare type MetricsOptions = { - /** - * Labels to add to every metrics in key-value format - */ - globalLabels?: Record; -}; - -declare type MetricsOptionsCommon = { - globalLabels?: Record; -}; - -declare type MetricsOptionsJson = { - format: 'json'; -} & MetricsOptionsCommon; - -declare type MetricsOptionsPrometheus = { - format: 'prometheus'; -} & MetricsOptionsCommon; - -declare type MiddlewareArgsMapper = { - requestArgsToMiddlewareArgs(requestArgs: RequestArgs): MiddlewareArgs; - middlewareArgsToRequestArgs(middlewareArgs: MiddlewareArgs): RequestArgs; -}; - -declare class MiddlewareHandler { - private _middlewares; - use(middleware: M): void; - get(id: number): M | undefined; - has(id: number): boolean; - length(): number; -} - -export declare type ModelArg = { - [MethodName in string]: unknown; -}; - -export declare type ModelArgs = { - model: { - [ModelName in string]: ModelArg; - }; -}; - -export declare type ModelKey = M extends keyof TypeMap['model'] ? M : Capitalize; - -export declare type ModelQueryOptionsCb = (args: ModelQueryOptionsCbArgs) => Promise; - -export declare type ModelQueryOptionsCbArgs = { - model: string; - operation: string; - args: JsArgs; - query: (args: JsArgs) => Promise; -}; - -export declare type NameArgs = { - name?: string; -}; - -export declare type Narrow = { - [K in keyof A]: A[K] extends Function ? A[K] : Narrow; -} | (A extends Narrowable ? A : never); - -export declare type Narrowable = string | number | bigint | boolean | []; - -export declare type NeverToUnknown = [T] extends [never] ? unknown : T; - -/** - * Imitates `fetch` via `https` to only suit our needs, it does nothing more. - * This is because we cannot bundle `node-fetch` as it uses many other Node.js - * utilities, while also bloating our bundles. This approach is much leaner. - * @param url - * @param options - * @returns - */ -declare function nodeFetch(url: string, options?: RequestOptions): Promise; - -declare class NodeHeaders { - readonly headers: Map; - constructor(init?: Record); - append(name: string, value: string): void; - delete(name: string): void; - get(name: string): string | null; - has(name: string): boolean; - set(name: string, value: string): void; - forEach(callbackfn: (value: string, key: string, parent: this) => void, thisArg?: any): void; -} - -/** - * @deprecated Please don´t rely on type checks to this error anymore. - * This will become a regular `PrismaClientKnownRequestError` with code `P2025` - * in the future major version of the client. - * Instead of `error instanceof Prisma.NotFoundError` use `error.code === "P2025"`. - */ -export declare class NotFoundError extends PrismaClientKnownRequestError { - constructor(message: string, clientVersion: string); -} - -declare class NullTypesEnumValue extends ObjectEnumValue { - _getNamespace(): string; -} - -/** - * List of Prisma enums that must use unique objects instead of strings as their values. - */ -export declare const objectEnumNames: string[]; - -/** - * Base class for unique values of object-valued enums. - */ -export declare abstract class ObjectEnumValue { - constructor(arg?: symbol); - abstract _getNamespace(): string; - _getName(): string; - toString(): string; -} - -export declare const objectEnumValues: { - classes: { - DbNull: typeof DbNull; - JsonNull: typeof JsonNull; - AnyNull: typeof AnyNull; - }; - instances: { - DbNull: DbNull; - JsonNull: JsonNull; - AnyNull: AnyNull; - }; -}; - -declare const officialPrismaAdapters: readonly ["@prisma/adapter-planetscale", "@prisma/adapter-neon", "@prisma/adapter-libsql", "@prisma/adapter-d1", "@prisma/adapter-pg", "@prisma/adapter-pg-worker"]; - -export declare type Omission = Record; - -declare type Omit_2 = { - [P in keyof T as P extends K ? never : P]: T[P]; -}; -export { Omit_2 as Omit } - -export declare type OmitValue = Key extends keyof Omit ? Omit[Key] : false; - -export declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; - -export declare type OperationPayload = { - name: string; - scalars: { - [ScalarName in string]: unknown; - }; - objects: { - [ObjectName in string]: unknown; - }; - composites: { - [CompositeName in string]: unknown; - }; -}; - -export declare type Optional = { - [P in K & keyof O]?: O[P]; -} & { - [P in Exclude]: O[P]; -}; - -export declare type OptionalFlat = { - [K in keyof T]?: T[K]; -}; - -export declare type OptionalKeys = { - [K in keyof O]-?: {} extends Pick_2 ? K : never; -}[keyof O]; - -declare type Options = { - maxWait?: number; - timeout?: number; - isolationLevel?: IsolationLevel; -}; - -declare type Options_2 = { - clientVersion: string; -}; - -export declare type Or = { - 0: { - 0: 0; - 1: 1; - }; - 1: { - 0: 1; - 1: 1; - }; -}[A][B]; - -export declare type PatchFlat = O1 & Omit_2; - -export declare type Path = O extends unknown ? P extends [infer K, ...infer R] ? K extends keyof O ? Path : Default : O : never; - -export declare type Payload = T extends { - [K: symbol]: { - types: { - payload: any; - }; - }; -} ? T[symbol]['types']['payload'] : any; - -export declare type PayloadToResult = RenameAndNestPayloadKeys

> = { - [K in keyof O]?: O[K][K] extends any[] ? PayloadToResult[] : O[K][K] extends object ? PayloadToResult : O[K][K]; -}; - -declare type Pick_2 = { - [P in keyof T as P extends K ? P : never]: T[P]; -}; -export { Pick_2 as Pick } - -export declare class PrismaClientInitializationError extends Error { - clientVersion: string; - errorCode?: string; - retryable?: boolean; - constructor(message: string, clientVersion: string, errorCode?: string); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientKnownRequestError extends Error implements ErrorWithBatchIndex { - code: string; - meta?: Record; - clientVersion: string; - batchRequestIdx?: number; - constructor(message: string, { code, clientVersion, meta, batchRequestIdx }: KnownErrorParams); - get [Symbol.toStringTag](): string; -} - -export declare type PrismaClientOptions = { - /** - * Overwrites the primary datasource url from your schema.prisma file - */ - datasourceUrl?: string; - /** - * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale. - */ - adapter?: DriverAdapter | null; - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasources?: Datasources; - /** - * @default "colorless" - */ - errorFormat?: ErrorFormat; - /** - * The default values for Transaction options - * maxWait ?= 2000 - * timeout ?= 5000 - */ - transactionOptions?: Transaction_2.Options; - /** - * @example - * \`\`\` - * // Defaults to stdout - * log: ['query', 'info', 'warn'] - * - * // Emit as events - * log: [ - * { emit: 'stdout', level: 'query' }, - * { emit: 'stdout', level: 'info' }, - * { emit: 'stdout', level: 'warn' } - * ] - * \`\`\` - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). - */ - log?: Array; - omit?: GlobalOmitOptions; - /** - * @internal - * You probably don't want to use this. \`__internal\` is used by internal tooling. - */ - __internal?: { - debug?: boolean; - engine?: { - cwd?: string; - binaryPath?: string; - endpoint?: string; - allowTriggerPanic?: boolean; - }; - /** This can be used for testing purposes */ - configOverride?: (config: GetPrismaClientConfig) => GetPrismaClientConfig; - }; -}; - -export declare class PrismaClientRustPanicError extends Error { - clientVersion: string; - constructor(message: string, clientVersion: string); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientUnknownRequestError extends Error implements ErrorWithBatchIndex { - clientVersion: string; - batchRequestIdx?: number; - constructor(message: string, { clientVersion, batchRequestIdx }: UnknownErrorParams); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientValidationError extends Error { - name: string; - clientVersion: string; - constructor(message: string, { clientVersion }: Options_2); - get [Symbol.toStringTag](): string; -} - -declare function prismaGraphQLToJSError({ error, user_facing_error }: RequestError, clientVersion: string, activeProvider: string): PrismaClientKnownRequestError | PrismaClientUnknownRequestError; - -export declare interface PrismaPromise extends Promise { - [Symbol.toStringTag]: 'PrismaPromise'; -} - -/** - * Prisma's `Promise` that is backwards-compatible. All additions on top of the - * original `Promise` are optional so that it can be backwards-compatible. - * @see [[createPrismaPromise]] - */ -declare interface PrismaPromise_2 extends Promise { - /** - * Extension of the original `.then` function - * @param onfulfilled same as regular promises - * @param onrejected same as regular promises - * @param transaction transaction options - */ - then(onfulfilled?: (value: A) => R1 | PromiseLike, onrejected?: (error: unknown) => R2 | PromiseLike, transaction?: PrismaPromiseTransaction): Promise; - /** - * Extension of the original `.catch` function - * @param onrejected same as regular promises - * @param transaction transaction options - */ - catch(onrejected?: ((reason: any) => R | PromiseLike) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; - /** - * Extension of the original `.finally` function - * @param onfinally same as regular promises - * @param transaction transaction options - */ - finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; - /** - * Called when executing a batch of regular tx - * @param transaction transaction options for batch tx - */ - requestTransaction?(transaction: PrismaPromiseBatchTransaction): PromiseLike; -} - -declare type PrismaPromiseBatchTransaction = { - kind: 'batch'; - id: number; - isolationLevel?: IsolationLevel; - index: number; - lock: PromiseLike; -}; - -declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => PrismaPromise_2; - -/** - * Creates a [[PrismaPromise]]. It is Prisma's implementation of `Promise` which - * is essentially a proxy for `Promise`. All the transaction-compatible client - * methods return one, this allows for pre-preparing queries without executing - * them until `.then` is called. It's the foundation of Prisma's query batching. - * @param callback that will be wrapped within our promise implementation - * @see [[PrismaPromise]] - * @returns - */ -declare type PrismaPromiseFactory = (callback: PrismaPromiseCallback) => PrismaPromise_2; - -declare type PrismaPromiseInteractiveTransaction = { - kind: 'itx'; - id: string; - payload: PayloadType; -}; - -declare type PrismaPromiseTransaction = PrismaPromiseBatchTransaction | PrismaPromiseInteractiveTransaction; - -export declare const PrivateResultType: unique symbol; - -declare namespace Public { - export { - validator - } -} -export { Public } - -declare namespace Public_2 { - export { - Args, - Result, - Payload, - PrismaPromise, - Operation, - Exact - } -} - -declare type Query = { - sql: string; - args: Array; - argTypes: Array; -}; - -declare interface Queryable { - readonly provider: 'mysql' | 'postgres' | 'sqlite'; - readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {}); - /** - * Execute a query given as SQL, interpolating the given parameters, - * and returning the type-aware result set of the query. - * - * This is the preferred way of executing `SELECT` queries. - */ - queryRaw(params: Query): Promise>; - /** - * Execute a query given as SQL, interpolating the given parameters, - * and returning the number of affected rows. - * - * This is the preferred way of executing `INSERT`, `UPDATE`, `DELETE` queries, - * as well as transactional queries. - */ - executeRaw(params: Query): Promise>; -} - -declare type QueryEngineBatchGraphQLRequest = { - batch: QueryEngineRequest[]; - transaction?: boolean; - isolationLevel?: Transaction_2.IsolationLevel; -}; - -declare type QueryEngineBatchRequest = QueryEngineBatchGraphQLRequest | JsonBatchQuery; - -declare type QueryEngineConfig = { - datamodel: string; - configDir: string; - logQueries: boolean; - ignoreEnvVarErrors: boolean; - datasourceOverrides: Record; - env: Record; - logLevel: QueryEngineLogLevel; - telemetry?: QueryEngineTelemetry; - engineProtocol: EngineProtocol; -}; - -declare interface QueryEngineConstructor { - new (config: QueryEngineConfig, logger: (log: string) => void, adapter?: ErrorCapturingDriverAdapter): QueryEngineInstance; -} - -declare type QueryEngineInstance = { - connect(headers: string): Promise; - disconnect(headers: string): Promise; - /** - * @param requestStr JSON.stringified `QueryEngineRequest | QueryEngineBatchRequest` - * @param headersStr JSON.stringified `QueryEngineRequestHeaders` - */ - query(requestStr: string, headersStr: string, transactionId?: string): Promise; - sdlSchema(): Promise; - dmmf(traceparent: string): Promise; - startTransaction(options: string, traceHeaders: string): Promise; - commitTransaction(id: string, traceHeaders: string): Promise; - rollbackTransaction(id: string, traceHeaders: string): Promise; - metrics(options: string): Promise; - applyPendingMigrations(): Promise; -}; - -declare type QueryEngineLogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off'; - -declare type QueryEngineRequest = { - query: string; - variables: Object; -}; - -declare type QueryEngineResult = { - data: T; - elapsed: number; -}; - -declare type QueryEngineTelemetry = { - enabled: Boolean; - endpoint: string; -}; - -declare type QueryEvent = { - timestamp: Date; - query: string; - params: string; - duration: number; - target: string; -}; - -declare type QueryEventType = 'query'; - -declare type QueryMiddleware = (params: QueryMiddlewareParams, next: (params: QueryMiddlewareParams) => Promise) => Promise; - -declare type QueryMiddlewareParams = { - /** The model this is executed on */ - model?: string; - /** The action that is being handled */ - action: Action; - /** TODO what is this */ - dataPath: string[]; - /** TODO what is this */ - runInTransaction: boolean; - args?: UserArgs_2; -}; - -export declare type QueryOptions = { - query: { - [ModelName in string]: { - [ModelAction in string]: ModelQueryOptionsCb; - } | QueryOptionsCb; - }; -}; - -export declare type QueryOptionsCb = (args: QueryOptionsCbArgs) => Promise; - -export declare type QueryOptionsCbArgs = { - model?: string; - operation: string; - args: JsArgs | RawQueryArgs; - query: (args: JsArgs | RawQueryArgs) => Promise; -}; - -/** - * Create raw SQL statement. - */ -export declare function raw(value: string): Sql; - -export declare type RawParameters = { - __prismaRawParameters__: true; - values: string; -}; - -export declare type RawQueryArgs = Sql | UnknownTypedSql | [query: string, ...values: RawValue[]]; - -declare type RawTaggedValue = { - $type: 'Raw'; - value: unknown; -}; - -/** - * Supported value or SQL instance. - */ -export declare type RawValue = Value | Sql; - -export declare type ReadonlyDeep = { - readonly [K in keyof T]: ReadonlyDeep; -}; - -declare type ReadonlyDeep_2 = { - +readonly [K in keyof O]: ReadonlyDeep_2; -}; - -declare type Record_2 = { - [P in T]: U; -}; -export { Record_2 as Record } - -export declare type RenameAndNestPayloadKeys

= { - [K in keyof P as K extends 'scalars' | 'objects' | 'composites' ? keyof P[K] : never]: P[K]; -}; - -declare type RequestBatchOptions = { - transaction?: TransactionOptions_2; - traceparent?: string; - numTry?: number; - containsWrite: boolean; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare interface RequestError { - error: string; - user_facing_error: { - is_panic: boolean; - message: string; - meta?: Record; - error_code?: string; - batch_request_idx?: number; - }; -} - -declare class RequestHandler { - client: Client; - dataloader: DataLoader; - private logEmitter?; - constructor(client: Client, logEmitter?: LogEmitter); - request(params: RequestParams): Promise; - mapQueryEngineResult({ dataPath, unpacker }: RequestParams, response: QueryEngineResult): any; - /** - * Handles the error and logs it, logging the error is done synchronously waiting for the event - * handlers to finish. - */ - handleAndLogRequestError(params: HandleErrorParams): never; - handleRequestError({ error, clientMethod, callsite, transaction, args, modelName, globalOmit, }: HandleErrorParams): never; - sanitizeMessage(message: any): any; - unpack(data: unknown, dataPath: string[], unpacker?: Unpacker): any; - get [Symbol.toStringTag](): string; -} - -declare type RequestOptions = { - method?: string; - headers?: Record; - body?: string; -}; - -declare type RequestOptions_2 = { - traceparent?: string; - numTry?: number; - interactiveTransaction?: InteractiveTransactionOptions; - isWrite: boolean; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare type RequestParams = { - modelName?: string; - action: Action; - protocolQuery: JsonQuery; - dataPath: string[]; - clientMethod: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - extensions: MergedExtensionsList; - args?: any; - headers?: Record; - unpacker?: Unpacker; - otelParentCtx?: Context; - otelChildCtx?: Context; - globalOmit?: GlobalOmitOptions; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare type RequestResponse = { - ok: boolean; - url: string; - statusText?: string; - status: number; - headers: NodeHeaders; - text: () => Promise; - json: () => Promise; -}; - -declare type RequiredExtensionArgs = NameArgs & ResultArgs & ModelArgs & ClientArgs & QueryOptions; -export { RequiredExtensionArgs } -export { RequiredExtensionArgs as UserArgs } - -export declare type RequiredKeys = { - [K in keyof O]-?: {} extends Pick_2 ? never : K; -}[keyof O]; - -declare function resolveDatasourceUrl({ inlineDatasources, overrideDatasources, env, clientVersion, }: { - inlineDatasources: GetPrismaClientConfig['inlineDatasources']; - overrideDatasources: Datasources; - env: Record; - clientVersion: string; -}): string; - -export declare type Result = T extends { - [K: symbol]: { - types: { - payload: any; - }; - }; -} ? GetResult : GetResult<{ - composites: {}; - objects: {}; - scalars: {}; - name: ''; -}, {}, F>; - -export declare type Result_2 = Result; - -declare namespace Result_3 { - export { - Operation, - FluentOperation, - Count, - GetFindResult, - SelectablePayloadFields, - SelectField, - DefaultSelection, - UnwrapPayload, - ApplyOmit, - OmitValue, - GetCountResult, - Aggregate, - GetAggregateResult, - GetBatchResult, - GetGroupByResult, - GetResult, - ExtractGlobalOmit - } -} - -declare type Result_4 = { - map(fn: (value: T) => U): Result_4; - flatMap(fn: (value: T) => Result_4): Result_4; -} & ({ - readonly ok: true; - readonly value: T; -} | { - readonly ok: false; - readonly error: Error_2; -}); - -export declare type ResultArg = { - [FieldName in string]: ResultFieldDefinition; -}; - -export declare type ResultArgs = { - result: { - [ModelName in string]: ResultArg; - }; -}; - -export declare type ResultArgsFieldCompute = (model: any) => unknown; - -export declare type ResultFieldDefinition = { - needs?: { - [FieldName in string]: boolean; - }; - compute: ResultArgsFieldCompute; -}; - -declare interface ResultSet { - /** - * List of column types appearing in a database query, in the same order as `columnNames`. - * They are used within the Query Engine to convert values from JS to Quaint values. - */ - columnTypes: Array; - /** - * List of column names appearing in a database query, in the same order as `columnTypes`. - */ - columnNames: Array; - /** - * List of rows retrieved from a database query. - * Each row is a list of values, whose length matches `columnNames` and `columnTypes`. - */ - rows: Array>; - /** - * The last ID of an `INSERT` statement, if any. - * This is required for `AUTO_INCREMENT` columns in databases based on MySQL and SQLite. - */ - lastInsertId?: string; -} - -export declare type Return = T extends (...args: any[]) => infer R ? R : T; - -declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown"; - -declare type RuntimeDataModel = { - readonly models: Record; - readonly enums: Record; - readonly types: Record; -}; - -declare type RuntimeEnum = Omit; - -declare type RuntimeModel = Omit; - -export declare type Select = T extends U ? T : never; - -export declare type SelectablePayloadFields = { - objects: { - [k in K]: O; - }; -} | { - composites: { - [k in K]: O; - }; -}; - -export declare type SelectField

, K extends PropertyKey> = P extends { - objects: Record; -} ? P['objects'][K] : P extends { - composites: Record; -} ? P['composites'][K] : never; - -declare type Selection_2 = Record; -export { Selection_2 as Selection } - -declare class Skip { - constructor(param?: symbol); - ifUndefined(value: T | undefined): T | Skip; -} - -export declare const skip: Skip; - -/** - * An interface that represents a span. A span represents a single operation - * within a trace. Examples of span might include remote procedure calls or a - * in-process function calls to sub-components. A Trace has a single, top-level - * "root" Span that in turn may have zero or more child Spans, which in turn - * may have children. - * - * Spans are created by the {@link Tracer.startSpan} method. - */ -declare interface Span { - /** - * Returns the {@link SpanContext} object associated with this Span. - * - * Get an immutable, serializable identifier for this span that can be used - * to create new child spans. Returned SpanContext is usable even after the - * span ends. - * - * @returns the SpanContext object associated with this Span. - */ - spanContext(): SpanContext; - /** - * Sets an attribute to the span. - * - * Sets a single Attribute with the key and value passed as arguments. - * - * @param key the key for this attribute. - * @param value the value for this attribute. Setting a value null or - * undefined is invalid and will result in undefined behavior. - */ - setAttribute(key: string, value: SpanAttributeValue): this; - /** - * Sets attributes to the span. - * - * @param attributes the attributes that will be added. - * null or undefined attribute values - * are invalid and will result in undefined behavior. - */ - setAttributes(attributes: SpanAttributes): this; - /** - * Adds an event to the Span. - * - * @param name the name of the event. - * @param [attributesOrStartTime] the attributes that will be added; these are - * associated with this event. Can be also a start time - * if type is {@type TimeInput} and 3rd param is undefined - * @param [startTime] start time of the event. - */ - addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this; - /** - * Adds a single link to the span. - * - * Links added after the creation will not affect the sampling decision. - * It is preferred span links be added at span creation. - * - * @param link the link to add. - */ - addLink(link: Link): this; - /** - * Adds multiple links to the span. - * - * Links added after the creation will not affect the sampling decision. - * It is preferred span links be added at span creation. - * - * @param links the links to add. - */ - addLinks(links: Link[]): this; - /** - * Sets a status to the span. If used, this will override the default Span - * status. Default is {@link SpanStatusCode.UNSET}. SetStatus overrides the value - * of previous calls to SetStatus on the Span. - * - * @param status the SpanStatus to set. - */ - setStatus(status: SpanStatus): this; - /** - * Updates the Span name. - * - * This will override the name provided via {@link Tracer.startSpan}. - * - * Upon this update, any sampling behavior based on Span name will depend on - * the implementation. - * - * @param name the Span name. - */ - updateName(name: string): this; - /** - * Marks the end of Span execution. - * - * Call to End of a Span MUST not have any effects on child spans. Those may - * still be running and can be ended later. - * - * Do not return `this`. The Span generally should not be used after it - * is ended so chaining is not desired in this context. - * - * @param [endTime] the time to set as Span's end time. If not provided, - * use the current time as the span's end time. - */ - end(endTime?: TimeInput): void; - /** - * Returns the flag whether this span will be recorded. - * - * @returns true if this Span is active and recording information like events - * with the `AddEvent` operation and attributes using `setAttributes`. - */ - isRecording(): boolean; - /** - * Sets exception as a span event - * @param exception the exception the only accepted values are string or Error - * @param [time] the time to set as Span's event time. If not provided, - * use the current time. - */ - recordException(exception: Exception, time?: TimeInput): void; -} - -/** - * @deprecated please use {@link Attributes} - */ -declare type SpanAttributes = Attributes; - -/** - * @deprecated please use {@link AttributeValue} - */ -declare type SpanAttributeValue = AttributeValue; - -declare type SpanCallback = (span?: Span, context?: Context) => R; - -/** - * A SpanContext represents the portion of a {@link Span} which must be - * serialized and propagated along side of a {@link Baggage}. - */ -declare interface SpanContext { - /** - * The ID of the trace that this span belongs to. It is worldwide unique - * with practically sufficient probability by being made as 16 randomly - * generated bytes, encoded as a 32 lowercase hex characters corresponding to - * 128 bits. - */ - traceId: string; - /** - * The ID of the Span. It is globally unique with practically sufficient - * probability by being made as 8 randomly generated bytes, encoded as a 16 - * lowercase hex characters corresponding to 64 bits. - */ - spanId: string; - /** - * Only true if the SpanContext was propagated from a remote parent. - */ - isRemote?: boolean; - /** - * Trace flags to propagate. - * - * It is represented as 1 byte (bitmap). Bit to represent whether trace is - * sampled or not. When set, the least significant bit documents that the - * caller may have recorded trace data. A caller who does not record trace - * data out-of-band leaves this flag unset. - * - * see {@link TraceFlags} for valid flag values. - */ - traceFlags: number; - /** - * Tracing-system-specific info to propagate. - * - * The tracestate field value is a `list` as defined below. The `list` is a - * series of `list-members` separated by commas `,`, and a list-member is a - * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs - * surrounding `list-members` are ignored. There can be a maximum of 32 - * `list-members` in a `list`. - * More Info: https://www.w3.org/TR/trace-context/#tracestate-field - * - * Examples: - * Single tracing system (generic format): - * tracestate: rojo=00f067aa0ba902b7 - * Multiple tracing systems (with different formatting): - * tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE - */ - traceState?: TraceState; -} - -declare enum SpanKind { - /** Default value. Indicates that the span is used internally. */ - INTERNAL = 0, - /** - * Indicates that the span covers server-side handling of an RPC or other - * remote request. - */ - SERVER = 1, - /** - * Indicates that the span covers the client-side wrapper around an RPC or - * other remote request. - */ - CLIENT = 2, - /** - * Indicates that the span describes producer sending a message to a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - PRODUCER = 3, - /** - * Indicates that the span describes consumer receiving a message from a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - CONSUMER = 4 -} - -/** - * Options needed for span creation - */ -declare interface SpanOptions { - /** - * The SpanKind of a span - * @default {@link SpanKind.INTERNAL} - */ - kind?: SpanKind; - /** A span's attributes */ - attributes?: SpanAttributes; - /** {@link Link}s span to other spans */ - links?: Link[]; - /** A manually specified start time for the created `Span` object. */ - startTime?: TimeInput; - /** The new span should be a root span. (Ignore parent from context). */ - root?: boolean; -} - -declare interface SpanStatus { - /** The status code of this message. */ - code: SpanStatusCode; - /** A developer-facing error message. */ - message?: string; -} - -/** - * An enumeration of status codes. - */ -declare enum SpanStatusCode { - /** - * The default status. - */ - UNSET = 0, - /** - * The operation has been validated by an Application developer or - * Operator to have completed successfully. - */ - OK = 1, - /** - * The operation contains an error. - */ - ERROR = 2 -} - -/** - * A SQL instance can be nested within each other to build SQL strings. - */ -export declare class Sql { - readonly values: Value[]; - readonly strings: string[]; - constructor(rawStrings: readonly string[], rawValues: readonly RawValue[]); - get sql(): string; - get statement(): string; - get text(): string; - inspect(): { - sql: string; - statement: string; - text: string; - values: unknown[]; - }; -} - -/** - * Create a SQL object from a template string. - */ -export declare function sqltag(strings: readonly string[], ...values: readonly RawValue[]): Sql; - -/** - * Defines TimeInput. - * - * hrtime, epoch milliseconds, performance.now() or Date - */ -declare type TimeInput = HrTime | number | Date; - -export declare type ToTuple = T extends any[] ? T : [T]; - -declare interface TraceState { - /** - * Create a new TraceState which inherits from this TraceState and has the - * given key set. - * The new entry will always be added in the front of the list of states. - * - * @param key key of the TraceState entry. - * @param value value of the TraceState entry. - */ - set(key: string, value: string): TraceState; - /** - * Return a new TraceState which inherits from this TraceState but does not - * contain the given key. - * - * @param key the key for the TraceState entry to be removed. - */ - unset(key: string): TraceState; - /** - * Returns the value to which the specified key is mapped, or `undefined` if - * this map contains no mapping for the key. - * - * @param key with which the specified value is to be associated. - * @returns the value to which the specified key is mapped, or `undefined` if - * this map contains no mapping for the key. - */ - get(key: string): string | undefined; - /** - * Serializes the TraceState to a `list` as defined below. The `list` is a - * series of `list-members` separated by commas `,`, and a list-member is a - * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs - * surrounding `list-members` are ignored. There can be a maximum of 32 - * `list-members` in a `list`. - * - * @returns the serialized string. - */ - serialize(): string; -} - -declare interface TracingHelper { - isEnabled(): boolean; - getTraceParent(context?: Context): string; - createEngineSpan(engineSpanEvent: EngineSpanEvent): void; - getActiveContext(): Context | undefined; - runInChildSpan(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback): R; -} - -declare interface Transaction extends Queryable { - /** - * Transaction options. - */ - readonly options: TransactionOptions; - /** - * Commit the transaction. - */ - commit(): Promise>; - /** - * Rolls back the transaction. - */ - rollback(): Promise>; -} - -declare namespace Transaction_2 { - export { - IsolationLevel, - Options, - InteractiveTransactionInfo, - TransactionHeaders - } -} - -declare interface TransactionContext extends Queryable { - /** - * Starts new transaction. - */ - startTransaction(): Promise>; -} - -declare type TransactionHeaders = { - traceparent?: string; -}; - -declare type TransactionOptions = { - usePhantomQuery: boolean; -}; - -declare type TransactionOptions_2 = { - kind: 'itx'; - options: InteractiveTransactionOptions; -} | { - kind: 'batch'; - options: BatchTransactionOptions; -}; - -export declare class TypedSql { - [PrivateResultType]: Result; - constructor(sql: string, values: Values); - get sql(): string; - get values(): Values; -} - -export declare type TypeMapCbDef = Fn<{ - extArgs: InternalArgs; - clientOptions: ClientOptionDef; -}, TypeMapDef>; - -/** Shared */ -export declare type TypeMapDef = Record; - -declare namespace Types { - export { - Result_3 as Result, - Extensions_2 as Extensions, - Utils, - Public_2 as Public, - isSkip, - Skip, - skip, - UnknownTypedSql, - OperationPayload as Payload - } -} -export { Types } - -declare type UnknownErrorParams = { - clientVersion: string; - batchRequestIdx?: number; -}; - -export declare type UnknownTypedSql = TypedSql; - -declare type Unpacker = (data: any) => any; - -export declare type UnwrapPayload

= {} extends P ? unknown : { - [K in keyof P]: P[K] extends { - scalars: infer S; - composites: infer C; - }[] ? Array> : P[K] extends { - scalars: infer S; - composites: infer C; - } | null ? S & UnwrapPayload | Select : never; -}; - -export declare type UnwrapPromise

= P extends Promise ? R : P; - -export declare type UnwrapTuple = { - [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise ? X : UnwrapPromise : UnwrapPromise; -}; - -/** - * Input that flows from the user into the Client. - */ -declare type UserArgs_2 = any; - -declare namespace Utils { - export { - EmptyToUnknown, - NeverToUnknown, - PatchFlat, - Omit_2 as Omit, - Pick_2 as Pick, - ComputeDeep, - Compute, - OptionalFlat, - ReadonlyDeep, - Narrowable, - Narrow, - Exact, - Cast, - Record_2 as Record, - UnwrapPromise, - UnwrapTuple, - Path, - Fn, - Call, - RequiredKeys, - OptionalKeys, - Optional, - Return, - ToTuple, - RenameAndNestPayloadKeys, - PayloadToResult, - Select, - Equals, - Or, - JsPromise - } -} - -declare function validator(): (select: Exact) => S; - -declare function validator, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): (select: Exact>) => S; - -declare function validator, O extends keyof C[M] & Operation, P extends keyof Args>(client: C, model: M, operation: O, prop: P): (select: Exact[P]>) => S; - -/** - * Values supported by SQL engine. - */ -export declare type Value = unknown; - -export declare function warnEnvConflicts(envPaths: any): void; - -export declare const warnOnce: (key: string, message: string, ...args: unknown[]) => void; - -declare type WasmLoadingConfig = { - /** - * WASM-bindgen runtime for corresponding module - */ - getRuntime: () => { - __wbg_set_wasm(exports: unknown): any; - QueryEngine: QueryEngineConstructor; - }; - /** - * Loads the raw wasm module for the wasm query engine. This configuration is - * generated specifically for each type of client, eg. Node.js client and Edge - * clients will have different implementations. - * @remarks this is a callback on purpose, we only load the wasm if needed. - * @remarks only used by LibraryEngine.ts - */ - getQueryEngineWasmModule: () => Promise; -}; - -export { } diff --git a/node_modules/@prisma/client/runtime/react-native.js b/node_modules/@prisma/client/runtime/react-native.js deleted file mode 100644 index 31d9fcc..0000000 --- a/node_modules/@prisma/client/runtime/react-native.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict";var na=Object.create;var er=Object.defineProperty;var ia=Object.getOwnPropertyDescriptor;var oa=Object.getOwnPropertyNames;var sa=Object.getPrototypeOf,aa=Object.prototype.hasOwnProperty;var Le=(e,t)=>()=>(e&&(t=e(e=0)),t);var ge=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xt=(e,t)=>{for(var r in t)er(e,r,{get:t[r],enumerable:!0})},Gn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of oa(t))!aa.call(e,i)&&i!==r&&er(e,i,{get:()=>t[i],enumerable:!(n=ia(t,i))||n.enumerable});return e};var he=(e,t,r)=>(r=e!=null?na(sa(e)):{},Gn(t||!e||!e.__esModule?er(r,"default",{value:e,enumerable:!0}):r,e)),la=e=>Gn(er({},"__esModule",{value:!0}),e);var y,c=Le(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var x,p=Le(()=>{"use strict";x=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,d=Le(()=>{"use strict";E=()=>{};E.prototype=E});var b,f=Le(()=>{"use strict";b=class{constructor(t){this.value=t}deref(){return this.value}}});var pi=ge(tt=>{"use strict";m();c();p();d();f();var Yn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ua=Yn(e=>{"use strict";e.byteLength=l,e.toByteArray=g,e.fromByteArray=S;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var F=C.indexOf("=");F===-1&&(F=A);var _=F===A?0:4-F%4;return[F,_]}function l(C){var A=a(C),F=A[0],_=A[1];return(F+_)*3/4-_}function u(C,A,F){return(A+F)*3/4-F}function g(C){var A,F=a(C),_=F[0],N=F[1],M=new n(u(C,_,N)),O=0,Y=N>0?_-4:_,U;for(U=0;U>16&255,M[O++]=A>>8&255,M[O++]=A&255;return N===2&&(A=r[C.charCodeAt(U)]<<2|r[C.charCodeAt(U+1)]>>4,M[O++]=A&255),N===1&&(A=r[C.charCodeAt(U)]<<10|r[C.charCodeAt(U+1)]<<4|r[C.charCodeAt(U+2)]>>2,M[O++]=A>>8&255,M[O++]=A&255),M}function h(C){return t[C>>18&63]+t[C>>12&63]+t[C>>6&63]+t[C&63]}function P(C,A,F){for(var _,N=[],M=A;MY?Y:O+M));return _===1?(A=C[F-1],N.push(t[A>>2]+t[A<<4&63]+"==")):_===2&&(A=(C[F-2]<<8)+C[F-1],N.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),N.join("")}}),ca=Yn(e=>{e.read=function(t,r,n,i,o){var s,a,l=o*8-i-1,u=(1<>1,h=-7,P=n?o-1:0,S=n?-1:1,C=t[r+P];for(P+=S,s=C&(1<<-h)-1,C>>=-h,h+=l;h>0;s=s*256+t[r+P],P+=S,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+P],P+=S,h-=8);if(s===0)s=1-g;else{if(s===u)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(C?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,l,u,g=s*8-o-1,h=(1<>1,S=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:s-1,A=i?1:-1,F=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+P>=1?r+=S/u:r+=S*Math.pow(2,1-P),r*u>=2&&(a++,u/=2),a+P>=h?(l=0,a=h):a+P>=1?(l=(r*u-1)*Math.pow(2,o),a=a+P):(l=r*Math.pow(2,P-1)*Math.pow(2,o),a=0));o>=8;t[n+C]=l&255,C+=A,l/=256,o-=8);for(a=a<0;t[n+C]=a&255,C+=A,a/=256,g-=8);t[n+C-A]|=F*128}}),Jr=ua(),Xe=ca(),Wn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;tt.Buffer=T;tt.SlowBuffer=ha;tt.INSPECT_MAX_BYTES=50;var tr=2147483647;tt.kMaxLength=tr;T.TYPED_ARRAY_SUPPORT=pa();!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function pa(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function Oe(e){if(e>tr)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Kr(e)}return Zn(e,t,r)}T.poolSize=8192;function Zn(e,t,r){if(typeof e=="string")return fa(e,t);if(ArrayBuffer.isView(e))return ma(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(ye(e,ArrayBuffer)||e&&ye(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ye(e,SharedArrayBuffer)||e&&ye(e.buffer,SharedArrayBuffer)))return ei(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return T.from(n,t,r);let i=ga(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}T.from=function(e,t,r){return Zn(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function Xn(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function da(e,t,r){return Xn(e),e<=0?Oe(e):t!==void 0?typeof r=="string"?Oe(e).fill(t,r):Oe(e).fill(t):Oe(e)}T.alloc=function(e,t,r){return da(e,t,r)};function Kr(e){return Xn(e),Oe(e<0?0:Hr(e)|0)}T.allocUnsafe=function(e){return Kr(e)};T.allocUnsafeSlow=function(e){return Kr(e)};function fa(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=ti(e,t)|0,n=Oe(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Gr(e){let t=e.length<0?0:Hr(e.length)|0,r=Oe(t);for(let n=0;n=tr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+tr.toString(16)+" bytes");return e|0}function ha(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(ye(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),ye(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function ti(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ye(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Wr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ci(e).length;default:if(i)return n?-1:Wr(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=ti;function ya(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ra(this,t,r);case"utf8":case"utf-8":return ni(this,t,r);case"ascii":return Ca(this,t,r);case"latin1":case"binary":return Aa(this,t,r);case"base64":return Pa(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Sa(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function Je(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};Wn&&(T.prototype[Wn]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(ye(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Yr(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:Kn(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Kn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Kn(e,t,r,n,i){let o=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,r/=2}function l(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let u;if(i){let g=-1;for(u=r;us&&(r=s-a),u=r;u>=0;u--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return wa(this,e,t,r);case"utf8":case"utf-8":return ba(this,e,t,r);case"ascii":case"latin1":case"binary":return Ea(this,e,t,r);case"base64":return xa(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return va(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Pa(e,t,r){return t===0&&r===e.length?Jr.fromByteArray(e):Jr.fromByteArray(e.slice(t,r))}function ni(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let l,u,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:l=e[i+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(s=h));break;case 3:l=e[i+1],u=e[i+2],(l&192)===128&&(u&192)===128&&(h=(o&15)<<12|(l&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:l=e[i+1],u=e[i+2],g=e[i+3],(l&192)===128&&(u&192)===128&&(g&192)===128&&(h=(o&15)<<18|(l&63)<<12|(u&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Ta(n)}var Hn=4096;function Ta(e){let t=e.length;if(t<=Hn)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||G(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||G(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||G(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||G(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=Ne(function(e){e=e>>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||G(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||G(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||G(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||G(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||G(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=Ne(function(e){e=e>>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||G(e,4,this.length),Xe.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||G(e,4,this.length),Xe.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||G(e,8,this.length),Xe.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||G(e,8,this.length),Xe.read(this,e,!1,52,8)};function oe(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;oe(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;oe(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function ii(e,t,r,n,i){ui(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function oi(e,t,r,n,i){ui(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}T.prototype.writeBigUInt64LE=Ne(function(e,t=0){return ii(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=Ne(function(e,t=0){return oi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);oe(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);oe(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};T.prototype.writeBigInt64LE=Ne(function(e,t=0){return ii(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=Ne(function(e,t=0){return oi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function si(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ai(e,t,r,n,i){return t=+t,r=r>>>0,i||si(e,t,r,4,34028234663852886e22,-34028234663852886e22),Xe.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return ai(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return ai(this,e,t,!1,r)};function li(e,t,r,n,i){return t=+t,r=r>>>0,i||si(e,t,r,8,17976931348623157e292,-17976931348623157e292),Xe.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return li(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return li(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let i;if(typeof e=="number")for(i=t;i2**32?i=zn(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=zn(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function zn(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Oa(e,t,r){et(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&vt(t,e.length-(r+1))}function ui(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Ze.ERR_OUT_OF_RANGE("value",a,e)}Oa(n,i,o)}function et(e,t){if(typeof e!="number")throw new Ze.ERR_INVALID_ARG_TYPE(t,"number",e)}function vt(e,t,r){throw Math.floor(e)!==e?(et(e,r),new Ze.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Ze.ERR_BUFFER_OUT_OF_BOUNDS:new Ze.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var ka=/[^+/0-9A-Za-z-_]/g;function Fa(e){if(e=e.split("=")[0],e=e.trim().replace(ka,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Wr(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Ma(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function ci(e){return Jr.toByteArray(Fa(e))}function rr(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function ye(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Yr(e){return e!==e}var _a=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Ne(e){return typeof BigInt>"u"?La:e}function La(){throw new Error("BigInt not supported")}});var w,m=Le(()=>{"use strict";w=he(pi())});function Na(){return!1}var Da,$a,nr,en=Le(()=>{"use strict";m();c();p();d();f();Da={},$a={existsSync:Na,promises:Da},nr=$a});function sl(...e){return e.join("/")}function al(...e){return e.join("/")}var Ti,ll,ul,we,sn=Le(()=>{"use strict";m();c();p();d();f();Ti="/",ll={sep:Ti},ul={resolve:sl,posix:ll,join:al,sep:Ti},we=ul});var Ri=ge((Xd,Ai)=>{"use strict";m();c();p();d();f();Ai.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Oi=ge((sf,Si)=>{"use strict";m();c();p();d();f();var pl=Ri();Si.exports=e=>{let t=pl(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}});var or,ki=Le(()=>{"use strict";m();c();p();d();f();or=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var Mi=ge((Bf,Fi)=>{"use strict";m();c();p();d();f();Fi.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var Li=ge((Yf,_i)=>{"use strict";m();c();p();d();f();_i.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var un=ge((nm,Ni)=>{"use strict";m();c();p();d();f();var hl=Li();Ni.exports=e=>typeof e=="string"?e.replace(hl(),""):e});var Di=ge((xm,ar)=>{"use strict";m();c();p();d();f();ar.exports=(e={})=>{let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let r=new URL(`${t}/issues/new`),n=["body","title","labels","template","milestone","assignee","projects"];for(let i of n){let o=e[i];if(o!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(o))throw new TypeError(`The \`${i}\` option should be an array`);o=o.join(",")}r.searchParams.set(i,o)}}return r.toString()};ar.exports.default=ar.exports});var Vi=ge((Oy,xl)=>{xl.exports={name:"@prisma/engines-version",version:"5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"bf0e5e8a04cada8225617067eaa03d041e2bba36"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.34",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Qi=ge(()=>{"use strict";m();c();p();d();f()});var Dn=ge((OA,ls)=>{"use strict";m();c();p();d();f();ls.exports=function(){function e(t,r,n,i,o){return tn?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;snn,Decimal:()=>Te,Extensions:()=>Zr,MetricsClient:()=>nt,NotFoundError:()=>Me,PrismaClientInitializationError:()=>V,PrismaClientKnownRequestError:()=>W,PrismaClientRustPanicError:()=>ue,PrismaClientUnknownRequestError:()=>K,PrismaClientValidationError:()=>H,Public:()=>Xr,Sql:()=>se,defineDmmfProperty:()=>ji,empty:()=>Gi,getPrismaClient:()=>ea,getRuntime:()=>Xo,join:()=>Ji,makeStrictEnum:()=>ta,makeTypedQueryFactory:()=>qi,objectEnumValues:()=>ur,raw:()=>bn,skip:()=>cr,sqltag:()=>En,warnEnvConflicts:()=>void 0,warnOnce:()=>It});module.exports=la(wp);m();c();p();d();f();var Zr={};xt(Zr,{defineExtension:()=>di,getExtensionContext:()=>fi});m();c();p();d();f();m();c();p();d();f();function di(e){return typeof e=="function"?e:t=>t.$extends(e)}m();c();p();d();f();function fi(e){return e}var Xr={};xt(Xr,{validator:()=>mi});m();c();p();d();f();m();c();p();d();f();function mi(...e){return t=>t}m();c();p();d();f();m();c();p();d();f();var ir={};xt(ir,{$:()=>bi,bgBlack:()=>Ka,bgBlue:()=>Za,bgCyan:()=>el,bgGreen:()=>za,bgMagenta:()=>Xa,bgRed:()=>Ha,bgWhite:()=>tl,bgYellow:()=>Ya,black:()=>Qa,blue:()=>We,bold:()=>pe,cyan:()=>ke,dim:()=>Pt,gray:()=>Rt,green:()=>Ct,grey:()=>Wa,hidden:()=>qa,inverse:()=>Ua,italic:()=>ja,magenta:()=>Ja,red:()=>Ge,reset:()=>Ba,strikethrough:()=>Va,underline:()=>Tt,white:()=>Ga,yellow:()=>At});m();c();p();d();f();var tn,gi,hi,yi,wi=!0;typeof y<"u"&&({FORCE_COLOR:tn,NODE_DISABLE_COLORS:gi,NO_COLOR:hi,TERM:yi}=y.env||{},wi=y.stdout&&y.stdout.isTTY);var bi={enabled:!gi&&hi==null&&yi!=="dumb"&&(tn!=null&&tn!=="0"||wi)};function q(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!bi.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Ba=q(0,0),pe=q(1,22),Pt=q(2,22),ja=q(3,23),Tt=q(4,24),Ua=q(7,27),qa=q(8,28),Va=q(9,29),Qa=q(30,39),Ge=q(31,39),Ct=q(32,39),At=q(33,39),We=q(34,39),Ja=q(35,39),ke=q(36,39),Ga=q(37,39),Rt=q(90,39),Wa=q(90,39),Ka=q(40,49),Ha=q(41,49),za=q(42,49),Ya=q(43,49),Za=q(44,49),Xa=q(45,49),el=q(46,49),tl=q(47,49);m();c();p();d();f();var rl=100,Ei=["green","yellow","blue","magenta","cyan","red"],St=[],xi=Date.now(),nl=0,rn=typeof y<"u"?y.env:{};globalThis.DEBUG??=rn.DEBUG??"";globalThis.DEBUG_COLORS??=rn.DEBUG_COLORS?rn.DEBUG_COLORS==="true":!0;var Ot={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function il(e){let t={color:Ei[nl++%Ei.length],enabled:Ot.enabled(e),namespace:e,log:Ot.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&St.push([o,...n]),St.length>rl&&St.shift(),Ot.enabled(o)||i){let l=n.map(g=>typeof g=="string"?g:ol(g)),u=`+${Date.now()-xi}ms`;xi=Date.now(),globalThis.DEBUG_COLORS?a(ir[s](pe(o)),...l,ir[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var nn=new Proxy(il,{get:(e,t)=>Ot[t],set:(e,t,r)=>Ot[t]=r});function ol(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function vi(e=7500){let t=St.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(` -`);return t.length{let e;(O=>(O.findUnique="findUnique",O.findUniqueOrThrow="findUniqueOrThrow",O.findFirst="findFirst",O.findFirstOrThrow="findFirstOrThrow",O.findMany="findMany",O.create="create",O.createMany="createMany",O.createManyAndReturn="createManyAndReturn",O.update="update",O.updateMany="updateMany",O.upsert="upsert",O.delete="delete",O.deleteMany="deleteMany",O.groupBy="groupBy",O.count="count",O.aggregate="aggregate",O.findRaw="findRaw",O.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(De||={});m();c();p();d();f();sn();function an(e){return we.sep===we.posix.sep?e:e.split(we.sep).join(we.posix.sep)}var Mt={};xt(Mt,{error:()=>ml,info:()=>fl,log:()=>dl,query:()=>gl,should:()=>Ii,tags:()=>Ft,warn:()=>ln});m();c();p();d();f();var Ft={error:Ge("prisma:error"),warn:At("prisma:warn"),info:ke("prisma:info"),query:We("prisma:query")},Ii={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function dl(...e){console.log(...e)}function ln(e,...t){Ii.warn()&&console.warn(`${Ft.warn} ${e}`,...t)}function fl(e,...t){console.info(`${Ft.info} ${e}`,...t)}function ml(e,...t){console.error(`${Ft.error} ${e}`,...t)}function gl(e,...t){console.log(`${Ft.query} ${e}`,...t)}m();c();p();d();f();function sr(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}m();c();p();d();f();function Fe(e,t){throw new Error(t)}m();c();p();d();f();function cn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}m();c();p();d();f();var pn=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});m();c();p();d();f();function rt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}m();c();p();d();f();function dn(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{$i.has(e)||($i.add(e),ln(t,...r))};m();c();p();d();f();var W=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};re(W,"PrismaClientKnownRequestError");var Me=class extends W{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};re(Me,"NotFoundError");m();c();p();d();f();var V=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};re(V,"PrismaClientInitializationError");m();c();p();d();f();var ue=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};re(ue,"PrismaClientRustPanicError");m();c();p();d();f();var K=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};re(K,"PrismaClientUnknownRequestError");m();c();p();d();f();var H=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};re(H,"PrismaClientValidationError");m();c();p();d();f();var nt=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};m();c();p();d();f();m();c();p();d();f();function _t(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function ji(e,t){let r=_t(()=>yl(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function yl(e){return{datamodel:{models:fn(e.models),enums:fn(e.enums),types:fn(e.types)}}}function fn(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}m();c();p();d();f();var lr=Symbol(),mn=new WeakMap,Ie=class{constructor(t){t===lr?mn.set(this,`Prisma.${this._getName()}`):mn.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return mn.get(this)}},Lt=class extends Ie{_getNamespace(){return"NullTypes"}},Nt=class extends Lt{};gn(Nt,"DbNull");var Dt=class extends Lt{};gn(Dt,"JsonNull");var $t=class extends Lt{};gn($t,"AnyNull");var ur={classes:{DbNull:Nt,JsonNull:Dt,AnyNull:$t},instances:{DbNull:new Nt(lr),JsonNull:new Dt(lr),AnyNull:new $t(lr)}};function gn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}m();c();p();d();f();var Ui=Symbol(),Bt=class{constructor(t){if(t!==Ui)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?cr:t}},cr=new Bt(Ui);function be(e){return e instanceof Bt}m();c();p();d();f();var hn=new WeakMap,jt=class{constructor(t,r){hn.set(this,{sql:t,values:r})}get sql(){return hn.get(this).sql}get values(){return hn.get(this).values}};function qi(e){return(...t)=>new jt(e,t)}m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();function Ut(e){return{ok:!1,error:e,map(){return Ut(e)},flatMap(){return Ut(e)}}}var yn=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},wn=e=>{let t=new yn,r=Ee(t,e.transactionContext.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:Ee(t,e.queryRaw.bind(e)),executeRaw:Ee(t,e.executeRaw.bind(e)),provider:e.provider,transactionContext:async(...i)=>(await r(...i)).map(s=>wl(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=El(t,e.getConnectionInfo.bind(e))),n},wl=(e,t)=>{let r=Ee(e,t.startTransaction.bind(t));return{adapterName:t.adapterName,provider:t.provider,queryRaw:Ee(e,t.queryRaw.bind(t)),executeRaw:Ee(e,t.executeRaw.bind(t)),startTransaction:async(...n)=>(await r(...n)).map(o=>bl(e,o))}},bl=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:Ee(e,t.queryRaw.bind(t)),executeRaw:Ee(e,t.executeRaw.bind(t)),commit:Ee(e,t.commit.bind(t)),rollback:Ee(e,t.rollback.bind(t))});function Ee(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return Ut({kind:"GenericJs",id:i})}}}function El(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return Ut({kind:"GenericJs",id:i})}}}var Xs=he(Vi());var GO=he(Qi());ki();en();sn();m();c();p();d();f();var se=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}m();c();p();d();f();m();c();p();d();f();var pr={enumerable:!0,configurable:!0,writable:!0};function dr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>pr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Wi=Symbol.for("nodejs.util.inspect.custom");function ve(e,t){let r=vl(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=Ki(Reflect.ownKeys(o),r),a=Ki(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{...pr,...l?.getPropertyDescriptor(s)}:pr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[Wi]=function(){let o={...this};return delete o[Wi],o},i}function vl(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function Ki(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}m();c();p();d();f();function it(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}m();c();p();d();f();function fr(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}m();c();p();d();f();m();c();p();d();f();var ot=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r,n=(i,o)=>o.write(i)){let i=r.length-1;for(let o=0;o0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};m();c();p();d();f();m();c();p();d();f();function Hi(e){return e.substring(0,1).toLowerCase()+e.substring(1)}m();c();p();d();f();function st(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function mr(e){return e.toString()!=="Invalid Date"}m();c();p();d();f();m();c();p();d();f();var at=9e15,Ue=1e9,xn="0123456789abcdef",hr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",yr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",vn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-at,maxE:at,crypto:!1},Xi,_e,L=!0,br="[DecimalError] ",je=br+"Invalid argument: ",eo=br+"Precision limit exceeded",to=br+"crypto unavailable",ro="[object Decimal]",te=Math.floor,J=Math.pow,Pl=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Tl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Cl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,no=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fe=1e7,I=7,Al=9007199254740991,Rl=hr.length-1,Pn=yr.length-1,R={toStringTag:ro};R.absoluteValue=R.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),k(e)};R.ceil=function(){return k(new this.constructor(this),this.e+1,2)};R.clampedTo=R.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(je+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};R.comparedTo=R.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};R.cosine=R.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+I,n.rounding=1,r=Sl(n,lo(n,r)),n.precision=e,n.rounding=t,k(_e==2||_e==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};R.cubeRoot=R.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(L=!1,o=g.s*J(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=Z(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=J(r,1/3),e=te((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(g),n=j(u.plus(g).times(a),u.plus(l),s+2,1),Z(a.d).slice(0,s)===(r=Z(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(k(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(k(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return L=!0,k(n,e,h.rounding,t)};R.decimalPlaces=R.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-te(this.e/I))*I,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};R.dividedBy=R.div=function(e){return j(this,new this.constructor(e))};R.dividedToIntegerBy=R.divToInt=function(e){var t=this,r=t.constructor;return k(j(t,new r(e),0,1,1),r.precision,r.rounding)};R.equals=R.eq=function(e){return this.cmp(e)===0};R.floor=function(){return k(new this.constructor(this),this.e+1,3)};R.greaterThan=R.gt=function(e){return this.cmp(e)>0};R.greaterThanOrEqualTo=R.gte=function(e){var t=this.cmp(e);return t==1||t===0};R.hyperbolicCosine=R.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/xr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=lt(s,1,o.times(t),new s(1),!0);for(var l,u=e,g=new s(8);u--;)l=o.times(o),o=a.minus(l.times(g.minus(l.times(g))));return k(o,s.precision=r,s.rounding=n,!0)};R.hyperbolicSine=R.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=lt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/xr(5,e)),i=lt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,k(i,t,r,!0)};R.hyperbolicTangent=R.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,j(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};R.inverseCosine=R.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?de(r,i,o):new r(0):new r(NaN):t.isZero()?de(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=de(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};R.inverseHyperbolicCosine=R.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,L=!1,r=r.times(r).minus(1).sqrt().plus(r),L=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};R.inverseHyperbolicSine=R.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,L=!1,r=r.times(r).plus(1).sqrt().plus(r),L=!0,n.precision=e,n.rounding=t,r.ln())};R.inverseHyperbolicTangent=R.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?k(new o(i),e,t,!0):(o.precision=r=n-i.e,i=j(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};R.inverseSine=R.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=de(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};R.inverseTangent=R.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,P=g.rounding;if(u.isFinite()){if(u.isZero())return new g(u);if(u.abs().eq(1)&&h+4<=Pn)return s=de(g,h+4,P).times(.25),s.s=u.s,s}else{if(!u.s)return new g(NaN);if(h+4<=Pn)return s=de(g,h+4,P).times(.5),s.s=u.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/I+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(L=!1,t=Math.ceil(a/I),n=1,l=u.times(u),s=new g(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};R.isNaN=function(){return!this.s};R.isNegative=R.isNeg=function(){return this.s<0};R.isPositive=R.isPos=function(){return this.s>0};R.isZero=function(){return!!this.d&&this.d[0]===0};R.lessThan=R.lt=function(e){return this.cmp(e)<0};R.lessThanOrEqualTo=R.lte=function(e){return this.cmp(e)<1};R.logarithm=R.log=function(e){var t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,P=g.rounding,S=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new g(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(L=!1,a=h+S,s=Be(u,a),n=t?wr(g,a+10):Be(e,a),l=j(s,n,a,1),Vt(l.d,i=h,P))do if(a+=10,s=Be(u,a),n=t?wr(g,a+10):Be(e,a),l=j(s,n,a,1),!o){+Z(l.d).slice(i+1,i+15)+1==1e14&&(l=k(l,h+1,0));break}while(Vt(l.d,i+=10,P));return L=!0,k(l,h,P)};R.minus=R.sub=function(e){var t,r,n,i,o,s,a,l,u,g,h,P,S=this,C=S.constructor;if(e=new C(e),!S.d||!e.d)return!S.s||!e.s?e=new C(NaN):S.d?e.s=-e.s:e=new C(e.d||S.s!==e.s?S:NaN),e;if(S.s!=e.s)return e.s=-e.s,S.plus(e);if(u=S.d,P=e.d,a=C.precision,l=C.rounding,!u[0]||!P[0]){if(P[0])e.s=-e.s;else if(u[0])e=new C(S);else return new C(l===3?-0:0);return L?k(e,a,l):e}if(r=te(e.e/I),g=te(S.e/I),u=u.slice(),o=g-r,o){for(h=o<0,h?(t=u,o=-o,s=P.length):(t=P,r=g,s=u.length),n=Math.max(Math.ceil(a/I),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=P.length,h=n0;--n)u[s++]=0;for(n=P.length;n>o;){if(u[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=g.length,s-i<0&&(i=s,r=g,g=u,u=r),t=0;i;)t=(u[--i]=u[i]+g[i]+t)/fe|0,u[i]%=fe;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=Er(u,n),L?k(e,a,l):e};R.precision=R.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(je+e);return r.d?(t=io(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};R.round=function(){var e=this,t=e.constructor;return k(new t(e),e.e+1,t.rounding)};R.sine=R.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+I,n.rounding=1,r=kl(n,lo(n,r)),n.precision=e,n.rounding=t,k(_e>2?r.neg():r,e,t,!0)):new n(NaN)};R.squareRoot=R.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,g=s.constructor;if(u!==1||!a||!a[0])return new g(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(L=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=Z(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=te((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new g(t)):n=new g(u.toString()),r=(l=g.precision)+3;;)if(o=n,n=o.plus(j(s,o,r+2,1)).times(.5),Z(o.d).slice(0,r)===(t=Z(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(k(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(k(n,l+1,1),e=!n.times(n).eq(s));break}return L=!0,k(n,l,g.rounding,e)};R.tangent=R.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=j(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,k(_e==2||_e==4?r.neg():r,e,t,!0)):new n(NaN)};R.times=R.mul=function(e){var t,r,n,i,o,s,a,l,u,g=this,h=g.constructor,P=g.d,S=(e=new h(e)).d;if(e.s*=g.s,!P||!P[0]||!S||!S[0])return new h(!e.s||P&&!P[0]&&!S||S&&!S[0]&&!P?NaN:!P||!S?e.s/0:e.s*0);for(r=te(g.e/I)+te(e.e/I),l=P.length,u=S.length,l=0;){for(t=0,i=l+n;i>n;)a=o[i]+S[n]*P[i-n-1]+t,o[i--]=a%fe|0,t=a/fe|0;o[i]=(o[i]+t)%fe|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Er(o,r),L?k(e,h.precision,h.rounding):e};R.toBinary=function(e,t){return An(this,2,e,t)};R.toDecimalPlaces=R.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ae(e,0,Ue),t===void 0?t=n.rounding:ae(t,0,8),k(r,e+r.e+1,t))};R.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Pe(n,!0):(ae(e,0,Ue),t===void 0?t=i.rounding:ae(t,0,8),n=k(new i(n),e+1,t),r=Pe(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=Pe(i):(ae(e,0,Ue),t===void 0?t=o.rounding:ae(t,0,8),n=k(new o(i),e+i.e+1,t),r=Pe(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};R.toFraction=function(e){var t,r,n,i,o,s,a,l,u,g,h,P,S=this,C=S.d,A=S.constructor;if(!C)return new A(S);if(u=r=new A(1),n=l=new A(0),t=new A(n),o=t.e=io(C)-S.e-1,s=o%I,t.d[0]=J(10,s<0?I+s:s),e==null)e=o>0?t:u;else{if(a=new A(e),!a.isInt()||a.lt(u))throw Error(je+a);e=a.gt(t)?o>0?t:u:a}for(L=!1,a=new A(Z(C)),g=A.precision,A.precision=o=C.length*I*2;h=j(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(h.times(i)),l=i,i=t,t=a.minus(h.times(i)),a=i;return i=j(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=S.s,P=j(u,n,o,1).minus(S).abs().cmp(j(l,r,o,1).minus(S).abs())<1?[u,n]:[l,r],A.precision=g,L=!0,P};R.toHexadecimal=R.toHex=function(e,t){return An(this,16,e,t)};R.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:ae(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(L=!1,r=j(r,e,0,t,1).times(e),L=!0,k(r)):(e.s=r.s,r=e),r};R.toNumber=function(){return+this};R.toOctal=function(e,t){return An(this,8,e,t)};R.toPower=R.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(J(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return k(a,n,o);if(t=te(e.e/I),t>=e.d.length-1&&(r=u<0?-u:u)<=Al)return i=oo(l,a,r,n),e.s<0?new l(1).div(i):k(i,n,o);if(s=a.s,s<0){if(tl.maxE+1||t0?s/0:0):(L=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Tn(e.times(Be(a,n+r)),n),i.d&&(i=k(i,n+5,1),Vt(i.d,n,o)&&(t=n+10,i=k(Tn(e.times(Be(a,t+r)),t),t+5,1),+Z(i.d).slice(n+1,n+15)+1==1e14&&(i=k(i,n+1,0)))),i.s=s,L=!0,l.rounding=o,k(i,n,o))};R.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Pe(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ae(e,1,Ue),t===void 0?t=i.rounding:ae(t,0,8),n=k(new i(n),e,t),r=Pe(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toSignificantDigits=R.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ae(e,1,Ue),t===void 0?t=n.rounding:ae(t,0,8)),k(new n(r),e,t)};R.toString=function(){var e=this,t=e.constructor,r=Pe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};R.truncated=R.trunc=function(){return k(new this.constructor(this),this.e+1,1)};R.valueOf=R.toJSON=function(){var e=this,t=e.constructor,r=Pe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Z(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(je+e)}function Vt(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=I,i=0):(i=Math.ceil((t+1)/I),t%=I),o=J(10,I-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==J(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==J(10,t-3)-1,s}function gr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Sl(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/xr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=lt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var j=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,l){var u,g,h,P,S,C,A,F,_,N,M,O,Y,U,Et,Q,ie,Se,X,Ye,Xt=n.constructor,Qr=n.s==i.s?1:-1,ee=n.d,$=i.d;if(!ee||!ee[0]||!$||!$[0])return new Xt(!n.s||!i.s||(ee?$&&ee[0]==$[0]:!$)?NaN:ee&&ee[0]==0||!$?Qr*0:Qr/0);for(l?(S=1,g=n.e-i.e):(l=fe,S=I,g=te(n.e/S)-te(i.e/S)),X=$.length,ie=ee.length,_=new Xt(Qr),N=_.d=[],h=0;$[h]==(ee[h]||0);h++);if($[h]>(ee[h]||0)&&g--,o==null?(U=o=Xt.precision,s=Xt.rounding):a?U=o+(n.e-i.e)+1:U=o,U<0)N.push(1),C=!0;else{if(U=U/S+2|0,h=0,X==1){for(P=0,$=$[0],U++;(h1&&($=e($,P,l),ee=e(ee,P,l),X=$.length,ie=ee.length),Q=X,M=ee.slice(0,X),O=M.length;O=l/2&&++Se;do P=0,u=t($,M,X,O),u<0?(Y=M[0],X!=O&&(Y=Y*l+(M[1]||0)),P=Y/Se|0,P>1?(P>=l&&(P=l-1),A=e($,P,l),F=A.length,O=M.length,u=t(A,M,F,O),u==1&&(P--,r(A,X=10;P/=10)h++;_.e=h+g*S-1,k(_,a?o+_.e+1:o,s,C)}return _}}();function k(e,t,r,n){var i,o,s,a,l,u,g,h,P,S=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=I,s=t,g=h[P=0],l=g/J(10,i-s-1)%10|0;else if(P=Math.ceil((o+1)/I),a=h.length,P>=a)if(n){for(;a++<=P;)h.push(0);g=l=0,i=1,o%=I,s=o-I+1}else break e;else{for(g=a=h[P],i=1;a>=10;a/=10)i++;o%=I,s=o-I+i,l=s<0?0:g/J(10,i-s-1)%10|0}if(n=n||t<0||h[P+1]!==void 0||(s<0?g:g%J(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?g/J(10,i-s):0:h[P-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,u?(t-=e.e+1,h[0]=J(10,(I-t%I)%I),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=P,a=1,P--):(h.length=P+1,a=J(10,I-o),h[P]=s>0?(g/J(10,i-s)%J(10,s)|0)*a:0),u)for(;;)if(P==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==fe&&(h[0]=1));break}else{if(h[P]+=a,h[P]!=fe)break;h[P--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return L&&(e.e>S.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+$e(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+$e(-i-1)+o,r&&(n=r-s)>0&&(o+=$e(n))):i>=s?(o+=$e(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+$e(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=$e(n))),o}function Er(e,t){var r=e[0];for(t*=I;r>=10;r/=10)t++;return t}function wr(e,t,r){if(t>Rl)throw L=!0,r&&(e.precision=r),Error(eo);return k(new e(hr),t,1,!0)}function de(e,t,r){if(t>Pn)throw Error(eo);return k(new e(yr),t,r,!0)}function io(e){var t=e.length-1,r=t*I+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function $e(e){for(var t="";e--;)t+="0";return t}function oo(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/I+4);for(L=!1;;){if(r%2&&(o=o.times(t),Yi(o.d,s)&&(i=!0)),r=te(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),Yi(t.d,s)}return L=!0,o}function zi(e){return e.d[e.d.length-1]&1}function so(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new P(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(L=!1,l=C):l=t,a=new P(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(J(2,h))/Math.LN10*2+5|0,l+=n,r=o=s=new P(1),P.precision=l;;){if(o=k(o.times(e),l,1),r=r.times(++g),a=s.plus(j(o,r,l,1)),Z(a.d).slice(0,l)===Z(s.d).slice(0,l)){for(i=h;i--;)s=k(s.times(s),l,1);if(t==null)if(u<3&&Vt(s.d,l-n,S,u))P.precision=l+=10,r=o=a=new P(1),g=0,u++;else return k(s,P.precision=C,S,L=!0);else return P.precision=C,s}s=a}}function Be(e,t){var r,n,i,o,s,a,l,u,g,h,P,S=1,C=10,A=e,F=A.d,_=A.constructor,N=_.rounding,M=_.precision;if(A.s<0||!F||!F[0]||!A.e&&F[0]==1&&F.length==1)return new _(F&&!F[0]?-1/0:A.s!=1?NaN:F?0:A);if(t==null?(L=!1,g=M):g=t,_.precision=g+=C,r=Z(F),n=r.charAt(0),Math.abs(o=A.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=Z(A.d),n=r.charAt(0),S++;o=A.e,n>1?(A=new _("0."+r),o++):A=new _(n+"."+r.slice(1))}else return u=wr(_,g+2,M).times(o+""),A=Be(new _(n+"."+r.slice(1)),g-C).plus(u),_.precision=M,t==null?k(A,M,N,L=!0):A;for(h=A,l=s=A=j(A.minus(1),A.plus(1),g,1),P=k(A.times(A),g,1),i=3;;){if(s=k(s.times(P),g,1),u=l.plus(j(s,new _(i),g,1)),Z(u.d).slice(0,g)===Z(l.d).slice(0,g))if(l=l.times(2),o!==0&&(l=l.plus(wr(_,g+2,M).times(o+""))),l=j(l,new _(S),g,1),t==null)if(Vt(l.d,g-C,N,a))_.precision=g+=C,u=s=A=j(h.minus(1),h.plus(1),g,1),P=k(A.times(A),g,1),i=a=1;else return k(l,_.precision=M,N,L=!0);else return _.precision=M,l;l=u,i+=2}}function ao(e){return String(e.s*e.s/0)}function Cn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%I,r<0&&(n+=I),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),no.test(t))return Cn(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Tl.test(t))r=16,t=t.toLowerCase();else if(Pl.test(t))r=2;else if(Cl.test(t))r=8;else throw Error(je+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=oo(n,new n(r),o,o*2)),u=gr(t,r,fe),g=u.length-1,o=g;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=Er(u,g),e.d=u,L=!1,s&&(e=j(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?J(2,l):He.pow(2,l))),L=!0,e)}function kl(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:lt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/xr(5,r)),t=lt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function lt(e,t,r,n,i){var o,s,a,l,u=1,g=e.precision,h=Math.ceil(g/I);for(L=!1,l=r.times(r),a=new e(n);;){if(s=j(a.times(l),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=j(s.times(l),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return L=!0,s.d.length=h+1,s}function xr(e,t){for(var r=e;--t;)r*=e;return r}function lo(e,t){var r,n=t.s<0,i=de(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return _e=n?4:1,t;if(r=t.divToInt(i),r.isZero())_e=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return _e=zi(r)?n?2:3:n?4:1,t;_e=zi(r)?n?1:4:n?3:2}return t.minus(i).abs()}function An(e,t,r,n){var i,o,s,a,l,u,g,h,P,S=e.constructor,C=r!==void 0;if(C?(ae(r,1,Ue),n===void 0?n=S.rounding:ae(n,0,8)):(r=S.precision,n=S.rounding),!e.isFinite())g=ao(e);else{for(g=Pe(e),s=g.indexOf("."),C?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),P=new S(1),P.e=g.length-s,P.d=gr(Pe(P),10,i),P.e=P.d.length),h=gr(g,10,i),o=l=h.length;h[--l]==0;)h.pop();if(!h[0])g=C?"0p+0":"0";else{if(s<0?o--:(e=new S(e),e.d=h,e.e=o,e=j(e,P,r,n,0,i),h=e.d,o=e.e,u=Xi),s=h[r],a=i/2,u=u||h[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,u)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)g+="0";for(h=gr(g,i,t),l=h.length;!h[l-1];--l);for(s=1,g="1.";sl)for(o-=l;o--;)g+="0";else ot)return e.length=t,!0}function Fl(e){return new this(e).abs()}function Ml(e){return new this(e).acos()}function Il(e){return new this(e).acosh()}function _l(e,t){return new this(e).plus(t)}function Ll(e){return new this(e).asin()}function Nl(e){return new this(e).asinh()}function Dl(e){return new this(e).atan()}function $l(e){return new this(e).atanh()}function Bl(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=de(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?de(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=de(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(j(e,t,o,1)),t=de(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(j(e,t,o,1)),r}function jl(e){return new this(e).cbrt()}function Ul(e){return k(e=new this(e),e.e+1,2)}function ql(e,t,r){return new this(e).clamp(t,r)}function Vl(e){if(!e||typeof e!="object")throw Error(br+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Ue,"rounding",0,8,"toExpNeg",-at,0,"toExpPos",0,at,"maxE",0,at,"minE",-at,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(je+r+": "+n);if(r="crypto",i&&(this[r]=vn[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(to);else this[r]=!1;else throw Error(je+r+": "+n);return this}function Ql(e){return new this(e).cos()}function Jl(e){return new this(e).cosh()}function uo(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,Zi(o)){u.s=o.s,L?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;L?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(to);else for(;o=10;i/=10)n++;n`}};function ct(e){return e instanceof Qt}m();c();p();d();f();m();c();p();d();f();var vr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};m();c();p();d();f();var Pr=e=>e,Tr={bold:Pr,red:Pr,green:Pr,dim:Pr,enabled:!1},co={bold:pe,red:Ge,green:Ct,dim:Pt,enabled:!0},pt={write(e){e.writeLine(",")}};m();c();p();d();f();var Ce=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};m();c();p();d();f();var qe=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var dt=class extends qe{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new vr(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new Ce("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(pt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};m();c();p();d();f();var po=": ",Cr=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+po.length}write(t){let r=new Ce(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(po).write(this.value)}};m();c();p();d();f();var ft=class e extends qe{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let l;if(s.value instanceof e?l=s.value.getField(a):s.value instanceof dt&&(l=s.value.getField(Number(a))),!l)return;s=l}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new Ce("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(pt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};m();c();p();d();f();var z=class extends qe{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Ce(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var Rn=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function mt(e){return new Rn(fo(e))}function fo(e){let t=new ft;for(let[r,n]of Object.entries(e)){let i=new Cr(r,mo(n));t.addField(i)}return t}function mo(e){if(typeof e=="string")return new z(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new z(String(e));if(typeof e=="bigint")return new z(`${e}n`);if(e===null)return new z("null");if(e===void 0)return new z("undefined");if(ut(e))return new z(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new z(`Buffer.alloc(${e.byteLength})`):new z(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=mr(e)?e.toISOString():"Invalid Date";return new z(`new Date("${t}")`)}return e instanceof Ie?new z(`Prisma.${e._getName()}`):ct(e)?new z(`prisma.${Hi(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?yu(e):typeof e=="object"?fo(e):new z(Object.prototype.toString.call(e))}function yu(e){let t=new dt;for(let r of e)t.addItem(mo(r));return t}function Ar(e,t){let r=t==="pretty"?co:Tr,n=e.renderAllMessages(r),i=new ot(0,{colors:r}).write(e).toString();return{message:n,args:i}}function go(e){if(e===void 0)return"";let t=mt(e);return new ot(0,{colors:Tr}).write(t).toString()}m();c();p();d();f();var wu="P2037";function Rr({error:e,user_facing_error:t},r,n){return t.error_code?new W(bu(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new K(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function bu(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===wu&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();var Jt="";function ho(e){var t=e.split(` -`);return t.reduce(function(r,n){var i=vu(n)||Tu(n)||Ru(n)||Fu(n)||Ou(n);return i&&r.push(i),r},[])}var Eu=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,xu=/\((\S*)(?::(\d+))(?::(\d+))\)/;function vu(e){var t=Eu.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=xu.exec(t[2]);return n&&i!=null&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:r?null:t[2],methodName:t[1]||Jt,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var Pu=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Tu(e){var t=Pu.exec(e);return t?{file:t[2],methodName:t[1]||Jt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Cu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Au=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Ru(e){var t=Cu.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Au.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||Jt,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Su=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Ou(e){var t=Su.exec(e);return t?{file:t[3],methodName:t[1]||Jt,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var ku=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Fu(e){var t=ku.exec(e);return t?{file:t[2],methodName:t[1]||Jt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Sn=class{getLocation(){return null}},On=class{constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=ho(t).find(i=>{if(!i.file)return!1;let o=an(i.file);return o!==""&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function Ve(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Sn:new On}m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();var yo={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function gt(e={}){let t=Iu(e);return Object.entries(t).reduce((n,[i,o])=>(yo[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Iu(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Sr(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function wo(e,t){let r=Sr(e);return t({action:"aggregate",unpacker:r,argsMapper:gt})(e)}m();c();p();d();f();function _u(e={}){let{select:t,...r}=e;return typeof t=="object"?gt({...r,_count:t}):gt({...r,_count:{_all:!0}})}function Lu(e={}){return typeof e.select=="object"?t=>Sr(e)(t)._count:t=>Sr(e)(t)._count._all}function bo(e,t){return t({action:"count",unpacker:Lu(e),argsMapper:_u})(e)}m();c();p();d();f();function Nu(e={}){let t=gt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function Du(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Eo(e,t){return t({action:"groupBy",unpacker:Du(e),argsMapper:Nu})(e)}function xo(e,t,r){if(t==="aggregate")return n=>wo(n,r);if(t==="count")return n=>bo(n,r);if(t==="groupBy")return n=>Eo(n,r)}m();c();p();d();f();function vo(e,t){let r=t.fields.filter(i=>!i.relationName),n=pn(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Qt(e,o,s.type,s.isList,s.kind==="enum")},...dr(Object.keys(n))})}m();c();p();d();f();m();c();p();d();f();var Po=e=>Array.isArray(e)?e:e.split("."),kn=(e,t)=>Po(t).reduce((r,n)=>r&&r[n],e),To=(e,t,r)=>Po(t).reduceRight((n,i,o,s)=>Object.assign({},kn(e,s.slice(0,o)),{[i]:n}),r);function $u(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Bu(e,t,r){return t===void 0?e??{}:To(t,r,e||!0)}function Fn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=Ve(e._errorFormat),g=$u(n,i),h=Bu(l,o,g),P=r({dataPath:g,callsite:u})(h),S=ju(e,t);return new Proxy(P,{get(C,A){if(!S.includes(A))return C[A];let _=[a[A].type,r,A],N=[g,h];return Fn(e,..._,...N)},...dr([...S,...Object.getOwnPropertyNames(P)])})}}function ju(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}m();c();p();d();f();m();c();p();d();f();var Oo=he(Mi());m();c();p();d();f();en();m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();var Co={keyword:ke,entity:ke,value:e=>pe(We(e)),punctuation:We,directive:ke,function:ke,variable:e=>pe(We(e)),string:e=>pe(Ct(e)),boolean:At,number:ke,comment:Rt};var Uu=e=>e,Or={},qu=0,D={manual:Or.Prism&&Or.Prism.manual,disableWorkerMessageHandler:Or.Prism&&Or.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof me){let t=e;return new me(t.type,D.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(D.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(Se instanceof me)continue;if(Y&&Q!=t.length-1){N.lastIndex=ie;var h=N.exec(e);if(!h)break;var g=h.index+(O?h[1].length:0),P=h.index+h[0].length,a=Q,l=ie;for(let $=t.length;a<$&&(l=l&&(++Q,ie=l);if(t[Q]instanceof me)continue;u=a-Q,Se=e.slice(ie,l),h.index-=ie}else{N.lastIndex=0;var h=N.exec(Se),u=1}if(!h){if(o)break;continue}O&&(U=h[1]?h[1].length:0);var g=h.index+U,h=h[0].slice(U),P=g+h.length,S=Se.slice(0,g),C=Se.slice(P);let X=[Q,u];S&&(++Q,ie+=S.length,X.push(S));let Ye=new me(A,M?D.tokenize(h,M):h,Et,h,Y);if(X.push(Ye),C&&X.push(C),Array.prototype.splice.apply(t,X),u!=1&&D.matchGrammar(e,t,r,Q,ie,!0,A),o)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let i in n)t[i]=n[i];delete t.rest}return D.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=D.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=D.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:me};D.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};D.languages.javascript=D.languages.extend("clike",{"class-name":[D.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});D.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;D.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:D.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:D.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:D.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:D.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});D.languages.markup&&D.languages.markup.tag.addInlined("script","javascript");D.languages.js=D.languages.javascript;D.languages.typescript=D.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});D.languages.ts=D.languages.typescript;function me(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}me.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return me.stringify(r,t)}).join(""):Vu(e.type)(e.content)};function Vu(e){return Co[e]||Uu}function Ao(e){return Qu(e,D.languages.javascript)}function Qu(e,t){return D.tokenize(e,t).map(n=>me.stringify(n)).join("")}m();c();p();d();f();var Ro=he(Oi());function So(e){return(0,Ro.default)(e)}var kr=class e{static read(t){let r;try{r=nr.readFileSync(t,"utf-8")}catch{return null}return e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(tthis.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,i=[...this.lines];return i[n]=r(i[n]),new e(this.firstLineNumber,i)}mapLines(t){return new e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,i)=>i===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(` -`);return new e(t,So(n).split(` -`))}highlight(){let t=Ao(this.toString());return new e(this.firstLineNumber,t.split(` -`))}toString(){return this.lines.join(` -`)}};var Ju={red:Ge,gray:Rt,dim:Pt,bold:pe,underline:Tt,highlightSource:e=>e.highlight()},Gu={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Wu({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Ku({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=Wu({message:t,originalMethod:r,isPanic:n,callArguments:i});if(!e||typeof window<"u"||y.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=kr.read(a.fileName)?.slice(l,a.lineNumber),g=u?.lineAt(a.lineNumber);if(u&&g){let h=zu(g),P=Hu(g);if(!P)return s;s.functionName=`${P.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,C=>C.slice(0,P.openingBraceIndex))),u=o.highlightSource(u);let S=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((C,A)=>o.gray(String(A).padStart(S))+" "+C).mapLines(C=>o.dim(C)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let C=h+S+1;C+=2,s.callArguments=(0,Oo.default)(i,C).slice(C)}}return s}function Hu(e){let t=Object.keys(De.ModelAction).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function zu(e){let t=0;for(let r=0;r{if("rejectOnNotFound"in n.args){let o=ht({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new H(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof W&&o.code==="P2025"?new Me(`No ${e} found`,t):o})}}m();c();p();d();f();function Ae(e){return e.replace(/^./,t=>t.toLowerCase())}var ec=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],tc=["aggregate","count","groupBy"];function Mn(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[rc(e,t),ic(e,t),qt(r),ne("name",()=>t),ne("$name",()=>t),ne("$parent",()=>e._appliedParent)];return ve({},n)}function rc(e,t){let r=Ae(t),n=Object.keys(De.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=l=>e._request(l);s=ko(o,t,e._clientVersion,s);let a=l=>u=>{let g=Ve(e._errorFormat);return e._createPrismaPromise(h=>{let P={args:u,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:g};return s({...P,...l})})};return ec.includes(o)?Fn(e,t,a):nc(i)?xo(e,i,a):a({})}}}function nc(e){return tc.includes(e)}function ic(e,t){return Ke(ne("fields",()=>{let r=e._runtimeDataModel.models[t];return vo(t,r)}))}m();c();p();d();f();function Fo(e){return e.replace(/^./,t=>t.toUpperCase())}var In=Symbol();function Gt(e){let t=[oc(e),ne(In,()=>e),ne("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(qt(r)),ve(e,t)}function oc(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Ae),n=[...new Set(t.concat(r))];return Ke({getKeys(){return n},getPropertyValue(i){let o=Fo(i);if(e._runtimeDataModel.models[o]!==void 0)return Mn(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Mn(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Mo(e){return e[In]?e[In]:e}function Io(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return Gt(t)}m();c();p();d();f();m();c();p();d();f();function _o({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(g=>n[g]);u.length>0&&a.push(it(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(g=>!r[g]);u.length>0&&a.push(it(u))}sc(e,l.needs)&&s.push(ac(l,ve(e,s)))}return s.length>0||a.length>0?ve(e,[...s,...a]):e}function sc(e,t){return t.every(r=>cn(e,r))}function ac(e,t){return Ke(ne(e.name,()=>e.compute(t)))}m();c();p();d();f();m();c();p();d();f();function Fr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sg.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=Fr({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function No({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Fr({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let g=Ae(l);return _o({result:a,modelName:g,select:u.select,omit:u.select?void 0:{...o?.[g],...u.omit},extensions:n})}})}m();c();p();d();f();m();c();p();d();f();function Do(e){if(e instanceof se)return lc(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Do(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=Vo(o,l),a.args=s,Bo(e,a,r,n+1)}})})}function jo(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return Bo(e,t,s)}function Uo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?qo(r,n,0,e):e(r)}}function qo(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=Vo(i,l),qo(a,t,r+1,n)}})}var $o=e=>e;function Vo(e=$o,t=$o){return r=>e(t(r))}m();c();p();d();f();m();c();p();d();f();function Jo(e,t,r){let n=Ae(r);return!t.result||!(t.result.$allModels||t.result[n])?e:uc({...e,...Qo(t.name,e,t.result.$allModels),...Qo(t.name,e,t.result[n])})}function uc(e){let t=new xe,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return rt(e,n=>({...n,needs:r(n.name,new Set)}))}function Qo(e,t,r){return r?rt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:cc(t,o,i)})):{}}function cc(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Go(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function Wo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Mr=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new xe;this.modelExtensionsCache=new xe;this.queryCallbacksCache=new xe;this.clientExtensions=_t(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=_t(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Jo(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=Ae(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Ir=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Mr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Mr(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};m();c();p();d();f();var Ko=le("prisma:client"),Ho={Vercel:"vercel","Netlify CI":"netlify"};function zo({postinstall:e,ciName:t,clientVersion:r}){if(Ko("checkPlatformCaching:postinstall",e),Ko("checkPlatformCaching:ciName",t),e===!0&&t&&t in Ho){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${Ho[t]}-build`;throw console.error(n),new V(n,r)}}m();c();p();d();f();function Yo(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();var pc="Cloudflare-Workers",dc="node";function Zo(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===pc?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===dc?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var fc={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function Xo(){let e=Zo();return{id:e,prettyName:fc[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}m();c();p();d();f();m();c();p();d();f();var _n=he(un());m();c();p();d();f();function es(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}m();c();p();d();f();function ts(e){return e.split(` -`).map(t=>t.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(` -`)}m();c();p();d();f();var rs=he(Di());function ns({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,rs.default)({user:t,repo:r,template:n,title:e,body:i})}function is({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=vi(6e3-(s?.length??0)),l=ts((0,_n.default)(a)),u=n?`# Description -\`\`\` -${n} -\`\`\``:"",g=(0,_n.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report: -## Versions - -| Name | Version | -|-----------------|--------------------| -| Node | ${y.version?.padEnd(19)}| -| OS | ${t?.padEnd(19)}| -| Prisma Client | ${e?.padEnd(19)}| -| Query Engine | ${i?.padEnd(19)}| -| Database | ${o?.padEnd(19)}| - -${u} - -## Logs -\`\`\` -${l} -\`\`\` - -## Client Snippet -\`\`\`ts -// PLEASE FILL YOUR CODE SNIPPET HERE -\`\`\` - -## Schema -\`\`\`prisma -// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE -\`\`\` - -## Prisma Engine Query -\`\`\` -${s?es(s):""} -\`\`\` -`),h=ns({title:r,body:g});return`${r} - -This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. - -${Tt(h)} - -If you want the Prisma team to look into it, please open the link above \u{1F64F} -To increase the chance of success, please post your schema and a snippet of -how you used Prisma Client in the issue. -`}m();c();p();d();f();function _r({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=t[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=r[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new V(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new V("error: Missing URL environment variable, value, or override.",n);return i}m();c();p();d();f();m();c();p();d();f();function os(e){if(e?.kind==="itx")return e.options.id}m();c();p();d();f();var Ln=class{constructor(t,r,n){this.engineObject=__PrismaProxy.create({datamodel:t.datamodel,env:y.env,ignoreEnvVarErrors:!0,datasourceOverrides:t.datasourceOverrides??{},logLevel:t.logLevel,logQueries:t.logQueries??!1,logCallback:r})}async connect(t){return __PrismaProxy.connect(this.engineObject,t)}async disconnect(t){return __PrismaProxy.disconnect(this.engineObject,t)}query(t,r,n){return __PrismaProxy.execute(this.engineObject,t,r,n)}sdlSchema(){return Promise.resolve("{}")}dmmf(t){return Promise.resolve("{}")}async startTransaction(t,r){return __PrismaProxy.startTransaction(this.engineObject,t,r)}async commitTransaction(t,r){return __PrismaProxy.commitTransaction(this.engineObject,t,r)}async rollbackTransaction(t,r){return __PrismaProxy.rollbackTransaction(this.engineObject,t,r)}metrics(t){return Promise.resolve("{}")}async applyPendingMigrations(){return __PrismaProxy.applyPendingMigrations(this.engineObject)}},ss={async loadLibrary(e){if(!__PrismaProxy)throw new V("__PrismaProxy not detected make sure React Native bindings are installed",e.clientVersion);return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:Ln}}};var mc="P2036",Re=le("prisma:client:libraryEngine");function gc(e){return e.item_type==="query"&&"query"in e}function hc(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var UC=[...on,"native"],Kt=class{constructor(t,r){this.name="LibraryEngine";this.libraryLoader=ss,this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,t.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary()}async applyPendingMigrations(){await this.start(),await this.engine?.applyPendingMigrations()}async transaction(t,r,n){await this.start();let i=JSON.stringify(r),o;if(t==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else t==="commit"?o=await this.engine?.commitTransaction(n.id,i):t==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(yc(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new W(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(Re("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;this.binaryTarget=await this.getCurrentBinaryTarget(),await this.loadEngine(),this.version()}async getCurrentBinaryTarget(){}parseEngineResponse(t){if(!t)throw new K("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new K("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new b(this),{adapter:r}=this.config;r&&Re("Using driver adapter: %O",r),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:y.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{t.deref()?.logger(n)},r)}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new V(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);if(r){if("span"in r){this.config.tracingHelper.createEngineSpan(r);return}r.level=r?.level.toLowerCase()??"unknown",gc(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):hc(r)?this.loggerRustPanic=new ue(Nn(this,`${r.message}: ${r.reason} in ${r.file}:${r.line}:${r.column}`),this.config.clientVersion):this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path})}}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Re(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{Re("library starting");try{let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,Re("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new V(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Re("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),Re("library stopping");let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,Re("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){Re(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new K(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s,elapsed:0}}catch(s){if(s instanceof V)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new ue(Nn(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new K(`${a.message} -${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){Re("requestBatch");let i=fr(t,r);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),os(r));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new K(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:l}=s;if(Array.isArray(a))return a.map(u=>u.errors&&u.errors.length>0?this.loggerRustPanic??this.buildQueryError(u.errors[0]):{data:u,elapsed:0});throw l&&l.length===1?new Error(l[0].error):new Error(JSON.stringify(s))}buildQueryError(t){if(t.user_facing_error.is_panic)return new ue(Nn(this,t.user_facing_error.message),this.config.clientVersion);let r=this.getExternalAdapterError(t.user_facing_error);return r?r.error:Rr(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t){if(t.error_code===mc&&this.config.adapter){let r=t.meta?.id;sr(typeof r=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(r);return sr(n,"External error with reported id was not registered"),n}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function yc(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function Nn(e,t){return is({binaryTarget:e.binaryTarget,title:t,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function as({copyEngine:e=!0},t){let r;try{r=_r({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||r?.startsWith("prisma+postgres://"));e&&n&&It("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=kt(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",l=i==="binary";if(o&&s||s&&!1){let u;throw e?r?.startsWith("prisma://")?u=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:u=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:u=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new H(u.join(` -`),{clientVersion:t.clientVersion})}return new Kt(t)}m();c();p();d();f();function Lr({generator:e}){return e?.previewFeatures??[]}m();c();p();d();f();m();c();p();d();f();function yt(e){return e.substring(0,1).toLowerCase()+e.substring(1)}m();c();p();d();f();m();c();p();d();f();var fs=he(Dn());m();c();p();d();f();function ps(e,t,r){let n=ds(e),i=wc(n),o=Ec(i);o?Nr(o,t,r):t.addErrorMessage(()=>"Unknown error")}function ds(e){return e.errors.flatMap(t=>t.kind==="Union"?ds(t):[t])}function wc(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:bc(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function bc(e,t){return[...new Set(e.concat(t))]}function Ec(e){return dn(e,(t,r)=>{let n=us(t),i=us(r);return n!==i?n-i:cs(t)-cs(r)})}function us(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function cs(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}m();c();p();d();f();var ce=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};m();c();p();d();f();var Ht=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(pt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function Nr(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":xc(e,t);break;case"IncludeOnScalar":vc(e,t);break;case"EmptySelection":Pc(e,t,r);break;case"UnknownSelectionField":Rc(e,t);break;case"InvalidSelectionValue":Sc(e,t);break;case"UnknownArgument":Oc(e,t);break;case"UnknownInputField":kc(e,t);break;case"RequiredArgumentMissing":Fc(e,t);break;case"InvalidArgumentType":Mc(e,t);break;case"InvalidArgumentValue":Ic(e,t);break;case"ValueTooLarge":_c(e,t);break;case"SomeFieldsMissing":Lc(e,t);break;case"TooManyFieldsGiven":Nc(e,t);break;case"Union":ps(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function xc(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function vc(e,t){let[r,n]=zt(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new ce(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${Yt(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Pc(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Tc(e,t,i);return}if(n.hasField("select")){Cc(e,t);return}}if(r?.[yt(e.outputType.name)]){Ac(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Tc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new ce(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function Cc(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),hs(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${Yt(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Ac(e,t){let r=new Ht;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new ce("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=zt(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new ft;l.addSuggestion(n),a.value=l}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function Rc(e,t){let r=ys(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":hs(n,e.outputType);break;case"include":Dc(n,e.outputType);break;case"omit":$c(n,e.outputType);break}}t.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(Yt(n)),i.join(" ")})}function Sc(e,t){let r=ys(e.selectionPath,t);r.parentKind!=="unknown"&&r.field.value.markAsError(),t.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`)}function Oc(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Bc(n,e.arguments)),t.addErrorMessage(i=>ms(i,r,e.arguments.map(o=>o.name)))}function kc(e,t){let[r,n]=zt(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&ws(o,e.inputType)}t.addErrorMessage(o=>ms(o,n,e.inputType.fields.map(s=>s.name)))}function ms(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Uc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(Yt(e)),n.join(" ")}function Fc(e,t){let r;t.addErrorMessage(l=>r?.value instanceof z&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=zt(e.argumentPath),s=new Ht,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new ce(o,s).makeRequired())}else{let l=e.inputTypes.map(gs).join(" | ");a.addSuggestion(new ce(o,l).makeRequired())}}function gs(e){return e.kind==="list"?`${gs(e.elementType)}[]`:e.name}function Mc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=Dr("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function Ic(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=Dr("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function _c(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof z&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function Lc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&ws(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${Dr("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(Yt(i)),o.join(" ")})}function Nc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${Dr("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function hs(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ce(r.name,"true"))}function Dc(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new ce(r.name,"true"))}function $c(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new ce(r.name,"true"))}function Bc(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new ce(r.name,r.typeNames.join(" | ")))}function ys(e,t){let[r,n]=zt(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),l=o?.getField(n);return o&&l?{parentKind:"select",parent:o,field:l,fieldName:n}:(l=s?.getField(n),s&&l?{parentKind:"include",field:l,parent:s,fieldName:n}:(l=a?.getField(n),a&&l?{parentKind:"omit",field:l,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function ws(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ce(r.name,r.typeNames.join(" | ")))}function zt(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function Yt({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Dr(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var jc=3;function Uc(e,t){let r=1/0,n;for(let i of t){let o=(0,fs.default)(e,i);o>jc||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[yt(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:Fe(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};m();c();p();d();f();var Ps=e=>({command:e});m();c();p();d();f();m();c();p();d();f();var Ts=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);m();c();p();d();f();function wt(e){try{return Cs(e,"fast")}catch{return Cs(e,"slow")}}function Cs(e,t){return JSON.stringify(e.map(r=>Rs(r,t)))}function Rs(e,t){return Array.isArray(e)?e.map(r=>Rs(r,t)):typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:st(e)?{prisma__type:"date",prisma__value:e.toJSON()}:Te.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:w.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Yc(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Ss(e):e}function Yc(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Ss(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(As);let t={};for(let r of Object.keys(e))t[r]=As(e[r]);return t}function As(e){return typeof e=="bigint"?e.toString():Ss(e)}m();c();p();d();f();var Zc=["$connect","$disconnect","$on","$transaction","$use","$extends"],Os=Zc;var Xc=/^(\s*alter\s)/i,ks=le("prisma:client");function jn(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Xc.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var Un=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(r instanceof jt)n=r.sql,i={values:wt(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:wt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:wt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:wt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Ts(r),i={values:wt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?ks(`prisma.${e}(${n}, ${i.values})`):ks(`prisma.${e}(${n})`),{query:n,parameters:i}},Fs={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new se(t,r)}},Ms={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};m();c();p();d();f();function qn(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??=Is(r(o)):Is(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function Is(e){return typeof e.then=="function"?e:Promise.resolve(e)}m();c();p();d();f();var _s={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Vn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??_s}};function Ls(e){return e.includes("tracing")?new Vn:_s}m();c();p();d();f();function Ns(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}m();c();p();d();f();function Ds(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}m();c();p();d();f();var Br=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};m();c();p();d();f();var js=he(un());m();c();p();d();f();function jr(e){return typeof e.batchRequestIdx=="number"}m();c();p();d();f();function Ur(e){return e===null?e:Array.isArray(e)?e.map(Ur):typeof e=="object"?ep(e)?tp(e):rt(e,Ur):e}function ep(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function tp({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return w.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new Te(t);case"Json":return JSON.parse(t);default:Fe(t,"Unknown tagged value")}}m();c();p();d();f();function $s(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Qn(e.query.arguments)),t.push(Qn(e.query.selection)),t.join("")}function Qn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Qn(n)})`:r}).join(" ")})`}m();c();p();d();f();var rp={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Jn(e){return rp[e]}m();c();p();d();f();var qr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;ize("bigint",r));case"bytes-array":return t.map(r=>ze("bytes",r));case"decimal-array":return t.map(r=>ze("decimal",r));case"datetime-array":return t.map(r=>ze("datetime",r));case"date-array":return t.map(r=>ze("date",r));case"time-array":return t.map(r=>ze("time",r));default:return t}}function Bs(e){let t=[],r=np(e);for(let n=0;n{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(h=>Jn(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:op(o),containsWrite:u,customDataProxyFetch:i})).map((h,P)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[P],h)}catch(S){return S}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Us(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Jn(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:$s(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(ip(t),sp(t,i)||t instanceof Me)throw t;if(t instanceof W&&ap(t)){let u=qs(t.meta);$r({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=ht({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new W(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ue(l,this.client._clientVersion);if(t instanceof K)throw new K(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof V)throw new V(l,this.client._clientVersion);if(t instanceof ue)throw new ue(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,js.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(u=>u!=="select"&&u!=="include"),a=kn(o,s),l=i==="queryRaw"?Bs(a):Ur(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function op(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Us(e)};Fe(e,"Unknown transaction kind")}}function Us(e){return{id:e.id,payload:e.payload}}function sp(e,t){return jr(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function ap(e){return e.code==="P2009"||e.code==="P2012"}function qs(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(qs)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}m();c();p();d();f();var Vs="5.21.1";var Qs=Vs;m();c();p();d();f();var Hs=he(Dn());m();c();p();d();f();var B=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};re(B,"PrismaClientConstructorValidationError");var Js=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],Gs=["pretty","colorless","minimal"],Ws=["info","query","warn","error"],up={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new B(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=bt(r,t)||` Available datasources: ${t.join(", ")}`;throw new B(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new B(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new B(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new B(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new B('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Lr(t).includes("driverAdapters"))throw new B('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(kt()==="binary")throw new B('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new B(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new B(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Gs.includes(e)){let t=bt(e,Gs);throw new B(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new B(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Ws.includes(r)){let n=bt(r,Ws);throw new B(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=bt(i,o);throw new B(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new B(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new B(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new B(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new B('"omit" option is expected to be an object.');if(e===null)throw new B('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=pp(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(u=>u.name===s);if(!l){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new B(dp(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new B(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=bt(r,t);throw new B(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function zs(e,t){for(let[r,n]of Object.entries(e)){if(!Js.includes(r)){let i=bt(r,Js);throw new B(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}up[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new B('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function bt(e,t){if(t.length===0||typeof e!="string")return"";let r=cp(e,t);return r?` Did you mean "${r}"?`:""}function cp(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Hs.default)(e,i)}));r.sort((i,o)=>i.distanceyt(n)===t);if(r)return e[r]}function dp(e,t){let r=mt(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=Ar(r,"colorless");return`Error validating "omit" option: - -${i} - -${n}`}m();c();p();d();f();function Ys(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u{n[u]=g,a()},g=>{if(!jr(g)){l(g);return}g.batchRequestIdx===u?l(g):(i||(i=g),a())})})}var Qe=le("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var fp={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},mp=Symbol.for("prisma.client.transaction.id"),gp={id:0,nextId(){return++this.id}};function ea(e){class t{constructor(n){this._originalClient=this;this._middlewares=new Br;this._createPrismaPromise=qn();this.$extends=Io;e=n?.__internal?.configOverride?.(e)??e,zo(e),n&&zs(n,e);let i=new or().on("error",()=>{});this._extensions=Ir.empty(),this._previewFeatures=Lr(e),this._clientVersion=e.clientVersion??Qs,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=Ls(this._previewFeatures);let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&we.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&we.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=wn(n.adapter);let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new V(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new V("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},g=u.debug===!0;g&&le.enable("prisma:client");let h=we.resolve(e.dirname,e.relativePath);nr.existsSync(h)||(h=e.dirname),Qe("dirname",e.dirname),Qe("relativePath",e.relativePath),Qe("cwd",h);let P=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:h,dirname:e.dirname,enableDebugLogs:g,allowTriggerPanic:P.allowTriggerPanic,datamodelPath:we.join(e.dirname,e.filename??"schema.prisma"),prismaPath:P.binaryPath??void 0,engineEndpoint:P.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Ds(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(S=>typeof S=="string"?S==="query":S.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:Yo(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:_r,getBatchRequestPayload:fr,prismaGraphQLToJSError:Rr,PrismaClientUnknownRequestError:K,PrismaClientInitializationError:V,PrismaClientKnownRequestError:W,debug:le("prisma:client:accelerateEngine"),engineVersion:Xs.version,clientVersion:e.clientVersion}},Qe("clientVersion",e.clientVersion),this._engine=as(e,this._engineConfig),this._requestHandler=new Vr(this,i),l.log)for(let S of l.log){let C=typeof S=="string"?S:S.emit==="stdout"?S.level:null;C&&this.$on(C,A=>{Mt.log(`${Mt.tags[C]??""}`,A.message||A.query)})}this._metrics=new nt(this._engine)}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=Gt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Pi()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Un({clientMethod:i,activeProvider:a}),callsite:Ve(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Zs(n,i);return jn(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new H("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(jn(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new H(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Ps,callsite:Ve(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Un({clientMethod:i,activeProvider:a}),callsite:Ve(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Zs(n,i));throw new H("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new H("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=gp.nextId(),s=Ns(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let g=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:u,isolationLevel:g,lock:s};return l.requestTransaction?.(h)??l});return Ys(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return Gt(ve(Mo(this),[ne("_appliedParent",()=>this._appliedParent._createItxClient(n)),ne("_createPrismaPromise",()=>qn(n)),ne(mp,()=>n.id),it(Os)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??fp,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let g=this._middlewares.get(++a);if(g)return this._tracingHelper.runInChildSpan(s.middleware,F=>g(u,_=>(F?.end(),l(_))));let{runInTransaction:h,args:P,...S}=u,C={...n,...S};P&&(C.args=i.middlewareArgsToRequestArgs(P)),n.transaction!==void 0&&h===!1&&delete C.transaction;let A=await jo(this,C);return C.model?No({result:A,modelName:C.model,args:C.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):A};return this._tracingHelper.runInChildSpan(s.operation,()=>l(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:g,unpacker:h,otelParentCtx:P,customDataProxyFetch:S}){try{n=u?u(n):n;let C={name:"serialize"},A=this._tracingHelper.runInChildSpan(C,()=>Es({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return le.enabled("prisma:client")&&(Qe("Prisma Client call:"),Qe(`prisma.${i}(${go(n)})`),Qe("Generated request:"),Qe(JSON.stringify(A,null,2)+` -`)),g?.kind==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:A,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:P,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:S})}catch(C){throw C.clientVersion=this._clientVersion,C}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new H("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function Zs(e,t){return hp(e)?[new se(e,t),Fs]:[e,Ms]}function hp(e){return Array.isArray(e)&&Array.isArray(e.raw)}m();c();p();d();f();var yp=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function ta(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!yp.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}m();c();p();d();f();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,skip,sqltag,warnEnvConflicts,warnOnce}); -//# sourceMappingURL=react-native.js.map diff --git a/node_modules/@prisma/client/runtime/wasm.js b/node_modules/@prisma/client/runtime/wasm.js deleted file mode 100644 index 7e7a082..0000000 --- a/node_modules/@prisma/client/runtime/wasm.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict";var _o=Object.create;var Ot=Object.defineProperty;var Do=Object.getOwnPropertyDescriptor;var Fo=Object.getOwnPropertyNames;var No=Object.getPrototypeOf,Uo=Object.prototype.hasOwnProperty;var se=(e,t)=>()=>(e&&(t=e(e=0)),t);var De=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),kt=(e,t)=>{for(var r in t)Ot(e,r,{get:t[r],enumerable:!0})},Zr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Fo(t))!Uo.call(e,i)&&i!==r&&Ot(e,i,{get:()=>t[i],enumerable:!(n=Do(t,i))||n.enumerable});return e};var Fe=(e,t,r)=>(r=e!=null?_o(No(e)):{},Zr(t||!e||!e.__esModule?Ot(r,"default",{value:e,enumerable:!0}):r,e)),qo=e=>Zr(Ot({},"__esModule",{value:!0}),e);function fr(e,t){if(t=t.toLowerCase(),t==="utf8"||t==="utf-8")return new y(jo.encode(e));if(t==="base64"||t==="base64url")return e=e.replace(/-/g,"+").replace(/_/g,"/"),e=e.replace(/[^A-Za-z0-9+/]/g,""),new y([...atob(e)].map(r=>r.charCodeAt(0)));if(t==="binary"||t==="ascii"||t==="latin1"||t==="latin-1")return new y([...e].map(r=>r.charCodeAt(0)));if(t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le"){let r=new y(e.length*2),n=new DataView(r.buffer);for(let i=0;ia.startsWith("get")||a.startsWith("set")),n=r.map(a=>a.replace("get","read").replace("set","write")),i=(a,u)=>function(g=0){return B(g,"offset"),Y(g,"offset"),$(g,"offset",this.length-1),new DataView(this.buffer)[r[a]](g,u)},o=(a,u)=>function(g,T=0){let C=r[a].match(/set(\w+\d+)/)[1].toLowerCase(),O=$o[C];return B(T,"offset"),Y(T,"offset"),$(T,"offset",this.length-1),Vo(g,"value",O[0],O[1]),new DataView(this.buffer)[r[a]](T,g,u),T+parseInt(r[a].match(/\d+/)[0])/8},s=a=>{a.forEach(u=>{u.includes("Uint")&&(e[u.replace("Uint","UInt")]=e[u]),u.includes("Float64")&&(e[u.replace("Float64","Double")]=e[u]),u.includes("Float32")&&(e[u.replace("Float32","Float")]=e[u])})};n.forEach((a,u)=>{a.startsWith("read")&&(e[a]=i(u,!1),e[a+"LE"]=i(u,!0),e[a+"BE"]=i(u,!1)),a.startsWith("write")&&(e[a]=o(u,!1),e[a+"LE"]=o(u,!0),e[a+"BE"]=o(u,!1)),s([a,a+"LE",a+"BE"])})}function tn(e){throw new Error(`Buffer polyfill does not implement "${e}"`)}function Mt(e,t){if(!(e instanceof Uint8Array))throw new TypeError(`The "${t}" argument must be an instance of Buffer or Uint8Array`)}function $(e,t,r=Go+1){if(e<0||e>r){let n=new RangeError(`The value of "${t}" is out of range. It must be >= 0 && <= ${r}. Received ${e}`);throw n.code="ERR_OUT_OF_RANGE",n}}function B(e,t){if(typeof e!="number"){let r=new TypeError(`The "${t}" argument must be of type number. Received type ${typeof e}.`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function Y(e,t){if(!Number.isInteger(e)||Number.isNaN(e)){let r=new RangeError(`The value of "${t}" is out of range. It must be an integer. Received ${e}`);throw r.code="ERR_OUT_OF_RANGE",r}}function Vo(e,t,r,n){if(en){let i=new RangeError(`The value of "${t}" is out of range. It must be >= ${r} and <= ${n}. Received ${e}`);throw i.code="ERR_OUT_OF_RANGE",i}}function en(e,t){if(typeof e!="string"){let r=new TypeError(`The "${t}" argument must be of type string. Received type ${typeof e}`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function Wo(e,t="utf8"){return y.from(e,t)}var y,$o,jo,Qo,Jo,Go,b,gr,c=se(()=>{"use strict";y=class e extends Uint8Array{constructor(){super(...arguments);this._isBuffer=!0}get offset(){return this.byteOffset}static alloc(r,n=0,i="utf8"){return en(i,"encoding"),e.allocUnsafe(r).fill(n,i)}static allocUnsafe(r){return e.from(r)}static allocUnsafeSlow(r){return e.from(r)}static isBuffer(r){return r&&!!r._isBuffer}static byteLength(r,n="utf8"){if(typeof r=="string")return fr(r,n).byteLength;if(r&&r.byteLength)return r.byteLength;let i=new TypeError('The "string" argument must be of type string or an instance of Buffer or ArrayBuffer.');throw i.code="ERR_INVALID_ARG_TYPE",i}static isEncoding(r){return Jo.includes(r)}static compare(r,n){Mt(r,"buff1"),Mt(n,"buff2");for(let i=0;in[i])return 1}return r.length===n.length?0:r.length>n.length?1:-1}static from(r,n="utf8"){if(r&&typeof r=="object"&&r.type==="Buffer")return new e(r.data);if(typeof r=="number")return new e(new Uint8Array(r));if(typeof r=="string")return fr(r,n);if(ArrayBuffer.isView(r)){let{byteOffset:i,byteLength:o,buffer:s}=r;return"map"in r&&typeof r.map=="function"?new e(r.map(a=>a%256),i,o):new e(s,i,o)}if(r&&typeof r=="object"&&("length"in r||"byteLength"in r||"buffer"in r))return new e(r);throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}static concat(r,n){if(r.length===0)return e.alloc(0);let i=[].concat(...r.map(s=>[...s])),o=e.alloc(n!==void 0?n:i.length);return o.set(n!==void 0?i.slice(0,n):i),o}slice(r=0,n=this.length){return this.subarray(r,n)}subarray(r=0,n=this.length){return Object.setPrototypeOf(super.subarray(r,n),e.prototype)}reverse(){return super.reverse(),this}readIntBE(r,n){B(r,"offset"),Y(r,"offset"),$(r,"offset",this.length-1),B(n,"byteLength"),Y(n,"byteLength");let i=new DataView(this.buffer,r,n),o=0;for(let s=0;s=0;s--)o.setUint8(s,r&255),r=r/256;return n+i}writeUintBE(r,n,i){return this.writeUIntBE(r,n,i)}writeUIntLE(r,n,i){B(n,"offset"),Y(n,"offset"),$(n,"offset",this.length-1),B(i,"byteLength"),Y(i,"byteLength");let o=new DataView(this.buffer,n,i);for(let s=0;sn===r[i])}copy(r,n=0,i=0,o=this.length){$(n,"targetStart"),$(i,"sourceStart",this.length),$(o,"sourceEnd"),n>>>=0,i>>>=0,o>>>=0;let s=0;for(;i=this.length?this.length-u:r.length),u);return this}includes(r,n=null,i="utf-8"){return this.indexOf(r,n,i)!==-1}lastIndexOf(r,n=null,i="utf-8"){return this.indexOf(r,n,i,!0)}indexOf(r,n=null,i="utf-8",o=!1){let s=o?this.findLastIndex.bind(this):this.findIndex.bind(this);i=typeof n=="string"?n:i;let a=e.from(typeof r=="number"?[r]:r,i),u=typeof n=="string"?0:n;return u=typeof n=="number"?u:null,u=Number.isNaN(u)?null:u,u??=o?this.length:0,u=u<0?this.length+u:u,a.length===0&&o===!1?u>=this.length?this.length:u:a.length===0&&o===!0?(u>=this.length?this.length:u)||this.length:s((g,T)=>(o?T<=u:T>=u)&&this[T]===a[0]&&a.every((O,A)=>this[T+A]===O))}toString(r="utf8",n=0,i=this.length){if(n=n<0?0:n,r=r.toString().toLowerCase(),i<=0)return"";if(r==="utf8"||r==="utf-8")return Qo.decode(this.slice(n,i));if(r==="base64"||r==="base64url"){let o=btoa(this.reduce((s,a)=>s+gr(a),""));return r==="base64url"?o.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):o}if(r==="binary"||r==="ascii"||r==="latin1"||r==="latin-1")return this.slice(n,i).reduce((o,s)=>o+gr(s&(r==="ascii"?127:255)),"");if(r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le"){let o=new DataView(this.buffer.slice(n,i));return Array.from({length:o.byteLength/2},(s,a)=>a*2+1o+s.toString(16).padStart(2,"0"),"");tn(`encoding "${r}"`)}toLocaleString(){return this.toString()}inspect(){return``}};$o={int8:[-128,127],int16:[-32768,32767],int32:[-2147483648,2147483647],uint8:[0,255],uint16:[0,65535],uint32:[0,4294967295],float32:[-1/0,1/0],float64:[-1/0,1/0],bigint64:[-0x8000000000000000n,0x7fffffffffffffffn],biguint64:[0n,0xffffffffffffffffn]},jo=new TextEncoder,Qo=new TextDecoder,Jo=["utf8","utf-8","hex","base64","ascii","binary","base64url","ucs2","ucs-2","utf16le","utf-16le","latin1","latin-1"],Go=4294967295;Bo(y.prototype);b=new Proxy(Wo,{construct(e,[t,r]){return y.from(t,r)},get(e,t){return y[t]}}),gr=String.fromCodePoint});var h,m=se(()=>{"use strict";h={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var x,p=se(()=>{"use strict";x=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,d=se(()=>{"use strict";E=()=>{};E.prototype=E});var w,f=se(()=>{"use strict";w=class{constructor(t){this.value=t}deref(){return this.value}}});function sn(e,t){var r,n,i,o,s,a,u,g,T=e.constructor,C=T.precision;if(!e.s||!t.s)return t.s||(t=new T(e)),U?D(t,C):t;if(u=e.d,g=t.d,s=e.e,i=t.e,u=u.slice(),o=s-i,o){for(o<0?(n=u,o=-o,a=g.length):(n=g,i=s,a=u.length),s=Math.ceil(C/N),a=s>a?s+1:a+1,o>a&&(o=a,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(a=u.length,o=g.length,a-o<0&&(o=a,n=g,g=u,u=n),r=0;o;)r=(u[--o]=u[o]+g[o]+r)/Q|0,u[o]%=Q;for(r&&(u.unshift(r),++i),a=u.length;u[--a]==0;)u.pop();return t.d=u,t.e=i,U?D(t,C):t}function le(e,t,r){if(e!==~~e||er)throw Error(Oe+e)}function ae(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t16)throw Error(yr+V(e));if(!e.s)return new T(Z);for(t==null?(U=!1,a=C):a=t,s=new T(.03125);e.abs().gte(.1);)e=e.times(s),g+=5;for(n=Math.log(Se(2,g))/Math.LN10*2+5|0,a+=n,r=i=o=new T(Z),T.precision=a;;){if(i=D(i.times(e),a),r=r.times(++u),s=o.plus(ye(i,r,a)),ae(s.d).slice(0,a)===ae(o.d).slice(0,a)){for(;g--;)o=D(o.times(o),a);return T.precision=C,t==null?(U=!0,D(o,C)):o}o=s}}function V(e){for(var t=e.e*N,r=e.d[0];r>=10;r/=10)t++;return t}function hr(e,t,r){if(t>e.LN10.sd())throw U=!0,r&&(e.precision=r),Error(re+"LN10 precision limit exceeded");return D(new e(e.LN10),t)}function Pe(e){for(var t="";e--;)t+="0";return t}function rt(e,t){var r,n,i,o,s,a,u,g,T,C=1,O=10,A=e,M=A.d,S=A.constructor,I=S.precision;if(A.s<1)throw Error(re+(A.s?"NaN":"-Infinity"));if(A.eq(Z))return new S(0);if(t==null?(U=!1,g=I):g=t,A.eq(10))return t==null&&(U=!0),hr(S,g);if(g+=O,S.precision=g,r=ae(M),n=r.charAt(0),o=V(A),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=ae(A.d),n=r.charAt(0),C++;o=V(A),n>1?(A=new S("0."+r),o++):A=new S(n+"."+r.slice(1))}else return u=hr(S,g+2,I).times(o+""),A=rt(new S(n+"."+r.slice(1)),g-O).plus(u),S.precision=I,t==null?(U=!0,D(A,I)):A;for(a=s=A=ye(A.minus(Z),A.plus(Z),g),T=D(A.times(A),g),i=3;;){if(s=D(s.times(T),g),u=a.plus(ye(s,new S(i),g)),ae(u.d).slice(0,g)===ae(a.d).slice(0,g))return a=a.times(2),o!==0&&(a=a.plus(hr(S,g+2,I).times(o+""))),a=ye(a,new S(C),g),S.precision=I,t==null?(U=!0,D(a,I)):a;a=u,i+=2}}function rn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Ue(r/N),e.d=[],n=(r+1)%N,r<0&&(n+=N),nIt||e.e<-It))throw Error(yr+r)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,r){var n,i,o,s,a,u,g,T,C=e.d;for(s=1,o=C[0];o>=10;o/=10)s++;if(n=t-s,n<0)n+=N,i=t,g=C[T=0];else{if(T=Math.ceil((n+1)/N),o=C.length,T>=o)return e;for(g=o=C[T],s=1;o>=10;o/=10)s++;n%=N,i=n-N+s}if(r!==void 0&&(o=Se(10,s-i-1),a=g/o%10|0,u=t<0||C[T+1]!==void 0||g%o,u=r<4?(a||u)&&(r==0||r==(e.s<0?3:2)):a>5||a==5&&(r==4||u||r==6&&(n>0?i>0?g/Se(10,s-i):0:C[T-1])%10&1||r==(e.s<0?8:7))),t<1||!C[0])return u?(o=V(e),C.length=1,t=t-o-1,C[0]=Se(10,(N-t%N)%N),e.e=Ue(-t/N)||0):(C.length=1,C[0]=e.e=e.s=0),e;if(n==0?(C.length=T,o=1,T--):(C.length=T+1,o=Se(10,N-n),C[T]=i>0?(g/Se(10,s-i)%Se(10,i)|0)*o:0),u)for(;;)if(T==0){(C[0]+=o)==Q&&(C[0]=1,++e.e);break}else{if(C[T]+=o,C[T]!=Q)break;C[T--]=0,o=1}for(n=C.length;C[--n]===0;)C.pop();if(U&&(e.e>It||e.e<-It))throw Error(yr+V(e));return e}function ln(e,t){var r,n,i,o,s,a,u,g,T,C,O=e.constructor,A=O.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new O(e),U?D(t,A):t;if(u=e.d,C=t.d,n=t.e,g=e.e,u=u.slice(),s=g-n,s){for(T=s<0,T?(r=u,s=-s,a=C.length):(r=C,n=g,a=u.length),i=Math.max(Math.ceil(A/N),a)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=u.length,a=C.length,T=i0;--i)u[a++]=0;for(i=C.length;i>s;){if(u[--i]0?o=o.charAt(0)+"."+o.slice(1)+Pe(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Pe(-i-1)+o,r&&(n=r-s)>0&&(o+=Pe(n))):i>=s?(o+=Pe(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Pe(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Pe(n))),e.s<0?"-"+o:o}function nn(e,t){if(e.length>t)return e.length=t,!0}function un(e){var t,r,n;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Oe+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return rn(s,o.toString())}else if(typeof o!="string")throw Error(Oe+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,Ho.test(o))rn(s,o);else throw Error(Oe+o)}if(i.prototype=R,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=un,i.config=i.set=zo,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Oe+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Oe+r+": "+n);return this}var Ne,Ko,br,U,re,Oe,yr,Ue,Se,Ho,Z,Q,N,on,It,R,ye,br,Lt,cn=se(()=>{"use strict";c();m();p();d();f();l();Ne=1e9,Ko={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},U=!0,re="[DecimalError] ",Oe=re+"Invalid argument: ",yr=re+"Exponent out of range: ",Ue=Math.floor,Se=Math.pow,Ho=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Q=1e7,N=7,on=9007199254740991,It=Ue(on/N),R={};R.absoluteValue=R.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};R.comparedTo=R.cmp=function(e){var t,r,n,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};R.decimalPlaces=R.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*N;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};R.dividedBy=R.div=function(e){return ye(this,new this.constructor(e))};R.dividedToIntegerBy=R.idiv=function(e){var t=this,r=t.constructor;return D(ye(t,new r(e),0,1),r.precision)};R.equals=R.eq=function(e){return!this.cmp(e)};R.exponent=function(){return V(this)};R.greaterThan=R.gt=function(e){return this.cmp(e)>0};R.greaterThanOrEqualTo=R.gte=function(e){return this.cmp(e)>=0};R.isInteger=R.isint=function(){return this.e>this.d.length-2};R.isNegative=R.isneg=function(){return this.s<0};R.isPositive=R.ispos=function(){return this.s>0};R.isZero=function(){return this.s===0};R.lessThan=R.lt=function(e){return this.cmp(e)<0};R.lessThanOrEqualTo=R.lte=function(e){return this.cmp(e)<1};R.logarithm=R.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Z))throw Error(re+"NaN");if(r.s<1)throw Error(re+(r.s?"NaN":"-Infinity"));return r.eq(Z)?new n(0):(U=!1,t=ye(rt(r,o),rt(e,o),o),U=!0,D(t,i))};R.minus=R.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ln(t,e):sn(t,(e.s=-e.s,e))};R.modulo=R.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(re+"NaN");return r.s?(U=!1,t=ye(r,e,0,1).times(e),U=!0,r.minus(t)):D(new n(r),i)};R.naturalExponential=R.exp=function(){return an(this)};R.naturalLogarithm=R.ln=function(){return rt(this)};R.negated=R.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};R.plus=R.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?sn(t,e):ln(t,(e.s=-e.s,e))};R.precision=R.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Oe+e);if(t=V(i)+1,n=i.d.length-1,r=n*N+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};R.squareRoot=R.sqrt=function(){var e,t,r,n,i,o,s,a=this,u=a.constructor;if(a.s<1){if(!a.s)return new u(0);throw Error(re+"NaN")}for(e=V(a),U=!1,i=Math.sqrt(+a),i==0||i==1/0?(t=ae(a.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Ue((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new u(t)):n=new u(i.toString()),r=u.precision,i=s=r+3;;)if(o=n,n=o.plus(ye(a,o,s+2)).times(.5),ae(o.d).slice(0,s)===(t=ae(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(D(o,r+1,0),o.times(o).eq(a)){n=o;break}}else if(t!="9999")break;s+=4}return U=!0,D(n,r)};R.times=R.mul=function(e){var t,r,n,i,o,s,a,u,g,T=this,C=T.constructor,O=T.d,A=(e=new C(e)).d;if(!T.s||!e.s)return new C(0);for(e.s*=T.s,r=T.e+e.e,u=O.length,g=A.length,u=0;){for(t=0,i=u+n;i>n;)a=o[i]+A[n]*O[i-n-1]+t,o[i--]=a%Q|0,t=a/Q|0;o[i]=(o[i]+t)%Q|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,U?D(e,C.precision):e};R.toDecimalPlaces=R.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(le(e,0,Ne),t===void 0?t=n.rounding:le(t,0,8),D(r,e+V(r)+1,t))};R.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ke(n,!0):(le(e,0,Ne),t===void 0?t=i.rounding:le(t,0,8),n=D(new i(n),e+1,t),r=ke(n,!0,e+1)),r};R.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?ke(i):(le(e,0,Ne),t===void 0?t=o.rounding:le(t,0,8),n=D(new o(i),e+V(i)+1,t),r=ke(n.abs(),!1,e+V(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};R.toInteger=R.toint=function(){var e=this,t=e.constructor;return D(new t(e),V(e)+1,t.rounding)};R.toNumber=function(){return+this};R.toPower=R.pow=function(e){var t,r,n,i,o,s,a=this,u=a.constructor,g=12,T=+(e=new u(e));if(!e.s)return new u(Z);if(a=new u(a),!a.s){if(e.s<1)throw Error(re+"Infinity");return a}if(a.eq(Z))return a;if(n=u.precision,e.eq(Z))return D(a,n);if(t=e.e,r=e.d.length-1,s=t>=r,o=a.s,s){if((r=T<0?-T:T)<=on){for(i=new u(Z),t=Math.ceil(n/N+4),U=!1;r%2&&(i=i.times(a),nn(i.d,t)),r=Ue(r/2),r!==0;)a=a.times(a),nn(a.d,t);return U=!0,e.s<0?new u(Z).div(i):D(i,n)}}else if(o<0)throw Error(re+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,a.s=1,U=!1,i=e.times(rt(a,n+g)),U=!0,i=an(i),i.s=o,i};R.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=V(i),n=ke(i,r<=o.toExpNeg||r>=o.toExpPos)):(le(e,1,Ne),t===void 0?t=o.rounding:le(t,0,8),i=D(new o(i),e,t),r=V(i),n=ke(i,e<=r||r<=o.toExpNeg,e)),n};R.toSignificantDigits=R.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(le(e,1,Ne),t===void 0?t=n.rounding:le(t,0,8)),D(new n(r),e,t)};R.toString=R.valueOf=R.val=R.toJSON=R[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=V(e),r=e.constructor;return ke(e,t<=r.toExpNeg||t>=r.toExpPos)};ye=function(){function e(n,i){var o,s=0,a=n.length;for(n=n.slice();a--;)o=n[a]*i+s,n[a]=o%Q|0,s=o/Q|0;return s&&n.unshift(s),n}function t(n,i,o,s){var a,u;if(o!=s)u=o>s?1:-1;else for(a=u=0;ai[a]?1:-1;break}return u}function r(n,i,o){for(var s=0;o--;)n[o]-=s,s=n[o]1;)n.shift()}return function(n,i,o,s){var a,u,g,T,C,O,A,M,S,I,ne,z,_e,k,Ae,dr,ie,At,St=n.constructor,Lo=n.s==i.s?1:-1,oe=n.d,q=i.d;if(!n.s)return new St(n);if(!i.s)throw Error(re+"Division by zero");for(u=n.e-i.e,ie=q.length,Ae=oe.length,A=new St(Lo),M=A.d=[],g=0;q[g]==(oe[g]||0);)++g;if(q[g]>(oe[g]||0)&&--u,o==null?z=o=St.precision:s?z=o+(V(n)-V(i))+1:z=o,z<0)return new St(0);if(z=z/N+2|0,g=0,ie==1)for(T=0,q=q[0],z++;(g1&&(q=e(q,T),oe=e(oe,T),ie=q.length,Ae=oe.length),k=ie,S=oe.slice(0,ie),I=S.length;I=Q/2&&++dr;do T=0,a=t(q,S,ie,I),a<0?(ne=S[0],ie!=I&&(ne=ne*Q+(S[1]||0)),T=ne/dr|0,T>1?(T>=Q&&(T=Q-1),C=e(q,T),O=C.length,I=S.length,a=t(C,S,O,I),a==1&&(T--,r(C,ie{"use strict";cn();v=class extends Lt{static isDecimal(t){return t instanceof Lt}static random(t=20){{let n=crypto.getRandomValues(new Uint8Array(t)).reduce((i,o)=>i+o,"");return new Lt(`0.${n.slice(0,t)}`)}}},ue=v});function Yo(){return!1}var Xo,Zo,fn,gn=se(()=>{"use strict";c();m();p();d();f();l();Xo={},Zo={existsSync:Yo,promises:Xo},fn=Zo});function os(...e){return e.join("/")}function ss(...e){return e.join("/")}var On,as,ls,it,kn=se(()=>{"use strict";c();m();p();d();f();l();On="/",as={sep:On},ls={resolve:os,posix:as,join:ss,sep:On},it=ls});var Nt,In=se(()=>{"use strict";c();m();p();d();f();l();Nt=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var _n=De((jc,Ln)=>{"use strict";c();m();p();d();f();l();Ln.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var Nn=De((nm,Fn)=>{"use strict";c();m();p();d();f();l();Fn.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var qn=De((cm,Un)=>{"use strict";c();m();p();d();f();l();var fs=Nn();Un.exports=e=>typeof e=="string"?e.replace(fs(),""):e});var Jn=De((eg,ws)=>{ws.exports={name:"@prisma/engines-version",version:"5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"bf0e5e8a04cada8225617067eaa03d041e2bba36"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.34",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Gn=De(()=>{"use strict";c();m();p();d();f();l()});var Qr=De((iR,Ni)=>{"use strict";c();m();p();d();f();l();Ni.exports=function(){function e(t,r,n,i,o){return tn?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;svr,Decimal:()=>ue,Extensions:()=>wr,MetricsClient:()=>Ve,NotFoundError:()=>we,PrismaClientInitializationError:()=>L,PrismaClientKnownRequestError:()=>J,PrismaClientRustPanicError:()=>Ee,PrismaClientUnknownRequestError:()=>G,PrismaClientValidationError:()=>j,Public:()=>Er,Sql:()=>X,defineDmmfProperty:()=>$n,empty:()=>Kn,getPrismaClient:()=>ko,getRuntime:()=>Ce,join:()=>Wn,makeStrictEnum:()=>Mo,makeTypedQueryFactory:()=>Qn,objectEnumValues:()=>Bt,raw:()=>Dr,skip:()=>Vt,sqltag:()=>Fr,warnEnvConflicts:()=>void 0,warnOnce:()=>lt});module.exports=qo(ol);c();m();p();d();f();l();var wr={};kt(wr,{defineExtension:()=>mn,getExtensionContext:()=>pn});c();m();p();d();f();l();c();m();p();d();f();l();function mn(e){return typeof e=="function"?e:t=>t.$extends(e)}c();m();p();d();f();l();function pn(e){return e}var Er={};kt(Er,{validator:()=>dn});c();m();p();d();f();l();c();m();p();d();f();l();function dn(...e){return t=>t}c();m();p();d();f();l();c();m();p();d();f();l();c();m();p();d();f();l();var xr,hn,yn,bn,wn=!0;typeof h<"u"&&({FORCE_COLOR:xr,NODE_DISABLE_COLORS:hn,NO_COLOR:yn,TERM:bn}=h.env||{},wn=h.stdout&&h.stdout.isTTY);var es={enabled:!hn&&yn==null&&bn!=="dumb"&&(xr!=null&&xr!=="0"||wn)};function F(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!es.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var cu=F(0,0),_t=F(1,22),Dt=F(2,22),mu=F(3,23),En=F(4,24),pu=F(7,27),du=F(8,28),fu=F(9,29),gu=F(30,39),qe=F(31,39),xn=F(32,39),Pn=F(33,39),vn=F(34,39),hu=F(35,39),Tn=F(36,39),yu=F(37,39),Cn=F(90,39),bu=F(90,39),wu=F(40,49),Eu=F(41,49),xu=F(42,49),Pu=F(43,49),vu=F(44,49),Tu=F(45,49),Cu=F(46,49),Ru=F(47,49);c();m();p();d();f();l();var ts=100,Rn=["green","yellow","blue","magenta","cyan","red"],Ft=[],An=Date.now(),rs=0,Pr=typeof h<"u"?h.env:{};globalThis.DEBUG??=Pr.DEBUG??"";globalThis.DEBUG_COLORS??=Pr.DEBUG_COLORS?Pr.DEBUG_COLORS==="true":!0;var nt={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function ns(e){let t={color:Rn[rs++%Rn.length],enabled:nt.enabled(e),namespace:e,log:nt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Ft.push([o,...n]),Ft.length>ts&&Ft.shift(),nt.enabled(o)||i){let u=n.map(T=>typeof T=="string"?T:is(T)),g=`+${Date.now()-An}ms`;An=Date.now(),a(o,...u,g)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var vr=new Proxy(ns,{get:(e,t)=>nt[t],set:(e,t,r)=>nt[t]=r});function is(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function Sn(){Ft.length=0}var ee=vr;c();m();p();d();f();l();c();m();p();d();f();l();var Tr=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd","arm"];c();m();p();d();f();l();var Mn="library";function ot(e){let t=us();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":Mn)}function us(){let e=h.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}c();m();p();d();f();l();c();m();p();d();f();l();var Me;(t=>{let e;(k=>(k.findUnique="findUnique",k.findUniqueOrThrow="findUniqueOrThrow",k.findFirst="findFirst",k.findFirstOrThrow="findFirstOrThrow",k.findMany="findMany",k.create="create",k.createMany="createMany",k.createManyAndReturn="createManyAndReturn",k.update="update",k.updateMany="updateMany",k.upsert="upsert",k.delete="delete",k.deleteMany="deleteMany",k.groupBy="groupBy",k.count="count",k.aggregate="aggregate",k.findRaw="findRaw",k.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(Me||={});var at={};kt(at,{error:()=>ps,info:()=>ms,log:()=>cs,query:()=>ds,should:()=>Dn,tags:()=>st,warn:()=>Cr});c();m();p();d();f();l();var st={error:qe("prisma:error"),warn:Pn("prisma:warn"),info:Tn("prisma:info"),query:vn("prisma:query")},Dn={warn:()=>!h.env.PRISMA_DISABLE_WARNINGS};function cs(...e){console.log(...e)}function Cr(e,...t){Dn.warn()&&console.warn(`${st.warn} ${e}`,...t)}function ms(e,...t){console.info(`${st.info} ${e}`,...t)}function ps(e,...t){console.error(`${st.error} ${e}`,...t)}function ds(e,...t){console.log(`${st.query} ${e}`,...t)}c();m();p();d();f();l();function Ut(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}c();m();p();d();f();l();function be(e,t){throw new Error(t)}c();m();p();d();f();l();function Rr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}c();m();p();d();f();l();var Ar=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});c();m();p();d();f();l();function Be(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}c();m();p();d();f();l();function Sr(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{Bn.has(e)||(Bn.add(e),Cr(t,...r))};c();m();p();d();f();l();var J=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};K(J,"PrismaClientKnownRequestError");var we=class extends J{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};K(we,"NotFoundError");c();m();p();d();f();l();var L=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};K(L,"PrismaClientInitializationError");c();m();p();d();f();l();var Ee=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};K(Ee,"PrismaClientRustPanicError");c();m();p();d();f();l();var G=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};K(G,"PrismaClientUnknownRequestError");c();m();p();d();f();l();var j=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};K(j,"PrismaClientValidationError");c();m();p();d();f();l();var Ve=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};c();m();p();d();f();l();c();m();p();d();f();l();function ut(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function $n(e,t){let r=ut(()=>gs(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function gs(e){throw new Error("Prisma.dmmf is not available when running in edge runtimes.")}function Or(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}c();m();p();d();f();l();var qt=Symbol(),kr=new WeakMap,xe=class{constructor(t){t===qt?kr.set(this,`Prisma.${this._getName()}`):kr.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return kr.get(this)}},ct=class extends xe{_getNamespace(){return"NullTypes"}},mt=class extends ct{};Mr(mt,"DbNull");var pt=class extends ct{};Mr(pt,"JsonNull");var dt=class extends ct{};Mr(dt,"AnyNull");var Bt={classes:{DbNull:mt,JsonNull:pt,AnyNull:dt},instances:{DbNull:new mt(qt),JsonNull:new pt(qt),AnyNull:new dt(qt)}};function Mr(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}c();m();p();d();f();l();var jn=Symbol(),ft=class{constructor(t){if(t!==jn)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?Vt:t}},Vt=new ft(jn);function ce(e){return e instanceof ft}c();m();p();d();f();l();var Ir=new WeakMap,gt=class{constructor(t,r){Ir.set(this,{sql:t,values:r})}get sql(){return Ir.get(this).sql}get values(){return Ir.get(this).values}};function Qn(e){return(...t)=>new gt(e,t)}c();m();p();d();f();l();c();m();p();d();f();l();c();m();p();d();f();l();c();m();p();d();f();l();function ht(e){return{ok:!1,error:e,map(){return ht(e)},flatMap(){return ht(e)}}}var Lr=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},_r=e=>{let t=new Lr,r=me(t,e.transactionContext.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:me(t,e.queryRaw.bind(e)),executeRaw:me(t,e.executeRaw.bind(e)),provider:e.provider,transactionContext:async(...i)=>(await r(...i)).map(s=>hs(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=bs(t,e.getConnectionInfo.bind(e))),n},hs=(e,t)=>{let r=me(e,t.startTransaction.bind(t));return{adapterName:t.adapterName,provider:t.provider,queryRaw:me(e,t.queryRaw.bind(t)),executeRaw:me(e,t.executeRaw.bind(t)),startTransaction:async(...n)=>(await r(...n)).map(o=>ys(e,o))}},ys=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:me(e,t.queryRaw.bind(t)),executeRaw:me(e,t.executeRaw.bind(t)),commit:me(e,t.commit.bind(t)),rollback:me(e,t.rollback.bind(t))});function me(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return ht({kind:"GenericJs",id:i})}}}function bs(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return ht({kind:"GenericJs",id:i})}}}var Oo=Fe(Jn());var HO=Fe(Gn());In();gn();kn();c();m();p();d();f();l();var X=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}c();m();p();d();f();l();c();m();p();d();f();l();var $t={enumerable:!0,configurable:!0,writable:!0};function jt(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>$t,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Hn=Symbol.for("nodejs.util.inspect.custom");function de(e,t){let r=Es(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=zn(Reflect.ownKeys(o),r),a=zn(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let u=r.get(s);return u?u.getPropertyDescriptor?{...$t,...u?.getPropertyDescriptor(s)}:$t:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[Hn]=function(){let o={...this};return delete o[Hn],o},i}function Es(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function zn(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}c();m();p();d();f();l();function $e(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}c();m();p();d();f();l();function Qt(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}c();m();p();d();f();l();c();m();p();d();f();l();var je=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r,n=(i,o)=>o.write(i)){let i=r.length-1;for(let o=0;o0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};c();m();p();d();f();l();c();m();p();d();f();l();function Yn(e){return e.substring(0,1).toLowerCase()+e.substring(1)}c();m();p();d();f();l();function Qe(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Jt(e){return e.toString()!=="Invalid Date"}c();m();p();d();f();l();l();function Je(e){return v.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}c();m();p();d();f();l();var bt=class{constructor(t,r,n,i,o){this.modelName=t,this.name=r,this.typeName=n,this.isList=i,this.isEnum=o}_toGraphQLInputType(){let t=this.isList?"List":"",r=this.isEnum?"Enum":"";return`${t}${r}${this.typeName}FieldRefInput<${this.modelName}>`}};function Ge(e){return e instanceof bt}c();m();p();d();f();l();c();m();p();d();f();l();var Gt=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};c();m();p();d();f();l();var Wt=e=>e,Kt={bold:Wt,red:Wt,green:Wt,dim:Wt,enabled:!1},Xn={bold:_t,red:qe,green:xn,dim:Dt,enabled:!0},We={write(e){e.writeLine(",")}};c();m();p();d();f();l();var fe=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};c();m();p();d();f();l();var ve=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var Ke=class extends ve{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new Gt(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new fe("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(We,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};c();m();p();d();f();l();var Zn=": ",Ht=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Zn.length}write(t){let r=new fe(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Zn).write(this.value)}};c();m();p();d();f();l();var He=class e extends ve{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let u;if(s.value instanceof e?u=s.value.getField(a):s.value instanceof Ke&&(u=s.value.getField(Number(a))),!u)return;s=u}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new fe("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(We,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};c();m();p();d();f();l();var W=class extends ve{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new fe(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var Nr=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function ze(e){return new Nr(ei(e))}function ei(e){let t=new He;for(let[r,n]of Object.entries(e)){let i=new Ht(r,ti(n));t.addField(i)}return t}function ti(e){if(typeof e=="string")return new W(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new W(String(e));if(typeof e=="bigint")return new W(`${e}n`);if(e===null)return new W("null");if(e===void 0)return new W("undefined");if(Je(e))return new W(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return b.isBuffer(e)?new W(`Buffer.alloc(${e.byteLength})`):new W(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Jt(e)?e.toISOString():"Invalid Date";return new W(`new Date("${t}")`)}return e instanceof xe?new W(`Prisma.${e._getName()}`):Ge(e)?new W(`prisma.${Yn(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Ps(e):typeof e=="object"?ei(e):new W(Object.prototype.toString.call(e))}function Ps(e){let t=new Ke;for(let r of e)t.addItem(ti(r));return t}function zt(e,t){let r=t==="pretty"?Xn:Kt,n=e.renderAllMessages(r),i=new je(0,{colors:r}).write(e).toString();return{message:n,args:i}}function ri(e){if(e===void 0)return"";let t=ze(e);return new je(0,{colors:Kt}).write(t).toString()}c();m();p();d();f();l();var vs="P2037";function Yt({error:e,user_facing_error:t},r,n){return t.error_code?new J(Ts(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new G(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function Ts(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===vs&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}c();m();p();d();f();l();c();m();p();d();f();l();c();m();p();d();f();l();c();m();p();d();f();l();c();m();p();d();f();l();var Ur=class{getLocation(){return null}};function Te(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Ur}c();m();p();d();f();l();c();m();p();d();f();l();c();m();p();d();f();l();var ni={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Ye(e={}){let t=Rs(e);return Object.entries(t).reduce((n,[i,o])=>(ni[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Rs(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Xt(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function ii(e,t){let r=Xt(e);return t({action:"aggregate",unpacker:r,argsMapper:Ye})(e)}c();m();p();d();f();l();function As(e={}){let{select:t,...r}=e;return typeof t=="object"?Ye({...r,_count:t}):Ye({...r,_count:{_all:!0}})}function Ss(e={}){return typeof e.select=="object"?t=>Xt(e)(t)._count:t=>Xt(e)(t)._count._all}function oi(e,t){return t({action:"count",unpacker:Ss(e),argsMapper:As})(e)}c();m();p();d();f();l();function Os(e={}){let t=Ye(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function ks(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function si(e,t){return t({action:"groupBy",unpacker:ks(e),argsMapper:Os})(e)}function ai(e,t,r){if(t==="aggregate")return n=>ii(n,r);if(t==="count")return n=>oi(n,r);if(t==="groupBy")return n=>si(n,r)}c();m();p();d();f();l();function li(e,t){let r=t.fields.filter(i=>!i.relationName),n=Ar(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new bt(e,o,s.type,s.isList,s.kind==="enum")},...jt(Object.keys(n))})}c();m();p();d();f();l();c();m();p();d();f();l();var ui=e=>Array.isArray(e)?e:e.split("."),qr=(e,t)=>ui(t).reduce((r,n)=>r&&r[n],e),ci=(e,t,r)=>ui(t).reduceRight((n,i,o,s)=>Object.assign({},qr(e,s.slice(0,o)),{[i]:n}),r);function Ms(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Is(e,t,r){return t===void 0?e??{}:ci(t,r,e||!0)}function Br(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((u,g)=>({...u,[g.name]:g}),{});return u=>{let g=Te(e._errorFormat),T=Ms(n,i),C=Is(u,o,T),O=r({dataPath:T,callsite:g})(C),A=Ls(e,t);return new Proxy(O,{get(M,S){if(!A.includes(S))return M[S];let ne=[a[S].type,r,S],z=[T,C];return Br(e,...ne,...z)},...jt([...A,...Object.getOwnPropertyNames(O)])})}}function Ls(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}c();m();p();d();f();l();c();m();p();d();f();l();var _s=Fe(_n());var Ds={red:qe,gray:Cn,dim:Dt,bold:_t,underline:En,highlightSource:e=>e.highlight()},Fs={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Ns({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Us({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],u=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${u}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${u}`)),t&&a.push(s.underline(qs(t))),i){a.push("");let g=[i.toString()];o&&(g.push(o),g.push(s.dim(")"))),a.push(g.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` -`)}function qs(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function Xe(e){let t=e.showColors?Ds:Fs,r;return typeof $getTemplateParameters<"u"?r=$getTemplateParameters(e,t):r=Ns(e),Us(r,t)}function mi(e,t,r,n){return e===Me.ModelAction.findFirstOrThrow||e===Me.ModelAction.findUniqueOrThrow?Bs(t,r,n):n}function Bs(e,t,r){return async n=>{if("rejectOnNotFound"in n.args){let o=Xe({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new j(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof J&&o.code==="P2025"?new we(`No ${e} found`,t):o})}}c();m();p();d();f();l();function ge(e){return e.replace(/^./,t=>t.toLowerCase())}var Vs=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],$s=["aggregate","count","groupBy"];function Vr(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[js(e,t),Js(e,t),yt(r),H("name",()=>t),H("$name",()=>t),H("$parent",()=>e._appliedParent)];return de({},n)}function js(e,t){let r=ge(t),n=Object.keys(Me.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=u=>e._request(u);s=mi(o,t,e._clientVersion,s);let a=u=>g=>{let T=Te(e._errorFormat);return e._createPrismaPromise(C=>{let O={args:g,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:C,callsite:T};return s({...O,...u})})};return Vs.includes(o)?Br(e,t,a):Qs(i)?ai(e,i,a):a({})}}}function Qs(e){return $s.includes(e)}function Js(e,t){return Ie(H("fields",()=>{let r=e._runtimeDataModel.models[t];return li(t,r)}))}c();m();p();d();f();l();function pi(e){return e.replace(/^./,t=>t.toUpperCase())}var $r=Symbol();function wt(e){let t=[Gs(e),H($r,()=>e),H("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(yt(r)),de(e,t)}function Gs(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(ge),n=[...new Set(t.concat(r))];return Ie({getKeys(){return n},getPropertyValue(i){let o=pi(i);if(e._runtimeDataModel.models[o]!==void 0)return Vr(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Vr(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function di(e){return e[$r]?e[$r]:e}function fi(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return wt(t)}c();m();p();d();f();l();c();m();p();d();f();l();function gi({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let u of Object.values(o)){if(n){if(n[u.name])continue;let g=u.needs.filter(T=>n[T]);g.length>0&&a.push($e(g))}else if(r){if(!r[u.name])continue;let g=u.needs.filter(T=>!r[T]);g.length>0&&a.push($e(g))}Ws(e,u.needs)&&s.push(Ks(u,de(e,s)))}return s.length>0||a.length>0?de(e,[...s,...a]):e}function Ws(e,t){return t.every(r=>Rr(e,r))}function Ks(e,t){return Ie(H(e.name,()=>e.compute(t)))}c();m();p();d();f();l();c();m();p();d();f();l();function Zt({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sT.name===o);if(!u||u.kind!=="object"||!u.relationName)continue;let g=typeof s=="object"?s:{};t[o]=Zt({visitor:i,result:t[o],args:g,modelName:u.type,runtimeDataModel:n})}}function yi({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Zt({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,u,g)=>{let T=ge(u);return gi({result:a,modelName:T,select:g.select,omit:g.select?void 0:{...o?.[T],...g.omit},extensions:n})}})}c();m();p();d();f();l();c();m();p();d();f();l();l();function bi(e){if(e instanceof X)return Hs(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:bi(t.args??{}),__internalParams:t,query:(s,a=t)=>{let u=a.customDataProxyFetch;return a.customDataProxyFetch=Ti(o,u),a.args=s,Ei(e,a,r,n+1)}})})}function xi(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return Ei(e,t,s)}function Pi(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?vi(r,n,0,e):e(r)}}function vi(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let u=a.customDataProxyFetch;return a.customDataProxyFetch=Ti(i,u),vi(a,t,r+1,n)}})}var wi=e=>e;function Ti(e=wi,t=wi){return r=>e(t(r))}c();m();p();d();f();l();c();m();p();d();f();l();function Ri(e,t,r){let n=ge(r);return!t.result||!(t.result.$allModels||t.result[n])?e:zs({...e,...Ci(t.name,e,t.result.$allModels),...Ci(t.name,e,t.result[n])})}function zs(e){let t=new pe,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return Be(e,n=>({...n,needs:r(n.name,new Set)}))}function Ci(e,t,r){return r?Be(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Ys(t,o,i)})):{}}function Ys(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Ai(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function Si(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var er=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new pe;this.modelExtensionsCache=new pe;this.queryCallbacksCache=new pe;this.clientExtensions=ut(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=ut(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Ri(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=ge(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},tr=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new er(t))}isEmpty(){return this.head===void 0}append(t){return new e(new er(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};c();m();p();d();f();l();var Oi=ee("prisma:client"),ki={Vercel:"vercel","Netlify CI":"netlify"};function Mi({postinstall:e,ciName:t,clientVersion:r}){if(Oi("checkPlatformCaching:postinstall",e),Oi("checkPlatformCaching:ciName",t),e===!0&&t&&t in ki){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${ki[t]}-build`;throw console.error(n),new L(n,r)}}c();m();p();d();f();l();function Ii(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}c();m();p();d();f();l();c();m();p();d();f();l();c();m();p();d();f();l();var Xs="Cloudflare-Workers",Zs="node";function Li(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===Xs?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===Zs?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var ea={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function Ce(){let e=Li();return{id:e,prettyName:ea[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}c();m();p();d();f();l();c();m();p();d();f();l();function rr({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=t[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=r[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw Ce().id==="workerd"?new L(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new L(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new L("error: Missing URL environment variable, value, or override.",n);return i}c();m();p();d();f();l();c();m();p();d();f();l();function _i(e){if(e?.kind==="itx")return e.options.id}c();m();p();d();f();l();var jr,Di={async loadLibrary(e){let{clientVersion:t,adapter:r,engineWasm:n}=e;if(r===void 0)throw new L(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Ce().prettyName})`,t);if(n===void 0)throw new L("WASM engine was unexpectedly `undefined`",t);jr===void 0&&(jr=(async()=>{let o=n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new L("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let a={"./query_engine_bg.js":o},u=new WebAssembly.Instance(s,a);return o.__wbg_set_wasm(u.exports),o.QueryEngine})());let i=await jr;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var ta="P2036",he=ee("prisma:client:libraryEngine");function ra(e){return e.item_type==="query"&&"query"in e}function na(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var tC=[...Tr,"native"],xt=class{constructor(t,r){this.name="LibraryEngine";this.libraryLoader=r??Di,this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,t.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary()}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(t,r,n){await this.start();let i=JSON.stringify(r),o;if(t==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else t==="commit"?o=await this.engine?.commitTransaction(n.id,i):t==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(ia(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new J(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(he("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;this.binaryTarget=await this.getCurrentBinaryTarget(),await this.loadEngine(),this.version()}async getCurrentBinaryTarget(){}parseEngineResponse(t){if(!t)throw new G("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new G("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new w(this),{adapter:r}=this.config;r&&he("Using driver adapter: %O",r),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:h.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{t.deref()?.logger(n)},r)}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new L(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);if(r){if("span"in r){this.config.tracingHelper.createEngineSpan(r);return}r.level=r?.level.toLowerCase()??"unknown",ra(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):(na(r),this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path}))}}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return he(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{he("library starting");try{let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,he("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new L(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return he("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),he("library stopping");let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,he("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){he(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new G(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s,elapsed:0}}catch(s){if(s instanceof L)throw s;s.code==="GenericFailure"&&s.message?.startsWith("PANIC:");let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new G(`${a.message} -${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){he("requestBatch");let i=Qt(t,r);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),_i(r));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new G(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:u}=s;if(Array.isArray(a))return a.map(g=>g.errors&&g.errors.length>0?this.loggerRustPanic??this.buildQueryError(g.errors[0]):{data:g,elapsed:0});throw u&&u.length===1?new Error(u[0].error):new Error(JSON.stringify(s))}buildQueryError(t){t.user_facing_error.is_panic;let r=this.getExternalAdapterError(t.user_facing_error);return r?r.error:Yt(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t){if(t.error_code===ta&&this.config.adapter){let r=t.meta?.id;Ut(typeof r=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(r);return Ut(n,"External error with reported id was not registered"),n}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function ia(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}c();m();p();d();f();l();var Pt="Accelerate has not been setup correctly. Make sure your client is using `.$extends(withAccelerate())`. See https://pris.ly/d/accelerate-getting-started",nr=class{constructor(t){this.config=t;this.name="AccelerateEngine";this.resolveDatasourceUrl=this.config.accelerateUtils?.resolveDatasourceUrl;this.getBatchRequestPayload=this.config.accelerateUtils?.getBatchRequestPayload;this.prismaGraphQLToJSError=this.config.accelerateUtils?.prismaGraphQLToJSError;this.PrismaClientUnknownRequestError=this.config.accelerateUtils?.PrismaClientUnknownRequestError;this.PrismaClientInitializationError=this.config.accelerateUtils?.PrismaClientInitializationError;this.PrismaClientKnownRequestError=this.config.accelerateUtils?.PrismaClientKnownRequestError;this.debug=this.config.accelerateUtils?.debug;this.engineVersion=this.config.accelerateUtils?.engineVersion;this.clientVersion=this.config.accelerateUtils?.clientVersion}onBeforeExit(t){}async start(){}async stop(){}version(t){return"unknown"}transaction(t,r,n){throw new L(Pt,this.config.clientVersion)}metrics(t){throw new L(Pt,this.config.clientVersion)}request(t,r){throw new L(Pt,this.config.clientVersion)}requestBatch(t,r){throw new L(Pt,this.config.clientVersion)}applyPendingMigrations(){throw new L(Pt,this.config.clientVersion)}};function Fi({copyEngine:e=!0},t){let r;try{r=rr({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...h.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||r?.startsWith("prisma+postgres://"));e&&n&<("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=ot(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",u=i==="binary";if(o&&s||s&&!1){let g;throw e?r?.startsWith("prisma://")?g=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:g=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:g=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new j(g.join(` -`),{clientVersion:t.clientVersion})}if(s)return new xt(t);if(o)return new nr(t);{let g=[`PrismaClient failed to initialize because it wasn't configured to run in this environment (${Ce().prettyName}).`,"In order to run Prisma Client in an edge runtime, you will need to configure one of the following options:","- Enable Driver Adapters: https://pris.ly/d/driver-adapters","- Enable Accelerate: https://pris.ly/d/accelerate"];throw new j(g.join(` -`),{clientVersion:t.clientVersion})}throw new j("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}c();m();p();d();f();l();function ir({generator:e}){return e?.previewFeatures??[]}c();m();p();d();f();l();c();m();p();d();f();l();function Ze(e){return e.substring(0,1).toLowerCase()+e.substring(1)}c();m();p();d();f();l();c();m();p();d();f();l();var $i=Fe(Qr());c();m();p();d();f();l();function Bi(e,t,r){let n=Vi(e),i=oa(n),o=aa(i);o?or(o,t,r):t.addErrorMessage(()=>"Unknown error")}function Vi(e){return e.errors.flatMap(t=>t.kind==="Union"?Vi(t):[t])}function oa(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:sa(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function sa(e,t){return[...new Set(e.concat(t))]}function aa(e){return Sr(e,(t,r)=>{let n=Ui(t),i=Ui(r);return n!==i?n-i:qi(t)-qi(r)})}function Ui(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function qi(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}c();m();p();d();f();l();var te=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};c();m();p();d();f();l();var vt=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(We,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function or(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":la(e,t);break;case"IncludeOnScalar":ua(e,t);break;case"EmptySelection":ca(e,t,r);break;case"UnknownSelectionField":fa(e,t);break;case"InvalidSelectionValue":ga(e,t);break;case"UnknownArgument":ha(e,t);break;case"UnknownInputField":ya(e,t);break;case"RequiredArgumentMissing":ba(e,t);break;case"InvalidArgumentType":wa(e,t);break;case"InvalidArgumentValue":Ea(e,t);break;case"ValueTooLarge":xa(e,t);break;case"SomeFieldsMissing":Pa(e,t);break;case"TooManyFieldsGiven":va(e,t);break;case"Union":Bi(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function la(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function ua(e,t){let[r,n]=Tt(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new te(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${Ct(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function ca(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){ma(e,t,i);return}if(n.hasField("select")){pa(e,t);return}}if(r?.[Ze(e.outputType.name)]){da(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function ma(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new te(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function pa(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),Ji(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${Ct(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function da(e,t){let r=new vt;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new te("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=Tt(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let u=a?.value.asObject()??new He;u.addSuggestion(n),a.value=u}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function fa(e,t){let r=Gi(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":Ji(n,e.outputType);break;case"include":Ta(n,e.outputType);break;case"omit":Ca(n,e.outputType);break}}t.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(Ct(n)),i.join(" ")})}function ga(e,t){let r=Gi(e.selectionPath,t);r.parentKind!=="unknown"&&r.field.value.markAsError(),t.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`)}function ha(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Ra(n,e.arguments)),t.addErrorMessage(i=>ji(i,r,e.arguments.map(o=>o.name)))}function ya(e,t){let[r,n]=Tt(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&Wi(o,e.inputType)}t.addErrorMessage(o=>ji(o,n,e.inputType.fields.map(s=>s.name)))}function ji(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Sa(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(Ct(e)),n.join(" ")}function ba(e,t){let r;t.addErrorMessage(u=>r?.value instanceof W&&r.value.text==="null"?`Argument \`${u.green(o)}\` must not be ${u.red("null")}.`:`Argument \`${u.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=Tt(e.argumentPath),s=new vt,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let u of e.inputTypes[0].fields)s.addField(u.name,u.typeNames.join(" | "));a.addSuggestion(new te(o,s).makeRequired())}else{let u=e.inputTypes.map(Qi).join(" | ");a.addSuggestion(new te(o,u).makeRequired())}}function Qi(e){return e.kind==="list"?`${Qi(e.elementType)}[]`:e.name}function wa(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=sr("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function Ea(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=sr("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function xa(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof W&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function Pa(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&Wi(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${sr("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(Ct(i)),o.join(" ")})}function va(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${sr("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function Ji(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new te(r.name,"true"))}function Ta(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new te(r.name,"true"))}function Ca(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new te(r.name,"true"))}function Ra(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new te(r.name,r.typeNames.join(" | ")))}function Gi(e,t){let[r,n]=Tt(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),u=o?.getField(n);return o&&u?{parentKind:"select",parent:o,field:u,fieldName:n}:(u=s?.getField(n),s&&u?{parentKind:"include",field:u,parent:s,fieldName:n}:(u=a?.getField(n),a&&u?{parentKind:"omit",field:u,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function Wi(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new te(r.name,r.typeNames.join(" | ")))}function Tt(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function Ct({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function sr(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var Aa=3;function Sa(e,t){let r=1/0,n;for(let i of t){let o=(0,$i.default)(e,i);o>Aa||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[Ze(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:be(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};c();m();p();d();f();l();var Xi=e=>({command:e});c();m();p();d();f();l();c();m();p();d();f();l();var Zi=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);c();m();p();d();f();l();l();function et(e){try{return eo(e,"fast")}catch{return eo(e,"slow")}}function eo(e,t){return JSON.stringify(e.map(r=>ro(r,t)))}function ro(e,t){return Array.isArray(e)?e.map(r=>ro(r,t)):typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:Qe(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ue.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:b.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Ua(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:b.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?no(e):e}function Ua(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function no(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(to);let t={};for(let r of Object.keys(e))t[r]=to(e[r]);return t}function to(e){return typeof e=="bigint"?e.toString():no(e)}c();m();p();d();f();l();var qa=["$connect","$disconnect","$on","$transaction","$use","$extends"],io=qa;var Ba=/^(\s*alter\s)/i,oo=ee("prisma:client");function Wr(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Ba.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var Kr=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(r instanceof gt)n=r.sql,i={values:et(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:et(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:et(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:et(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Zi(r),i={values:et(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?oo(`prisma.${e}(${n}, ${i.values})`):oo(`prisma.${e}(${n})`),{query:n,parameters:i}},so={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new X(t,r)}},ao={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};c();m();p();d();f();l();function Hr(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??=lo(r(o)):lo(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function lo(e){return typeof e.then=="function"?e:Promise.resolve(e)}c();m();p();d();f();l();var uo={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},zr=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??uo}};function co(e){return e.includes("tracing")?new zr:uo}c();m();p();d();f();l();function mo(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}c();m();p();d();f();l();function po(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}c();m();p();d();f();l();var lr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};c();m();p();d();f();l();var ho=Fe(qn());c();m();p();d();f();l();function ur(e){return typeof e.batchRequestIdx=="number"}c();m();p();d();f();l();l();function cr(e){return e===null?e:Array.isArray(e)?e.map(cr):typeof e=="object"?Va(e)?$a(e):Be(e,cr):e}function Va(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function $a({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return b.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ue(t);case"Json":return JSON.parse(t);default:be(t,"Unknown tagged value")}}c();m();p();d();f();l();function fo(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Yr(e.query.arguments)),t.push(Yr(e.query.selection)),t.join("")}function Yr(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Yr(n)})`:r}).join(" ")})`}c();m();p();d();f();l();var ja={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Xr(e){return ja[e]}c();m();p();d();f();l();var mr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,h.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;iLe("bigint",r));case"bytes-array":return t.map(r=>Le("bytes",r));case"decimal-array":return t.map(r=>Le("decimal",r));case"datetime-array":return t.map(r=>Le("datetime",r));case"date-array":return t.map(r=>Le("date",r));case"time-array":return t.map(r=>Le("time",r));default:return t}}function go(e){let t=[],r=Qa(e);for(let n=0;n{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(C=>C.protocolQuery),u=this.client._tracingHelper.getTraceParent(s),g=n.some(C=>Xr(C.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:u,transaction:Ga(o),containsWrite:g,customDataProxyFetch:i})).map((C,O)=>{if(C instanceof Error)return C;try{return this.mapQueryEngineResult(n[O],C)}catch(A){return A}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?yo(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Xr(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:fo(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,t,r);return h.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(Ja(t),Wa(t,i)||t instanceof we)throw t;if(t instanceof J&&Ka(t)){let g=bo(t.meta);ar({args:o,errors:[g],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let u=t.message;if(n&&(u=Xe({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:u})),u=this.sanitizeMessage(u),t.code){let g=s?{modelName:s,...t.meta}:t.meta;throw new J(u,{code:t.code,clientVersion:this.client._clientVersion,meta:g,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new Ee(u,this.client._clientVersion);if(t instanceof G)throw new G(u,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof L)throw new L(u,this.client._clientVersion);if(t instanceof Ee)throw new Ee(u,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,ho.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(g=>g!=="select"&&g!=="include"),a=qr(o,s),u=i==="queryRaw"?go(a):cr(a);return n?n(u):u}get[Symbol.toStringTag](){return"RequestHandler"}};function Ga(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:yo(e)};be(e,"Unknown transaction kind")}}function yo(e){return{id:e.id,payload:e.payload}}function Wa(e,t){return ur(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function Ka(e){return e.code==="P2009"||e.code==="P2012"}function bo(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(bo)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}c();m();p();d();f();l();var wo="5.21.1";var Eo=wo;c();m();p();d();f();l();var Co=Fe(Qr());c();m();p();d();f();l();var _=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};K(_,"PrismaClientConstructorValidationError");var xo=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],Po=["pretty","colorless","minimal"],vo=["info","query","warn","error"],za={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new _(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=tt(r,t)||` Available datasources: ${t.join(", ")}`;throw new _(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new _(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new _(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new _(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new _('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!ir(t).includes("driverAdapters"))throw new _('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(ot()==="binary")throw new _('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new _(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new _(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Po.includes(e)){let t=tt(e,Po);throw new _(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new _(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!vo.includes(r)){let n=tt(r,vo);throw new _(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=tt(i,o);throw new _(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new _(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new _(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new _(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new _('"omit" option is expected to be an object.');if(e===null)throw new _('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=Xa(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let u=o.fields.find(g=>g.name===s);if(!u){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(u.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new _(Za(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new _(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=tt(r,t);throw new _(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Ro(e,t){for(let[r,n]of Object.entries(e)){if(!xo.includes(r)){let i=tt(r,xo);throw new _(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}za[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new _('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function tt(e,t){if(t.length===0||typeof e!="string")return"";let r=Ya(e,t);return r?` Did you mean "${r}"?`:""}function Ya(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Co.default)(e,i)}));r.sort((i,o)=>i.distanceZe(n)===t);if(r)return e[r]}function Za(e,t){let r=ze(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=zt(r,"colorless");return`Error validating "omit" option: - -${i} - -${n}`}c();m();p();d();f();l();function Ao(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},u=g=>{o||(o=!0,r(g))};for(let g=0;g{n[g]=T,a()},T=>{if(!ur(T)){u(T);return}T.batchRequestIdx===g?u(T):(i||(i=T),a())})})}var Re=ee("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var el={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},tl=Symbol.for("prisma.client.transaction.id"),rl={id:0,nextId(){return++this.id}};function ko(e){class t{constructor(n){this._originalClient=this;this._middlewares=new lr;this._createPrismaPromise=Hr();this.$extends=fi;e=n?.__internal?.configOverride?.(e)??e,Mi(e),n&&Ro(n,e);let i=new Nt().on("error",()=>{});this._extensions=tr.empty(),this._previewFeatures=ir(e),this._clientVersion=e.clientVersion??Eo,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=co(this._previewFeatures);let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&it.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&it.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=_r(n.adapter);let u=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==u)throw new L(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${u}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new L("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=e.injectableEdgeEnv?.();try{let u=n??{},g=u.__internal??{},T=g.debug===!0;T&&ee.enable("prisma:client");let C=it.resolve(e.dirname,e.relativePath);fn.existsSync(C)||(C=e.dirname),Re("dirname",e.dirname),Re("relativePath",e.relativePath),Re("cwd",C);let O=g.engine||{};if(u.errorFormat?this._errorFormat=u.errorFormat:h.env.NODE_ENV==="production"?this._errorFormat="minimal":h.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:C,dirname:e.dirname,enableDebugLogs:T,allowTriggerPanic:O.allowTriggerPanic,datamodelPath:it.join(e.dirname,e.filename??"schema.prisma"),prismaPath:O.binaryPath??void 0,engineEndpoint:O.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:u.log&&po(u.log),logQueries:u.log&&!!(typeof u.log=="string"?u.log==="query":u.log.find(A=>typeof A=="string"?A==="query":A.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:Ii(u,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:u.transactionOptions?.maxWait??2e3,timeout:u.transactionOptions?.timeout??5e3,isolationLevel:u.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:rr,getBatchRequestPayload:Qt,prismaGraphQLToJSError:Yt,PrismaClientUnknownRequestError:G,PrismaClientInitializationError:L,PrismaClientKnownRequestError:J,debug:ee("prisma:client:accelerateEngine"),engineVersion:Oo.version,clientVersion:e.clientVersion}},Re("clientVersion",e.clientVersion),this._engine=Fi(e,this._engineConfig),this._requestHandler=new pr(this,i),u.log)for(let A of u.log){let M=typeof A=="string"?A:A.emit==="stdout"?A.level:null;M&&this.$on(M,S=>{at.log(`${at.tags[M]??""}`,S.message||S.query)})}this._metrics=new Ve(this._engine)}catch(u){throw u.clientVersion=this._clientVersion,u}return this._appliedParent=wt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Sn()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Kr({clientMethod:i,activeProvider:a}),callsite:Te(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=So(n,i);return Wr(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new j("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(Wr(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new j(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Xi,callsite:Te(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Kr({clientMethod:i,activeProvider:a}),callsite:Te(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...So(n,i));throw new j("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new j("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=rl.nextId(),s=mo(n.length),a=n.map((u,g)=>{if(u?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let T=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,C={kind:"batch",id:o,index:g,isolationLevel:T,lock:s};return u.requestTransaction?.(C)??u});return Ao(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),u;try{let g={kind:"itx",...a};u=await n(this._createItxClient(g)),await this._engine.transaction("commit",o,a)}catch(g){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),g}return u}_createItxClient(n){return wt(de(di(this),[H("_appliedParent",()=>this._appliedParent._createItxClient(n)),H("_createPrismaPromise",()=>Hr(n)),H(tl,()=>n.id),$e(io)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??el,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,u=async g=>{let T=this._middlewares.get(++a);if(T)return this._tracingHelper.runInChildSpan(s.middleware,I=>T(g,ne=>(I?.end(),u(ne))));let{runInTransaction:C,args:O,...A}=g,M={...n,...A};O&&(M.args=i.middlewareArgsToRequestArgs(O)),n.transaction!==void 0&&C===!1&&delete M.transaction;let S=await xi(this,M);return M.model?yi({result:S,modelName:M.model,args:M.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):S};return this._tracingHelper.runInChildSpan(s.operation,()=>u(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:u,argsMapper:g,transaction:T,unpacker:C,otelParentCtx:O,customDataProxyFetch:A}){try{n=g?g(n):n;let M={name:"serialize"},S=this._tracingHelper.runInChildSpan(M,()=>Hi({modelName:u,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return ee.enabled("prisma:client")&&(Re("Prisma Client call:"),Re(`prisma.${i}(${ri(n)})`),Re("Generated request:"),Re(JSON.stringify(S,null,2)+` -`)),T?.kind==="batch"&&await T.lock,this._requestHandler.request({protocolQuery:S,modelName:u,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:T,unpacker:C,otelParentCtx:O,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:A})}catch(M){throw M.clientVersion=this._clientVersion,M}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new j("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function So(e,t){return nl(e)?[new X(e,t),so]:[e,ao]}function nl(e){return Array.isArray(e)&&Array.isArray(e.raw)}c();m();p();d();f();l();var il=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Mo(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!il.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}c();m();p();d();f();l();l();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,skip,sqltag,warnEnvConflicts,warnOnce}); -//# sourceMappingURL=wasm.js.map diff --git a/node_modules/@prisma/client/scripts/colors.js b/node_modules/@prisma/client/scripts/colors.js deleted file mode 100644 index ac30d2e..0000000 --- a/node_modules/@prisma/client/scripts/colors.js +++ /dev/null @@ -1,176 +0,0 @@ -'use strict' - -const isObject = (val) => val !== null && typeof val === 'object' && !Array.isArray(val) - -// this is a modified version of https://github.com/chalk/ansi-regex (MIT License) -const ANSI_REGEX = - /* eslint-disable-next-line no-control-regex */ - /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g - -const create = () => { - const colors = { enabled: true, visible: true, styles: {}, keys: {} } - - if ('FORCE_COLOR' in process.env) { - colors.enabled = process.env.FORCE_COLOR !== '0' - } - - const ansi = (style) => { - let open = (style.open = `\u001b[${style.codes[0]}m`) - let close = (style.close = `\u001b[${style.codes[1]}m`) - let regex = (style.regex = new RegExp(`\\u001b\\[${style.codes[1]}m`, 'g')) - style.wrap = (input, newline) => { - if (input.includes(close)) input = input.replace(regex, close + open) - let output = open + input + close - // see https://github.com/chalk/chalk/pull/92, thanks to the - // chalk contributors for this fix. However, we've confirmed that - // this issue is also present in Windows terminals - return newline ? output.replace(/\r*\n/g, `${close}$&${open}`) : output - } - return style - } - - const wrap = (style, input, newline) => { - return typeof style === 'function' ? style(input) : style.wrap(input, newline) - } - - const style = (input, stack) => { - if (input === '' || input == null) return '' - if (colors.enabled === false) return input - if (colors.visible === false) return '' - let str = '' + input - let nl = str.includes('\n') - let n = stack.length - if (n > 0 && stack.includes('unstyle')) { - stack = [...new Set(['unstyle', ...stack])].reverse() - } - while (n-- > 0) str = wrap(colors.styles[stack[n]], str, nl) - return str - } - - const define = (name, codes, type) => { - colors.styles[name] = ansi({ name, codes }) - let keys = colors.keys[type] || (colors.keys[type] = []) - keys.push(name) - - Reflect.defineProperty(colors, name, { - configurable: true, - enumerable: true, - set(value) { - colors.alias(name, value) - }, - get() { - let color = (input) => style(input, color.stack) - Reflect.setPrototypeOf(color, colors) - color.stack = this.stack ? this.stack.concat(name) : [name] - return color - }, - }) - } - - define('reset', [0, 0], 'modifier') - define('bold', [1, 22], 'modifier') - define('dim', [2, 22], 'modifier') - define('italic', [3, 23], 'modifier') - define('underline', [4, 24], 'modifier') - define('inverse', [7, 27], 'modifier') - define('hidden', [8, 28], 'modifier') - define('strikethrough', [9, 29], 'modifier') - - define('black', [30, 39], 'color') - define('red', [31, 39], 'color') - define('green', [32, 39], 'color') - define('yellow', [33, 39], 'color') - define('blue', [34, 39], 'color') - define('magenta', [35, 39], 'color') - define('cyan', [36, 39], 'color') - define('white', [37, 39], 'color') - define('gray', [90, 39], 'color') - define('grey', [90, 39], 'color') - - define('bgBlack', [40, 49], 'bg') - define('bgRed', [41, 49], 'bg') - define('bgGreen', [42, 49], 'bg') - define('bgYellow', [43, 49], 'bg') - define('bgBlue', [44, 49], 'bg') - define('bgMagenta', [45, 49], 'bg') - define('bgCyan', [46, 49], 'bg') - define('bgWhite', [47, 49], 'bg') - - define('blackBright', [90, 39], 'bright') - define('redBright', [91, 39], 'bright') - define('greenBright', [92, 39], 'bright') - define('yellowBright', [93, 39], 'bright') - define('blueBright', [94, 39], 'bright') - define('magentaBright', [95, 39], 'bright') - define('cyanBright', [96, 39], 'bright') - define('whiteBright', [97, 39], 'bright') - - define('bgBlackBright', [100, 49], 'bgBright') - define('bgRedBright', [101, 49], 'bgBright') - define('bgGreenBright', [102, 49], 'bgBright') - define('bgYellowBright', [103, 49], 'bgBright') - define('bgBlueBright', [104, 49], 'bgBright') - define('bgMagentaBright', [105, 49], 'bgBright') - define('bgCyanBright', [106, 49], 'bgBright') - define('bgWhiteBright', [107, 49], 'bgBright') - - colors.ansiRegex = ANSI_REGEX - colors.hasColor = colors.hasAnsi = (str) => { - colors.ansiRegex.lastIndex = 0 - return typeof str === 'string' && str !== '' && colors.ansiRegex.test(str) - } - - colors.alias = (name, color) => { - let fn = typeof color === 'string' ? colors[color] : color - - if (typeof fn !== 'function') { - throw new TypeError('Expected alias to be the name of an existing color (string) or a function') - } - - if (!fn.stack) { - Reflect.defineProperty(fn, 'name', { value: name }) - colors.styles[name] = fn - fn.stack = [name] - } - - Reflect.defineProperty(colors, name, { - configurable: true, - enumerable: true, - set(value) { - colors.alias(name, value) - }, - get() { - let color = (input) => style(input, color.stack) - Reflect.setPrototypeOf(color, colors) - color.stack = this.stack ? this.stack.concat(fn.stack) : fn.stack - return color - }, - }) - } - - colors.theme = (custom) => { - if (!isObject(custom)) throw new TypeError('Expected theme to be an object') - for (let name of Object.keys(custom)) { - colors.alias(name, custom[name]) - } - return colors - } - - colors.alias('unstyle', (str) => { - if (typeof str === 'string' && str !== '') { - colors.ansiRegex.lastIndex = 0 - return str.replace(colors.ansiRegex, '') - } - return '' - }) - - colors.alias('noop', (str) => str) - colors.none = colors.clear = colors.noop - - colors.stripColor = colors.unstyle - colors.define = define - return colors -} - -module.exports = create() -module.exports.create = create diff --git a/node_modules/@prisma/client/scripts/default-deno-edge.ts b/node_modules/@prisma/client/scripts/default-deno-edge.ts deleted file mode 100644 index bca0a97..0000000 --- a/node_modules/@prisma/client/scripts/default-deno-edge.ts +++ /dev/null @@ -1,9 +0,0 @@ -class PrismaClient { - constructor() { - throw new Error( - '@prisma/client/deno/edge did not initialize yet. Please run "prisma generate" and try to import it again.', - ) - } -} - -export { PrismaClient } diff --git a/node_modules/@prisma/client/scripts/default-index.d.ts b/node_modules/@prisma/client/scripts/default-index.d.ts deleted file mode 100644 index bac7a5c..0000000 --- a/node_modules/@prisma/client/scripts/default-index.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ - -import * as runtime from '@prisma/client/runtime/library' - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare const PrismaClient: any - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new Prisma() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client). - */ -export declare type PrismaClient = any - -export declare class PrismaClientExtends< - ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, -> { - $extends: { extArgs: ExtArgs } & (< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ) => PrismaClientExtends & Args['client']) - - $transaction( - fn: (prisma: Omit) => Promise, - options?: { maxWait?: number; timeout?: number; isolationLevel?: string }, - ): Promise - $transaction

[]>( - arg: [...P], - options?: { isolationLevel?: string }, - ): Promise> -} - -export declare const dmmf: any -export declare type dmmf = any - -/** - * Get the type of the value, that the Promise holds. - */ -export declare type PromiseType> = T extends PromiseLike ? U : T - -/** - * Get the return type of a function which returns a Promise. - */ -export declare type PromiseReturnType Promise> = PromiseType> - -export namespace Prisma { - export type TransactionClient = any - - export function defineExtension< - R extends runtime.Types.Extensions.UserArgs['result'] = {}, - M extends runtime.Types.Extensions.UserArgs['model'] = {}, - Q extends runtime.Types.Extensions.UserArgs['query'] = {}, - C extends runtime.Types.Extensions.UserArgs['client'] = {}, - Args extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.InternalArgs, - >( - args: - | ((client: PrismaClientExtends) => { $extends: { extArgs: Args } }) - | { name?: string } - | { result?: R & runtime.Types.Extensions.UserArgs['result'] } - | { model?: M & runtime.Types.Extensions.UserArgs['model'] } - | { query?: Q & runtime.Types.Extensions.UserArgs['query'] } - | { client?: C & runtime.Types.Extensions.UserArgs['client'] }, - ): (client: any) => PrismaClientExtends - - export type Extension = runtime.Types.Extensions.UserArgs - export import getExtensionContext = runtime.Extensions.getExtensionContext - export import Args = runtime.Types.Public.Args - export import Payload = runtime.Types.Public.Payload - export import Result = runtime.Types.Public.Result - export import Exact = runtime.Types.Public.Exact - export import PrismaPromise = runtime.Types.Public.PrismaPromise - - export const prismaVersion: { - client: string - engine: string - } -} diff --git a/node_modules/@prisma/client/scripts/default-index.js b/node_modules/@prisma/client/scripts/default-index.js deleted file mode 100644 index 6c1378f..0000000 --- a/node_modules/@prisma/client/scripts/default-index.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/scripts/default-index.ts -var default_index_exports = {}; -__export(default_index_exports, { - Prisma: () => Prisma, - PrismaClient: () => PrismaClient, - default: () => default_index_default -}); -module.exports = __toCommonJS(default_index_exports); - -// ../../node_modules/.pnpm/@prisma+engines-version@5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36/node_modules/@prisma/engines-version/package.json -var prisma = { - enginesVersion: "bf0e5e8a04cada8225617067eaa03d041e2bba36" -}; - -// package.json -var version = "5.21.1"; - -// src/runtime/utils/clientVersion.ts -var clientVersion = version; - -// src/scripts/default-index.ts -var PrismaClient = class { - constructor() { - throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.'); - } -}; -function defineExtension(ext) { - if (typeof ext === "function") { - return ext; - } - return (client) => client.$extends(ext); -} -function getExtensionContext(that) { - return that; -} -var Prisma = { - defineExtension, - getExtensionContext, - prismaVersion: { client: clientVersion, engine: prisma.enginesVersion } -}; -var default_index_default = { Prisma }; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Prisma, - PrismaClient -}); diff --git a/node_modules/@prisma/client/scripts/postinstall.d.ts b/node_modules/@prisma/client/scripts/postinstall.d.ts deleted file mode 100644 index 3b9fc2c..0000000 --- a/node_modules/@prisma/client/scripts/postinstall.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function getPostInstallTrigger(): string -export const UNABLE_TO_FIND_POSTINSTALL_TRIGGER__EMPTY_STRING -export const UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING -export const UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR -export const UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR diff --git a/node_modules/@prisma/client/scripts/postinstall.js b/node_modules/@prisma/client/scripts/postinstall.js deleted file mode 100644 index fec6746..0000000 --- a/node_modules/@prisma/client/scripts/postinstall.js +++ /dev/null @@ -1,410 +0,0 @@ -// @ts-check -const childProcess = require('child_process') -const { promisify } = require('util') -const fs = require('fs') -const path = require('path') -const c = require('./colors') - -const exec = promisify(childProcess.exec) - -function debug(message, ...optionalParams) { - if (process.env.DEBUG && process.env.DEBUG === 'prisma:postinstall') { - console.log(message, ...optionalParams) - } -} -/** - * Adds `package.json` to the end of a path if it doesn't already exist' - * @param {string} pth - */ -function addPackageJSON(pth) { - if (pth.endsWith('package.json')) return pth - return path.join(pth, 'package.json') -} - -/** - * Looks up for a `package.json` which is not `@prisma/cli` or `prisma` and returns the directory of the package - * @param {string | null} startPath - Path to Start At - * @param {number} limit - Find Up limit - * @returns {string | null} - */ -function findPackageRoot(startPath, limit = 10) { - if (!startPath || !fs.existsSync(startPath)) return null - let currentPath = startPath - // Limit traversal - for (let i = 0; i < limit; i++) { - const pkgPath = addPackageJSON(currentPath) - if (fs.existsSync(pkgPath)) { - try { - const pkg = require(pkgPath) - if (pkg.name && !['@prisma/cli', 'prisma'].includes(pkg.name)) { - return pkgPath.replace('package.json', '') - } - } catch {} // eslint-disable-line no-empty - } - currentPath = path.join(currentPath, '../') - } - return null -} - -/** - * The `postinstall` hook of client sets up the ground and env vars for the `prisma generate` command, - * and runs it, showing a warning if the schema is not found. - * - initializes the ./node_modules/.prisma/client folder with the default index(-browser).js/index.d.ts, - * which define a `PrismaClient` class stub that throws an error if instantiated before the `prisma generate` - * command is successfully executed. - * - sets the path of the root of the project (TODO: to verify) to the `process.env.PRISMA_GENERATE_IN_POSTINSTALL` - * variable, or `'true'` if the project root cannot be found. - * - runs `prisma generate`, passing through additional information about the command that triggered the generation, - * which is useful for debugging/telemetry. It tries to use the local `prisma` package if it is installed, otherwise it - * falls back to the global `prisma` package. If neither options are available, it warns the user to install `prisma` first. - */ -async function main() { - if (process.env.INIT_CWD) { - process.chdir(process.env.INIT_CWD) // necessary, because npm chooses __dirname as process.cwd() - // in the postinstall hook - } - - await createDefaultGeneratedThrowFiles() - - // TODO: consider using the `which` package - const localPath = getLocalPackagePath() - - // Only execute if !localpath - const installedGlobally = localPath ? undefined : await isInstalledGlobally() - - // this is needed, so we can find the correct schemas in yarn workspace projects - const root = findPackageRoot(localPath) - - process.env.PRISMA_GENERATE_IN_POSTINSTALL = root ? root : 'true' - - debug({ - localPath, - installedGlobally, - init_cwd: process.env.INIT_CWD, - PRISMA_GENERATE_IN_POSTINSTALL: process.env.PRISMA_GENERATE_IN_POSTINSTALL, - }) - try { - if (localPath) { - await run('node', [localPath, 'generate', '--postinstall', doubleQuote(getPostInstallTrigger())]) - return - } - if (installedGlobally) { - await run('prisma', ['generate', '--postinstall', doubleQuote(getPostInstallTrigger())]) - return - } - } catch (e) { - // if exit code = 1 do not print - if (e && e !== 1) { - console.error(e) - } - debug(e) - } - - if (!localPath && !installedGlobally) { - console.error( - `${c.yellow( - 'warning', - )} In order to use "@prisma/client", please install Prisma CLI. You can install it with "npm add -D prisma".`, - ) - } -} - -function getLocalPackagePath() { - try { - const packagePath = require.resolve('prisma/package.json') - if (packagePath) { - return require.resolve('prisma') - } - } catch (e) {} // eslint-disable-line no-empty - - // TODO: consider removing this - try { - const packagePath = require.resolve('@prisma/cli/package.json') - if (packagePath) { - return require.resolve('@prisma/cli') - } - } catch (e) {} // eslint-disable-line no-empty - - return null -} - -async function isInstalledGlobally() { - try { - const result = await exec('prisma -v') - if (result.stdout.includes('@prisma/client')) { - return true - } else { - console.error(`${c.yellow('warning')} You still have the ${c.bold('prisma')} cli (Prisma 1) installed globally. -Please uninstall it with either ${c.green('npm remove -g prisma')} or ${c.green('yarn global remove prisma')}.`) - } - } catch (e) { - return false - } -} - -if (!process.env.PRISMA_SKIP_POSTINSTALL_GENERATE) { - main() - .catch((e) => { - if (e.stderr) { - if (e.stderr.includes(`Can't find schema.prisma`)) { - console.error( - `${c.yellow('warning')} @prisma/client needs a ${c.bold('schema.prisma')} to function, but couldn't find it. - Please either create one manually or use ${c.bold('prisma init')}. - Once you created it, run ${c.bold('prisma generate')}. - To keep Prisma related things separate, we recommend creating it in a subfolder called ${c.underline( - './prisma', - )} like so: ${c.underline('./prisma/schema.prisma')}\n`, - ) - } else { - console.error(e.stderr) - } - } else { - console.error(e) - } - process.exit(0) - }) - .finally(() => { - debug(`postinstall trigger: ${getPostInstallTrigger()}`) - }) -} - -function run(cmd, params, cwd = process.cwd()) { - const child = childProcess.spawn(cmd, params, { - stdio: ['pipe', 'inherit', 'inherit'], - cwd, - }) - - return new Promise((resolve, reject) => { - child.on('close', () => { - resolve(undefined) - }) - child.on('exit', (code) => { - if (code === 0) { - resolve(undefined) - } else { - reject(code) - } - }) - child.on('error', () => { - reject() - }) - }) -} - -/** - * Copies our default "throw" files into the default generation folder. These - * files are dummy and informative because they just throw an error to let the - * user know that they have forgotten to run `prisma generate` or that they - * don't have a a schema file yet. We only add these files at the default - * location `node_modules/.prisma/client`. - */ -async function createDefaultGeneratedThrowFiles() { - try { - const dotPrismaClientDir = path.join(__dirname, '../../../.prisma/client') - const denoPrismaClientDir = path.join(__dirname, '../../../.prisma/client/deno') - - await makeDir(dotPrismaClientDir) - await makeDir(denoPrismaClientDir) - - const defaultFileConfig = { - js: path.join(__dirname, 'default-index.js'), - ts: path.join(__dirname, 'default-index.d.ts'), - } - - /** - * @type {Record} - */ - const defaultFiles = { - index: defaultFileConfig, - edge: defaultFileConfig, - default: defaultFileConfig, - wasm: defaultFileConfig, - 'index-browser': { - js: path.join(__dirname, 'default-index.js'), - ts: undefined, - }, - 'deno/edge': { - js: undefined, - ts: path.join(__dirname, 'default-deno-edge.ts'), - }, - } - - for (const file of Object.keys(defaultFiles)) { - const { js, ts } = defaultFiles[file] ?? {} - const dotPrismaJsFilePath = path.join(dotPrismaClientDir, `${file}.js`) - const dotPrismaTsFilePath = path.join(dotPrismaClientDir, `${file}.d.ts`) - - if (js && !fs.existsSync(dotPrismaJsFilePath) && fs.existsSync(js)) { - await fs.promises.copyFile(js, dotPrismaJsFilePath) - } - - if (ts && !fs.existsSync(dotPrismaTsFilePath) && fs.existsSync(ts)) { - await fs.promises.copyFile(ts, dotPrismaTsFilePath) - } - } - } catch (e) { - console.error(e) - } -} - -// TODO: can this be replaced some utility eg. mkdir -function makeDir(input) { - const make = async (pth) => { - try { - await fs.promises.mkdir(pth) - - return pth - } catch (error) { - if (error.code === 'EPERM') { - throw error - } - - if (error.code === 'ENOENT') { - if (path.dirname(pth) === pth) { - throw new Error(`operation not permitted, mkdir '${pth}'`) - } - - if (error.message.includes('null bytes')) { - throw error - } - - await make(path.dirname(pth)) - - return make(pth) - } - - try { - const stats = await fs.promises.stat(pth) - if (!stats.isDirectory()) { - throw new Error('The path is not a directory') - } - } catch (_) { - throw error - } - - return pth - } - } - - return make(path.resolve(input)) -} - -/** - * Get the command that triggered this postinstall script being run. If there is - * an error while attempting to get this value then the string constant - * 'ERROR_WHILE_FINDING_POSTINSTALL_TRIGGER' is returned. - * This information is just necessary for telemetry. - * This is passed to `prisma generate` as a string like `--postinstall value`. - */ -function getPostInstallTrigger() { - /* - npm_config_argv` is not officially documented so here are our research notes - - `npm_config_argv` is available to the postinstall script when the containing package has been installed by npm into some project. - - An example of its value: - - ``` - npm_config_argv: '{"remain":["../test"],"cooked":["add","../test"],"original":["add","../test"]}', - ``` - - We are interesting in the data contained in the "original" field. - - Trivia/Note: `npm_config_argv` is not available when running e.g. `npm install` on the containing package itself (e.g. when working on it) - - Yarn mimics this data and environment variable. Here is an example following `yarn add` for the same package: - - ``` - npm_config_argv: '{"remain":[],"cooked":["add"],"original":["add","../test"]}' - ``` - - Other package managers like `pnpm` have not been tested. - */ - - const maybe_npm_config_argv_string = process.env.npm_config_argv - - if (maybe_npm_config_argv_string === undefined) { - return UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING - } - - let npm_config_argv - try { - npm_config_argv = JSON.parse(maybe_npm_config_argv_string) - } catch (e) { - return `${UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR}: ${maybe_npm_config_argv_string}` - } - - if (typeof npm_config_argv !== 'object' || npm_config_argv === null) { - return `${UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR}: ${maybe_npm_config_argv_string}` - } - - const npm_config_argv_original_arr = npm_config_argv.original - - if (!Array.isArray(npm_config_argv_original_arr)) { - return `${UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR}: ${maybe_npm_config_argv_string}` - } - - const npm_config_argv_original = npm_config_argv_original_arr.filter((arg) => arg !== '').join(' ') - - const command = - npm_config_argv_original === '' - ? getPackageManagerName() - : [getPackageManagerName(), npm_config_argv_original].join(' ') - - return command -} - -/** - * Wrap double quotes around the given string. - */ -function doubleQuote(x) { - return `"${x}"` -} - -/** - * Get the package manager name currently being used. If parsing fails, then the following pattern is returned: - * UNKNOWN_NPM_CONFIG_USER_AGENT(). - */ -function getPackageManagerName() { - const userAgent = process.env.npm_config_user_agent - if (!userAgent) return 'MISSING_NPM_CONFIG_USER_AGENT' - - const name = parsePackageManagerName(userAgent) - if (!name) return `UNKNOWN_NPM_CONFIG_USER_AGENT(${userAgent})` - - return name -} - -/** - * Parse package manager name from useragent. If parsing fails, `null` is returned. - */ -function parsePackageManagerName(userAgent) { - let packageManager = null - - // example: 'yarn/1.22.4 npm/? node/v13.11.0 darwin x64' - // References: - // - https://pnpm.io/only-allow-pnpm - // - https://github.com/cameronhunter/npm-config-user-agent-parser - if (userAgent) { - const matchResult = userAgent.match(/^([^/]+)\/.+/) - if (matchResult) { - packageManager = matchResult[1].trim() - } - } - - return packageManager -} - -// prettier-ignore -const UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING = 'UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING' -// prettier-ignore -const UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR = 'UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR' -// prettier-ignore -const UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR = 'UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR' - -// expose for testing - -exports.UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING = UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING -exports.UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR = UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_PARSE_ERROR -exports.UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR = UNABLE_TO_FIND_POSTINSTALL_TRIGGER_JSON_SCHEMA_ERROR -exports.getPostInstallTrigger = getPostInstallTrigger diff --git a/node_modules/@prisma/client/sql.d.ts b/node_modules/@prisma/client/sql.d.ts deleted file mode 100644 index ff2b18f..0000000 --- a/node_modules/@prisma/client/sql.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '.prisma/client/sql' diff --git a/node_modules/@prisma/client/sql.js b/node_modules/@prisma/client/sql.js deleted file mode 100644 index 6d54621..0000000 --- a/node_modules/@prisma/client/sql.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict' -module.exports = { - ...require('.prisma/client/sql'), -} diff --git a/node_modules/@prisma/client/sql.mjs b/node_modules/@prisma/client/sql.mjs deleted file mode 100644 index 9349dbf..0000000 --- a/node_modules/@prisma/client/sql.mjs +++ /dev/null @@ -1 +0,0 @@ -export * from '../../.prisma/client/sql/index.mjs' diff --git a/node_modules/@prisma/client/wasm.d.ts b/node_modules/@prisma/client/wasm.d.ts deleted file mode 100644 index 1a47896..0000000 --- a/node_modules/@prisma/client/wasm.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '.prisma/client/wasm' diff --git a/node_modules/@prisma/client/wasm.js b/node_modules/@prisma/client/wasm.js deleted file mode 100644 index a63271a..0000000 --- a/node_modules/@prisma/client/wasm.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - // https://github.com/prisma/prisma/pull/12907 - ...require('.prisma/client/wasm'), -} diff --git a/node_modules/@socket.io/component-emitter/LICENSE b/node_modules/@socket.io/component-emitter/LICENSE deleted file mode 100644 index de51692..0000000 --- a/node_modules/@socket.io/component-emitter/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Component contributors - -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: - -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. diff --git a/node_modules/@socket.io/component-emitter/Readme.md b/node_modules/@socket.io/component-emitter/Readme.md deleted file mode 100644 index feb36f1..0000000 --- a/node_modules/@socket.io/component-emitter/Readme.md +++ /dev/null @@ -1,79 +0,0 @@ -# `@socket.io/component-emitter` - - Event emitter component. - -This project is a fork of the [`component-emitter`](https://github.com/sindresorhus/component-emitter) project, with [Socket.IO](https://socket.io/)-specific TypeScript typings. - -## Installation - -``` -$ npm i @socket.io/component-emitter -``` - -## API - -### Emitter(obj) - - The `Emitter` may also be used as a mixin. For example - a "plain" object may become an emitter, or you may - extend an existing prototype. - - As an `Emitter` instance: - -```js -import { Emitter } from '@socket.io/component-emitter'; - -var emitter = new Emitter; -emitter.emit('something'); -``` - - As a mixin: - -```js -import { Emitter } from '@socket.io/component-emitter'; - -var user = { name: 'tobi' }; -Emitter(user); - -user.emit('im a user'); -``` - - As a prototype mixin: - -```js -import { Emitter } from '@socket.io/component-emitter'; - -Emitter(User.prototype); -``` - -### Emitter#on(event, fn) - - Register an `event` handler `fn`. - -### Emitter#once(event, fn) - - Register a single-shot `event` handler `fn`, - removed immediately after it is invoked the - first time. - -### Emitter#off(event, fn) - - * Pass `event` and `fn` to remove a listener. - * Pass `event` to remove all listeners on that event. - * Pass nothing to remove all listeners on all events. - -### Emitter#emit(event, ...) - - Emit an `event` with variable option args. - -### Emitter#listeners(event) - - Return an array of callbacks, or an empty array. - -### Emitter#hasListeners(event) - - Check if this emitter has `event` handlers. - -## License - -MIT diff --git a/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts b/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts deleted file mode 100644 index 49a74e1..0000000 --- a/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts +++ /dev/null @@ -1,179 +0,0 @@ -/** - * An events map is an interface that maps event names to their value, which - * represents the type of the `on` listener. - */ -export interface EventsMap { - [event: string]: any; -} - -/** - * The default events map, used if no EventsMap is given. Using this EventsMap - * is equivalent to accepting all event names, and any data. - */ -export interface DefaultEventsMap { - [event: string]: (...args: any[]) => void; -} - -/** - * Returns a union type containing all the keys of an event map. - */ -export type EventNames = keyof Map & (string | symbol); - -/** The tuple type representing the parameters of an event listener */ -export type EventParams< - Map extends EventsMap, - Ev extends EventNames - > = Parameters; - -/** - * The event names that are either in ReservedEvents or in UserEvents - */ -export type ReservedOrUserEventNames< - ReservedEventsMap extends EventsMap, - UserEvents extends EventsMap - > = EventNames | EventNames; - -/** - * Type of a listener of a user event or a reserved event. If `Ev` is in - * `ReservedEvents`, the reserved event listener is returned. - */ -export type ReservedOrUserListener< - ReservedEvents extends EventsMap, - UserEvents extends EventsMap, - Ev extends ReservedOrUserEventNames - > = FallbackToUntypedListener< - Ev extends EventNames - ? ReservedEvents[Ev] - : Ev extends EventNames - ? UserEvents[Ev] - : never - >; - -/** - * Returns an untyped listener type if `T` is `never`; otherwise, returns `T`. - * - * This is a hack to mitigate https://github.com/socketio/socket.io/issues/3833. - * Needed because of https://github.com/microsoft/TypeScript/issues/41778 - */ -type FallbackToUntypedListener = [T] extends [never] - ? (...args: any[]) => void | Promise - : T; - -/** - * Strictly typed version of an `EventEmitter`. A `TypedEventEmitter` takes type - * parameters for mappings of event names to event data types, and strictly - * types method calls to the `EventEmitter` according to these event maps. - * - * @typeParam ListenEvents - `EventsMap` of user-defined events that can be - * listened to with `on` or `once` - * @typeParam EmitEvents - `EventsMap` of user-defined events that can be - * emitted with `emit` - * @typeParam ReservedEvents - `EventsMap` of reserved events, that can be - * emitted by socket.io with `emitReserved`, and can be listened to with - * `listen`. - */ -export class Emitter< - ListenEvents extends EventsMap, - EmitEvents extends EventsMap, - ReservedEvents extends EventsMap = {} - > { - /** - * Adds the `listener` function as an event listener for `ev`. - * - * @param ev Name of the event - * @param listener Callback function - */ - on>( - ev: Ev, - listener: ReservedOrUserListener - ): this; - - /** - * Adds a one-time `listener` function as an event listener for `ev`. - * - * @param ev Name of the event - * @param listener Callback function - */ - once>( - ev: Ev, - listener: ReservedOrUserListener - ): this; - - /** - * Removes the `listener` function as an event listener for `ev`. - * - * @param ev Name of the event - * @param listener Callback function - */ - off>( - ev?: Ev, - listener?: ReservedOrUserListener - ): this; - - /** - * Emits an event. - * - * @param ev Name of the event - * @param args Values to send to listeners of this event - */ - emit>( - ev: Ev, - ...args: EventParams - ): this; - - /** - * Emits a reserved event. - * - * This method is `protected`, so that only a class extending - * `StrictEventEmitter` can emit its own reserved events. - * - * @param ev Reserved event name - * @param args Arguments to emit along with the event - */ - protected emitReserved>( - ev: Ev, - ...args: EventParams - ): this; - - /** - * Returns the listeners listening to an event. - * - * @param event Event name - * @returns Array of listeners subscribed to `event` - */ - listeners>( - event: Ev - ): ReservedOrUserListener[]; - - /** - * Returns true if there is a listener for this event. - * - * @param event Event name - * @returns boolean - */ - hasListeners< - Ev extends ReservedOrUserEventNames - >(event: Ev): boolean; - - /** - * Removes the `listener` function as an event listener for `ev`. - * - * @param ev Name of the event - * @param listener Callback function - */ - removeListener< - Ev extends ReservedOrUserEventNames - >( - ev?: Ev, - listener?: ReservedOrUserListener - ): this; - - /** - * Removes all `listener` function as an event listener for `ev`. - * - * @param ev Name of the event - */ - removeAllListeners< - Ev extends ReservedOrUserEventNames - >(ev?: Ev): this; -} diff --git a/node_modules/@socket.io/component-emitter/lib/cjs/index.js b/node_modules/@socket.io/component-emitter/lib/cjs/index.js deleted file mode 100644 index e0d5497..0000000 --- a/node_modules/@socket.io/component-emitter/lib/cjs/index.js +++ /dev/null @@ -1,176 +0,0 @@ - -/** - * Expose `Emitter`. - */ - -exports.Emitter = Emitter; - -/** - * Initialize a new `Emitter`. - * - * @api public - */ - -function Emitter(obj) { - if (obj) return mixin(obj); -} - -/** - * Mixin the emitter properties. - * - * @param {Object} obj - * @return {Object} - * @api private - */ - -function mixin(obj) { - for (var key in Emitter.prototype) { - obj[key] = Emitter.prototype[key]; - } - return obj; -} - -/** - * Listen on the given `event` with `fn`. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.on = -Emitter.prototype.addEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - (this._callbacks['$' + event] = this._callbacks['$' + event] || []) - .push(fn); - return this; -}; - -/** - * Adds an `event` listener that will be invoked a single - * time then automatically removed. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.once = function(event, fn){ - function on() { - this.off(event, on); - fn.apply(this, arguments); - } - - on.fn = fn; - this.on(event, on); - return this; -}; - -/** - * Remove the given callback for `event` or all - * registered callbacks. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.off = -Emitter.prototype.removeListener = -Emitter.prototype.removeAllListeners = -Emitter.prototype.removeEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - - // all - if (0 == arguments.length) { - this._callbacks = {}; - return this; - } - - // specific event - var callbacks = this._callbacks['$' + event]; - if (!callbacks) return this; - - // remove all handlers - if (1 == arguments.length) { - delete this._callbacks['$' + event]; - return this; - } - - // remove specific handler - var cb; - for (var i = 0; i < callbacks.length; i++) { - cb = callbacks[i]; - if (cb === fn || cb.fn === fn) { - callbacks.splice(i, 1); - break; - } - } - - // Remove event specific arrays for event types that no - // one is subscribed for to avoid memory leak. - if (callbacks.length === 0) { - delete this._callbacks['$' + event]; - } - - return this; -}; - -/** - * Emit `event` with the given args. - * - * @param {String} event - * @param {Mixed} ... - * @return {Emitter} - */ - -Emitter.prototype.emit = function(event){ - this._callbacks = this._callbacks || {}; - - var args = new Array(arguments.length - 1) - , callbacks = this._callbacks['$' + event]; - - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - - if (callbacks) { - callbacks = callbacks.slice(0); - for (var i = 0, len = callbacks.length; i < len; ++i) { - callbacks[i].apply(this, args); - } - } - - return this; -}; - -// alias used for reserved events (protected method) -Emitter.prototype.emitReserved = Emitter.prototype.emit; - -/** - * Return array of callbacks for `event`. - * - * @param {String} event - * @return {Array} - * @api public - */ - -Emitter.prototype.listeners = function(event){ - this._callbacks = this._callbacks || {}; - return this._callbacks['$' + event] || []; -}; - -/** - * Check if this emitter has `event` handlers. - * - * @param {String} event - * @return {Boolean} - * @api public - */ - -Emitter.prototype.hasListeners = function(event){ - return !! this.listeners(event).length; -}; diff --git a/node_modules/@socket.io/component-emitter/lib/cjs/package.json b/node_modules/@socket.io/component-emitter/lib/cjs/package.json deleted file mode 100644 index b6cc1b6..0000000 --- a/node_modules/@socket.io/component-emitter/lib/cjs/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "@socket.io/component-emitter", - "type": "commonjs" -} diff --git a/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts b/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts deleted file mode 100644 index 49a74e1..0000000 --- a/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts +++ /dev/null @@ -1,179 +0,0 @@ -/** - * An events map is an interface that maps event names to their value, which - * represents the type of the `on` listener. - */ -export interface EventsMap { - [event: string]: any; -} - -/** - * The default events map, used if no EventsMap is given. Using this EventsMap - * is equivalent to accepting all event names, and any data. - */ -export interface DefaultEventsMap { - [event: string]: (...args: any[]) => void; -} - -/** - * Returns a union type containing all the keys of an event map. - */ -export type EventNames = keyof Map & (string | symbol); - -/** The tuple type representing the parameters of an event listener */ -export type EventParams< - Map extends EventsMap, - Ev extends EventNames - > = Parameters; - -/** - * The event names that are either in ReservedEvents or in UserEvents - */ -export type ReservedOrUserEventNames< - ReservedEventsMap extends EventsMap, - UserEvents extends EventsMap - > = EventNames | EventNames; - -/** - * Type of a listener of a user event or a reserved event. If `Ev` is in - * `ReservedEvents`, the reserved event listener is returned. - */ -export type ReservedOrUserListener< - ReservedEvents extends EventsMap, - UserEvents extends EventsMap, - Ev extends ReservedOrUserEventNames - > = FallbackToUntypedListener< - Ev extends EventNames - ? ReservedEvents[Ev] - : Ev extends EventNames - ? UserEvents[Ev] - : never - >; - -/** - * Returns an untyped listener type if `T` is `never`; otherwise, returns `T`. - * - * This is a hack to mitigate https://github.com/socketio/socket.io/issues/3833. - * Needed because of https://github.com/microsoft/TypeScript/issues/41778 - */ -type FallbackToUntypedListener = [T] extends [never] - ? (...args: any[]) => void | Promise - : T; - -/** - * Strictly typed version of an `EventEmitter`. A `TypedEventEmitter` takes type - * parameters for mappings of event names to event data types, and strictly - * types method calls to the `EventEmitter` according to these event maps. - * - * @typeParam ListenEvents - `EventsMap` of user-defined events that can be - * listened to with `on` or `once` - * @typeParam EmitEvents - `EventsMap` of user-defined events that can be - * emitted with `emit` - * @typeParam ReservedEvents - `EventsMap` of reserved events, that can be - * emitted by socket.io with `emitReserved`, and can be listened to with - * `listen`. - */ -export class Emitter< - ListenEvents extends EventsMap, - EmitEvents extends EventsMap, - ReservedEvents extends EventsMap = {} - > { - /** - * Adds the `listener` function as an event listener for `ev`. - * - * @param ev Name of the event - * @param listener Callback function - */ - on>( - ev: Ev, - listener: ReservedOrUserListener - ): this; - - /** - * Adds a one-time `listener` function as an event listener for `ev`. - * - * @param ev Name of the event - * @param listener Callback function - */ - once>( - ev: Ev, - listener: ReservedOrUserListener - ): this; - - /** - * Removes the `listener` function as an event listener for `ev`. - * - * @param ev Name of the event - * @param listener Callback function - */ - off>( - ev?: Ev, - listener?: ReservedOrUserListener - ): this; - - /** - * Emits an event. - * - * @param ev Name of the event - * @param args Values to send to listeners of this event - */ - emit>( - ev: Ev, - ...args: EventParams - ): this; - - /** - * Emits a reserved event. - * - * This method is `protected`, so that only a class extending - * `StrictEventEmitter` can emit its own reserved events. - * - * @param ev Reserved event name - * @param args Arguments to emit along with the event - */ - protected emitReserved>( - ev: Ev, - ...args: EventParams - ): this; - - /** - * Returns the listeners listening to an event. - * - * @param event Event name - * @returns Array of listeners subscribed to `event` - */ - listeners>( - event: Ev - ): ReservedOrUserListener[]; - - /** - * Returns true if there is a listener for this event. - * - * @param event Event name - * @returns boolean - */ - hasListeners< - Ev extends ReservedOrUserEventNames - >(event: Ev): boolean; - - /** - * Removes the `listener` function as an event listener for `ev`. - * - * @param ev Name of the event - * @param listener Callback function - */ - removeListener< - Ev extends ReservedOrUserEventNames - >( - ev?: Ev, - listener?: ReservedOrUserListener - ): this; - - /** - * Removes all `listener` function as an event listener for `ev`. - * - * @param ev Name of the event - */ - removeAllListeners< - Ev extends ReservedOrUserEventNames - >(ev?: Ev): this; -} diff --git a/node_modules/@socket.io/component-emitter/lib/esm/index.js b/node_modules/@socket.io/component-emitter/lib/esm/index.js deleted file mode 100644 index b2e5c3f..0000000 --- a/node_modules/@socket.io/component-emitter/lib/esm/index.js +++ /dev/null @@ -1,169 +0,0 @@ -/** - * Initialize a new `Emitter`. - * - * @api public - */ - -export function Emitter(obj) { - if (obj) return mixin(obj); -} - -/** - * Mixin the emitter properties. - * - * @param {Object} obj - * @return {Object} - * @api private - */ - -function mixin(obj) { - for (var key in Emitter.prototype) { - obj[key] = Emitter.prototype[key]; - } - return obj; -} - -/** - * Listen on the given `event` with `fn`. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.on = -Emitter.prototype.addEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - (this._callbacks['$' + event] = this._callbacks['$' + event] || []) - .push(fn); - return this; -}; - -/** - * Adds an `event` listener that will be invoked a single - * time then automatically removed. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.once = function(event, fn){ - function on() { - this.off(event, on); - fn.apply(this, arguments); - } - - on.fn = fn; - this.on(event, on); - return this; -}; - -/** - * Remove the given callback for `event` or all - * registered callbacks. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.off = -Emitter.prototype.removeListener = -Emitter.prototype.removeAllListeners = -Emitter.prototype.removeEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - - // all - if (0 == arguments.length) { - this._callbacks = {}; - return this; - } - - // specific event - var callbacks = this._callbacks['$' + event]; - if (!callbacks) return this; - - // remove all handlers - if (1 == arguments.length) { - delete this._callbacks['$' + event]; - return this; - } - - // remove specific handler - var cb; - for (var i = 0; i < callbacks.length; i++) { - cb = callbacks[i]; - if (cb === fn || cb.fn === fn) { - callbacks.splice(i, 1); - break; - } - } - - // Remove event specific arrays for event types that no - // one is subscribed for to avoid memory leak. - if (callbacks.length === 0) { - delete this._callbacks['$' + event]; - } - - return this; -}; - -/** - * Emit `event` with the given args. - * - * @param {String} event - * @param {Mixed} ... - * @return {Emitter} - */ - -Emitter.prototype.emit = function(event){ - this._callbacks = this._callbacks || {}; - - var args = new Array(arguments.length - 1) - , callbacks = this._callbacks['$' + event]; - - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - - if (callbacks) { - callbacks = callbacks.slice(0); - for (var i = 0, len = callbacks.length; i < len; ++i) { - callbacks[i].apply(this, args); - } - } - - return this; -}; - -// alias used for reserved events (protected method) -Emitter.prototype.emitReserved = Emitter.prototype.emit; - -/** - * Return array of callbacks for `event`. - * - * @param {String} event - * @return {Array} - * @api public - */ - -Emitter.prototype.listeners = function(event){ - this._callbacks = this._callbacks || {}; - return this._callbacks['$' + event] || []; -}; - -/** - * Check if this emitter has `event` handlers. - * - * @param {String} event - * @return {Boolean} - * @api public - */ - -Emitter.prototype.hasListeners = function(event){ - return !! this.listeners(event).length; -}; diff --git a/node_modules/@socket.io/component-emitter/lib/esm/package.json b/node_modules/@socket.io/component-emitter/lib/esm/package.json deleted file mode 100644 index 0511a0c..0000000 --- a/node_modules/@socket.io/component-emitter/lib/esm/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "@socket.io/component-emitter", - "type": "module" -} diff --git a/node_modules/@socket.io/component-emitter/package.json b/node_modules/@socket.io/component-emitter/package.json deleted file mode 100644 index 3a18a8d..0000000 --- a/node_modules/@socket.io/component-emitter/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@socket.io/component-emitter", - "description": "Event emitter", - "version": "3.1.2", - "license": "MIT", - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "component": { - "scripts": { - "emitter/index.js": "index.js" - } - }, - "main": "./lib/cjs/index.js", - "module": "./lib/esm/index.js", - "types": "./lib/cjs/index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/socketio/emitter.git" - }, - "scripts": { - "test": "make test" - }, - "files": [ - "lib/" - ] -} diff --git a/node_modules/@socket.io/postgres-adapter/LICENSE b/node_modules/@socket.io/postgres-adapter/LICENSE deleted file mode 100644 index afc17bc..0000000 --- a/node_modules/@socket.io/postgres-adapter/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2021 Damien Arrachequesne (@darrachequesne) - -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: - -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. diff --git a/node_modules/@socket.io/postgres-adapter/README.md b/node_modules/@socket.io/postgres-adapter/README.md deleted file mode 100644 index 42ccf55..0000000 --- a/node_modules/@socket.io/postgres-adapter/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# Socket.IO Postgres adapter - -The `@socket.io/postgres-adapter` package allows broadcasting packets between multiple Socket.IO servers. - - - - Diagram of Socket.IO packets forwarded through PostgreSQL - - -**Table of contents** - -- [Supported features](#supported-features) -- [Installation](#installation) -- [Usage](#usage) -- [License](#license) - -## Supported features - -| Feature | `socket.io` version | Support | -|---------------------------------|---------------------|------------------------------------------------| -| Socket management | `4.0.0` | :white_check_mark: YES (since version `0.1.0`) | -| Inter-server communication | `4.1.0` | :white_check_mark: YES (since version `0.1.0`) | -| Broadcast with acknowledgements | `4.5.0` | :white_check_mark: YES (since version `0.3.0`) | -| Connection state recovery | `4.6.0` | :x: NO | - -## Installation - -``` -npm install @socket.io/postgres-adapter -``` - -## Usage - -```js -import { Server } from "socket.io"; -import { createAdapter } from "@socket.io/postgres-adapter"; -import pg from "pg"; - -const io = new Server(); - -const pool = new pg.Pool({ - user: "postgres", - host: "localhost", - database: "postgres", - password: "changeit", - port: 5432, -}); - -pool.query(` - CREATE TABLE IF NOT EXISTS socket_io_attachments ( - id bigserial UNIQUE, - created_at timestamptz DEFAULT NOW(), - payload bytea - ); -`); - -pool.on("error", (err) => { - console.error("Postgres error", err); -}); - -io.adapter(createAdapter(pool)); -io.listen(3000); -``` - -## License - -[MIT](LICENSE) diff --git a/node_modules/@socket.io/postgres-adapter/dist/index.d.ts b/node_modules/@socket.io/postgres-adapter/dist/index.d.ts deleted file mode 100644 index b008a74..0000000 --- a/node_modules/@socket.io/postgres-adapter/dist/index.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { Pool } from "pg"; -import { ClusterAdapterWithHeartbeat } from "socket.io-adapter"; -import type { ClusterAdapterOptions, ClusterMessage, ClusterResponse, Offset, ServerId } from "socket.io-adapter"; -export interface PostgresAdapterOptions { - /** - * the name of this node - * @default a random id - */ - uid: string; - /** - * The prefix of the notification channel - * @default "socket.io" - */ - channelPrefix: string; - /** - * The name of the table for payloads over the 8000 bytes limit or containing binary data - * @default "socket_io_attachments" - */ - tableName: string; - /** - * The threshold for the payload size in bytes (see https://www.postgresql.org/docs/current/sql-notify.html) - * @default 8000 - */ - payloadThreshold: number; - /** - * after this timeout the adapter will stop waiting from responses to request - * @default 5000 - */ - requestsTimeout: number; - /** - * Number of ms between two cleanup queries - * @default 30000 - */ - cleanupInterval: number; - /** - * Handler for errors. If undefined, the errors will be simply logged. - * - * @default undefined - */ - errorHandler: (err: Error) => void; -} -/** - * Returns a function that will create a PostgresAdapter instance. - * - * @param pool - a pg.Pool instance - * @param opts - additional options - * - * @public - */ -export declare function createAdapter(pool: Pool, opts?: Partial): (nsp: any) => PostgresAdapter; -export declare class PostgresAdapter extends ClusterAdapterWithHeartbeat { - readonly channel: string; - readonly tableName: string; - payloadThreshold: number; - errorHandler: (err: Error) => void; - private readonly pool; - /** - * Adapter constructor. - * - * @param nsp - the namespace - * @param pool - a pg.Pool instance - * @param opts - additional options - * - * @public - */ - constructor(nsp: any, pool: Pool, opts?: Partial); - onEvent(event: any): Promise; - protected doPublish(message: ClusterMessage): Promise; - protected doPublishResponse(requesterUid: ServerId, response: ClusterResponse): Promise; - private _publish; - private publishWithAttachment; -} diff --git a/node_modules/@socket.io/postgres-adapter/dist/index.js b/node_modules/@socket.io/postgres-adapter/dist/index.js deleted file mode 100644 index 492fd18..0000000 --- a/node_modules/@socket.io/postgres-adapter/dist/index.js +++ /dev/null @@ -1,211 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PostgresAdapter = exports.createAdapter = void 0; -const msgpack_1 = require("@msgpack/msgpack"); -const socket_io_adapter_1 = require("socket.io-adapter"); -const debug = require("debug")("socket.io-postgres-adapter"); -const hasBinary = (obj, toJSON) => { - if (!obj || typeof obj !== "object") { - return false; - } - if (obj instanceof ArrayBuffer || ArrayBuffer.isView(obj)) { - return true; - } - if (Array.isArray(obj)) { - for (let i = 0, l = obj.length; i < l; i++) { - if (hasBinary(obj[i])) { - return true; - } - } - return false; - } - for (const key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) { - return true; - } - } - if (obj.toJSON && typeof obj.toJSON === "function" && !toJSON) { - return hasBinary(obj.toJSON(), true); - } - return false; -}; -const defaultErrorHandler = (err) => debug(err); -/** - * Returns a function that will create a PostgresAdapter instance. - * - * @param pool - a pg.Pool instance - * @param opts - additional options - * - * @public - */ -function createAdapter(pool, opts = {}) { - const errorHandler = opts.errorHandler || defaultErrorHandler; - const tableName = opts.tableName || "socket_io_attachments"; - const cleanupInterval = opts.cleanupInterval || 30000; - const channelToAdapters = new Map(); - let isConnectionInProgress = false; - let client; - let cleanupTimer; - const scheduleReconnection = () => { - const reconnectionDelay = Math.floor(2000 * (0.5 + Math.random())); - setTimeout(initClient, reconnectionDelay); - }; - const initClient = async () => { - try { - debug("fetching client from the pool"); - client = await pool.connect(); - isConnectionInProgress = false; - for (const [channel] of channelToAdapters) { - debug("client listening to %s", channel); - await client.query(`LISTEN "${channel}"`); - } - client.on("notification", async (msg) => { - var _a; - try { - await ((_a = channelToAdapters.get(msg.channel)) === null || _a === void 0 ? void 0 : _a.onEvent(msg.payload)); - } - catch (err) { - errorHandler(err); - } - }); - client.on("error", () => { - debug("client error"); - }); - client.on("end", () => { - debug("client was closed, scheduling reconnection..."); - scheduleReconnection(); - }); - } - catch (err) { - errorHandler(err); - debug("error while initializing client, scheduling reconnection..."); - scheduleReconnection(); - } - }; - const scheduleCleanup = () => { - cleanupTimer = setTimeout(async () => { - try { - await pool.query(`DELETE FROM ${tableName} WHERE created_at < now() - interval '${cleanupInterval} milliseconds'`); - } - catch (err) { - errorHandler(err); - } - scheduleCleanup(); - }, cleanupInterval); - }; - return function (nsp) { - let adapter = new PostgresAdapter(nsp, pool, opts); - channelToAdapters.set(adapter.channel, adapter); - if (isConnectionInProgress) { - // nothing to do - } - else if (client) { - debug("client listening to %s", adapter.channel); - client.query(`LISTEN "${adapter.channel}"`).catch(errorHandler); - } - else { - isConnectionInProgress = true; - initClient(); - scheduleCleanup(); - } - const defaultClose = adapter.close; - adapter.close = () => { - channelToAdapters.delete(adapter.channel); - if (channelToAdapters.size === 0) { - if (client) { - client.removeAllListeners("end"); - client.release(); - client = null; - } - if (cleanupTimer) { - clearTimeout(cleanupTimer); - } - } - defaultClose.call(adapter); - }; - return adapter; - }; -} -exports.createAdapter = createAdapter; -class PostgresAdapter extends socket_io_adapter_1.ClusterAdapterWithHeartbeat { - /** - * Adapter constructor. - * - * @param nsp - the namespace - * @param pool - a pg.Pool instance - * @param opts - additional options - * - * @public - */ - constructor(nsp, pool, opts = {}) { - super(nsp, opts); - this.pool = pool; - const channelPrefix = opts.channelPrefix || "socket.io"; - this.channel = `${channelPrefix}#${nsp.name}`; - this.tableName = opts.tableName || "socket_io_attachments"; - this.payloadThreshold = opts.payloadThreshold || 8000; - this.errorHandler = opts.errorHandler || defaultErrorHandler; - } - async onEvent(event) { - let document = JSON.parse(event); - if (document.uid === this.uid) { - return debug("ignore message from self"); - } - if (document.attachmentId) { - const result = await this.pool.query(`SELECT payload FROM ${this.tableName} WHERE id = $1`, [document.attachmentId]); - document = (0, msgpack_1.decode)(result.rows[0].payload); - } - this.onMessage(document); - } - doPublish(message) { - return this._publish(message).then(() => { - // connection state recovery is not currently supported - return ""; - }); - } - doPublishResponse(requesterUid, response) { - return this._publish(response); - } - async _publish(document) { - document.uid = this.uid; - try { - if ([ - socket_io_adapter_1.MessageType.BROADCAST, - socket_io_adapter_1.MessageType.BROADCAST_ACK, - socket_io_adapter_1.MessageType.SERVER_SIDE_EMIT, - socket_io_adapter_1.MessageType.SERVER_SIDE_EMIT_RESPONSE, - ].includes(document.type) && - hasBinary(document)) { - return await this.publishWithAttachment(document); - } - const payload = JSON.stringify(document); - if (Buffer.byteLength(payload) > this.payloadThreshold) { - return await this.publishWithAttachment(document); - } - debug("sending event of type %s to channel %s", document.type, this.channel); - await this.pool.query(`SELECT pg_notify($1, $2)`, [ - this.channel, - payload, - ]); - } - catch (err) { - this.errorHandler(err); - } - } - async publishWithAttachment(document) { - const payload = (0, msgpack_1.encode)(document); - debug("sending event of type %s with attachment to channel %s", document.type, this.channel); - const result = await this.pool.query(`INSERT INTO ${this.tableName} (payload) VALUES ($1) RETURNING id;`, [payload]); - const attachmentId = result.rows[0].id; - const headerPayload = JSON.stringify({ - uid: document.uid, - type: document.type, - attachmentId, - }); - await this.pool.query(`SELECT pg_notify($1, $2)`, [ - this.channel, - headerPayload, - ]); - } -} -exports.PostgresAdapter = PostgresAdapter; diff --git a/node_modules/@socket.io/postgres-adapter/package.json b/node_modules/@socket.io/postgres-adapter/package.json deleted file mode 100644 index 44195e6..0000000 --- a/node_modules/@socket.io/postgres-adapter/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "@socket.io/postgres-adapter", - "version": "0.4.0", - "description": "The Socket.IO Postgres adapter, allowing to broadcast events between several Socket.IO servers", - "license": "MIT", - "repository": { - "type": "git", - "url": "git@github.com:socketio/socket.io-postgres-adapter.git" - }, - "files": [ - "dist/" - ], - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "scripts": { - "compile": "rimraf ./dist && tsc", - "test": "npm run format:check && tsc && nyc mocha --require ts-node/register test/index.ts", - "format:check": "prettier --parser typescript --check lib/**/*.ts test/**/*.ts", - "format:fix": "prettier --parser typescript --write lib/**/*.ts test/**/*.ts", - "prepack": "npm run compile" - }, - "dependencies": { - "@msgpack/msgpack": "~2.8.0", - "@types/pg": "^8.6.6", - "debug": "~4.3.4", - "pg": "^8.9.0" - }, - "peerDependencies": { - "socket.io-adapter": "^2.5.4" - }, - "devDependencies": { - "@types/expect.js": "^0.3.29", - "@types/mocha": "^10.0.1", - "@types/node": "^14.14.7", - "expect.js": "0.3.1", - "mocha": "^10.2.0", - "nyc": "^15.1.0", - "prettier": "^2.8.3", - "rimraf": "^5.0.5", - "socket.io": "^4.6.0", - "socket.io-client": "^4.6.1", - "ts-node": "^10.9.1", - "typescript": "^4.9.5" - }, - "engines": { - "node": ">=12.0.0" - }, - "keywords": [ - "socket.io", - "postgres", - "postgresql", - "adapter" - ] -} diff --git a/node_modules/@types/cookie/LICENSE b/node_modules/@types/cookie/LICENSE deleted file mode 100755 index 9e841e7..0000000 --- a/node_modules/@types/cookie/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - 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: - - 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 diff --git a/node_modules/@types/cookie/README.md b/node_modules/@types/cookie/README.md deleted file mode 100755 index b6b6998..0000000 --- a/node_modules/@types/cookie/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/cookie` - -# Summary -This package contains type definitions for cookie (https://github.com/jshttp/cookie). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie. - -### Additional Details - * Last updated: Tue, 06 Jul 2021 20:32:30 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by [Pine Mizune](https://github.com/pine), and [Piotr Błażejewicz](https://github.com/peterblazejewicz). diff --git a/node_modules/@types/cookie/index.d.ts b/node_modules/@types/cookie/index.d.ts deleted file mode 100755 index a9690c3..0000000 --- a/node_modules/@types/cookie/index.d.ts +++ /dev/null @@ -1,135 +0,0 @@ -// Type definitions for cookie 0.4 -// Project: https://github.com/jshttp/cookie -// Definitions by: Pine Mizune -// Piotr Błażejewicz -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * Basic HTTP cookie parser and serializer for HTTP servers. - */ - -/** - * Additional serialization options - */ -export interface CookieSerializeOptions { - /** - * Specifies the value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.3|Domain Set-Cookie attribute}. By default, no - * domain is set, and most clients will consider the cookie to apply to only - * the current domain. - */ - domain?: string | undefined; - - /** - * Specifies a function that will be used to encode a cookie's value. Since - * value of a cookie has a limited character set (and must be a simple - * string), this function can be used to encode a value into a string suited - * for a cookie's value. - * - * The default function is the global `encodeURIComponent`, which will - * encode a JavaScript string into UTF-8 byte sequences and then URL-encode - * any that fall outside of the cookie range. - */ - encode?(value: string): string; - - /** - * Specifies the `Date` object to be the value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.1|`Expires` `Set-Cookie` attribute}. By default, - * no expiration is set, and most clients will consider this a "non-persistent cookie" and will delete - * it on a condition like exiting a web browser application. - * - * *Note* the {@link https://tools.ietf.org/html/rfc6265#section-5.3|cookie storage model specification} - * states that if both `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is - * possible not all clients by obey this, so if both are set, they should - * point to the same date and time. - */ - expires?: Date | undefined; - /** - * Specifies the boolean value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.6|`HttpOnly` `Set-Cookie` attribute}. - * When truthy, the `HttpOnly` attribute is set, otherwise it is not. By - * default, the `HttpOnly` attribute is not set. - * - * *Note* be careful when setting this to true, as compliant clients will - * not allow client-side JavaScript to see the cookie in `document.cookie`. - */ - httpOnly?: boolean | undefined; - /** - * Specifies the number (in seconds) to be the value for the `Max-Age` - * `Set-Cookie` attribute. The given number will be converted to an integer - * by rounding down. By default, no maximum age is set. - * - * *Note* the {@link https://tools.ietf.org/html/rfc6265#section-5.3|cookie storage model specification} - * states that if both `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is - * possible not all clients by obey this, so if both are set, they should - * point to the same date and time. - */ - maxAge?: number | undefined; - /** - * Specifies the value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.4|`Path` `Set-Cookie` attribute}. - * By default, the path is considered the "default path". - */ - path?: string | undefined; - /** - * Specifies the boolean or string to be the value for the {@link https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7|`SameSite` `Set-Cookie` attribute}. - * - * - `true` will set the `SameSite` attribute to `Strict` for strict same - * site enforcement. - * - `false` will not set the `SameSite` attribute. - * - `'lax'` will set the `SameSite` attribute to Lax for lax same site - * enforcement. - * - `'strict'` will set the `SameSite` attribute to Strict for strict same - * site enforcement. - * - `'none'` will set the SameSite attribute to None for an explicit - * cross-site cookie. - * - * More information about the different enforcement levels can be found in {@link https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7|the specification}. - * - * *note* This is an attribute that has not yet been fully standardized, and may change in the future. This also means many clients may ignore this attribute until they understand it. - */ - sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined; - /** - * Specifies the boolean value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.5|`Secure` `Set-Cookie` attribute}. When truthy, the - * `Secure` attribute is set, otherwise it is not. By default, the `Secure` attribute is not set. - * - * *Note* be careful when setting this to `true`, as compliant clients will - * not send the cookie back to the server in the future if the browser does - * not have an HTTPS connection. - */ - secure?: boolean | undefined; -} - -/** - * Additional parsing options - */ -export interface CookieParseOptions { - /** - * Specifies a function that will be used to decode a cookie's value. Since - * the value of a cookie has a limited character set (and must be a simple - * string), this function can be used to decode a previously-encoded cookie - * value into a JavaScript string or other object. - * - * The default function is the global `decodeURIComponent`, which will decode - * any URL-encoded sequences into their byte representations. - * - * *Note* if an error is thrown from this function, the original, non-decoded - * cookie value will be returned as the cookie's value. - */ - decode?(value: string): string; -} - -/** - * Parse an HTTP Cookie header string and returning an object of all cookie - * name-value pairs. - * - * @param str the string representing a `Cookie` header value - * @param [options] object containing parsing options - */ -export function parse(str: string, options?: CookieParseOptions): { [key: string]: string }; - -/** - * Serialize a cookie name-value pair into a `Set-Cookie` header string. - * - * @param name the name for the cookie - * @param value value to set the cookie to - * @param [options] object containing serialization options - * @throws {TypeError} when `maxAge` options is invalid - */ -export function serialize(name: string, value: string, options?: CookieSerializeOptions): string; diff --git a/node_modules/@types/cookie/package.json b/node_modules/@types/cookie/package.json deleted file mode 100755 index 4aae1e4..0000000 --- a/node_modules/@types/cookie/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "@types/cookie", - "version": "0.4.1", - "description": "TypeScript definitions for cookie", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie", - "license": "MIT", - "contributors": [ - { - "name": "Pine Mizune", - "url": "https://github.com/pine", - "githubUsername": "pine" - }, - { - "name": "Piotr Błażejewicz", - "url": "https://github.com/peterblazejewicz", - "githubUsername": "peterblazejewicz" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/cookie" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "7d4a6dd505c896319459ae131b5fa8fc0a2ed25552db53dac87946119bb21559", - "typeScriptVersion": "3.6" -} \ No newline at end of file diff --git a/node_modules/@types/cors/LICENSE b/node_modules/@types/cors/LICENSE deleted file mode 100644 index 9e841e7..0000000 --- a/node_modules/@types/cors/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - 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: - - 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 diff --git a/node_modules/@types/cors/README.md b/node_modules/@types/cors/README.md deleted file mode 100644 index 79c8b00..0000000 --- a/node_modules/@types/cors/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# Installation -> `npm install --save @types/cors` - -# Summary -This package contains type definitions for cors (https://github.com/expressjs/cors/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cors. -## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cors/index.d.ts) -````ts -/// - -import { IncomingHttpHeaders } from "http"; - -type StaticOrigin = boolean | string | RegExp | Array; - -type CustomOrigin = ( - requestOrigin: string | undefined, - callback: (err: Error | null, origin?: StaticOrigin) => void, -) => void; - -declare namespace e { - interface CorsRequest { - method?: string | undefined; - headers: IncomingHttpHeaders; - } - interface CorsOptions { - /** - * @default '*'' - */ - origin?: StaticOrigin | CustomOrigin | undefined; - /** - * @default 'GET,HEAD,PUT,PATCH,POST,DELETE' - */ - methods?: string | string[] | undefined; - allowedHeaders?: string | string[] | undefined; - exposedHeaders?: string | string[] | undefined; - credentials?: boolean | undefined; - maxAge?: number | undefined; - /** - * @default false - */ - preflightContinue?: boolean | undefined; - /** - * @default 204 - */ - optionsSuccessStatus?: number | undefined; - } - type CorsOptionsDelegate = ( - req: T, - callback: (err: Error | null, options?: CorsOptions) => void, - ) => void; -} - -declare function e( - options?: e.CorsOptions | e.CorsOptionsDelegate, -): ( - req: T, - res: { - statusCode?: number | undefined; - setHeader(key: string, value: string): any; - end(): any; - }, - next: (err?: any) => any, -) => void; -export = e; - -```` - -### Additional Details - * Last updated: Mon, 20 Nov 2023 23:36:24 GMT - * Dependencies: [@types/node](https://npmjs.com/package/@types/node) - -# Credits -These definitions were written by [Alan Plum](https://github.com/pluma), and [Gaurav Sharma](https://github.com/gtpan77). diff --git a/node_modules/@types/cors/index.d.ts b/node_modules/@types/cors/index.d.ts deleted file mode 100644 index 79a3cf9..0000000 --- a/node_modules/@types/cors/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/// - -import { IncomingHttpHeaders } from "http"; - -type StaticOrigin = boolean | string | RegExp | Array; - -type CustomOrigin = ( - requestOrigin: string | undefined, - callback: (err: Error | null, origin?: StaticOrigin) => void, -) => void; - -declare namespace e { - interface CorsRequest { - method?: string | undefined; - headers: IncomingHttpHeaders; - } - interface CorsOptions { - /** - * @default '*'' - */ - origin?: StaticOrigin | CustomOrigin | undefined; - /** - * @default 'GET,HEAD,PUT,PATCH,POST,DELETE' - */ - methods?: string | string[] | undefined; - allowedHeaders?: string | string[] | undefined; - exposedHeaders?: string | string[] | undefined; - credentials?: boolean | undefined; - maxAge?: number | undefined; - /** - * @default false - */ - preflightContinue?: boolean | undefined; - /** - * @default 204 - */ - optionsSuccessStatus?: number | undefined; - } - type CorsOptionsDelegate = ( - req: T, - callback: (err: Error | null, options?: CorsOptions) => void, - ) => void; -} - -declare function e( - options?: e.CorsOptions | e.CorsOptionsDelegate, -): ( - req: T, - res: { - statusCode?: number | undefined; - setHeader(key: string, value: string): any; - end(): any; - }, - next: (err?: any) => any, -) => void; -export = e; diff --git a/node_modules/@types/cors/package.json b/node_modules/@types/cors/package.json deleted file mode 100644 index 5b400cb..0000000 --- a/node_modules/@types/cors/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@types/cors", - "version": "2.8.17", - "description": "TypeScript definitions for cors", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cors", - "license": "MIT", - "contributors": [ - { - "name": "Alan Plum", - "githubUsername": "pluma", - "url": "https://github.com/pluma" - }, - { - "name": "Gaurav Sharma", - "githubUsername": "gtpan77", - "url": "https://github.com/gtpan77" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/cors" - }, - "scripts": {}, - "dependencies": { - "@types/node": "*" - }, - "typesPublisherContentHash": "04d506dbb23d9e7a142bfb227d59c61102abec00fb40694bb64a8d9fe1f1a3a1", - "typeScriptVersion": "4.5" -} \ No newline at end of file diff --git a/node_modules/@types/node/LICENSE b/node_modules/@types/node/LICENSE deleted file mode 100644 index 9e841e7..0000000 --- a/node_modules/@types/node/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - 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: - - 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 diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md deleted file mode 100644 index 4ae9d7c..0000000 --- a/node_modules/@types/node/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Installation -> `npm install --save @types/node` - -# Summary -This package contains type definitions for node (https://nodejs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. - -### Additional Details - * Last updated: Sat, 19 Oct 2024 03:38:51 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). diff --git a/node_modules/@types/node/assert.d.ts b/node_modules/@types/node/assert.d.ts deleted file mode 100644 index 35917ca..0000000 --- a/node_modules/@types/node/assert.d.ts +++ /dev/null @@ -1,1040 +0,0 @@ -/** - * The `node:assert` module provides a set of assertion functions for verifying - * invariants. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/assert.js) - */ -declare module "assert" { - /** - * An alias of {@link ok}. - * @since v0.5.9 - * @param value The input that is checked for being truthy. - */ - function assert(value: unknown, message?: string | Error): asserts value; - namespace assert { - /** - * 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 { - /** - * Set to the `actual` argument for methods such as {@link assert.strictEqual()}. - */ - actual: unknown; - /** - * 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. - */ - generatedMessage: boolean; - /** - * 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; - }); - } - /** - * This feature is deprecated and will be removed in a future version. - * Please consider using alternatives such as the `mock` helper function. - * @since v14.2.0, v12.19.0 - * @deprecated Deprecated - */ - class CallTracker { - /** - * The wrapper function is expected to be called exactly `exact` times. If the - * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an - * error. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func); - * ``` - * @since v14.2.0, v12.19.0 - * @param [fn='A no-op function'] - * @param [exact=1] - * @return A function that wraps `fn`. - */ - calls(exact?: number): () => void; - calls any>(fn?: Func, exact?: number): Func; - /** - * Example: - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * callsfunc(1, 2, 3); - * - * assert.deepStrictEqual(tracker.getCalls(callsfunc), - * [{ thisArg: undefined, arguments: [1, 2, 3] }]); - * ``` - * @since v18.8.0, v16.18.0 - * @return An array with all the calls to a tracked function. - */ - getCalls(fn: Function): CallTrackerCall[]; - /** - * The arrays contains information about the expected and actual number of calls of - * the functions that have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * // Returns an array containing information on callsfunc() - * console.log(tracker.report()); - * // [ - * // { - * // message: 'Expected the func function to be executed 2 time(s) but was - * // executed 0 time(s).', - * // actual: 0, - * // expected: 2, - * // operator: 'func', - * // stack: stack trace - * // } - * // ] - * ``` - * @since v14.2.0, v12.19.0 - * @return An array of objects containing information about the wrapper functions returned by {@link tracker.calls()}. - */ - report(): CallTrackerReportInformation[]; - /** - * Reset calls of the call tracker. If a tracked function is passed as an argument, the calls will be reset for it. - * If no arguments are passed, all tracked functions will be reset. - * - * ```js - * import assert from 'node:assert'; - * - * const tracker = new assert.CallTracker(); - * - * function func() {} - * const callsfunc = tracker.calls(func); - * - * callsfunc(); - * // Tracker was called once - * assert.strictEqual(tracker.getCalls(callsfunc).length, 1); - * - * tracker.reset(callsfunc); - * assert.strictEqual(tracker.getCalls(callsfunc).length, 0); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn a tracked function to reset. - */ - reset(fn?: Function): void; - /** - * Iterates through the list of functions passed to {@link tracker.calls()} and will throw an error for functions that - * have not been called the expected number of times. - * - * ```js - * import assert from 'node:assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * callsfunc(); - * - * // Will throw an error since callsfunc() was only called once. - * tracker.verify(); - * ``` - * @since v14.2.0, v12.19.0 - */ - verify(): void; - } - interface CallTrackerCall { - thisArg: object; - arguments: unknown[]; - } - interface CallTrackerReportInformation { - message: string; - /** The actual number of times the function was called. */ - actual: number; - /** The number of times the function was expected to be called. */ - expected: number; - /** The name of the function that is wrapped. */ - operator: string; - /** A stack trace of the function. */ - stack: object; - } - type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error; - /** - * Throws an `AssertionError` with the provided error message or a default - * error message. If the `message` parameter is an instance of an `Error` then - * it will be thrown instead of the `AssertionError`. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.fail(); - * // AssertionError [ERR_ASSERTION]: Failed - * - * assert.fail('boom'); - * // AssertionError [ERR_ASSERTION]: boom - * - * assert.fail(new TypeError('need array')); - * // TypeError: need array - * ``` - * - * Using `assert.fail()` with more than two arguments is possible but deprecated. - * See below for further details. - * @since v0.1.21 - * @param [message='Failed'] - */ - function fail(message?: string | Error): never; - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ - function fail( - actual: unknown, - expected: unknown, - message?: string | Error, - operator?: string, - // eslint-disable-next-line @typescript-eslint/ban-types - stackStartFn?: Function, - ): never; - /** - * Tests if `value` is truthy. It is equivalent to `assert.equal(!!value, true, message)`. - * - * If `value` is not truthy, an `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` then it will be thrown instead of the `AssertionError`. - * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. - * - * Be aware that in the `repl` the error message will be different to the one - * thrown in a file! See below for further details. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.ok(true); - * // OK - * assert.ok(1); - * // OK - * - * assert.ok(); - * // AssertionError: No value argument passed to `assert.ok()` - * - * assert.ok(false, 'it\'s false'); - * // AssertionError: it's false - * - * // In the repl: - * assert.ok(typeof 123 === 'string'); - * // AssertionError: false == true - * - * // In a file (e.g. test.js): - * assert.ok(typeof 123 === 'string'); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(typeof 123 === 'string') - * - * assert.ok(false); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(false) - * - * assert.ok(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(0) - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * // Using `assert()` works the same: - * assert(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert(0) - * ``` - * @since v0.1.21 - */ - function ok(value: unknown, message?: string | Error): asserts value; - /** - * **Strict assertion mode** - * - * An alias of {@link strictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link strictEqual} instead. - * - * Tests shallow, coercive equality between the `actual` and `expected` parameters - * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled - * and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'node:assert'; - * - * assert.equal(1, 1); - * // OK, 1 == 1 - * assert.equal(1, '1'); - * // OK, 1 == '1' - * assert.equal(NaN, NaN); - * // OK - * - * assert.equal(1, 2); - * // AssertionError: 1 == 2 - * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); - * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } - * ``` - * - * If the values are not equal, an `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` then it will be thrown instead of the `AssertionError`. - * @since v0.1.21 - */ - function equal(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. - * - * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is - * specially handled and treated as being identical if both sides are `NaN`. - * - * ```js - * import assert from 'node:assert'; - * - * assert.notEqual(1, 2); - * // OK - * - * assert.notEqual(1, 1); - * // AssertionError: 1 != 1 - * - * assert.notEqual(1, '1'); - * // AssertionError: 1 != '1' - * ``` - * - * If the values are equal, an `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` then it will be thrown instead of the `AssertionError`. - * @since v0.1.21 - */ - function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link deepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. - * - * Tests for deep equality between the `actual` and `expected` parameters. Consider - * using {@link deepStrictEqual} instead. {@link deepEqual} can have - * surprising results. - * - * _Deep equality_ means that the enumerable "own" properties of child objects - * are also recursively evaluated by the following rules. - * @since v0.1.21 - */ - function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notDeepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. - * - * Tests for any deep inequality. Opposite of {@link deepEqual}. - * - * ```js - * import assert from 'node:assert'; - * - * const obj1 = { - * a: { - * b: 1, - * }, - * }; - * const obj2 = { - * a: { - * b: 2, - * }, - * }; - * const obj3 = { - * a: { - * b: 1, - * }, - * }; - * const obj4 = { __proto__: obj1 }; - * - * assert.notDeepEqual(obj1, obj1); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj2); - * // OK - * - * assert.notDeepEqual(obj1, obj3); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj4); - * // OK - * ``` - * - * If the values are deeply equal, an `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` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests strict equality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.strictEqual(1, 2); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // - * // 1 !== 2 - * - * assert.strictEqual(1, 1); - * // OK - * - * assert.strictEqual('Hello foobar', 'Hello World!'); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // + actual - expected - * // - * // + 'Hello foobar' - * // - 'Hello World!' - * // ^ - * - * const apples = 1; - * const oranges = 2; - * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); - * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 - * - * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); - * // TypeError: Inputs are not identical - * ``` - * - * If the values are not strictly equal, an `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` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests strict inequality between the `actual` and `expected` parameters as - * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.notStrictEqual(1, 2); - * // OK - * - * assert.notStrictEqual(1, 1); - * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: - * // - * // 1 - * - * assert.notStrictEqual(1, '1'); - * // OK - * ``` - * - * If the values are strictly equal, an `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` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests for 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. - * @since v1.2.0 - */ - function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); - * // OK - * ``` - * - * If the values are deeply and strictly equal, an `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` then it will be thrown - * instead of the `AssertionError`. - * @since v1.2.0 - */ - function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Expects the function `fn` to throw an error. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * a validation object where each property will be tested for strict deep equality, - * or an instance of error where each property will be tested for strict deep - * equality including the non-enumerable `message` and `name` properties. When - * using an object, it is also possible to use a regular expression, when - * validating against a string property. See below for examples. - * - * If specified, `message` will be appended to the message provided by the `AssertionError` if the `fn` call fails to throw or in case the error validation - * fails. - * - * Custom validation object/error instance: - * - * ```js - * import assert from 'node:assert/strict'; - * - * const err = new TypeError('Wrong value'); - * err.code = 404; - * err.foo = 'bar'; - * err.info = { - * nested: true, - * baz: 'text', - * }; - * err.reg = /abc/i; - * - * assert.throws( - * () => { - * throw err; - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * info: { - * nested: true, - * baz: 'text', - * }, - * // Only properties on the validation object will be tested for. - * // Using nested objects requires all properties to be present. Otherwise - * // the validation is going to fail. - * }, - * ); - * - * // Using regular expressions to validate error properties: - * assert.throws( - * () => { - * throw err; - * }, - * { - * // The `name` and `message` properties are strings and using regular - * // expressions on those will match against the string. If they fail, an - * // error is thrown. - * name: /^TypeError$/, - * message: /Wrong/, - * foo: 'bar', - * info: { - * nested: true, - * // It is not possible to use regular expressions for nested properties! - * baz: 'text', - * }, - * // The `reg` property contains a regular expression and only if the - * // validation object contains an identical regular expression, it is going - * // to pass. - * reg: /abc/i, - * }, - * ); - * - * // Fails due to the different `message` and `name` properties: - * assert.throws( - * () => { - * const otherErr = new Error('Not found'); - * // Copy all enumerable properties from `err` to `otherErr`. - * for (const [key, value] of Object.entries(err)) { - * otherErr[key] = value; - * } - * throw otherErr; - * }, - * // The error's `message` and `name` properties will also be checked when using - * // an error as validation object. - * err, - * ); - * ``` - * - * Validate instanceof using constructor: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * Error, - * ); - * ``` - * - * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): - * - * Using a regular expression runs `.toString` on the error object, and will - * therefore also include the error name. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * /^Error: Wrong value$/, - * ); - * ``` - * - * Custom error validation: - * - * The function must return `true` to indicate all internal validations passed. - * It will otherwise fail with an `AssertionError`. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * (err) => { - * assert(err instanceof Error); - * assert(/value/.test(err)); - * // Avoid returning anything from validation functions besides `true`. - * // Otherwise, it's not clear what part of the validation failed. Instead, - * // throw an error about the specific validation that failed (as done in this - * // example) and add as much helpful debugging information to that error as - * // possible. - * return true; - * }, - * 'unexpected error', - * ); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for `message` instead. This can lead to easy-to-miss mistakes. Using the same - * message as the thrown error message is going to result in an `ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using - * a string as the second argument gets considered: - * - * ```js - * import assert from 'node:assert/strict'; - * - * function throwingFirst() { - * throw new Error('First'); - * } - * - * function throwingSecond() { - * throw new Error('Second'); - * } - * - * function notThrowing() {} - * - * // The second argument is a string and the input function threw an Error. - * // The first case will not throw as it does not match for the error message - * // thrown by the input function! - * assert.throws(throwingFirst, 'Second'); - * // In the next example the message has no benefit over the message from the - * // error and since it is not clear if the user intended to actually match - * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. - * assert.throws(throwingSecond, 'Second'); - * // TypeError [ERR_AMBIGUOUS_ARGUMENT] - * - * // The string is only used (as message) in case the function does not throw: - * assert.throws(notThrowing, 'Second'); - * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second - * - * // If it was intended to match for the error message do this instead: - * // It does not throw because the error messages match. - * assert.throws(throwingSecond, /Second$/); - * - * // If the error message does not match, an AssertionError is thrown. - * assert.throws(throwingFirst, /Second$/); - * // AssertionError [ERR_ASSERTION] - * ``` - * - * Due to the confusing error-prone notation, avoid a string as the second - * argument. - * @since v0.1.21 - */ - function throws(block: () => unknown, message?: string | Error): void; - function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Asserts that the function `fn` does not throw an error. - * - * Using `assert.doesNotThrow()` is actually not useful because there - * is no benefit in catching an error and then rethrowing it. Instead, consider - * adding a comment next to the specific code path that should not throw and keep - * error messages as expressive as possible. - * - * When `assert.doesNotThrow()` is called, it will immediately call the `fn` function. - * - * If an error is thrown and it is the same type as that specified by the `error` parameter, then an `AssertionError` is thrown. If the error is of a - * different type, or if the `error` parameter is undefined, the error is - * propagated back to the caller. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation - * function. See {@link throws} for more details. - * - * The following, for instance, will throw the `TypeError` because there is no - * matching error type in the assertion: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError, - * ); - * ``` - * - * However, the following will result in an `AssertionError` with the message - * 'Got unwanted exception...': - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * TypeError, - * ); - * ``` - * - * If an `AssertionError` is thrown and a value is provided for the `message` parameter, the value of `message` will be appended to the `AssertionError` message: - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * /Wrong value/, - * 'Whoops', - * ); - * // Throws: AssertionError: Got unwanted exception: Whoops - * ``` - * @since v0.1.21 - */ - function doesNotThrow(block: () => unknown, message?: string | Error): void; - function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Throws `value` if `value` is not `undefined` or `null`. This is useful when - * testing the `error` argument in callbacks. The stack trace contains all frames - * from the error passed to `ifError()` including the potential new frames for `ifError()` itself. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.ifError(null); - * // OK - * assert.ifError(0); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 - * assert.ifError('error'); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' - * assert.ifError(new Error()); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error - * - * // Create some random error frames. - * let err; - * (function errorFrame() { - * err = new Error('test error'); - * })(); - * - * (function ifErrorFrame() { - * assert.ifError(err); - * })(); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error - * // at ifErrorFrame - * // at errorFrame - * ``` - * @since v0.1.97 - */ - function ifError(value: unknown): asserts value is null | undefined; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * 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-v22.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}. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * an object where each property will be tested for, or an instance of error where - * each property will be tested for including the non-enumerable `message` and `name` properties. - * - * If specified, `message` will be the message provided by the `{@link AssertionError}` if the `asyncFn` fails to reject. - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * }, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * (err) => { - * assert.strictEqual(err.name, 'TypeError'); - * assert.strictEqual(err.message, 'Wrong value'); - * return true; - * }, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.rejects( - * Promise.reject(new Error('Wrong value')), - * Error, - * ).then(() => { - * // ... - * }); - * ``` - * - * `error` cannot be a string. If a string is provided as the second argument, then `error` is assumed to - * be omitted and the string will be used for `message` instead. This can lead to easy-to-miss mistakes. Please read the - * example in {@link throws} carefully if using a string as the second argument gets considered. - * @since v10.0.0 - */ - function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; - function rejects( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is not rejected. - * - * 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-v22.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 - * benefit in catching a rejection and then rejecting it again. Instead, consider - * adding a comment next to the specific code path that should not reject and keep - * error messages as expressive as possible. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation - * function. See {@link throws} for more details. - * - * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. - * - * ```js - * import assert from 'node:assert/strict'; - * - * await assert.doesNotReject( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError, - * ); - * ``` - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) - * .then(() => { - * // ... - * }); - * ``` - * @since v10.0.0 - */ - function doesNotReject( - block: (() => Promise) | Promise, - message?: string | Error, - ): Promise; - function doesNotReject( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - /** - * Expects the `string` input to match the regular expression. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.match('I will fail', /pass/); - * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... - * - * assert.match(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.match('I will pass', /pass/); - * // OK - * ``` - * - * 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-v22.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; - /** - * Expects the `string` input not to match the regular expression. - * - * ```js - * import assert from 'node:assert/strict'; - * - * assert.doesNotMatch('I will fail', /fail/); - * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... - * - * assert.doesNotMatch(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.doesNotMatch('I will pass', /different/); - * // OK - * ``` - * - * 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-v22.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}. - * - * 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'; - * 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 - */ - 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; - }; - } - export = assert; -} -declare module "node:assert" { - import assert = require("assert"); - export = assert; -} diff --git a/node_modules/@types/node/assert/strict.d.ts b/node_modules/@types/node/assert/strict.d.ts deleted file mode 100644 index f333913..0000000 --- a/node_modules/@types/node/assert/strict.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module "assert/strict" { - import { strict } from "node:assert"; - export = strict; -} -declare module "node:assert/strict" { - import { strict } from "node:assert"; - export = strict; -} diff --git a/node_modules/@types/node/async_hooks.d.ts b/node_modules/@types/node/async_hooks.d.ts deleted file mode 100644 index 4d6df81..0000000 --- a/node_modules/@types/node/async_hooks.d.ts +++ /dev/null @@ -1,541 +0,0 @@ -/** - * 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-v22.x/api/async_context.html#class-asynclocalstorage) tracks async context - * * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v22.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: - * - * ```js - * import async_hooks from 'node:async_hooks'; - * ``` - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/async_hooks.js) - */ -declare module "async_hooks" { - /** - * ```js - * import { executionAsyncId } from 'node:async_hooks'; - * import fs from 'node:fs'; - * - * console.log(executionAsyncId()); // 1 - bootstrap - * const path = '.'; - * fs.open(path, 'r', (err, fd) => { - * console.log(executionAsyncId()); // 6 - open() - * }); - * ``` - * - * The ID returned from `executionAsyncId()` is related to execution timing, not - * causality (which is covered by `triggerAsyncId()`): - * - * ```js - * const server = net.createServer((conn) => { - * // Returns the ID of the server, not of the new connection, because the - * // callback runs in the execution scope of the server's MakeCallback(). - * async_hooks.executionAsyncId(); - * - * }).listen(port, () => { - * // Returns the ID of a TickObject (process.nextTick()) because all - * // callbacks passed to .listen() are wrapped in a nextTick(). - * async_hooks.executionAsyncId(); - * }); - * ``` - * - * Promise contexts may not get precise `executionAsyncIds` by default. - * See the section on [promise execution tracking](https://nodejs.org/docs/latest-v22.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. - */ - function executionAsyncId(): number; - /** - * Resource objects returned by `executionAsyncResource()` are most often internal - * Node.js handle objects with undocumented APIs. Using any functions or properties - * on the object is likely to crash your application and should be avoided. - * - * Using `executionAsyncResource()` in the top-level execution context will - * return an empty object as there is no handle or request object to use, - * but having an object representing the top-level can be helpful. - * - * ```js - * import { open } from 'node:fs'; - * import { executionAsyncId, executionAsyncResource } from 'node:async_hooks'; - * - * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} - * open(new URL(import.meta.url), 'r', (err, fd) => { - * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap - * }); - * ``` - * - * This can be used to implement continuation local storage without the - * use of a tracking `Map` to store the metadata: - * - * ```js - * import { createServer } from 'node:http'; - * import { - * executionAsyncId, - * executionAsyncResource, - * createHook, - * } from 'node:async_hooks'; - * const sym = Symbol('state'); // Private symbol to avoid pollution - * - * createHook({ - * init(asyncId, type, triggerAsyncId, resource) { - * const cr = executionAsyncResource(); - * if (cr) { - * resource[sym] = cr[sym]; - * } - * }, - * }).enable(); - * - * const server = createServer((req, res) => { - * executionAsyncResource()[sym] = { state: req.url }; - * setTimeout(function() { - * res.end(JSON.stringify(executionAsyncResource()[sym])); - * }, 100); - * }).listen(3000); - * ``` - * @since v13.9.0, v12.17.0 - * @return The resource representing the current execution. Useful to store data within the resource. - */ - function executionAsyncResource(): object; - /** - * ```js - * const server = net.createServer((conn) => { - * // The resource that caused (or triggered) this callback to be called - * // was that of the new connection. Thus the return value of triggerAsyncId() - * // is the asyncId of "conn". - * async_hooks.triggerAsyncId(); - * - * }).listen(port, () => { - * // Even though all callbacks passed to .listen() are wrapped in a nextTick() - * // the callback itself exists because the call to the server's .listen() - * // was made. So the return value would be the ID of the server. - * async_hooks.triggerAsyncId(); - * }); - * ``` - * - * Promise contexts may not get valid `triggerAsyncId`s by default. See - * the section on [promise execution tracking](https://nodejs.org/docs/latest-v22.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; - interface HookCallbacks { - /** - * Called when a class is constructed that has the possibility to emit an asynchronous event. - * @param asyncId A unique ID for the async resource - * @param type The type of the async resource - * @param triggerAsyncId The unique ID of the async resource in whose execution context this async resource was created - * @param resource Reference to the resource representing the async operation, needs to be released during destroy - */ - init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; - /** - * When an asynchronous operation is initiated or completes a callback is called to notify the user. - * The before callback is called just before said callback is executed. - * @param asyncId the unique identifier assigned to the resource about to execute the callback. - */ - before?(asyncId: number): void; - /** - * Called immediately after the callback specified in `before` is completed. - * - * If an uncaught exception occurs during execution of the callback, then `after` will run after the `'uncaughtException'` event is emitted or a `domain`'s handler runs. - * @param asyncId the unique identifier assigned to the resource which has executed the callback. - */ - after?(asyncId: number): void; - /** - * Called when a promise has resolve() called. This may not be in the same execution id - * as the promise itself. - * @param asyncId the unique id for the promise that was resolve()d. - */ - promiseResolve?(asyncId: number): void; - /** - * Called after the resource corresponding to asyncId is destroyed - * @param asyncId a unique ID for the async resource - */ - destroy?(asyncId: number): void; - } - interface AsyncHook { - /** - * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. - */ - enable(): this; - /** - * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. - */ - disable(): this; - } - /** - * Registers functions to be called for different lifetime events of each async - * operation. - * - * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the - * respective asynchronous event during a resource's lifetime. - * - * All callbacks are optional. For example, if only resource cleanup needs to - * be tracked, then only the `destroy` callback needs to be passed. The - * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. - * - * ```js - * import { createHook } from 'node:async_hooks'; - * - * const asyncHook = createHook({ - * init(asyncId, type, triggerAsyncId, resource) { }, - * destroy(asyncId) { }, - * }); - * ``` - * - * The callbacks will be inherited via the prototype chain: - * - * ```js - * class MyAsyncCallbacks { - * init(asyncId, type, triggerAsyncId, resource) { } - * destroy(asyncId) {} - * } - * - * class MyAddedCallbacks extends MyAsyncCallbacks { - * before(asyncId) { } - * after(asyncId) { } - * } - * - * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); - * ``` - * - * Because promises are asynchronous resources whose lifecycle is tracked - * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. - * @since v8.1.0 - * @param callbacks The `Hook Callbacks` to register - * @return Instance used for disabling and enabling hooks - */ - function createHook(callbacks: HookCallbacks): AsyncHook; - interface AsyncResourceOptions { - /** - * The ID of the execution context that created this async event. - * @default executionAsyncId() - */ - triggerAsyncId?: number | undefined; - /** - * Disables automatic `emitDestroy` when the object is garbage collected. - * This usually does not need to be set (even if `emitDestroy` is called - * manually), unless the resource's `asyncId` is retrieved and the - * sensitive API's `emitDestroy` is called with it. - * @default false - */ - requireManualDestroy?: boolean | undefined; - } - /** - * The class `AsyncResource` is designed to be extended by the embedder's async - * resources. Using this, users can easily trigger the lifetime events of their - * own resources. - * - * The `init` hook will trigger when an `AsyncResource` is instantiated. - * - * The following is an overview of the `AsyncResource` API. - * - * ```js - * import { AsyncResource, executionAsyncId } from 'node:async_hooks'; - * - * // AsyncResource() is meant to be extended. Instantiating a - * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * // async_hook.executionAsyncId() is used. - * const asyncResource = new AsyncResource( - * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false }, - * ); - * - * // Run a function in the execution context of the resource. This will - * // * establish the context of the resource - * // * trigger the AsyncHooks before callbacks - * // * call the provided function `fn` with the supplied arguments - * // * trigger the AsyncHooks after callbacks - * // * restore the original execution context - * asyncResource.runInAsyncScope(fn, thisArg, ...args); - * - * // Call AsyncHooks destroy callbacks. - * asyncResource.emitDestroy(); - * - * // Return the unique ID assigned to the AsyncResource instance. - * asyncResource.asyncId(); - * - * // Return the trigger ID for the AsyncResource instance. - * asyncResource.triggerAsyncId(); - * ``` - */ - class AsyncResource { - /** - * AsyncResource() is meant to be extended. Instantiating a - * new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * async_hook.executionAsyncId() is used. - * @param type The type of async event. - * @param triggerAsyncId The ID of the execution context that created - * this async event (default: `executionAsyncId()`), or an - * AsyncResourceOptions object (since v9.3.0) - */ - constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); - /** - * Binds the given function to the current execution context. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current execution context. - * @param type An optional name to associate with the underlying `AsyncResource`. - */ - static bind any, ThisArg>( - fn: Func, - type?: string, - thisArg?: ThisArg, - ): Func; - /** - * Binds the given function to execute to this `AsyncResource`'s scope. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current `AsyncResource`. - */ - bind any>(fn: Func): Func; - /** - * Call the provided function with the provided arguments in the execution context - * of the async resource. This will establish the context, trigger the AsyncHooks - * before callbacks, call the function, trigger the AsyncHooks after callbacks, and - * then restore the original execution context. - * @since v9.6.0 - * @param fn The function to call in the execution context of this async resource. - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runInAsyncScope( - fn: (this: This, ...args: any[]) => Result, - thisArg?: This, - ...args: any[] - ): Result; - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - * @return A reference to `asyncResource`. - */ - emitDestroy(): this; - /** - * @return The unique `asyncId` assigned to the resource. - */ - asyncId(): number; - /** - * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. - */ - triggerAsyncId(): number; - } - /** - * This class creates stores that stay coherent through asynchronous operations. - * - * While you can create your own implementation on top of the `node:async_hooks` module, `AsyncLocalStorage` should be preferred as it is a performant and memory - * safe implementation that involves significant optimizations that are non-obvious - * to implement. - * - * The following example uses `AsyncLocalStorage` to build a simple logger - * that assigns IDs to incoming HTTP requests and includes them in messages - * logged within each request. - * - * ```js - * import http from 'node:http'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const asyncLocalStorage = new AsyncLocalStorage(); - * - * function logWithId(msg) { - * const id = asyncLocalStorage.getStore(); - * console.log(`${id !== undefined ? id : '-'}:`, msg); - * } - * - * let idSeq = 0; - * http.createServer((req, res) => { - * asyncLocalStorage.run(idSeq++, () => { - * logWithId('start'); - * // Imagine any chain of async operations here - * setImmediate(() => { - * logWithId('finish'); - * res.end(); - * }); - * }); - * }).listen(8080); - * - * http.get('http://localhost:8080'); - * http.get('http://localhost:8080'); - * // Prints: - * // 0: start - * // 1: start - * // 0: finish - * // 1: finish - * ``` - * - * Each instance of `AsyncLocalStorage` maintains an independent storage context. - * Multiple instances can safely exist simultaneously without risk of interfering - * with each other's data. - * @since v13.10.0, v12.17.0 - */ - class AsyncLocalStorage { - /** - * 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. - */ - static bind any>(fn: Func): Func; - /** - * Captures the current execution context and returns a function that accepts a - * function as an argument. Whenever the returned function is called, it - * calls the function passed to it within the captured context. - * - * ```js - * const asyncLocalStorage = new AsyncLocalStorage(); - * const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot()); - * const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore())); - * console.log(result); // returns 123 - * ``` - * - * AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple - * async context tracking purposes, for example: - * - * ```js - * class Foo { - * #runInAsyncScope = AsyncLocalStorage.snapshot(); - * - * get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); } - * } - * - * const foo = asyncLocalStorage.run(123, () => new Foo()); - * 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(): (fn: (...args: TArgs) => R, ...args: TArgs) => R; - /** - * Disables the instance of `AsyncLocalStorage`. All subsequent calls - * to `asyncLocalStorage.getStore()` will return `undefined` until `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. - * - * When calling `asyncLocalStorage.disable()`, all current contexts linked to the - * instance will be exited. - * - * Calling `asyncLocalStorage.disable()` is required before the `asyncLocalStorage` can be garbage collected. This does not apply to stores - * provided by the `asyncLocalStorage`, as those objects are garbage collected - * along with the corresponding async resources. - * - * Use this method when the `asyncLocalStorage` is not in use anymore - * in the current process. - * @since v13.10.0, v12.17.0 - * @experimental - */ - disable(): void; - /** - * Returns the current store. - * If called outside of an asynchronous context initialized by - * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it - * returns `undefined`. - * @since v13.10.0, v12.17.0 - */ - getStore(): T | undefined; - /** - * Runs a function synchronously within a context and returns its - * return value. The store is not accessible outside of the callback function. - * The store is accessible to any asynchronous operations created within the - * callback. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `run()` too. - * The stacktrace is not impacted by this call and the context is exited. - * - * Example: - * - * ```js - * const store = { id: 2 }; - * try { - * asyncLocalStorage.run(store, () => { - * asyncLocalStorage.getStore(); // Returns the store object - * setTimeout(() => { - * asyncLocalStorage.getStore(); // Returns the store object - * }, 200); - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns undefined - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - */ - run(store: T, callback: () => R): R; - run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Runs a function synchronously outside of a context and returns its - * return value. The store is not accessible within the callback function or - * the asynchronous operations created within the callback. Any `getStore()` call done within the callback function will always return `undefined`. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `exit()` too. - * The stacktrace is not impacted by this call and the context is re-entered. - * - * Example: - * - * ```js - * // Within a call to run - * try { - * asyncLocalStorage.getStore(); // Returns the store object or value - * asyncLocalStorage.exit(() => { - * asyncLocalStorage.getStore(); // Returns undefined - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns the same object or value - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - * @experimental - */ - exit(callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Transitions into the context for the remainder of the current - * synchronous execution and then persists the store through any following - * asynchronous calls. - * - * Example: - * - * ```js - * const store = { id: 1 }; - * // Replaces previous store with the given store object - * asyncLocalStorage.enterWith(store); - * asyncLocalStorage.getStore(); // Returns the store object - * someAsyncOperation(() => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * ``` - * - * This transition will continue for the _entire_ synchronous execution. - * This means that if, for example, the context is entered within an event - * handler subsequent event handlers will also run within that context unless - * specifically bound to another context with an `AsyncResource`. That is why `run()` should be preferred over `enterWith()` unless there are strong reasons - * to use the latter method. - * - * ```js - * const store = { id: 1 }; - * - * emitter.on('my-event', () => { - * asyncLocalStorage.enterWith(store); - * }); - * emitter.on('my-event', () => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * - * asyncLocalStorage.getStore(); // Returns undefined - * emitter.emit('my-event'); - * asyncLocalStorage.getStore(); // Returns the same object - * ``` - * @since v13.11.0, v12.17.0 - * @experimental - */ - enterWith(store: T): void; - } -} -declare module "node:async_hooks" { - export * from "async_hooks"; -} diff --git a/node_modules/@types/node/buffer.buffer.d.ts b/node_modules/@types/node/buffer.buffer.d.ts deleted file mode 100644 index 0b6c49a..0000000 --- a/node_modules/@types/node/buffer.buffer.d.ts +++ /dev/null @@ -1,385 +0,0 @@ -declare module "buffer" { - global { - interface BufferConstructor { - // see buffer.d.ts for implementation shared with all TypeScript versions - - /** - * 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: TArrayBuffer): 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, - 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): 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 - | { - [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; - /** - * 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: - * 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; - /** - * 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: - * ``` - * - * 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: - * ``` - * - * 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: - * ``` - * - * 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): - * - * buf.fill(0); - * - * console.log(buf); - * // Prints: - * ``` - * - * 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; - } - interface Buffer extends Uint8Array { - // see buffer.d.ts for implementation shared with all TypeScript versions - - /** - * 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; - } - } -} diff --git a/node_modules/@types/node/buffer.d.ts b/node_modules/@types/node/buffer.d.ts deleted file mode 100644 index 792bf4d..0000000 --- a/node_modules/@types/node/buffer.d.ts +++ /dev/null @@ -1,1933 +0,0 @@ -// 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. - * - * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and - * extends it with methods that cover additional use cases. Node.js APIs accept - * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well. - * - * While the `Buffer` class is available within the global scope, it is still - * recommended to explicitly reference it via an import or require statement. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Creates a zero-filled Buffer of length 10. - * const buf1 = Buffer.alloc(10); - * - * // Creates a Buffer of length 10, - * // filled with bytes which all have the value `1`. - * const buf2 = Buffer.alloc(10, 1); - * - * // Creates an uninitialized buffer of length 10. - * // This is faster than calling Buffer.alloc() but the returned - * // Buffer instance might contain old data that needs to be - * // overwritten using fill(), write(), or other functions that fill the Buffer's - * // contents. - * const buf3 = Buffer.allocUnsafe(10); - * - * // Creates a Buffer containing the bytes [1, 2, 3]. - * const buf4 = Buffer.from([1, 2, 3]); - * - * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries - * // are all truncated using `(value & 255)` to fit into the range 0–255. - * const buf5 = Buffer.from([257, 257.5, -255, '1']); - * - * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': - * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) - * // [116, 195, 169, 115, 116] (in decimal notation) - * const buf6 = Buffer.from('tést'); - * - * // 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/v22.x/lib/buffer.js) - */ -declare module "buffer" { - import { BinaryLike } from "node:crypto"; - import { ReadableStream as WebReadableStream } from "node:stream/web"; - /** - * This function returns `true` if `input` contains only valid UTF-8-encoded data, - * including the case in which `input` is empty. - * - * Throws if the `input` is a detached array buffer. - * @since v19.4.0, v18.14.0 - * @param input The input to validate. - */ - export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean; - /** - * This function returns `true` if `input` contains only valid ASCII-encoded data, - * including the case in which `input` is empty. - * - * Throws if the `input` is a detached array 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 const kMaxLength: number; - export const kStringMaxLength: number; - export const constants: { - MAX_LENGTH: number; - MAX_STRING_LENGTH: number; - }; - export type TranscodeEncoding = - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "utf-16le" - | "ucs2" - | "ucs-2" - | "latin1" - | "binary"; - /** - * Re-encodes the given `Buffer` or `Uint8Array` instance from one character - * encoding to another. Returns a new `Buffer` instance. - * - * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if - * conversion from `fromEnc` to `toEnc` is not permitted. - * - * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`, `'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. - * - * The transcoding process will use substitution characters if a given byte - * sequence cannot be adequately represented in the target encoding. For instance: - * - * ```js - * import { Buffer, transcode } from 'node:buffer'; - * - * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); - * console.log(newBuf.toString('ascii')); - * // Prints: '?' - * ``` - * - * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced - * with `?` in the transcoded `Buffer`. - * @since v7.1.0 - * @param source A `Buffer` or `Uint8Array` instance. - * @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; - }; - /** - * 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 }; - /** - * @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 `import { EOL } from 'node:os'`. - */ - endings?: "transparent" | "native"; - /** - * The Blob content-type. The intent is for `type` to convey - * the MIME media type of the data, however no validation of the type format - * is performed. - */ - 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 - * multiple worker threads. - * @since v15.7.0, v14.18.0 - */ - export class Blob { - /** - * The total size of the `Blob` in bytes. - * @since v15.7.0, v14.18.0 - */ - readonly size: number; - /** - * The content-type of the `Blob`. - * @since v15.7.0, v14.18.0 - */ - readonly type: string; - /** - * Creates a new `Blob` object containing a concatenation of the given sources. - * - * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into - * the 'Blob' and can therefore be safely modified after the 'Blob' is created. - * - * String sources are also copied into the `Blob`. - */ - constructor(sources: Array, options?: BlobOptions); - /** - * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of - * the `Blob` data. - * @since v15.7.0, v14.18.0 - */ - arrayBuffer(): Promise; - /** - * The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise`. - * - * ```js - * const blob = new Blob(['hello']); - * blob.bytes().then((bytes) => { - * console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ] - * }); - * ``` - */ - bytes(): Promise; - /** - * Creates and returns a new `Blob` containing a subset of this `Blob` objects - * data. The original `Blob` is not altered. - * @since v15.7.0, v14.18.0 - * @param start The starting index. - * @param end The ending index. - * @param type The content-type for the new `Blob` - */ - slice(start?: number, end?: number, type?: string): Blob; - /** - * Returns a promise that fulfills with the contents of the `Blob` decoded as a - * UTF-8 string. - * @since v15.7.0, v14.18.0 - */ - text(): Promise; - /** - * Returns a new `ReadableStream` that allows the content of the `Blob` to be read. - * @since v16.7.0 - */ - stream(): WebReadableStream; - } - 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 `import { EOL } from 'node:os'`. - */ - endings?: "native" | "transparent"; - /** The File content-type. */ - type?: string; - /** The last modified date of the file. `Default`: Date.now(). */ - lastModified?: number; - } - /** - * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files. - * @since v19.2.0, v18.13.0 - */ - export class File extends Blob { - constructor(sources: Array, fileName: string, options?: FileOptions); - /** - * The name of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly name: string; - /** - * The last modified date of the `File`. - * @since v19.2.0, v18.13.0 - */ - readonly lastModified: number; - } - export import atob = globalThis.atob; - export import btoa = globalThis.btoa; - - global { - namespace NodeJS { - export { BufferEncoding }; - } - // Buffer class - type BufferEncoding = - | "ascii" - | "utf8" - | "utf-8" - | "utf16le" - | "utf-16le" - | "ucs2" - | "ucs-2" - | "base64" - | "base64url" - | "latin1" - | "binary" - | "hex"; - type WithImplicitCoercion = - | 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 { - // 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. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * Buffer.isBuffer(Buffer.alloc(10)); // true - * Buffer.isBuffer(Buffer.from('foo')); // true - * Buffer.isBuffer('a string'); // false - * Buffer.isBuffer([]); // false - * Buffer.isBuffer(new Uint8Array(1024)); // false - * ``` - * @since v0.1.101 - */ - isBuffer(obj: any): obj is Buffer; - /** - * Returns `true` if `encoding` is the name of a supported character encoding, - * or `false` otherwise. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * console.log(Buffer.isEncoding('utf8')); - * // Prints: true - * - * console.log(Buffer.isEncoding('hex')); - * // Prints: true - * - * console.log(Buffer.isEncoding('utf/8')); - * // Prints: false - * - * console.log(Buffer.isEncoding('')); - * // Prints: false - * ``` - * @since v0.9.1 - * @param encoding A character encoding name to check. - */ - isEncoding(encoding: string): encoding is BufferEncoding; - /** - * Returns the byte length of a string when encoded using `encoding`. - * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account - * for the encoding that is used to convert the string into bytes. - * - * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. - * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the - * return value might be greater than the length of a `Buffer` created from the - * string. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const str = '\u00bd + \u00bc = \u00be'; - * - * console.log(`${str}: ${str.length} characters, ` + - * `${Buffer.byteLength(str, 'utf8')} bytes`); - * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes - * ``` - * - * When `string` is a - * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- - * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- - * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. - * @since v0.1.90 - * @param string A value to calculate the length of. - * @param [encoding='utf8'] If `string` is a string, this is its encoding. - * @return The number of bytes contained within `string`. - */ - byteLength( - string: string | Buffer | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, - encoding?: BufferEncoding, - ): number; - /** - * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of `Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('1234'); - * const buf2 = Buffer.from('0123'); - * const arr = [buf1, buf2]; - * - * console.log(arr.sort(Buffer.compare)); - * // Prints: [ , ] - * // (This result is equal to: [buf2, buf1].) - * ``` - * @since v0.11.13 - * @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; - /** - * This is the size (in bytes) of pre-allocated internal `Buffer` instances used - * for pooling. This value may be modified. - * @since v0.11.3 - */ - poolSize: number; - } - 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 - * written. However, partially encoded characters will not be written. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.alloc(256); - * - * const len = buf.write('\u00bd + \u00bc = \u00be', 0); - * - * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); - * // Prints: 12 bytes: ½ + ¼ = ¾ - * - * const buffer = Buffer.alloc(10); - * - * const length = buffer.write('abcd', 8); - * - * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); - * // Prints: 2 bytes : ab - * ``` - * @since v0.1.90 - * @param string String to write to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write `string`. - * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). - * @param [encoding='utf8'] The character encoding of `string`. - * @return Number of bytes written. - */ - write(string: string, encoding?: BufferEncoding): number; - write(string: string, offset: number, encoding?: BufferEncoding): number; - write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; - /** - * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. - * - * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, - * then each invalid byte is replaced with the replacement character `U+FFFD`. - * - * The maximum length of a string instance (in UTF-16 code units) is available - * as {@link constants.MAX_STRING_LENGTH}. - * - * ```js - * import { Buffer } from 'node: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; - * } - * - * console.log(buf1.toString('utf8')); - * // Prints: abcdefghijklmnopqrstuvwxyz - * console.log(buf1.toString('utf8', 0, 5)); - * // Prints: abcde - * - * const buf2 = Buffer.from('tést'); - * - * console.log(buf2.toString('hex')); - * // Prints: 74c3a97374 - * console.log(buf2.toString('utf8', 0, 3)); - * // Prints: té - * console.log(buf2.toString(undefined, 0, 3)); - * // Prints: té - * ``` - * @since v0.1.90 - * @param [encoding='utf8'] The character encoding to use. - * @param [start=0] The byte offset to start decoding at. - * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). - */ - toString(encoding?: BufferEncoding, start?: number, end?: number): string; - /** - * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls - * this function when stringifying a `Buffer` instance. - * - * `Buffer.from()` accepts objects in the format returned from this method. - * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); - * const json = JSON.stringify(buf); - * - * console.log(json); - * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} - * - * const copy = JSON.parse(json, (key, value) => { - * return value && value.type === 'Buffer' ? - * Buffer.from(value) : - * value; - * }); - * - * console.log(copy); - * // Prints: - * ``` - * @since v0.9.2 - */ - toJSON(): { - type: "Buffer"; - data: number[]; - }; - /** - * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('414243', 'hex'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.equals(buf2)); - * // Prints: true - * console.log(buf1.equals(buf3)); - * // Prints: false - * ``` - * @since v0.11.13 - * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. - */ - equals(otherBuffer: Uint8Array): boolean; - /** - * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. - * Comparison is based on the actual sequence of bytes in each `Buffer`. - * - * * `0` is returned if `target` is the same as `buf` - * * `1` is returned if `target` should come _before_`buf` when sorted. - * * `-1` is returned if `target` should come _after_`buf` when sorted. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('BCD'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.compare(buf1)); - * // Prints: 0 - * console.log(buf1.compare(buf2)); - * // Prints: -1 - * console.log(buf1.compare(buf3)); - * // Prints: -1 - * console.log(buf2.compare(buf1)); - * // Prints: 1 - * console.log(buf2.compare(buf3)); - * // Prints: 1 - * console.log([buf1, buf2, buf3].sort(Buffer.compare)); - * // Prints: [ , , ] - * // (This result is equal to: [buf1, buf3, buf2].) - * ``` - * - * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd` arguments can be used to limit the comparison to specific ranges within `target` and `buf` respectively. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); - * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); - * - * console.log(buf1.compare(buf2, 5, 9, 0, 4)); - * // Prints: 0 - * console.log(buf1.compare(buf2, 0, 6, 4)); - * // Prints: -1 - * console.log(buf1.compare(buf2, 5, 6, 5)); - * // Prints: 1 - * ``` - * - * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`, `targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. - * @since v0.11.13 - * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. - * @param [targetStart=0] The offset within `target` at which to begin comparison. - * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). - * @param [sourceStart=0] The offset within `buf` at which to begin comparison. - * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). - */ - compare( - target: Uint8Array, - targetStart?: number, - targetEnd?: number, - sourceStart?: number, - sourceEnd?: number, - ): -1 | 0 | 1; - /** - * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. - * - * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available - * for all TypedArrays, including Node.js `Buffer`s, although it takes - * different function arguments. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create two `Buffer` instances. - * const buf1 = Buffer.allocUnsafe(26); - * const buf2 = Buffer.allocUnsafe(26).fill('!'); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. - * buf1.copy(buf2, 8, 16, 20); - * // This is equivalent to: - * // buf2.set(buf1.subarray(16, 20), 8); - * - * console.log(buf2.toString('ascii', 0, 25)); - * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! - * ``` - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Create a `Buffer` and copy data from one region to an overlapping region - * // within the same `Buffer`. - * - * const buf = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf[i] = i + 97; - * } - * - * buf.copy(buf, 0, 4, 10); - * - * console.log(buf.toString()); - * // Prints: efghijghijklmnopqrstuvwxyz - * ``` - * @since v0.1.90 - * @param target A `Buffer` or {@link Uint8Array} to copy into. - * @param [targetStart=0] The offset within `target` at which to begin writing. - * @param [sourceStart=0] The offset within `buf` from which to begin copying. - * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). - * @return The number of bytes copied. - */ - copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64BE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64LE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64LE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * This function is also available under the `writeBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64BE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * - * This function is also available under the `writeBigUint64LE` alias. - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64LE(value: bigint, offset?: number): number; - /** - * @alias Buffer.writeBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - writeBigUint64LE(value: bigint, offset?: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintLE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntLE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntLE - * @since v14.9.0, v12.19.0 - */ - writeUintLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintBE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntBE(value: number, offset: number, byteLength: number): number; - /** - * @alias Buffer.writeUIntBE - * @since v14.9.0, v12.19.0 - */ - writeUintBE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than a signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a - * signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntBE(value: number, offset: number, byteLength: number): number; - /** - * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64BE(0)); - * // Prints: 4294967295n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64BE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64BE - * @since v14.10.0, v12.19.0 - */ - readBigUint64BE(offset?: number): bigint; - /** - * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64LE(0)); - * // Prints: 18446744069414584320n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64LE(offset?: number): bigint; - /** - * @alias Buffer.readBigUInt64LE - * @since v14.10.0, v12.19.0 - */ - readBigUint64LE(offset?: number): bigint; - /** - * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64BE(offset?: number): bigint; - /** - * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64LE(offset?: number): bigint; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned, little-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintLE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntLE(0, 6).toString(16)); - * // Prints: ab9078563412 - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntLE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntLE - * @since v14.9.0, v12.19.0 - */ - readUintLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned big-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintBE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readUIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntBE(offset: number, byteLength: number): number; - /** - * @alias Buffer.readUIntBE - * @since v14.9.0, v12.19.0 - */ - readUintBE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a little-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntLE(0, 6).toString(16)); - * // Prints: -546f87a9cbee - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a big-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * console.log(buf.readIntBE(1, 0).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntBE(offset: number, byteLength: number): number; - /** - * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. - * - * This function is also available under the `readUint8` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, -2]); - * - * console.log(buf.readUInt8(0)); - * // Prints: 1 - * console.log(buf.readUInt8(1)); - * // Prints: 254 - * console.log(buf.readUInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readUInt8(offset?: number): number; - /** - * @alias Buffer.readUInt8 - * @since v14.9.0, v12.19.0 - */ - readUint8(offset?: number): number; - /** - * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified `offset`. - * - * This function is also available under the `readUint16LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16LE(0).toString(16)); - * // Prints: 3412 - * console.log(buf.readUInt16LE(1).toString(16)); - * // Prints: 5634 - * console.log(buf.readUInt16LE(2).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16LE(offset?: number): number; - /** - * @alias Buffer.readUInt16LE - * @since v14.9.0, v12.19.0 - */ - readUint16LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16BE(0).toString(16)); - * // Prints: 1234 - * console.log(buf.readUInt16BE(1).toString(16)); - * // Prints: 3456 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16BE(offset?: number): number; - /** - * @alias Buffer.readUInt16BE - * @since v14.9.0, v12.19.0 - */ - readUint16BE(offset?: number): number; - /** - * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32LE(0).toString(16)); - * // Prints: 78563412 - * console.log(buf.readUInt32LE(1).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32LE(offset?: number): number; - /** - * @alias Buffer.readUInt32LE - * @since v14.9.0, v12.19.0 - */ - readUint32LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32BE(0).toString(16)); - * // Prints: 12345678 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32BE(offset?: number): number; - /** - * @alias Buffer.readUInt32BE - * @since v14.9.0, v12.19.0 - */ - readUint32BE(offset?: number): number; - /** - * Reads a signed 8-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([-1, 5]); - * - * console.log(buf.readInt8(0)); - * // Prints: -1 - * console.log(buf.readInt8(1)); - * // Prints: 5 - * console.log(buf.readInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readInt8(offset?: number): number; - /** - * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16LE(0)); - * // Prints: 1280 - * console.log(buf.readInt16LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16LE(offset?: number): number; - /** - * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16BE(offset?: number): number; - /** - * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32LE(0)); - * // Prints: 83886080 - * console.log(buf.readInt32LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32LE(offset?: number): number; - /** - * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32BE(offset?: number): number; - /** - * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatLE(0)); - * // Prints: 1.539989614439558e-36 - * console.log(buf.readFloatLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatLE(offset?: number): number; - /** - * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatBE(0)); - * // Prints: 2.387939260590663e-38 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatBE(offset?: number): number; - /** - * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleLE(0)); - * // Prints: 5.447603722011605e-270 - * console.log(buf.readDoubleLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleLE(offset?: number): number; - /** - * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleBE(0)); - * // Prints: 8.20788039913184e-304 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleBE(offset?: number): number; - reverse(): this; - /** - * Interprets `buf` as an array of unsigned 16-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap16(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap16(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * - * One convenient use of `buf.swap16()` is to perform a fast in-place conversion - * between UTF-16 little-endian and UTF-16 big-endian: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); - * buf.swap16(); // Convert to big-endian UTF-16 text. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - 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. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap32(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap32(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - 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. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap64(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap64(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v6.3.0 - * @return A reference to `buf`. - */ - 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 - * other than an unsigned 8-bit integer. - * - * This function is also available under the `writeUint8` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt8(0x3, 0); - * buf.writeUInt8(0x4, 1); - * buf.writeUInt8(0x23, 2); - * buf.writeUInt8(0x42, 3); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeUInt8(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt8 - * @since v14.9.0, v12.19.0 - */ - writeUint8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 16-bit integer. - * - * This function is also available under the `writeUint16LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16LE(0xdead, 0); - * buf.writeUInt16LE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16LE - * @since v14.9.0, v12.19.0 - */ - writeUint16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 16-bit integer. - * - * This function is also available under the `writeUint16BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16BE(0xdead, 0); - * buf.writeUInt16BE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt16BE - * @since v14.9.0, v12.19.0 - */ - writeUint16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 32-bit integer. - * - * This function is also available under the `writeUint32LE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32LE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32LE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32LE - * @since v14.9.0, v12.19.0 - */ - writeUint32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 32-bit integer. - * - * This function is also available under the `writeUint32BE` alias. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32BE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32BE(value: number, offset?: number): number; - /** - * @alias Buffer.writeUInt32BE - * @since v14.9.0, v12.19.0 - */ - writeUint32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a valid - * signed 8-bit integer. Behavior is undefined when `value` is anything other than - * a signed 8-bit integer. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt8(2, 0); - * buf.writeInt8(-2, 1); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeInt8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16LE(0x0304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16BE(0x0102, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32LE(0x05060708, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32BE(0x01020304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatLE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatBE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatBE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleLE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleBE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleBE(value: number, offset?: number): number; - /** - * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, - * the entire `buf` will be filled: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Fill a `Buffer` with the ASCII character 'h'. - * - * const b = Buffer.allocUnsafe(50).fill('h'); - * - * console.log(b.toString()); - * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh - * - * // Fill a buffer with empty string - * const c = Buffer.allocUnsafe(5).fill(''); - * - * console.log(c.fill('')); - * // Prints: - * ``` - * - * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or - * integer. If the resulting integer is greater than `255` (decimal), `buf` will be - * filled with `value & 255`. - * - * If the final write of a `fill()` operation falls on a multi-byte character, - * then only the bytes of that character that fit into `buf` are written: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * // Fill a `Buffer` with character that takes up two bytes in UTF-8. - * - * console.log(Buffer.allocUnsafe(5).fill('\u0222')); - * // Prints: - * ``` - * - * If `value` contains invalid characters, it is truncated; if no valid - * fill data remains, an exception is thrown: - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.allocUnsafe(5); - * - * console.log(buf.fill('a')); - * // Prints: - * console.log(buf.fill('aazz', 'hex')); - * // Prints: - * console.log(buf.fill('zz', 'hex')); - * // Throws an exception. - * ``` - * @since v0.5.0 - * @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`. - * @param [offset=0] Number of bytes to skip before starting to fill `buf`. - * @param [end=buf.length] Where to stop filling `buf` (not inclusive). - * @param [encoding='utf8'] The encoding for `value` if `value` is a string. - * @return A reference to `buf`. - */ - fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; - /** - * If `value` is: - * - * * a string, `value` is interpreted according to the character encoding in `encoding`. - * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. - * To compare a partial `Buffer`, use `buf.subarray`. - * * a number, `value` will be interpreted as an unsigned 8-bit integer - * value between `0` and `255`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.indexOf('this')); - * // Prints: 0 - * console.log(buf.indexOf('is')); - * // Prints: 2 - * console.log(buf.indexOf(Buffer.from('a buffer'))); - * // Prints: 8 - * console.log(buf.indexOf(97)); - * // Prints: 8 (97 is the decimal ASCII value for 'a') - * console.log(buf.indexOf(Buffer.from('a buffer example'))); - * // Prints: -1 - * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: 8 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); - * // Prints: 4 - * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); - * // Prints: 6 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. If the result - * of coercion is `NaN` or `0`, then the entire buffer will be searched. This - * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.indexOf(99.9)); - * console.log(b.indexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN or 0. - * // Prints: 1, searching the whole buffer. - * console.log(b.indexOf('b', undefined)); - * console.log(b.indexOf('b', {})); - * console.log(b.indexOf('b', null)); - * console.log(b.indexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer` and `byteOffset` is less - * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. - * @since v1.5.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @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; - /** - * Identical to `buf.indexOf()`, except the last occurrence of `value` is found - * rather than the first occurrence. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this buffer is a buffer'); - * - * console.log(buf.lastIndexOf('this')); - * // Prints: 0 - * console.log(buf.lastIndexOf('buffer')); - * // Prints: 17 - * console.log(buf.lastIndexOf(Buffer.from('buffer'))); - * // Prints: 17 - * console.log(buf.lastIndexOf(97)); - * // Prints: 15 (97 is the decimal ASCII value for 'a') - * console.log(buf.lastIndexOf(Buffer.from('yolo'))); - * // Prints: -1 - * console.log(buf.lastIndexOf('buffer', 5)); - * // Prints: 5 - * console.log(buf.lastIndexOf('buffer', 4)); - * // Prints: -1 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); - * // Prints: 6 - * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); - * // Prints: 4 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. Any arguments - * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. - * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.lastIndexOf(99.9)); - * console.log(b.lastIndexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN. - * // Prints: 1, searching the whole buffer. - * console.log(b.lastIndexOf('b', undefined)); - * console.log(b.lastIndexOf('b', {})); - * - * // Passing a byteOffset that coerces to 0. - * // Prints: -1, equivalent to passing 0. - * console.log(b.lastIndexOf('b', null)); - * console.log(b.lastIndexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. - * @since v6.0.0 - * @param value What to search for. - * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @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; - /** - * Equivalent to `buf.indexOf() !== -1`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.includes('this')); - * // Prints: true - * console.log(buf.includes('is')); - * // Prints: true - * console.log(buf.includes(Buffer.from('a buffer'))); - * // Prints: true - * console.log(buf.includes(97)); - * // Prints: true (97 is the decimal ASCII value for 'a') - * console.log(buf.includes(Buffer.from('a buffer example'))); - * // Prints: false - * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: true - * console.log(buf.includes('this', 4)); - * // Prints: false - * ``` - * @since v5.3.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is its encoding. - * @return `true` if `value` was found in `buf`, `false` otherwise. - */ - includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; - } - var Buffer: BufferConstructor; - /** - * Decodes a string of Base64-encoded data into bytes, and encodes those bytes - * into a string using Latin-1 (ISO-8859-1). - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `Buffer.from(data, 'base64')` instead. - * @param data The Base64-encoded input string. - */ - function atob(data: string): string; - /** - * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes - * into a string using Base64. - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.** - * @since v15.13.0, v14.17.0 - * @legacy Use `buf.toString('base64')` instead. - * @param data An ASCII (Latin1) string. - */ - function btoa(data: string): string; - interface Blob extends _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 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" { - export * from "buffer"; -} diff --git a/node_modules/@types/node/child_process.d.ts b/node_modules/@types/node/child_process.d.ts deleted file mode 100644 index 09f181f..0000000 --- a/node_modules/@types/node/child_process.d.ts +++ /dev/null @@ -1,1549 +0,0 @@ -/** - * The `node:child_process` module provides the ability to spawn subprocesses in - * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability - * is primarily provided by the {@link spawn} function: - * - * ```js - * import { spawn } from 'node:child_process'; - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * By default, pipes for `stdin`, `stdout`, and `stderr` are established between - * 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 - * 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 - * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is - * used. If `options.env` is set without `PATH`, lookup on Unix is performed - * on a default search path search of `/usr/bin:/bin` (see your operating system's - * manual for execvpe/execvp), on Windows the current processes environment - * variable `PATH` is used. - * - * On Windows, environment variables are case-insensitive. Node.js - * lexicographically sorts the `env` keys and uses the first one that - * case-insensitively matches. Only first (in lexicographic order) entry will be - * passed to the subprocess. This might lead to issues on Windows when passing - * objects to the `env` option that have multiple variants of the same key, such as `PATH` and `Path`. - * - * The {@link spawn} method spawns the child process asynchronously, - * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks - * the event loop until the spawned process either exits or is terminated. - * - * For convenience, the `node:child_process` module provides a handful of - * synchronous and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on - * top of {@link spawn} or {@link spawnSync}. - * - * * {@link exec}: spawns a shell and runs a command within that - * shell, passing the `stdout` and `stderr` to a callback function when - * complete. - * * {@link execFile}: similar to {@link exec} except - * that it spawns the command directly without first spawning a shell by - * default. - * * {@link fork}: spawns a new Node.js process and invokes a - * specified module with an IPC communication channel established that allows - * sending messages between parent and child. - * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. - * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. - * - * 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/v22.x/lib/child_process.js) - */ -declare module "child_process" { - import { ObjectEncodingOptions } from "node:fs"; - 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 { URL } from "node:url"; - type Serializable = string | object | number | boolean | bigint; - type SendHandle = net.Socket | net.Server | dgram.Socket | undefined; - /** - * Instances of the `ChildProcess` represent spawned child processes. - * - * Instances of `ChildProcess` are not intended to be created directly. Rather, - * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create - * instances of `ChildProcess`. - * @since v2.2.0 - */ - class ChildProcess extends EventEmitter { - /** - * A `Writable Stream` that represents the child process's `stdin`. - * - * If a child process waits to read all of its input, the child will not continue - * until this stream has been closed via `end()`. - * - * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will - * refer to the same value. - * - * The `subprocess.stdin` property can be `null` or `undefined` if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stdin: Writable | null; - /** - * A `Readable Stream` that represents the child process's `stdout`. - * - * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will - * refer to the same value. - * - * ```js - * import { spawn } from 'node:child_process'; - * - * const subprocess = spawn('ls'); - * - * subprocess.stdout.on('data', (data) => { - * console.log(`Received chunk ${data}`); - * }); - * ``` - * - * The `subprocess.stdout` property can be `null` or `undefined` if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stdout: Readable | null; - /** - * A `Readable Stream` that represents the child process's `stderr`. - * - * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will - * refer to the same value. - * - * The `subprocess.stderr` property can be `null` or `undefined` if the child process could not be successfully spawned. - * @since v0.1.90 - */ - stderr: Readable | null; - /** - * The `subprocess.channel` property is a reference to the child's IPC channel. If - * no IPC channel exists, this property is `undefined`. - * @since v7.1.0 - */ - readonly channel?: Pipe | null | undefined; - /** - * A sparse array of pipes to the child process, corresponding with positions in - * the `stdio` option passed to {@link spawn} that have been set - * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and `subprocess.stdio[2]` are also available as `subprocess.stdin`, `subprocess.stdout`, and `subprocess.stderr`, - * respectively. - * - * In the following example, only the child's fd `1` (stdout) is configured as a - * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values - * in the array are `null`. - * - * ```js - * import assert from 'node:assert'; - * import fs from 'node:fs'; - * import child_process from 'node:child_process'; - * - * const subprocess = child_process.spawn('ls', { - * stdio: [ - * 0, // Use parent's stdin for child. - * 'pipe', // Pipe child's stdout to parent. - * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. - * ], - * }); - * - * assert.strictEqual(subprocess.stdio[0], null); - * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); - * - * assert(subprocess.stdout); - * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); - * - * assert.strictEqual(subprocess.stdio[2], null); - * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); - * ``` - * - * The `subprocess.stdio` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.7.10 - */ - readonly stdio: [ - Writable | null, - // stdin - Readable | null, - // stdout - Readable | null, - // stderr - Readable | Writable | null | undefined, - // extra - Readable | Writable | null | undefined, // extra - ]; - /** - * The `subprocess.killed` property indicates whether the child process - * successfully received a signal from `subprocess.kill()`. The `killed` property - * does not indicate that the child process has been terminated. - * @since v0.5.10 - */ - readonly killed: boolean; - /** - * Returns the process identifier (PID) of the child process. If the child process - * fails to spawn due to errors, then the value is `undefined` and `error` is - * emitted. - * - * ```js - * import { spawn } from 'node:child_process'; - * const grep = spawn('grep', ['ssh']); - * - * console.log(`Spawned child pid: ${grep.pid}`); - * grep.stdin.end(); - * ``` - * @since v0.1.90 - */ - readonly pid?: number | undefined; - /** - * The `subprocess.connected` property indicates whether it is still possible to - * send and receive messages from a child process. When `subprocess.connected` is `false`, it is no longer possible to send or receive messages. - * @since v0.7.2 - */ - readonly connected: boolean; - /** - * The `subprocess.exitCode` property indicates the exit code of the child process. - * If the child process is still running, the field will be `null`. - */ - readonly exitCode: number | null; - /** - * The `subprocess.signalCode` property indicates the signal received by - * the child process if any, else `null`. - */ - readonly signalCode: NodeJS.Signals | null; - /** - * The `subprocess.spawnargs` property represents the full list of command-line - * arguments the child process was launched with. - */ - readonly spawnargs: string[]; - /** - * The `subprocess.spawnfile` property indicates the executable file name of - * the child process that is launched. - * - * For {@link fork}, its value will be equal to `process.execPath`. - * For {@link spawn}, its value will be the name of - * the executable file. - * For {@link exec}, its value will be the name of the shell - * in which the child process is launched. - */ - readonly spawnfile: string; - /** - * The `subprocess.kill()` method sends a signal to the child process. If no - * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function - * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. - * - * ```js - * import { spawn } from 'node:child_process'; - * const grep = spawn('grep', ['ssh']); - * - * grep.on('close', (code, signal) => { - * console.log( - * `child process terminated due to receipt of signal ${signal}`); - * }); - * - * // Send SIGHUP to process. - * grep.kill('SIGHUP'); - * ``` - * - * The `ChildProcess` object may emit an `'error'` event if the signal - * cannot be delivered. Sending a signal to a child process that has already exited - * is not an error but may have unforeseen consequences. Specifically, if the - * process identifier (PID) has been reassigned to another process, the signal will - * be delivered to that process instead which can have unexpected results. - * - * While the function is called `kill`, the signal delivered to the child process - * may not actually terminate the process. - * - * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. - * - * On Windows, where POSIX signals do not exist, the `signal` argument will be - * ignored, and the process will be killed forcefully and abruptly (similar to `'SIGKILL'`). - * See `Signal Events` for more details. - * - * On Linux, child processes of child processes will not be terminated - * when attempting to kill their parent. This is likely to happen when running a - * new process in a shell or with the use of the `shell` option of `ChildProcess`: - * - * ```js - * 'use strict'; - * import { spawn } from 'node:child_process'; - * - * const subprocess = spawn( - * 'sh', - * [ - * '-c', - * `node -e "setInterval(() => { - * console.log(process.pid, 'is alive') - * }, 500);"`, - * ], { - * stdio: ['inherit', 'inherit', 'inherit'], - * }, - * ); - * - * setTimeout(() => { - * subprocess.kill(); // Does not terminate the Node.js process in the shell. - * }, 2000); - * ``` - * @since v0.1.90 - */ - kill(signal?: NodeJS.Signals | number): boolean; - /** - * Calls {@link ChildProcess.kill} with `'SIGTERM'`. - * @since v20.5.0 - */ - [Symbol.dispose](): void; - /** - * When an IPC channel has been established between the parent and child ( - * i.e. when using {@link fork}), the `subprocess.send()` method can - * be used to send messages to the child process. When the child process is a - * Node.js instance, these messages can be received via the `'message'` event. - * - * The message goes through serialization and parsing. The resulting - * message might not be the same as what is originally sent. - * - * For example, in the parent script: - * - * ```js - * import cp from 'node:child_process'; - * const n = cp.fork(`${__dirname}/sub.js`); - * - * n.on('message', (m) => { - * console.log('PARENT got message:', m); - * }); - * - * // Causes the child to print: CHILD got message: { hello: 'world' } - * n.send({ hello: 'world' }); - * ``` - * - * And then the child script, `'sub.js'` might look like this: - * - * ```js - * process.on('message', (m) => { - * console.log('CHILD got message:', m); - * }); - * - * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } - * process.send({ foo: 'bar', baz: NaN }); - * ``` - * - * Child Node.js processes will have a `process.send()` method of their own - * that allows the child to send messages back to the parent. - * - * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages - * containing a `NODE_` prefix in the `cmd` property are reserved for use within - * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the `'internalMessage'` event and are consumed internally by Node.js. - * Applications should avoid using such messages or listening for `'internalMessage'` events as it is subject to change without notice. - * - * The optional `sendHandle` argument that may be passed to `subprocess.send()` is - * for passing a TCP server or socket object to the child process. The child will - * receive the object as the second argument passed to the callback function - * registered on the `'message'` event. Any data that is received and buffered in - * the socket will not be sent to the child. Sending IPC sockets is not supported on Windows. - * - * The optional `callback` is a function that is invoked after the message is - * sent but before the child may have received it. The function is called with a - * single argument: `null` on success, or an `Error` object on failure. - * - * If no `callback` function is provided and the message cannot be sent, an `'error'` event will be emitted by the `ChildProcess` object. This can - * happen, for instance, when the child process has already exited. - * - * `subprocess.send()` will return `false` if the channel has closed or when the - * backlog of unsent messages exceeds a threshold that makes it unwise to send - * more. Otherwise, the method returns `true`. The `callback` function can be - * used to implement flow control. - * - * #### Example: sending a server object - * - * The `sendHandle` argument can be used, for instance, to pass the handle of - * a TCP server object to the child process as illustrated in the example below: - * - * ```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 = createServer(); - * server.on('connection', (socket) => { - * socket.end('handled by parent'); - * }); - * server.listen(1337, () => { - * subprocess.send('server', server); - * }); - * ``` - * - * The child would then receive the server object as: - * - * ```js - * process.on('message', (m, server) => { - * if (m === 'server') { - * server.on('connection', (socket) => { - * socket.end('handled by child'); - * }); - * } - * }); - * ``` - * - * Once the server is now shared between the parent and child, some connections - * can be handled by the parent and some by the child. - * - * While the example above uses a server created using the `node:net` module, `node:dgram` module servers use exactly the same workflow with the exceptions of - * listening on a `'message'` event instead of `'connection'` and using `server.bind()` instead of `server.listen()`. This is, however, only - * supported on Unix platforms. - * - * #### Example: sending a socket object - * - * Similarly, the `sendHandler` argument can be used to pass the handle of a - * socket to the child process. The example below spawns two children that each - * handle connections with "normal" or "special" priority: - * - * ```js - * 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 = createServer({ pauseOnConnect: true }); - * server.on('connection', (socket) => { - * - * // If this is special priority... - * if (socket.remoteAddress === '74.125.127.100') { - * special.send('socket', socket); - * return; - * } - * // This is normal priority. - * normal.send('socket', socket); - * }); - * server.listen(1337); - * ``` - * - * The `subprocess.js` would receive the socket handle as the second argument - * passed to the event callback function: - * - * ```js - * process.on('message', (m, socket) => { - * if (m === 'socket') { - * if (socket) { - * // Check that the client socket exists. - * // It is possible for the socket to be closed between the time it is - * // sent and the time it is received in the child process. - * socket.end(`Request handled with ${process.argv[2]} priority`); - * } - * } - * }); - * ``` - * - * Do not use `.maxConnections` on a socket that has been passed to a subprocess. - * The parent cannot track when the socket is destroyed. - * - * Any `'message'` handlers in the subprocess should verify that `socket` exists, - * 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-v22.x/api/net.html#class-netsocket), [`net.Server`](https://nodejs.org/docs/latest-v22.x/api/net.html#class-netserver), or [`dgram.Socket`](https://nodejs.org/docs/latest-v22.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; - send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; - send( - message: Serializable, - sendHandle?: SendHandle, - options?: MessageOptions, - callback?: (error: Error | null) => void, - ): boolean; - /** - * Closes the IPC channel between parent and child, allowing the child to exit - * gracefully once there are no other connections keeping it alive. After calling - * this method the `subprocess.connected` and `process.connected` properties in - * both the parent and child (respectively) will be set to `false`, and it will be - * no longer possible to pass messages between the processes. - * - * The `'disconnect'` event will be emitted when there are no messages in the - * process of being received. This will most often be triggered immediately after - * calling `subprocess.disconnect()`. - * - * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked - * within the child process to close the IPC channel as well. - * @since v0.7.2 - */ - disconnect(): void; - /** - * By default, the parent will wait for the detached child to exit. To prevent the - * parent from waiting for a given `subprocess` to exit, use the `subprocess.unref()` method. Doing so will cause the parent's event loop to not - * include the child in its reference count, allowing the parent to exit - * independently of the child, unless there is an established IPC channel between - * the child and the parent. - * - * ```js - * import { spawn } from 'node:child_process'; - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore', - * }); - * - * subprocess.unref(); - * ``` - * @since v0.7.10 - */ - unref(): void; - /** - * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will - * restore the removed reference count for the child process, forcing the parent - * to wait for the child to exit before exiting itself. - * - * ```js - * import { spawn } from 'node:child_process'; - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore', - * }); - * - * subprocess.unref(); - * subprocess.ref(); - * ``` - * @since v0.7.10 - */ - ref(): void; - /** - * events.EventEmitter - * 1. close - * 2. disconnect - * 3. error - * 4. exit - * 5. message - * 6. spawn - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - addListener(event: "spawn", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean; - emit(event: "spawn", listener: () => void): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - on(event: "spawn", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - once(event: "spawn", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependListener(event: "spawn", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "close", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "exit", - listener: (code: number | null, signal: NodeJS.Signals | null) => void, - ): this; - prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependOnceListener(event: "spawn", listener: () => void): this; - } - // return this object when stdio option is undefined or not specified - interface ChildProcessWithoutNullStreams extends ChildProcess { - stdin: Writable; - stdout: Readable; - stderr: Readable; - readonly stdio: [ - Writable, - Readable, - Readable, - // stderr - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined, // extra, no modification - ]; - } - // return this object when stdio option is a tuple of 3 - interface ChildProcessByStdio - extends ChildProcess - { - stdin: I; - stdout: O; - stderr: E; - readonly stdio: [ - I, - O, - E, - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined, // extra, no modification - ]; - } - interface MessageOptions { - keepOpen?: boolean | undefined; - } - type IOType = "overlapped" | "pipe" | "ignore" | "inherit"; - type StdioOptions = IOType | Array; - type SerializationType = "json" | "advanced"; - interface MessagingOptions extends Abortable { - /** - * Specify the kind of serialization used for sending messages between processes. - * @default 'json' - */ - serialization?: SerializationType | undefined; - /** - * The signal value to be used when the spawned process will be killed by the abort signal. - * @default 'SIGTERM' - */ - killSignal?: NodeJS.Signals | number | undefined; - /** - * In milliseconds the maximum amount of time the process is allowed to run. - */ - timeout?: number | undefined; - } - interface ProcessEnvOptions { - uid?: number | undefined; - gid?: number | undefined; - cwd?: string | URL | undefined; - env?: NodeJS.ProcessEnv | undefined; - } - interface CommonOptions extends ProcessEnvOptions { - /** - * @default false - */ - windowsHide?: boolean | undefined; - /** - * @default 0 - */ - timeout?: number | undefined; - } - interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { - argv0?: string | undefined; - /** - * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - shell?: boolean | string | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - interface SpawnOptions extends CommonSpawnOptions { - detached?: boolean | undefined; - } - interface SpawnOptionsWithoutStdio extends SpawnOptions { - stdio?: StdioPipeNamed | StdioPipe[] | undefined; - } - type StdioNull = "inherit" | "ignore" | Stream; - type StdioPipeNamed = "pipe" | "overlapped"; - type StdioPipe = undefined | null | StdioPipeNamed; - interface SpawnOptionsWithStdioTuple< - Stdin extends StdioNull | StdioPipe, - Stdout extends StdioNull | StdioPipe, - Stderr extends StdioNull | StdioPipe, - > extends SpawnOptions { - stdio: [Stdin, Stdout, Stderr]; - } - /** - * The `child_process.spawn()` method spawns a new process using the given `command`, with command-line arguments in `args`. If omitted, `args` defaults - * to an empty array. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * A third argument may be used to specify additional options, with these defaults: - * - * ```js - * const defaults = { - * cwd: undefined, - * env: process.env, - * }; - * ``` - * - * Use `cwd` to specify the working directory from which the process is spawned. - * If not given, the default is to inherit the current working directory. If given, - * but the path does not exist, the child process emits an `ENOENT` error - * and exits immediately. `ENOENT` is also emitted when the command - * does not exist. - * - * Use `env` to specify environment variables that will be visible to the new - * process, the default is `process.env`. - * - * `undefined` values in `env` will be ignored. - * - * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the - * exit code: - * - * ```js - * import { spawn } from 'node:child_process'; - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * Example: A very elaborate way to run `ps ax | grep ssh` - * - * ```js - * import { spawn } from 'node:child_process'; - * const ps = spawn('ps', ['ax']); - * const grep = spawn('grep', ['ssh']); - * - * ps.stdout.on('data', (data) => { - * grep.stdin.write(data); - * }); - * - * ps.stderr.on('data', (data) => { - * console.error(`ps stderr: ${data}`); - * }); - * - * ps.on('close', (code) => { - * if (code !== 0) { - * console.log(`ps process exited with code ${code}`); - * } - * grep.stdin.end(); - * }); - * - * grep.stdout.on('data', (data) => { - * console.log(data.toString()); - * }); - * - * grep.stderr.on('data', (data) => { - * console.error(`grep stderr: ${data}`); - * }); - * - * grep.on('close', (code) => { - * if (code !== 0) { - * console.log(`grep process exited with code ${code}`); - * } - * }); - * ``` - * - * Example of checking for failed `spawn`: - * - * ```js - * import { spawn } from 'node:child_process'; - * const subprocess = spawn('bad_command'); - * - * subprocess.on('error', (err) => { - * console.error('Failed to start subprocess.'); - * }); - * ``` - * - * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process - * title while others (Windows, SunOS) will use `command`. - * - * Node.js overwrites `argv[0]` with `process.execPath` on startup, so `process.argv[0]` in a Node.js child process will not match the `argv0` parameter passed to `spawn` from the parent. Retrieve - * it with the `process.argv0` property instead. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * import { spawn } from 'node:child_process'; - * const controller = new AbortController(); - * const { signal } = controller; - * const grep = spawn('grep', ['ssh'], { signal }); - * grep.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * ``` - * @since v0.1.90 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptions): ChildProcess; - // overloads of spawn with 'args' - function spawn( - command: string, - args?: readonly string[], - options?: SpawnOptionsWithoutStdio, - ): ChildProcessWithoutNullStreams; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: readonly string[], - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn(command: string, args: readonly string[], options: SpawnOptions): ChildProcess; - interface ExecOptions extends CommonOptions { - shell?: string | undefined; - signal?: AbortSignal | undefined; - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - } - interface ExecOptionsWithStringEncoding extends ExecOptions { - encoding: BufferEncoding; - } - interface ExecOptionsWithBufferEncoding extends ExecOptions { - encoding: BufferEncoding | null; // specify `null`. - } - interface ExecException extends Error { - cmd?: string | undefined; - killed?: boolean | undefined; - code?: number | undefined; - signal?: NodeJS.Signals | undefined; - stdout?: string; - stderr?: string; - } - /** - * Spawns a shell then executes the `command` within that shell, buffering any - * generated output. The `command` string passed to the exec function is processed - * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) - * need to be dealt with accordingly: - * - * ```js - * 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 - * // a delimiter of multiple arguments. - * - * exec('echo "The \\$HOME variable is $HOME"'); - * // The $HOME variable is escaped in the first instance, but not in the second. - * ``` - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * - * If a `callback` function is provided, it is called with the arguments `(error, stdout, stderr)`. On success, `error` will be `null`. On error, `error` will be an instance of `Error`. The - * `error.code` property will be - * the exit code of the process. By convention, any exit code other than `0` indicates an error. `error.signal` will be the signal that terminated the - * process. - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * ```js - * import { exec } from 'node:child_process'; - * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { - * if (error) { - * console.error(`exec error: ${error}`); - * return; - * } - * console.log(`stdout: ${stdout}`); - * console.error(`stderr: ${stderr}`); - * }); - * ``` - * - * If `timeout` is greater than `0`, the parent will send the signal - * identified by the `killSignal` property (the default is `'SIGTERM'`) if the - * child runs longer than `timeout` milliseconds. - * - * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace - * the existing process and uses a shell to execute the command. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * 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'); - * console.log('stdout:', stdout); - * console.error('stderr:', stderr); - * } - * lsExample(); - * ``` - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * import { exec } from 'node:child_process'; - * const controller = new AbortController(); - * const { signal } = controller; - * const child = exec('grep ssh', { signal }, (error) => { - * console.error(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.90 - * @param command The command to run, with space-separated arguments. - * @param callback called with the output when process terminates. - */ - function exec( - command: string, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - // `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, - ): ChildProcess; - // `options` with well known `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, - 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, - ): ChildProcess; - interface PromiseWithChild extends Promise { - child: ChildProcess; - } - namespace exec { - function __promisify__(command: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: { - encoding: "buffer" | null; - } & ExecOptions, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: ExecOptions, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options?: (ObjectEncodingOptions & ExecOptions) | null, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ExecFileOptions extends CommonOptions, Abortable { - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - windowsVerbatimArguments?: boolean | undefined; - shell?: boolean | string | undefined; - signal?: AbortSignal | undefined; - } - interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { - encoding: "buffer" | null; - } - interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - type ExecFileException = - & Omit - & Omit - & { code?: string | number | undefined | 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 - * efficient than {@link exec}. - * - * The same options as {@link exec} are supported. Since a shell is - * not spawned, behaviors such as I/O redirection and file globbing are not - * supported. - * - * ```js - * import { execFile } from 'node:child_process'; - * const child = execFile('node', ['--version'], (error, stdout, stderr) => { - * if (error) { - * throw error; - * } - * console.log(stdout); - * }); - * ``` - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned `ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * 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); - * } - * getVersion(); - * ``` - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * import { execFile } from 'node:child_process'; - * const controller = new AbortController(); - * const { signal } = controller; - * const child = execFile('node', ['--version'], { signal }, (error) => { - * console.error(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.91 - * @param file The name or path of the executable file to run. - * @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, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - 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, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function execFile( - file: string, - options: ExecFileOptionsWithStringEncoding, - 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, - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function execFile( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: - | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) - | undefined - | null, - ): ChildProcess; - function execFile( - file: string, - args: readonly string[] | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: - | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) - | undefined - | null, - ): ChildProcess; - namespace execFile { - function __promisify__(file: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithBufferEncoding, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithStringEncoding, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithStringEncoding, - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithOtherEncoding, - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: readonly string[] | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - ): 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; - }>; - } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { - execPath?: string | undefined; - execArgv?: string[] | undefined; - silent?: boolean | undefined; - /** - * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - detached?: boolean | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - /** - * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. - * Like {@link spawn}, a `ChildProcess` object is returned. The - * returned `ChildProcess` will have an additional communication channel - * built-in that allows messages to be passed back and forth between the parent and - * child. See `subprocess.send()` for details. - * - * Keep in mind that spawned Node.js child processes are - * independent of the parent with exception of the IPC communication channel - * that is established between the two. Each process has its own memory, with - * their own V8 instances. Because of the additional resource allocations - * required, spawning a large number of child Node.js processes is not - * recommended. - * - * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the `options` object allows for an alternative - * execution path to be used. - * - * Node.js processes launched with a custom `execPath` will communicate with the - * parent process using the file descriptor (fd) identified using the - * environment variable `NODE_CHANNEL_FD` on the child process. - * - * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the - * current process. - * - * The `shell` option available in {@link spawn} is not supported by `child_process.fork()` and will be ignored if set. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * if (process.argv[2] === 'child') { - * setTimeout(() => { - * console.log(`Hello from ${process.argv[2]}!`); - * }, 1_000); - * } else { - * import { fork } from 'node:child_process'; - * const controller = new AbortController(); - * const { signal } = controller; - * const child = fork(__filename, ['child'], { signal }); - * child.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * } - * ``` - * @since v0.5.0 - * @param modulePath The module to run in the child. - * @param args List of string arguments. - */ - function fork(modulePath: string | URL, options?: ForkOptions): ChildProcess; - function fork(modulePath: string | URL, args?: readonly string[], options?: ForkOptions): ChildProcess; - interface SpawnSyncOptions extends CommonSpawnOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | "buffer" | null | undefined; - } - interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { - encoding: BufferEncoding; - } - interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { - encoding?: "buffer" | null | undefined; - } - interface SpawnSyncReturns { - pid: number; - output: Array; - stdout: T; - stderr: T; - status: number | null; - signal: NodeJS.Signals | null; - error?: Error | undefined; - } - /** - * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the process intercepts and handles the `SIGTERM` signal - * and doesn't exit, the parent process will wait until the child process has - * exited. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawnSync(command: string): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; - function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns; - function spawnSync( - command: string, - args: readonly string[], - options: SpawnSyncOptionsWithStringEncoding, - ): SpawnSyncReturns; - function spawnSync( - command: string, - args: readonly string[], - options: SpawnSyncOptionsWithBufferEncoding, - ): SpawnSyncReturns; - function spawnSync( - command: string, - args?: readonly string[], - options?: SpawnSyncOptions, - ): SpawnSyncReturns; - interface CommonExecOptions extends CommonOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - /** - * Can be set to 'pipe', 'inherit, or 'ignore', or an array of these strings. - * If passed as an array, the first element is used for `stdin`, the second for - * `stdout`, and the third for `stderr`. A fourth element can be used to - * specify the `stdio` behavior beyond the standard streams. See - * {@link ChildProcess.stdio} for more information. - * - * @default 'pipe' - */ - stdio?: StdioOptions | undefined; - killSignal?: NodeJS.Signals | number | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | "buffer" | null | undefined; - } - interface ExecSyncOptions extends CommonExecOptions { - shell?: string | undefined; - } - interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { - encoding: BufferEncoding; - } - interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { - encoding?: "buffer" | null | undefined; - } - /** - * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the child process intercepts and handles the `SIGTERM` signal and doesn't exit, the parent process will wait until the child process - * has exited. - * - * If the process times out or has a non-zero exit code, this method will throw. - * The `Error` object will contain the entire result from {@link spawnSync}. - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @return The stdout from the command. - */ - function execSync(command: string): Buffer; - function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string; - function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer; - function execSync(command: string, options?: ExecSyncOptions): string | Buffer; - interface ExecFileSyncOptions extends CommonExecOptions { - shell?: boolean | string | undefined; - } - interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; - } - interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { - encoding?: "buffer" | null; // specify `null`. - } - /** - * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not - * return until the child process has fully closed. When a timeout has been - * encountered and `killSignal` is sent, the method won't return until the process - * has completely exited. - * - * If the child process intercepts and handles the `SIGTERM` signal and - * does not exit, the parent process will still wait until the child process has - * exited. - * - * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @return The stdout from the command. - */ - function execFileSync(file: string): Buffer; - 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, - args: readonly string[], - options: ExecFileSyncOptionsWithStringEncoding, - ): string; - function execFileSync( - file: string, - args: readonly string[], - options: ExecFileSyncOptionsWithBufferEncoding, - ): Buffer; - function execFileSync(file: string, args?: readonly string[], options?: ExecFileSyncOptions): string | Buffer; -} -declare module "node:child_process" { - export * from "child_process"; -} diff --git a/node_modules/@types/node/cluster.d.ts b/node_modules/@types/node/cluster.d.ts deleted file mode 100644 index 86b48d9..0000000 --- a/node_modules/@types/node/cluster.d.ts +++ /dev/null @@ -1,579 +0,0 @@ -/** - * 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-v22.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 - * server ports. - * - * ```js - * import cluster from 'node:cluster'; - * import http from 'node:http'; - * import { availableParallelism } from 'node:os'; - * import process from 'node:process'; - * - * const numCPUs = availableParallelism(); - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('exit', (worker, code, signal) => { - * console.log(`worker ${worker.process.pid} died`); - * }); - * } else { - * // Workers can share any TCP connection - * // In this case it is an HTTP server - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * - * console.log(`Worker ${process.pid} started`); - * } - * ``` - * - * Running Node.js will now share port 8000 between the workers: - * - * ```console - * $ node server.js - * Primary 3596 is running - * Worker 4324 started - * Worker 4520 started - * Worker 6056 started - * Worker 5644 started - * ``` - * - * 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/v22.x/lib/cluster.js) - */ -declare module "cluster" { - import * as child from "node:child_process"; - import EventEmitter = require("node:events"); - import * as net from "node:net"; - type SerializationType = "json" | "advanced"; - export interface ClusterSettings { - /** - * List of string arguments passed to the Node.js executable. - * @default process.execArgv - */ - execArgv?: string[] | undefined; - /** - * File path to worker file. - * @default process.argv[1] - */ - exec?: string | undefined; - /** - * String arguments passed to worker. - * @default process.argv.slice(2) - */ - args?: string[] | undefined; - /** - * Whether or not to send output to parent's stdio. - * @default false - */ - 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-v22.x/api/child_process.html#child_processspawncommand-args-options)'s - * [`stdio`](https://nodejs.org/docs/latest-v22.x/api/child_process.html#optionsstdio). - */ - stdio?: any[] | undefined; - /** - * Sets the user identity of the process. (See [`setuid(2)`](https://man7.org/linux/man-pages/man2/setuid.2.html).) - */ - uid?: number | undefined; - /** - * Sets the group identity of the process. (See [`setgid(2)`](https://man7.org/linux/man-pages/man2/setgid.2.html).) - */ - gid?: number | undefined; - /** - * Sets inspector port of worker. This can be a number, or a function that takes no arguments and returns a number. - * By default each worker gets its own port, incremented from the primary's `process.debugPort`. - */ - 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-v22.x/api/child_process.html#advanced-serialization) for more details. - * @default false - */ - serialization?: SerializationType | undefined; - /** - * Current working directory of the worker process. - * @default undefined (inherits from parent process) - */ - cwd?: string | undefined; - /** - * Hide the forked processes console window that would normally be created on Windows systems. - * @default false - */ - windowsHide?: boolean | undefined; - } - export interface Address { - address: string; - port: number; - /** - * The `addressType` is one of: - * - * * `4` (TCPv4) - * * `6` (TCPv6) - * * `-1` (Unix domain socket) - * * `'udp4'` or `'udp6'` (UDPv4 or UDPv6) - */ - addressType: 4 | 6 | -1 | "udp4" | "udp6"; - } - /** - * A `Worker` object contains all public information and method about a worker. - * In the primary it can be obtained using `cluster.workers`. In a worker - * it can be obtained using `cluster.worker`. - * @since v0.7.0 - */ - export class Worker extends EventEmitter { - /** - * Each new worker is given its own unique id, this id is stored in the `id`. - * - * While a worker is alive, this is the key that indexes it in `cluster.workers`. - * @since v0.8.0 - */ - id: number; - /** - * All workers are created using [`child_process.fork()`](https://nodejs.org/docs/latest-v22.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-v22.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 - * accidental disconnection. - * @since v0.7.0 - */ - process: child.ChildProcess; - /** - * 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-v22.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()`. - * - * This example will echo back all messages from the primary: - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * worker.send('hi there'); - * - * } else if (cluster.isWorker) { - * process.on('message', (msg) => { - * process.send(msg); - * }); - * } - * ``` - * @since v0.7.0 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. - */ - send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; - send( - message: child.Serializable, - sendHandle: child.SendHandle, - callback?: (error: Error | null) => void, - ): boolean; - send( - message: child.Serializable, - sendHandle: child.SendHandle, - options?: child.MessageOptions, - callback?: (error: Error | null) => void, - ): boolean; - /** - * This function will kill the worker. In the primary worker, it does this by - * disconnecting the `worker.process`, and once disconnected, killing with `signal`. In the worker, it does it by killing the process with `signal`. - * - * The `kill()` function kills the worker process without waiting for a graceful - * disconnect, it has the same behavior as `worker.process.kill()`. - * - * 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-v22.x/api/process.html#processkillpid-signal). - * @since v0.9.12 - * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. - */ - kill(signal?: string): void; - destroy(signal?: string): void; - /** - * In a worker, this function will close all servers, wait for the `'close'` event - * on those servers, and then disconnect the IPC channel. - * - * In the primary, an internal message is sent to the worker causing it to call `.disconnect()` on itself. - * - * Causes `.exitedAfterDisconnect` to be set. - * - * After a server is closed, it will no longer accept new connections, - * but connections may be accepted by any other listening worker. Existing - * connections will be allowed to close as usual. When no more connections exist, - * see `server.close()`, the IPC channel to the worker will close allowing it - * to die gracefully. - * - * The above applies _only_ to server connections, client connections are not - * automatically closed by workers, and disconnect does not wait for them to close - * before exiting. - * - * In a worker, `process.disconnect` exists, but it is not this function; - * it is `disconnect()`. - * - * Because long living server connections may block workers from disconnecting, it - * may be useful to send a message, so application specific actions may be taken to - * close them. It also may be useful to implement a timeout, killing a worker if - * 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; - * - * worker.on('listening', (address) => { - * worker.send('shutdown'); - * worker.disconnect(); - * timeout = setTimeout(() => { - * worker.kill(); - * }, 2000); - * }); - * - * worker.on('disconnect', () => { - * clearTimeout(timeout); - * }); - * - * } else if (cluster.isWorker) { - * const server = net.createServer((socket) => { - * // Connections never end - * }); - * - * server.listen(8000); - * - * process.on('message', (msg) => { - * if (msg === 'shutdown') { - * // Initiate graceful close of any connections to server - * } - * }); - * } - * ``` - * @since v0.7.7 - * @return A reference to `worker`. - */ - disconnect(): void; - /** - * 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 - * has been created. It is disconnected after the `'disconnect'` event is emitted. - * @since v0.11.14 - */ - isConnected(): boolean; - /** - * This function returns `true` if the worker's process has terminated (either - * because of exiting or being signaled). Otherwise, it returns `false`. - * - * ```js - * import cluster from 'node:cluster'; - * import http from 'node:http'; - * import { availableParallelism } from 'node:os'; - * import process from 'node:process'; - * - * const numCPUs = availableParallelism(); - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('fork', (worker) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * - * cluster.on('exit', (worker, code, signal) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * } else { - * // Workers can share any TCP connection. In this case, it is an HTTP server. - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end(`Current process\n ${process.pid}`); - * process.kill(process.pid); - * }).listen(8000); - * } - * ``` - * @since v0.11.14 - */ - isDead(): boolean; - /** - * This property is `true` if the worker exited due to `.disconnect()`. - * If the worker exited any other way, it is `false`. If the - * worker has not exited, it is `undefined`. - * - * The boolean `worker.exitedAfterDisconnect` allows distinguishing between - * voluntary and accidental exit, the primary may choose not to respawn a worker - * based on this value. - * - * ```js - * cluster.on('exit', (worker, code, signal) => { - * if (worker.exitedAfterDisconnect === true) { - * console.log('Oh, it was just voluntary – no need to worry'); - * } - * }); - * - * // kill worker - * worker.kill(); - * ``` - * @since v6.0.0 - */ - exitedAfterDisconnect: boolean; - /** - * events.EventEmitter - * 1. disconnect - * 2. error - * 3. exit - * 4. listening - * 5. message - * 6. online - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "exit", listener: (code: number, signal: string) => void): this; - addListener(event: "listening", listener: (address: Address) => void): this; - addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "exit", code: number, signal: string): boolean; - emit(event: "listening", address: Address): boolean; - emit(event: "message", message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "exit", listener: (code: number, signal: string) => void): this; - on(event: "listening", listener: (address: Address) => void): this; - on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "exit", listener: (code: number, signal: string) => void): this; - once(event: "listening", listener: (address: Address) => void): this; - once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependListener(event: "listening", listener: (address: Address) => void): this; - prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: "online", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependOnceListener(event: "listening", listener: (address: Address) => void): this; - prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: "online", listener: () => void): this; - } - export interface Cluster extends EventEmitter { - disconnect(callback?: () => void): void; - /** - * Spawn a new worker process. - * - * This can only be called from the primary process. - * @param env Key/value pairs to add to worker process environment. - * @since v0.6.0 - */ - fork(env?: any): Worker; - /** @deprecated since v16.0.0 - use isPrimary. */ - readonly isMaster: boolean; - /** - * True if the process is a primary. This is determined by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID` - * is undefined, then `isPrimary` is `true`. - * @since v16.0.0 - */ - readonly isPrimary: boolean; - /** - * True if the process is not a primary (it is the negation of `cluster.isPrimary`). - * @since v0.6.0 - */ - 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-v22.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 - * IOCP handles without incurring a large performance hit. - * - * `cluster.schedulingPolicy` can also be set through the `NODE_CLUSTER_SCHED_POLICY` environment variable. Valid values are `'rr'` and `'none'`. - * @since v0.11.2 - */ - schedulingPolicy: number; - /** - * After calling [`.setupPrimary()`](https://nodejs.org/docs/latest-v22.x/api/cluster.html#clustersetupprimarysettings) - * (or [`.fork()`](https://nodejs.org/docs/latest-v22.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-v22.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-v22.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-v22.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. - * - * ```js - * import cluster from 'node:cluster'; - * - * cluster.setupPrimary({ - * exec: 'worker.js', - * args: ['--use', 'https'], - * silent: true, - * }); - * cluster.fork(); // https worker - * cluster.setupPrimary({ - * exec: 'worker.js', - * args: ['--use', 'http'], - * }); - * cluster.fork(); // http worker - * ``` - * - * This can only be called from the primary process. - * @since v16.0.0 - */ - setupPrimary(settings?: ClusterSettings): void; - /** - * A reference to the current worker object. Not available in the primary process. - * - * ```js - * import cluster from 'node:cluster'; - * - * if (cluster.isPrimary) { - * console.log('I am primary'); - * cluster.fork(); - * cluster.fork(); - * } else if (cluster.isWorker) { - * console.log(`I am worker #${cluster.worker.id}`); - * } - * ``` - * @since v0.7.0 - */ - readonly worker?: Worker | undefined; - /** - * 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. - * - * A worker is removed from `cluster.workers` after the worker has disconnected _and_ exited. The order between these two events cannot be determined in advance. However, it - * is guaranteed that the removal from the `cluster.workers` list happens before the last `'disconnect'` or `'exit'` event is emitted. - * - * ```js - * import cluster from 'node:cluster'; - * - * for (const worker of Object.values(cluster.workers)) { - * worker.send('big announcement to all workers'); - * } - * ``` - * @since v0.7.0 - */ - readonly workers?: NodeJS.Dict | undefined; - readonly SCHED_NONE: number; - readonly SCHED_RR: number; - /** - * events.EventEmitter - * 1. disconnect - * 2. exit - * 3. fork - * 4. listening - * 5. message - * 6. online - * 7. setup - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: (worker: Worker) => void): this; - addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - addListener(event: "fork", listener: (worker: Worker) => void): this; - addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - addListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: (worker: Worker) => void): this; - addListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect", worker: Worker): boolean; - emit(event: "exit", worker: Worker, code: number, signal: string): boolean; - emit(event: "fork", worker: Worker): boolean; - emit(event: "listening", worker: Worker, address: Address): boolean; - emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online", worker: Worker): boolean; - emit(event: "setup", settings: ClusterSettings): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: (worker: Worker) => void): this; - on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - on(event: "fork", listener: (worker: Worker) => void): this; - on(event: "listening", listener: (worker: Worker, address: Address) => void): this; - on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: (worker: Worker) => void): this; - on(event: "setup", listener: (settings: ClusterSettings) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: (worker: Worker) => void): this; - once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - once(event: "fork", listener: (worker: Worker) => void): this; - once(event: "listening", listener: (worker: Worker, address: Address) => void): this; - once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: (worker: Worker) => void): this; - once(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: (worker: Worker) => void): this; - 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, - ): this; - prependListener(event: "online", listener: (worker: Worker) => void): this; - prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; - prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener( - event: "message", - listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void, - ): this; - prependOnceListener(event: "online", listener: (worker: Worker) => void): this; - prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - } - const cluster: Cluster; - export default cluster; -} -declare module "node:cluster" { - export * from "cluster"; - export { default as default } from "cluster"; -} diff --git a/node_modules/@types/node/compatibility/disposable.d.ts b/node_modules/@types/node/compatibility/disposable.d.ts deleted file mode 100644 index 5fff612..0000000 --- a/node_modules/@types/node/compatibility/disposable.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Polyfills for the explicit resource management types added in TypeScript 5.2. -// TODO: remove once this package no longer supports TS 5.1, and replace with a -// to TypeScript's disposable library in index.d.ts. - -interface SymbolConstructor { - readonly dispose: unique symbol; - readonly asyncDispose: unique symbol; -} - -interface Disposable { - [Symbol.dispose](): void; -} - -interface AsyncDisposable { - [Symbol.asyncDispose](): PromiseLike; -} diff --git a/node_modules/@types/node/compatibility/index.d.ts b/node_modules/@types/node/compatibility/index.d.ts deleted file mode 100644 index 5c41e37..0000000 --- a/node_modules/@types/node/compatibility/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Declaration files in this directory contain types relating to TypeScript library features -// that are not included in all TypeScript versions supported by DefinitelyTyped, but -// which can be made backwards-compatible without needing `typesVersions`. -// If adding declarations to this directory, please specify which versions of TypeScript require them, -// so that they can be removed when no longer needed. - -/// -/// -/// diff --git a/node_modules/@types/node/compatibility/indexable.d.ts b/node_modules/@types/node/compatibility/indexable.d.ts deleted file mode 100644 index 9919702..0000000 --- a/node_modules/@types/node/compatibility/indexable.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Polyfill for ES2022's .at() method on string/array prototypes, added to TypeScript in 4.6. -// TODO: these methods are not used within @types/node, and should be removed at the next -// major @types/node version; users should include the es2022 TypeScript libraries -// if they need these features. - -interface RelativeIndexable { - at(index: number): T | undefined; -} - -interface String extends RelativeIndexable {} -interface Array extends RelativeIndexable {} -interface ReadonlyArray extends RelativeIndexable {} -interface Int8Array extends RelativeIndexable {} -interface Uint8Array extends RelativeIndexable {} -interface Uint8ClampedArray extends RelativeIndexable {} -interface Int16Array extends RelativeIndexable {} -interface Uint16Array extends RelativeIndexable {} -interface Int32Array extends RelativeIndexable {} -interface Uint32Array extends RelativeIndexable {} -interface Float32Array extends RelativeIndexable {} -interface Float64Array extends RelativeIndexable {} -interface BigInt64Array extends RelativeIndexable {} -interface BigUint64Array extends RelativeIndexable {} diff --git a/node_modules/@types/node/compatibility/iterators.d.ts b/node_modules/@types/node/compatibility/iterators.d.ts deleted file mode 100644 index 156e785..0000000 --- a/node_modules/@types/node/compatibility/iterators.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Backwards-compatible iterator interfaces, augmented with iterator helper methods by lib.esnext.iterator in TypeScript 5.6. -// The IterableIterator interface does not contain these methods, which creates assignability issues in places where IteratorObjects -// are expected (eg. DOM-compatible APIs) if lib.esnext.iterator is loaded. -// Also ensures that iterators returned by the Node API, which inherit from Iterator.prototype, correctly expose the iterator helper methods -// if lib.esnext.iterator is loaded. -// TODO: remove once this package no longer supports TS 5.5, and replace NodeJS.BuiltinIteratorReturn with BuiltinIteratorReturn. - -// Placeholders for TS <5.6 -interface IteratorObject {} -interface AsyncIteratorObject {} - -declare namespace NodeJS { - // Populate iterator methods for TS <5.6 - interface Iterator extends globalThis.Iterator {} - interface AsyncIterator extends globalThis.AsyncIterator {} - - // Polyfill for TS 5.6's instrinsic BuiltinIteratorReturn type, required for DOM-compatible iterators - type BuiltinIteratorReturn = ReturnType extends - globalThis.Iterator ? TReturn - : any; -} diff --git a/node_modules/@types/node/console.d.ts b/node_modules/@types/node/console.d.ts deleted file mode 100644 index 3e4c2d9..0000000 --- a/node_modules/@types/node/console.d.ts +++ /dev/null @@ -1,452 +0,0 @@ -/** - * The `node:console` module provides a simple debugging console that is similar to - * the JavaScript console mechanism provided by web browsers. - * - * 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-v22.x/api/process.html#processstdout) and - * [`process.stderr`](https://nodejs.org/docs/latest-v22.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-v22.x/api/process.html#a-note-on-process-io) for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/console.js) - */ -declare module "console" { - import console = require("node:console"); - export = console; -} -declare module "node:console" { - import { InspectOptions } from "node:util"; - global { - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build - interface Console { - Console: console.ConsoleConstructor; - /** - * `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-v22.x/api/util.html#utilformatformat-args). - * - * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. - * - * ```js - * console.assert(true, 'does nothing'); - * - * console.assert(false, 'Whoops %s work', 'didn\'t'); - * // Assertion failed: Whoops didn't work - * - * console.assert(); - * // Assertion failed - * ``` - * @since v0.1.101 - * @param value The value tested for being truthy. - * @param message All arguments besides `value` are used as error message. - */ - assert(value: any, message?: string, ...optionalParams: any[]): void; - /** - * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the - * TTY. When `stdout` is not a TTY, this method does nothing. - * - * The specific operation of `console.clear()` can vary across operating systems - * and terminal types. For most Linux operating systems, `console.clear()` operates similarly to the `clear` shell command. On Windows, `console.clear()` will clear only the output in the - * current terminal viewport for the Node.js - * binary. - * @since v8.3.0 - */ - clear(): void; - /** - * Maintains an internal counter specific to `label` and outputs to `stdout` the - * number of times `console.count()` has been called with the given `label`. - * - * ```js - * > console.count() - * default: 1 - * undefined - * > console.count('default') - * default: 2 - * undefined - * > console.count('abc') - * abc: 1 - * undefined - * > console.count('xyz') - * xyz: 1 - * undefined - * > console.count('abc') - * abc: 2 - * undefined - * > console.count() - * default: 3 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. - */ - count(label?: string): void; - /** - * Resets the internal counter specific to `label`. - * - * ```js - * > console.count('abc'); - * abc: 1 - * undefined - * > console.countReset('abc'); - * undefined - * > console.count('abc'); - * abc: 1 - * undefined - * > - * ``` - * @since v8.3.0 - * @param [label='default'] The display label for the counter. - */ - countReset(label?: string): void; - /** - * The `console.debug()` function is an alias for {@link log}. - * @since v8.0.0 - */ - debug(message?: any, ...optionalParams: any[]): void; - /** - * Uses [`util.inspect()`](https://nodejs.org/docs/latest-v22.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 - */ - dir(obj: any, options?: InspectOptions): void; - /** - * This method calls `console.log()` passing it the arguments received. - * This method does not produce any XML formatting. - * @since v8.0.0 - */ - dirxml(...data: any[]): void; - /** - * 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-v22.x/api/util.html#utilformatformat-args)). - * - * ```js - * const code = 5; - * console.error('error #%d', code); - * // Prints: error #5, to stderr - * console.error('error', code); - * // Prints: error 5, to stderr - * ``` - * - * If formatting elements (e.g. `%d`) are not found in the first string then - * [`util.inspect()`](https://nodejs.org/docs/latest-v22.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-v22.x/api/util.html#utilformatformat-args) - * for more information. - * @since v0.1.100 - */ - error(message?: any, ...optionalParams: any[]): void; - /** - * Increases indentation of subsequent lines by spaces for `groupIndentation` length. - * - * If one or more `label`s are provided, those are printed first without the - * additional indentation. - * @since v8.5.0 - */ - group(...label: any[]): void; - /** - * An alias for {@link group}. - * @since v8.5.0 - */ - groupCollapsed(...label: any[]): void; - /** - * Decreases indentation of subsequent lines by spaces for `groupIndentation` length. - * @since v8.5.0 - */ - groupEnd(): void; - /** - * The `console.info()` function is an alias for {@link log}. - * @since v0.1.100 - */ - info(message?: any, ...optionalParams: any[]): void; - /** - * 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-v22.x/api/util.html#utilformatformat-args)). - * - * ```js - * const count = 5; - * console.log('count: %d', count); - * // Prints: count: 5, to stdout - * console.log('count:', count); - * // Prints: count: 5, to stdout - * ``` - * - * See [`util.format()`](https://nodejs.org/docs/latest-v22.x/api/util.html#utilformatformat-args) for more information. - * @since v0.1.100 - */ - log(message?: any, ...optionalParams: any[]): void; - /** - * Try to construct a table with the columns of the properties of `tabularData` (or use `properties`) and rows of `tabularData` and log it. Falls back to just - * logging the argument if it can't be parsed as tabular. - * - * ```js - * // These can't be parsed as tabular data - * console.table(Symbol()); - * // Symbol() - * - * console.table(undefined); - * // undefined - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); - * // ┌─────────┬─────┬─────┐ - * // │ (index) │ a │ b │ - * // ├─────────┼─────┼─────┤ - * // │ 0 │ 1 │ 'Y' │ - * // │ 1 │ 'Z' │ 2 │ - * // └─────────┴─────┴─────┘ - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); - * // ┌─────────┬─────┐ - * // │ (index) │ a │ - * // ├─────────┼─────┤ - * // │ 0 │ 1 │ - * // │ 1 │ 'Z' │ - * // └─────────┴─────┘ - * ``` - * @since v10.0.0 - * @param properties Alternate properties for constructing the table. - */ - table(tabularData: any, properties?: readonly string[]): void; - /** - * Starts a timer that can be used to compute the duration of an operation. Timers - * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in - * suitable time units to `stdout`. For example, if the elapsed - * time is 3869ms, `console.timeEnd()` displays "3.869s". - * @since v0.1.104 - * @param [label='default'] - */ - time(label?: string): void; - /** - * Stops a timer that was previously started by calling {@link time} and - * prints the result to `stdout`: - * - * ```js - * console.time('bunch-of-stuff'); - * // Do a bunch of stuff. - * console.timeEnd('bunch-of-stuff'); - * // Prints: bunch-of-stuff: 225.438ms - * ``` - * @since v0.1.104 - * @param [label='default'] - */ - timeEnd(label?: string): void; - /** - * For a timer that was previously started by calling {@link time}, prints - * the elapsed time and other `data` arguments to `stdout`: - * - * ```js - * console.time('process'); - * const value = expensiveProcess1(); // Returns 42 - * console.timeLog('process', value); - * // Prints "process: 365.227ms 42". - * doExpensiveProcess2(value); - * console.timeEnd('process'); - * ``` - * @since v10.7.0 - * @param [label='default'] - */ - timeLog(label?: string, ...data: any[]): void; - /** - * Prints to `stderr` the string `'Trace: '`, followed by the [`util.format()`](https://nodejs.org/docs/latest-v22.x/api/util.html#utilformatformat-args) - * formatted message and stack trace to the current position in the code. - * - * ```js - * console.trace('Show me'); - * // Prints: (stack trace will vary based on where trace is called) - * // Trace: Show me - * // at repl:2:9 - * // at REPLServer.defaultEval (repl.js:248:27) - * // at bound (domain.js:287:14) - * // at REPLServer.runBound [as eval] (domain.js:300:12) - * // at REPLServer. (repl.js:412:12) - * // at emitOne (events.js:82:20) - * // at REPLServer.emit (events.js:169:7) - * // at REPLServer.Interface._onLine (readline.js:210:10) - * // at REPLServer.Interface._line (readline.js:549:8) - * // at REPLServer.Interface._ttyWrite (readline.js:826:14) - * ``` - * @since v0.1.104 - */ - trace(message?: any, ...optionalParams: any[]): void; - /** - * The `console.warn()` function is an alias for {@link error}. - * @since v0.1.100 - */ - warn(message?: any, ...optionalParams: any[]): void; - // --- Inspector mode only --- - /** - * This method does not display anything unless used in the inspector. The `console.profile()` - * method starts a JavaScript CPU profile with an optional label until {@link profileEnd} - * is called. The profile is then added to the Profile panel of the inspector. - * - * ```js - * console.profile('MyLabel'); - * // Some code - * console.profileEnd('MyLabel'); - * // Adds the profile 'MyLabel' to the Profiles panel of the inspector. - * ``` - * @since v8.0.0 - */ - profile(label?: string): void; - /** - * This method does not display anything unless used in the inspector. Stops the current - * JavaScript CPU profiling session if one has been started and prints the report to the - * Profiles panel of the inspector. See {@link profile} for an example. - * - * If this method is called without a label, the most recently started profile is stopped. - * @since v8.0.0 - */ - profileEnd(label?: string): void; - /** - * This method does not display anything unless used in the inspector. The `console.timeStamp()` - * method adds an event with the label `'label'` to the Timeline panel of the inspector. - * @since v8.0.0 - */ - timeStamp(label?: string): void; - } - /** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * 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-v22.x/api/process.html#processstdout) and - * [`process.stderr`](https://nodejs.org/docs/latest-v22.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-v22.x/api/process.html#a-note-on-process-io) for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/console.js) - */ - namespace console { - interface ConsoleConstructorOptions { - stdout: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream | undefined; - /** - * Ignore errors when writing to the underlying streams. - * @default true - */ - ignoreErrors?: boolean | undefined; - /** - * Set color support for this `Console` instance. Setting to true enables coloring while inspecting - * values. Setting to `false` disables coloring while inspecting values. Setting to `'auto'` makes color - * support depend on the value of the `isTTY` property and the value returned by `getColorDepth()` on the - * respective stream. This option can not be used, if `inspectOptions.colors` is set as well. - * @default auto - */ - colorMode?: boolean | "auto" | undefined; - /** - * Specifies options that are passed along to - * [`util.inspect()`](https://nodejs.org/docs/latest-v22.x/api/util.html#utilinspectobject-options). - */ - inspectOptions?: InspectOptions | undefined; - /** - * Set group indentation. - * @default 2 - */ - groupIndentation?: number | undefined; - } - interface ConsoleConstructor { - prototype: Console; - new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; - new(options: ConsoleConstructorOptions): Console; - } - } - var console: Console; - } - export = globalThis.console; -} diff --git a/node_modules/@types/node/constants.d.ts b/node_modules/@types/node/constants.d.ts deleted file mode 100644 index c3ac2b8..0000000 --- a/node_modules/@types/node/constants.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ -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; -} - -declare module "node:constants" { - import constants = require("constants"); - export = constants; -} diff --git a/node_modules/@types/node/crypto.d.ts b/node_modules/@types/node/crypto.d.ts deleted file mode 100644 index 9b6bcf8..0000000 --- a/node_modules/@types/node/crypto.d.ts +++ /dev/null @@ -1,4451 +0,0 @@ -/** - * The `node:crypto` module provides cryptographic functionality that includes a - * set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify - * functions. - * - * ```js - * const { createHmac } = await import('node:crypto'); - * - * const secret = 'abcdefg'; - * const hash = createHmac('sha256', secret) - * .update('I love cupcakes') - * .digest('hex'); - * console.log(hash); - * // Prints: - * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/crypto.js) - */ -declare module "crypto" { - import * as stream from "node:stream"; - import { PeerCertificate } from "node:tls"; - /** - * SPKAC is a Certificate Signing Request mechanism originally implemented by - * Netscape and was specified formally as part of HTML5's `keygen` element. - * - * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects - * should not use this element anymore. - * - * The `node:crypto` module provides the `Certificate` class for working with SPKAC - * data. The most common usage is handling output generated by the HTML5 `` element. Node.js uses [OpenSSL's SPKAC - * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally. - * @since v0.11.8 - */ - class Certificate { - /** - * ```js - * const { Certificate } = await import('node:crypto'); - * const spkac = getSpkacSomehow(); - * const challenge = Certificate.exportChallenge(spkac); - * console.log(challenge.toString('utf8')); - * // Prints: the challenge as a UTF8 string - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportChallenge(spkac: BinaryLike): Buffer; - /** - * ```js - * const { Certificate } = await import('node:crypto'); - * const spkac = getSpkacSomehow(); - * const publicKey = Certificate.exportPublicKey(spkac); - * console.log(publicKey); - * // Prints: the public key as - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return The public key component of the `spkac` data structure, which includes a public key and a challenge. - */ - static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * ```js - * import { Buffer } from 'node:buffer'; - * const { Certificate } = await import('node:crypto'); - * - * const spkac = getSpkacSomehow(); - * console.log(Certificate.verifySpkac(Buffer.from(spkac))); - * // Prints: true or false - * ``` - * @since v9.0.0 - * @param encoding The `encoding` of the `spkac` string. - * @return `true` if the given `spkac` data structure is valid, `false` otherwise. - */ - static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - /** - * @deprecated - * @param spkac - * @returns The challenge component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportChallenge(spkac: BinaryLike): Buffer; - /** - * @deprecated - * @param spkac - * @param encoding The encoding of the spkac string. - * @returns The public key component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * @deprecated - * @param spkac - * @returns `true` if the given `spkac` data structure is valid, - * `false` otherwise. - */ - verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - } - namespace constants { - // https://nodejs.org/dist/latest-v22.x/docs/api/crypto.html#crypto-constants - const OPENSSL_VERSION_NUMBER: number; - /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ - const SSL_OP_ALL: number; - /** Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode for TLS v1.3 */ - const SSL_OP_ALLOW_NO_DHE_KEX: number; - /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; - /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_CIPHER_SERVER_PREFERENCE: number; - /** Instructs OpenSSL to use Cisco's version identifier of DTLS_BAD_VER. */ - const SSL_OP_CISCO_ANYCONNECT: number; - /** Instructs OpenSSL to turn on cookie exchange. */ - const SSL_OP_COOKIE_EXCHANGE: number; - /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ - const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; - /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ - const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; - /** Allows initial connection to servers that do not support RI. */ - const SSL_OP_LEGACY_SERVER_CONNECT: number; - /** Instructs OpenSSL to disable support for SSL/TLS compression. */ - const SSL_OP_NO_COMPRESSION: number; - /** Instructs OpenSSL to disable encrypt-then-MAC. */ - const SSL_OP_NO_ENCRYPT_THEN_MAC: number; - const SSL_OP_NO_QUERY_MTU: number; - /** Instructs OpenSSL to disable renegotiation. */ - const SSL_OP_NO_RENEGOTIATION: number; - /** Instructs OpenSSL to always start a new session when performing renegotiation. */ - const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; - /** Instructs OpenSSL to turn off SSL v2 */ - const SSL_OP_NO_SSLv2: number; - /** Instructs OpenSSL to turn off SSL v3 */ - const SSL_OP_NO_SSLv3: number; - /** Instructs OpenSSL to disable use of RFC4507bis tickets. */ - const SSL_OP_NO_TICKET: number; - /** Instructs OpenSSL to turn off TLS v1 */ - const SSL_OP_NO_TLSv1: number; - /** Instructs OpenSSL to turn off TLS v1.1 */ - const SSL_OP_NO_TLSv1_1: number; - /** Instructs OpenSSL to turn off TLS v1.2 */ - const SSL_OP_NO_TLSv1_2: number; - /** Instructs OpenSSL to turn off TLS v1.3 */ - const SSL_OP_NO_TLSv1_3: number; - /** Instructs OpenSSL server to prioritize ChaCha20-Poly1305 when the client does. This option has no effect if `SSL_OP_CIPHER_SERVER_PREFERENCE` is not enabled. */ - const SSL_OP_PRIORITIZE_CHACHA: number; - /** Instructs OpenSSL to disable version rollback attack detection. */ - const SSL_OP_TLS_ROLLBACK_BUG: number; - const ENGINE_METHOD_RSA: number; - const ENGINE_METHOD_DSA: number; - const ENGINE_METHOD_DH: number; - const ENGINE_METHOD_RAND: number; - const ENGINE_METHOD_EC: number; - const ENGINE_METHOD_CIPHERS: number; - const ENGINE_METHOD_DIGESTS: number; - const ENGINE_METHOD_PKEY_METHS: number; - const ENGINE_METHOD_PKEY_ASN1_METHS: number; - const ENGINE_METHOD_ALL: number; - const ENGINE_METHOD_NONE: number; - const DH_CHECK_P_NOT_SAFE_PRIME: number; - const DH_CHECK_P_NOT_PRIME: number; - const DH_UNABLE_TO_CHECK_GENERATOR: number; - const DH_NOT_SUITABLE_GENERATOR: number; - const RSA_PKCS1_PADDING: number; - const RSA_SSLV23_PADDING: number; - const RSA_NO_PADDING: number; - const RSA_PKCS1_OAEP_PADDING: number; - const RSA_X931_PADDING: number; - const RSA_PKCS1_PSS_PADDING: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ - const RSA_PSS_SALTLEN_DIGEST: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ - const RSA_PSS_SALTLEN_MAX_SIGN: number; - /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ - const RSA_PSS_SALTLEN_AUTO: number; - const POINT_CONVERSION_COMPRESSED: number; - const POINT_CONVERSION_UNCOMPRESSED: number; - const POINT_CONVERSION_HYBRID: number; - /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ - const defaultCoreCipherList: string; - /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ - const defaultCipherList: string; - } - interface HashOptions extends stream.TransformOptions { - /** - * For XOF hash functions such as `shake256`, the - * outputLength option can be used to specify the desired output length in bytes. - */ - outputLength?: number | undefined; - } - /** @deprecated since v10.0.0 */ - const fips: boolean; - /** - * Creates and returns a `Hash` object that can be used to generate hash digests - * using the given `algorithm`. Optional `options` argument controls stream - * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option - * can be used to specify the desired output length in bytes. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * Example: generating the sha256 sum of a file - * - * ```js - * import { - * createReadStream, - * } from 'node:fs'; - * import { argv } from 'node:process'; - * const { - * createHash, - * } = await import('node:crypto'); - * - * const filename = argv[2]; - * - * const hash = createHash('sha256'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hash.update(data); - * else { - * console.log(`${hash.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.92 - * @param options `stream.transform` options - */ - function createHash(algorithm: string, options?: HashOptions): Hash; - /** - * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. - * Optional `options` argument controls stream behavior. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms` will - * display the available digest algorithms. - * - * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is - * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was - * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not - * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256). - * - * Example: generating the sha256 HMAC of a file - * - * ```js - * import { - * createReadStream, - * } from 'node:fs'; - * import { argv } from 'node:process'; - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const filename = argv[2]; - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hmac.update(data); - * else { - * console.log(`${hmac.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; - // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings - type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary"; - type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "utf-16le" | "latin1"; - type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2"; - type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; - type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid"; - /** - * The `Hash` class is a utility for creating hash digests of data. It can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed hash digest on the readable side, or - * * Using the `hash.update()` and `hash.digest()` methods to produce the - * computed hash. - * - * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hash` objects as streams: - * - * ```js - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hash.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * } - * }); - * - * hash.write('some data to hash'); - * hash.end(); - * ``` - * - * Example: Using `Hash` and piped streams: - * - * ```js - * import { createReadStream } from 'node:fs'; - * import { stdout } from 'node:process'; - * const { createHash } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * const input = createReadStream('test.js'); - * input.pipe(hash).setEncoding('hex').pipe(stdout); - * ``` - * - * Example: Using the `hash.update()` and `hash.digest()` methods: - * - * ```js - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('some data to hash'); - * console.log(hash.digest('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * ``` - * @since v0.1.92 - */ - class Hash extends stream.Transform { - private constructor(); - /** - * Creates a new `Hash` object that contains a deep copy of the internal state - * of the current `Hash` object. - * - * The optional `options` argument controls stream behavior. For XOF hash - * functions such as `'shake256'`, the `outputLength` option can be used to - * specify the desired output length in bytes. - * - * An error is thrown when an attempt is made to copy the `Hash` object after - * its `hash.digest()` method has been called. - * - * ```js - * // Calculate a rolling hash. - * const { - * createHash, - * } = await import('node:crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('one'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('two'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('three'); - * console.log(hash.copy().digest('hex')); - * - * // Etc. - * ``` - * @since v13.1.0 - * @param options `stream.transform` options - */ - copy(options?: HashOptions): Hash; - /** - * Updates the hash content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hash; - update(data: string, inputEncoding: Encoding): Hash; - /** - * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). - * If `encoding` is provided a string will be returned; otherwise - * a `Buffer` is returned. - * - * The `Hash` object can not be used again after `hash.digest()` method has been - * called. Multiple calls will cause an error to be thrown. - * @since v0.1.92 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - /** - * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can - * be used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed HMAC digest on the readable side, or - * * Using the `hmac.update()` and `hmac.digest()` methods to produce the - * computed HMAC digest. - * - * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hmac` objects as streams: - * - * ```js - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hmac.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * } - * }); - * - * hmac.write('some data to hash'); - * hmac.end(); - * ``` - * - * Example: Using `Hmac` and piped streams: - * - * ```js - * import { createReadStream } from 'node:fs'; - * import { stdout } from 'node:process'; - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream('test.js'); - * input.pipe(hmac).pipe(stdout); - * ``` - * - * Example: Using the `hmac.update()` and `hmac.digest()` methods: - * - * ```js - * const { - * createHmac, - * } = await import('node:crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.update('some data to hash'); - * console.log(hmac.digest('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * ``` - * @since v0.1.94 - * @deprecated Since v20.13.0 Calling `Hmac` class directly with `Hmac()` or `new Hmac()` is deprecated due to being internals, not intended for public use. Please use the {@link createHmac} method to create Hmac instances. - */ - class Hmac extends stream.Transform { - private constructor(); - /** - * Updates the `Hmac` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hmac; - update(data: string, inputEncoding: Encoding): Hmac; - /** - * Calculates the HMAC digest of all of the data passed using `hmac.update()`. - * If `encoding` is - * provided a string is returned; otherwise a `Buffer` is returned; - * - * The `Hmac` object can not be used again after `hmac.digest()` has been - * called. Multiple calls to `hmac.digest()` will result in an error being thrown. - * @since v0.1.94 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - type KeyObjectType = "secret" | "public" | "private"; - interface KeyExportOptions { - type: "pkcs1" | "spki" | "pkcs8" | "sec1"; - format: T; - cipher?: string | undefined; - passphrase?: string | Buffer | undefined; - } - interface JwkKeyExportOptions { - format: "jwk"; - } - interface JsonWebKey { - crv?: string | undefined; - d?: string | undefined; - dp?: string | undefined; - dq?: string | undefined; - e?: string | undefined; - k?: string | undefined; - kty?: string | undefined; - n?: string | undefined; - p?: string | undefined; - q?: string | undefined; - qi?: string | undefined; - x?: string | undefined; - y?: string | undefined; - [key: string]: unknown; - } - interface AsymmetricKeyDetails { - /** - * Key size in bits (RSA, DSA). - */ - modulusLength?: number | undefined; - /** - * Public exponent (RSA). - */ - publicExponent?: bigint | undefined; - /** - * Name of the message digest (RSA-PSS). - */ - hashAlgorithm?: string | undefined; - /** - * Name of the message digest used by MGF1 (RSA-PSS). - */ - mgf1HashAlgorithm?: string | undefined; - /** - * Minimal salt length in bytes (RSA-PSS). - */ - saltLength?: number | undefined; - /** - * Size of q in bits (DSA). - */ - divisorLength?: number | undefined; - /** - * Name of the curve (EC). - */ - namedCurve?: string | undefined; - } - /** - * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, - * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` - * objects are not to be created directly using the `new`keyword. - * - * Most applications should consider using the new `KeyObject` API instead of - * passing keys as strings or `Buffer`s due to improved security features. - * - * `KeyObject` instances can be passed to other threads via `postMessage()`. - * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to - * be listed in the `transferList` argument. - * @since v11.6.0 - */ - class KeyObject { - private constructor(); - /** - * Example: Converting a `CryptoKey` instance to a `KeyObject`: - * - * ```js - * const { KeyObject } = await import('node:crypto'); - * const { subtle } = globalThis.crypto; - * - * const key = await subtle.generateKey({ - * name: 'HMAC', - * hash: 'SHA-256', - * length: 256, - * }, true, ['sign', 'verify']); - * - * const keyObject = KeyObject.from(key); - * console.log(keyObject.symmetricKeySize); - * // Prints: 32 (symmetric key size in bytes) - * ``` - * @since v15.0.0 - */ - static from(key: webcrypto.CryptoKey): KeyObject; - /** - * For asymmetric keys, this property represents the type of the key. Supported key - * types are: - * - * * `'rsa'` (OID 1.2.840.113549.1.1.1) - * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) - * * `'dsa'` (OID 1.2.840.10040.4.1) - * * `'ec'` (OID 1.2.840.10045.2.1) - * * `'x25519'` (OID 1.3.101.110) - * * `'x448'` (OID 1.3.101.111) - * * `'ed25519'` (OID 1.3.101.112) - * * `'ed448'` (OID 1.3.101.113) - * * `'dh'` (OID 1.2.840.113549.1.3.1) - * - * This property is `undefined` for unrecognized `KeyObject` types and symmetric - * keys. - * @since v11.6.0 - */ - asymmetricKeyType?: KeyType | undefined; - /** - * For asymmetric keys, this property represents the size of the embedded key in - * bytes. This property is `undefined` for symmetric keys. - */ - asymmetricKeySize?: number | undefined; - /** - * This property exists only on asymmetric keys. Depending on the type of the key, - * this object contains information about the key. None of the information obtained - * through this property can be used to uniquely identify a key or to compromise - * the security of the key. - * - * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, - * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be - * set. - * - * Other key details might be exposed via this API using additional attributes. - * @since v15.7.0 - */ - asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; - /** - * For symmetric keys, the following encoding options can be used: - * - * For public keys, the following encoding options can be used: - * - * For private keys, the following encoding options can be used: - * - * The result type depends on the selected encoding format, when PEM the - * result is a string, when DER it will be a buffer containing the data - * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. - * - * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are - * ignored. - * - * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of - * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be - * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for - * encrypted private keys. Since PKCS#8 defines its own - * encryption mechanism, PEM-level encryption is not supported when encrypting - * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for - * PKCS#1 and SEC1 encryption. - * @since v11.6.0 - */ - export(options: KeyExportOptions<"pem">): string | Buffer; - export(options?: KeyExportOptions<"der">): Buffer; - export(options?: JwkKeyExportOptions): JsonWebKey; - /** - * Returns `true` or `false` depending on whether the keys have exactly the same - * type, value, and parameters. This method is not [constant time](https://en.wikipedia.org/wiki/Timing_attack). - * @since v17.7.0, v16.15.0 - * @param otherKeyObject A `KeyObject` with which to compare `keyObject`. - */ - equals(otherKeyObject: KeyObject): boolean; - /** - * For secret keys, this property represents the size of the key in bytes. This - * property is `undefined` for asymmetric keys. - * @since v11.6.0 - */ - symmetricKeySize?: number | undefined; - /** - * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys - * or `'private'` for private (asymmetric) keys. - * @since v11.6.0 - */ - type: KeyObjectType; - } - type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm" | "chacha20-poly1305"; - type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm"; - type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb"; - type BinaryLike = string | NodeJS.ArrayBufferView; - type CipherKey = BinaryLike | KeyObject; - interface CipherCCMOptions extends stream.TransformOptions { - authTagLength: number; - } - interface CipherGCMOptions extends stream.TransformOptions { - authTagLength?: number | undefined; - } - interface CipherOCBOptions extends stream.TransformOptions { - authTagLength: number; - } - /** - * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and - * initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a - * given IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createCipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherCCMOptions, - ): CipherCCM; - function createCipheriv( - algorithm: CipherOCBTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherOCBOptions, - ): CipherOCB; - function createCipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike, - options?: CipherGCMOptions, - ): CipherGCM; - function createCipheriv( - algorithm: string, - key: CipherKey, - iv: BinaryLike | null, - options?: stream.TransformOptions, - ): Cipher; - /** - * Instances of the `Cipher` class are used to encrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain unencrypted - * data is written to produce encrypted data on the readable side, or - * * Using the `cipher.update()` and `cipher.final()` methods to produce - * the encrypted data. - * - * The {@link createCipheriv} method is - * used to create `Cipher` instances. `Cipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Cipher` objects as streams: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * // Once we have the key and iv, we can create and use the cipher... - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = ''; - * cipher.setEncoding('hex'); - * - * cipher.on('data', (chunk) => encrypted += chunk); - * cipher.on('end', () => console.log(encrypted)); - * - * cipher.write('some clear text data'); - * cipher.end(); - * }); - * }); - * ``` - * - * Example: Using `Cipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'node:fs'; - * - * import { - * pipeline, - * } from 'node:stream'; - * - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.js'); - * const output = createWriteStream('test.enc'); - * - * pipeline(input, cipher, output, (err) => { - * if (err) throw err; - * }); - * }); - * }); - * ``` - * - * Example: Using the `cipher.update()` and `cipher.final()` methods: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); - * encrypted += cipher.final('hex'); - * console.log(encrypted); - * }); - * }); - * ``` - * @since v0.1.94 - */ - class Cipher extends stream.Transform { - private constructor(); - /** - * Updates the cipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or `DataView`. If `data` is a `Buffer`, - * `TypedArray`, or `DataView`, then `inputEncoding` is ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being - * thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the data. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: BinaryLike): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `cipher.final()` method has been called, the `Cipher` object can no - * longer be used to encrypt data. Attempts to call `cipher.final()` more than - * once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When using block encryption algorithms, the `Cipher` class will automatically - * add padding to the input data to the appropriate block size. To disable the - * default padding call `cipher.setAutoPadding(false)`. - * - * When `autoPadding` is `false`, the length of the entire input data must be a - * multiple of the cipher's block size or `cipher.final()` will throw an error. - * Disabling automatic padding is useful for non-standard padding, for instance - * using `0x0` instead of PKCS padding. - * - * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(autoPadding?: boolean): this; - } - interface CipherCCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - interface CipherGCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - interface CipherOCB extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - getAuthTag(): Buffer; - } - /** - * Creates and returns a `Decipher` object that uses the given `algorithm`, `key` and initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the `authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength` option is not required but can be used to restrict accepted authentication tags - * to those with the specified length. - * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms` will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a given - * IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createDecipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherCCMOptions, - ): DecipherCCM; - function createDecipheriv( - algorithm: CipherOCBTypes, - key: CipherKey, - iv: BinaryLike, - options: CipherOCBOptions, - ): DecipherOCB; - function createDecipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike, - options?: CipherGCMOptions, - ): DecipherGCM; - function createDecipheriv( - algorithm: string, - key: CipherKey, - iv: BinaryLike | null, - options?: stream.TransformOptions, - ): Decipher; - /** - * Instances of the `Decipher` class are used to decrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain encrypted - * data is written to produce unencrypted data on the readable side, or - * * Using the `decipher.update()` and `decipher.final()` methods to - * produce the unencrypted data. - * - * The {@link createDecipheriv} method is - * used to create `Decipher` instances. `Decipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Decipher` objects as streams: - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Key length is dependent on the algorithm. In this case for aes192, it is - * // 24 bytes (192 bits). - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * let decrypted = ''; - * decipher.on('readable', () => { - * let chunk; - * while (null !== (chunk = decipher.read())) { - * decrypted += chunk.toString('utf8'); - * } - * }); - * decipher.on('end', () => { - * console.log(decrypted); - * // Prints: some clear text data - * }); - * - * // Encrypted with same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * decipher.write(encrypted, 'hex'); - * decipher.end(); - * ``` - * - * Example: Using `Decipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.enc'); - * const output = createWriteStream('test.js'); - * - * input.pipe(decipher).pipe(output); - * ``` - * - * Example: Using the `decipher.update()` and `decipher.final()` methods: - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * scryptSync, - * createDecipheriv, - * } = await import('node:crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * // Encrypted using same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); - * decrypted += decipher.final('utf8'); - * console.log(decrypted); - * // Prints: some clear text data - * ``` - * @since v0.1.94 - */ - class Decipher extends stream.Transform { - private constructor(); - /** - * Updates the decipher with `data`. If the `inputEncoding` argument is given, - * the `data` argument is a string using the specified encoding. If the `inputEncoding` argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is - * ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding` is specified, a string using the specified encoding is returned. If no `outputEncoding` is provided, a `Buffer` is returned. - * - * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error - * being thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: NodeJS.ArrayBufferView): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `decipher.final()` method has been called, the `Decipher` object can - * no longer be used to decrypt data. Attempts to call `decipher.final()` more - * than once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When data has been encrypted without standard block padding, calling `decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and - * removing padding. - * - * Turning auto padding off will only work if the input data's length is a - * multiple of the ciphers block size. - * - * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(auto_padding?: boolean): this; - } - interface DecipherCCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - }, - ): this; - } - interface DecipherGCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - } - interface DecipherOCB extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - }, - ): this; - } - interface PrivateKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: "pkcs1" | "pkcs8" | "sec1" | undefined; - passphrase?: string | Buffer | undefined; - encoding?: string | undefined; - } - interface PublicKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: "pkcs1" | "spki" | undefined; - encoding?: string | undefined; - } - /** - * Asynchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKey, - * } = await import('node:crypto'); - * - * generateKey('hmac', { length: 512 }, (err, key) => { - * if (err) throw err; - * console.log(key.export().toString('hex')); // 46e..........620 - * }); - * ``` - * - * The size of a generated HMAC key should not exceed the block size of the - * underlying hash function. See {@link createHmac} for more information. - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKey( - type: "hmac" | "aes", - options: { - length: number; - }, - callback: (err: Error | null, key: KeyObject) => void, - ): void; - /** - * Synchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKeySync, - * } = await import('node:crypto'); - * - * const key = generateKeySync('hmac', { length: 512 }); - * console.log(key.export().toString('hex')); // e89..........41e - * ``` - * - * The size of a generated HMAC key should not exceed the block size of the - * underlying hash function. See {@link createHmac} for more information. - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKeySync( - type: "hmac" | "aes", - options: { - length: number; - }, - ): KeyObject; - interface JsonWebKeyInput { - key: JsonWebKey; - format: "jwk"; - } - /** - * Creates and returns a new key object containing a private key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key` must be an object with the properties described above. - * - * If the private key is encrypted, a `passphrase` must be specified. The length - * of the passphrase is limited to 1024 bytes. - * @since v11.6.0 - */ - function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a public key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject` with type `'private'`, the public key is derived from the given private key; - * otherwise, `key` must be an object with the properties described above. - * - * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. - * - * Because public keys can be derived from private keys, a private key may be - * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the - * returned `KeyObject` will be `'public'` and that the private key cannot be - * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type `'private'` is given, a new `KeyObject` with type `'public'` will be returned - * and it will be impossible to extract the private key from the returned object. - * @since v11.6.0 - */ - function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a secret key for symmetric - * encryption or `Hmac`. - * @since v11.6.0 - * @param encoding The string encoding when `key` is a string. - */ - function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; - function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; - /** - * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. - * Optional `options` argument controls the `stream.Writable` behavior. - * - * In some cases, a `Sign` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createSign(algorithm: string, options?: stream.WritableOptions): Sign; - type DSAEncoding = "der" | "ieee-p1363"; - interface SigningOptions { - /** - * @see crypto.constants.RSA_PKCS1_PADDING - */ - padding?: number | undefined; - saltLength?: number | undefined; - dsaEncoding?: DSAEncoding | undefined; - } - interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} - interface SignKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface SignJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {} - interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} - interface VerifyKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {} - type KeyLike = string | Buffer | KeyObject; - /** - * The `Sign` class is a utility for generating signatures. It can be used in one - * of two ways: - * - * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or - * * Using the `sign.update()` and `sign.sign()` methods to produce the - * signature. - * - * The {@link createSign} method is used to create `Sign` instances. The - * argument is the string name of the hash function to use. `Sign` objects are not - * to be created directly using the `new` keyword. - * - * Example: Using `Sign` and `Verify` objects as streams: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify, - * } = await import('node:crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('ec', { - * namedCurve: 'sect239k1', - * }); - * - * const sign = createSign('SHA256'); - * sign.write('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey, 'hex'); - * - * const verify = createVerify('SHA256'); - * verify.write('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature, 'hex')); - * // Prints: true - * ``` - * - * Example: Using the `sign.update()` and `verify.update()` methods: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify, - * } = await import('node:crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('rsa', { - * modulusLength: 2048, - * }); - * - * const sign = createSign('SHA256'); - * sign.update('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey); - * - * const verify = createVerify('SHA256'); - * verify.update('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature)); - * // Prints: true - * ``` - * @since v0.1.92 - */ - class Sign extends stream.Writable { - private constructor(); - /** - * Updates the `Sign` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): this; - update(data: string, inputEncoding: Encoding): this; - /** - * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the following additional properties can be passed: - * - * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * The `Sign` object can not be again used after `sign.sign()` method has been - * called. Multiple calls to `sign.sign()` will result in an error being thrown. - * @since v0.1.92 - */ - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): Buffer; - sign( - privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, - outputFormat: BinaryToTextEncoding, - ): string; - } - /** - * Creates and returns a `Verify` object that uses the given algorithm. - * Use {@link getHashes} to obtain an array of names of the available - * signing algorithms. Optional `options` argument controls the `stream.Writable` behavior. - * - * In some cases, a `Verify` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; - /** - * The `Verify` class is a utility for verifying signatures. It can be used in one - * of two ways: - * - * * As a writable `stream` where written data is used to validate against the - * supplied signature, or - * * Using the `verify.update()` and `verify.verify()` methods to verify - * the signature. - * - * The {@link createVerify} method is used to create `Verify` instances. `Verify` objects are not to be created directly using the `new` keyword. - * - * See `Sign` for examples. - * @since v0.1.92 - */ - class Verify extends stream.Writable { - private constructor(); - /** - * Updates the `Verify` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `inputEncoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or `DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Verify; - update(data: string, inputEncoding: Encoding): Verify; - /** - * Verifies the provided data using the given `object` and `signature`. - * - * If `object` is not a `KeyObject`, this function behaves as if `object` had been passed to {@link createPublicKey}. If it is an - * object, the following additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the data, in - * the `signatureEncoding`. - * If a `signatureEncoding` is specified, the `signature` is expected to be a - * string; otherwise `signature` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * The `verify` object can not be used again after `verify.verify()` has been - * called. Multiple calls to `verify.verify()` will result in an error being - * thrown. - * - * Because public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.1.92 - */ - verify( - object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - ): boolean; - verify( - object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: string, - signature_format?: BinaryToTextEncoding, - ): boolean; - } - /** - * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an - * optional specific `generator`. - * - * The `generator` argument can be a number, string, or `Buffer`. If `generator` is not specified, the value `2` is used. - * - * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise - * a `Buffer`, `TypedArray`, or `DataView` is expected. - * - * If `generatorEncoding` is specified, `generator` is expected to be a string; - * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. - * @since v0.11.12 - * @param primeEncoding The `encoding` of the `prime` string. - * @param [generator=2] - * @param generatorEncoding The `encoding` of the `generator` string. - */ - function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman; - function createDiffieHellman( - prime: ArrayBuffer | NodeJS.ArrayBufferView, - generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, - ): DiffieHellman; - function createDiffieHellman( - prime: ArrayBuffer | NodeJS.ArrayBufferView, - generator: string, - generatorEncoding: BinaryToTextEncoding, - ): DiffieHellman; - function createDiffieHellman( - prime: string, - primeEncoding: BinaryToTextEncoding, - generator?: number | ArrayBuffer | NodeJS.ArrayBufferView, - ): DiffieHellman; - function createDiffieHellman( - prime: string, - primeEncoding: BinaryToTextEncoding, - generator: string, - generatorEncoding: BinaryToTextEncoding, - ): DiffieHellman; - /** - * The `DiffieHellman` class is a utility for creating Diffie-Hellman key - * exchanges. - * - * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. - * - * ```js - * import assert from 'node:assert'; - * - * const { - * createDiffieHellman, - * } = await import('node:crypto'); - * - * // Generate Alice's keys... - * const alice = createDiffieHellman(2048); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * // OK - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * ``` - * @since v0.5.0 - */ - class DiffieHellman { - private constructor(); - /** - * Generates private and public Diffie-Hellman key values unless they have been - * generated or computed already, and returns - * the public key in the specified `encoding`. This key should be - * transferred to the other party. - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular, - * once a private key has been generated or set, calling this function only updates - * the public key but does not generate a new private key. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using the specified `inputEncoding`, and secret is - * encoded using specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. - * @since v0.5.0 - * @param inputEncoding The `encoding` of an `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer; - computeSecret( - otherPublicKey: NodeJS.ArrayBufferView, - inputEncoding: null, - outputEncoding: BinaryToTextEncoding, - ): string; - computeSecret( - otherPublicKey: string, - inputEncoding: BinaryToTextEncoding, - outputEncoding: BinaryToTextEncoding, - ): string; - /** - * Returns the Diffie-Hellman prime in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrime(): Buffer; - getPrime(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman generator in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getGenerator(): Buffer; - getGenerator(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman public key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPublicKey(): Buffer; - getPublicKey(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman private key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * Sets the Diffie-Hellman public key. If the `encoding` argument is provided, `publicKey` is expected - * to be a string. If no `encoding` is provided, `publicKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `publicKey` string. - */ - setPublicKey(publicKey: NodeJS.ArrayBufferView): void; - setPublicKey(publicKey: string, encoding: BufferEncoding): void; - /** - * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected - * to be a string. If no `encoding` is provided, `privateKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * - * This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be - * used to manually provide the public key or to automatically derive it. - * @since v0.5.0 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BufferEncoding): void; - /** - * A bit field containing any warnings and/or errors resulting from a check - * performed during initialization of the `DiffieHellman` object. - * - * The following values are valid for this property (as defined in `node:constants` module): - * - * * `DH_CHECK_P_NOT_SAFE_PRIME` - * * `DH_CHECK_P_NOT_PRIME` - * * `DH_UNABLE_TO_CHECK_GENERATOR` - * * `DH_NOT_SUITABLE_GENERATOR` - * @since v0.11.12 - */ - verifyError: number; - } - /** - * The `DiffieHellmanGroup` class takes a well-known modp group as its argument. - * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation. - * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods. - * - * ```js - * const { createDiffieHellmanGroup } = await import('node:crypto'); - * const dh = createDiffieHellmanGroup('modp1'); - * ``` - * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt): - * ```bash - * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h - * modp1 # 768 bits - * modp2 # 1024 bits - * modp5 # 1536 bits - * modp14 # 2048 bits - * modp15 # etc. - * modp16 - * modp17 - * modp18 - * ``` - * @since v0.7.5 - */ - const DiffieHellmanGroup: DiffieHellmanGroupConstructor; - interface DiffieHellmanGroupConstructor { - new(name: string): DiffieHellmanGroup; - (name: string): DiffieHellmanGroup; - readonly prototype: DiffieHellmanGroup; - } - type DiffieHellmanGroup = Omit; - /** - * Creates a predefined `DiffieHellmanGroup` key exchange object. The - * supported groups are listed in the documentation for `DiffieHellmanGroup`. - * - * The returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing - * the keys (with `diffieHellman.setPublicKey()`, for example). The - * advantage of using this method is that the parties do not have to - * generate nor exchange a group modulus beforehand, saving both processor - * and communication time. - * - * Example (obtaining a shared secret): - * - * ```js - * const { - * getDiffieHellman, - * } = await import('node:crypto'); - * const alice = getDiffieHellman('modp14'); - * const bob = getDiffieHellman('modp14'); - * - * alice.generateKeys(); - * bob.generateKeys(); - * - * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); - * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); - * - * // aliceSecret and bobSecret should be the same - * console.log(aliceSecret === bobSecret); - * ``` - * @since v0.7.5 - */ - function getDiffieHellman(groupName: string): DiffieHellmanGroup; - /** - * An alias for {@link getDiffieHellman} - * @since v0.9.3 - */ - function createDiffieHellmanGroup(name: string): DiffieHellmanGroup; - /** - * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`. - * - * The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an error occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. By default, the successfully generated `derivedKey` will be passed to the callback as a `Buffer`. An error will be - * thrown if any of the input arguments specify invalid values or types. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2, - * } = await import('node:crypto'); - * - * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * @since v0.5.5 - */ - function pbkdf2( - password: BinaryLike, - salt: BinaryLike, - iterations: number, - keylen: number, - digest: string, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - /** - * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`. - * - * If an error occurs an `Error` will be thrown, otherwise the derived key will be - * returned as a `Buffer`. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2Sync, - * } = await import('node:crypto'); - * - * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); - * console.log(key.toString('hex')); // '3745e48...08d59ae' - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * @since v0.9.3 - */ - function pbkdf2Sync( - password: BinaryLike, - salt: BinaryLike, - iterations: number, - keylen: number, - digest: string, - ): Buffer; - /** - * Generates cryptographically strong pseudorandom data. The `size` argument - * is a number indicating the number of bytes to generate. - * - * If a `callback` function is provided, the bytes are generated asynchronously - * and the `callback` function is invoked with two arguments: `err` and `buf`. - * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The `buf` argument is a `Buffer` containing the generated bytes. - * - * ```js - * // Asynchronous - * const { - * randomBytes, - * } = await import('node:crypto'); - * - * randomBytes(256, (err, buf) => { - * if (err) throw err; - * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); - * }); - * ``` - * - * If the `callback` function is not provided, the random bytes are generated - * synchronously and returned as a `Buffer`. An error will be thrown if - * there is a problem generating the bytes. - * - * ```js - * // Synchronous - * const { - * randomBytes, - * } = await import('node:crypto'); - * - * const buf = randomBytes(256); - * console.log( - * `${buf.length} bytes of random data: ${buf.toString('hex')}`); - * ``` - * - * The `crypto.randomBytes()` method will not complete until there is - * sufficient entropy available. - * This should normally never take longer than a few milliseconds. The only time - * when generating the random bytes may conceivably block for a longer period of - * time is right after boot, when the whole system is still low on entropy. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomBytes()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomBytes` requests when doing so as part of fulfilling a client - * request. - * @since v0.5.8 - * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. - * @return if the `callback` function is not provided. - */ - function randomBytes(size: number): Buffer; - function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - function pseudoRandomBytes(size: number): Buffer; - function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - /** - * Return a random integer `n` such that `min <= n < max`. This - * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). - * - * The range (`max - min`) must be less than 2**48. `min` and `max` must - * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). - * - * If the `callback` function is not provided, the random integer is - * generated synchronously. - * - * ```js - * // Asynchronous - * const { - * randomInt, - * } = await import('node:crypto'); - * - * randomInt(3, (err, n) => { - * if (err) throw err; - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * }); - * ``` - * - * ```js - * // Synchronous - * const { - * randomInt, - * } = await import('node:crypto'); - * - * const n = randomInt(3); - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * ``` - * - * ```js - * // With `min` argument - * const { - * randomInt, - * } = await import('node:crypto'); - * - * const n = randomInt(1, 7); - * console.log(`The dice rolled: ${n}`); - * ``` - * @since v14.10.0, v12.19.0 - * @param [min=0] Start of random range (inclusive). - * @param max End of random range (exclusive). - * @param callback `function(err, n) {}`. - */ - function randomInt(max: number): number; - function randomInt(min: number, max: number): number; - function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; - function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; - /** - * Synchronous version of {@link randomFill}. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFillSync } = await import('node:crypto'); - * - * const buf = Buffer.alloc(10); - * console.log(randomFillSync(buf).toString('hex')); - * - * randomFillSync(buf, 5); - * console.log(buf.toString('hex')); - * - * // The above is equivalent to the following: - * randomFillSync(buf, 5, 5); - * console.log(buf.toString('hex')); - * ``` - * - * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFillSync } = await import('node:crypto'); - * - * const a = new Uint32Array(10); - * console.log(Buffer.from(randomFillSync(a).buffer, - * a.byteOffset, a.byteLength).toString('hex')); - * - * const b = new DataView(new ArrayBuffer(10)); - * console.log(Buffer.from(randomFillSync(b).buffer, - * b.byteOffset, b.byteLength).toString('hex')); - * - * const c = new ArrayBuffer(10); - * console.log(Buffer.from(randomFillSync(c)).toString('hex')); - * ``` - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @return The object passed as `buffer` argument. - */ - function randomFillSync(buffer: T, offset?: number, size?: number): T; - /** - * This function is similar to {@link randomBytes} but requires the first - * argument to be a `Buffer` that will be filled. It also - * requires that a callback is passed in. - * - * If the `callback` function is not provided, an error will be thrown. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFill } = await import('node:crypto'); - * - * const buf = Buffer.alloc(10); - * randomFill(buf, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * randomFill(buf, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * // The above is equivalent to the following: - * randomFill(buf, 5, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * ``` - * - * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as `buffer`. - * - * While this includes instances of `Float32Array` and `Float64Array`, this - * function should not be used to generate random floating-point numbers. The - * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array - * contains finite numbers only, they are not drawn from a uniform random - * distribution and have no meaningful lower or upper bounds. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { randomFill } = await import('node:crypto'); - * - * const a = new Uint32Array(10); - * randomFill(a, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const b = new DataView(new ArrayBuffer(10)); - * randomFill(b, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const c = new ArrayBuffer(10); - * randomFill(c, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf).toString('hex')); - * }); - * ``` - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomFill()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomFill` requests when doing so as part of fulfilling a client - * request. - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @param callback `function(err, buf) {}`. - */ - function randomFill( - buffer: T, - callback: (err: Error | null, buf: T) => void, - ): void; - function randomFill( - buffer: T, - offset: number, - callback: (err: Error | null, buf: T) => void, - ): void; - function randomFill( - buffer: T, - offset: number, - size: number, - callback: (err: Error | null, buf: T) => void, - ): void; - interface ScryptOptions { - cost?: number | undefined; - blockSize?: number | undefined; - parallelization?: number | undefined; - N?: number | undefined; - r?: number | undefined; - p?: number | undefined; - maxmem?: number | undefined; - } - /** - * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * The `callback` function is called with two arguments: `err` and `derivedKey`. `err` is an exception object when key derivation fails, otherwise `err` is `null`. `derivedKey` is passed to the - * callback as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scrypt, - * } = await import('node:crypto'); - * - * // Using the factory defaults. - * scrypt('password', 'salt', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * // Using a custom N parameter. Must be a power of two. - * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' - * }); - * ``` - * @since v10.5.0 - */ - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - options: ScryptOptions, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - /** - * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * An exception is thrown when key derivation fails, otherwise the derived key is - * returned as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scryptSync, - * } = await import('node:crypto'); - * // Using the factory defaults. - * - * const key1 = scryptSync('password', 'salt', 64); - * console.log(key1.toString('hex')); // '3745e48...08d59ae' - * // Using a custom N parameter. Must be a power of two. - * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); - * console.log(key2.toString('hex')); // '3745e48...aa39b34' - * ``` - * @since v10.5.0 - */ - function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; - interface RsaPublicKey { - key: KeyLike; - padding?: number | undefined; - } - interface RsaPrivateKey { - key: KeyLike; - passphrase?: string | undefined; - /** - * @default 'sha1' - */ - oaepHash?: string | undefined; - oaepLabel?: NodeJS.TypedArray | undefined; - padding?: number | undefined; - } - /** - * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using - * the corresponding private key, for example using {@link privateDecrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.11.14 - */ - function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `key`.`buffer` was previously encrypted using - * the corresponding private key, for example using {@link privateEncrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v1.1.0 - */ - function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using - * the corresponding public key, for example using {@link publicEncrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`. - * @since v0.11.14 - */ - function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using - * the corresponding public key, for example using {@link publicDecrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`. - * @since v1.1.0 - */ - function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * ```js - * const { - * getCiphers, - * } = await import('node:crypto'); - * - * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] - * ``` - * @since v0.9.3 - * @return An array with the names of the supported cipher algorithms. - */ - function getCiphers(): string[]; - /** - * ```js - * const { - * getCurves, - * } = await import('node:crypto'); - * - * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] - * ``` - * @since v2.3.0 - * @return An array with the names of the supported elliptic curves. - */ - function getCurves(): string[]; - /** - * @since v10.0.0 - * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. - */ - function getFips(): 1 | 0; - /** - * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. - * Throws an error if FIPS mode is not available. - * @since v10.0.0 - * @param bool `true` to enable FIPS mode. - */ - function setFips(bool: boolean): void; - /** - * ```js - * const { - * getHashes, - * } = await import('node:crypto'); - * - * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] - * ``` - * @since v0.9.3 - * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. - */ - function getHashes(): string[]; - /** - * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) - * key exchanges. - * - * Instances of the `ECDH` class can be created using the {@link createECDH} function. - * - * ```js - * import assert from 'node:assert'; - * - * const { - * createECDH, - * } = await import('node:crypto'); - * - * // Generate Alice's keys... - * const alice = createECDH('secp521r1'); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createECDH('secp521r1'); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * // OK - * ``` - * @since v0.11.14 - */ - class ECDH { - private constructor(); - /** - * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the - * format specified by `format`. The `format` argument specifies point encoding - * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is - * interpreted using the specified `inputEncoding`, and the returned key is encoded - * using the specified `outputEncoding`. - * - * Use {@link getCurves} to obtain a list of available curve names. - * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display - * the name and description of each available elliptic curve. - * - * If `format` is not specified the point will be returned in `'uncompressed'` format. - * - * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * Example (uncompressing a key): - * - * ```js - * const { - * createECDH, - * ECDH, - * } = await import('node:crypto'); - * - * const ecdh = createECDH('secp256k1'); - * ecdh.generateKeys(); - * - * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); - * - * const uncompressedKey = ECDH.convertKey(compressedKey, - * 'secp256k1', - * 'hex', - * 'hex', - * 'uncompressed'); - * - * // The converted key and the uncompressed public key should be the same - * console.log(uncompressedKey === ecdh.getPublicKey('hex')); - * ``` - * @since v10.0.0 - * @param inputEncoding The `encoding` of the `key` string. - * @param outputEncoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - static convertKey( - key: BinaryLike, - curve: string, - inputEncoding?: BinaryToTextEncoding, - outputEncoding?: "latin1" | "hex" | "base64" | "base64url", - format?: "uncompressed" | "compressed" | "hybrid", - ): Buffer | string; - /** - * Generates private and public EC Diffie-Hellman key values, and returns - * the public key in the specified `format` and `encoding`. This key should be - * transferred to the other party. - * - * The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. - * - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using specified `inputEncoding`, and the returned secret - * is encoded using the specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. - * - * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey` lies outside of the elliptic curve. Since `otherPublicKey` is - * usually supplied from a remote user over an insecure network, - * be sure to handle this exception accordingly. - * @since v0.11.14 - * @param inputEncoding The `encoding` of the `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; - computeSecret( - otherPublicKey: string, - inputEncoding: BinaryToTextEncoding, - outputEncoding: BinaryToTextEncoding, - ): string; - /** - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @return The EC Diffie-Hellman in the specified `encoding`. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. - * - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. - */ - getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer; - getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Sets the EC Diffie-Hellman private key. - * If `encoding` is provided, `privateKey` is expected - * to be a string; otherwise `privateKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`. - * - * If `privateKey` is not valid for the curve specified when the `ECDH` object was - * created, an error is thrown. Upon setting the private key, the associated - * public point (key) is also generated and set in the `ECDH` object. - * @since v0.11.14 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; - } - /** - * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a - * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent - * OpenSSL releases, `openssl ecparam -list_curves` will also display the name - * and description of each available elliptic curve. - * @since v0.11.14 - */ - function createECDH(curveName: string): ECDH; - /** - * This function compares the underlying bytes that represent the given `ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time - * algorithm. - * - * This function does not leak timing information that - * would allow an attacker to guess one of the values. This is suitable for - * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). - * - * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they - * must have the same byte length. An error is thrown if `a` and `b` have - * different byte lengths. - * - * If at least one of `a` and `b` is a `TypedArray` with more than one byte per - * entry, such as `Uint16Array`, the result will be computed using the platform - * byte order. - * - * **When both of the inputs are `Float32Array`s or `Float64Array`s, this function might return unexpected results due to IEEE 754** - * **encoding of floating-point numbers. In particular, neither `x === y` nor `Object.is(x, y)` implies that the byte representations of two floating-point** - * **numbers `x` and `y` are equal.** - * - * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code - * is timing-safe. Care should be taken to ensure that the surrounding code does - * not introduce timing vulnerabilities. - * @since v6.6.0 - */ - function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; - type KeyType = "rsa" | "rsa-pss" | "dsa" | "ec" | "ed25519" | "ed448" | "x25519" | "x448"; - type KeyFormat = "pem" | "der" | "jwk"; - interface BasePrivateKeyEncodingOptions { - format: T; - cipher?: string | undefined; - passphrase?: string | undefined; - } - interface KeyPairKeyObjectResult { - publicKey: KeyObject; - privateKey: KeyObject; - } - interface ED25519KeyPairKeyObjectOptions {} - interface ED448KeyPairKeyObjectOptions {} - interface X25519KeyPairKeyObjectOptions {} - interface X448KeyPairKeyObjectOptions {} - interface ECKeyPairKeyObjectOptions { - /** - * Name of the curve to use - */ - namedCurve: string; - /** - * Must be `'named'` or `'explicit'`. Default: `'named'`. - */ - paramEncoding?: "explicit" | "named" | undefined; - } - interface RSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - } - interface RSAPSSKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - } - interface DSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - } - interface RSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs1" | "pkcs8"; - }; - } - interface RSAPSSKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Public exponent - * @default 0x10001 - */ - publicExponent?: number | undefined; - /** - * Name of the message digest - */ - hashAlgorithm?: string; - /** - * Name of the message digest used by MGF1 - */ - mgf1HashAlgorithm?: string; - /** - * Minimal salt length in bytes - */ - saltLength?: string; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface DSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ECKeyPairOptions extends ECKeyPairKeyObjectOptions { - publicKeyEncoding: { - type: "pkcs1" | "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "sec1" | "pkcs8"; - }; - } - interface ED25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface ED448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X25519KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface X448KeyPairOptions { - publicKeyEncoding: { - type: "spki"; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: "pkcs8"; - }; - } - interface KeyPairSyncResult { - publicKey: T1; - privateKey: T2; - } - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * When encoding public keys, it is recommended to use `'spki'`. When encoding - * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, - * and to keep the passphrase confidential. - * - * ```js - * const { - * generateKeyPairSync, - * } = await import('node:crypto'); - * - * const { - * publicKey, - * privateKey, - * } = generateKeyPairSync('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem', - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret', - * }, - * }); - * ``` - * - * The return value `{ publicKey, privateKey }` represents the generated key pair. - * When PEM encoding was selected, the respective key will be a string, otherwise - * it will be a buffer containing the data encoded as DER. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): KeyPairSyncResult; - function generateKeyPairSync( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): KeyPairSyncResult; - function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - /** - * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, - * Ed25519, Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * It is recommended to encode public keys as `'spki'` and private keys as `'pkcs8'` with encryption for long-term storage: - * - * ```js - * const { - * generateKeyPair, - * } = await import('node:crypto'); - * - * generateKeyPair('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem', - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret', - * }, - * }, (err, publicKey, privateKey) => { - * // Handle errors and use the generated key pair. - * }); - * ``` - * - * On completion, `callback` will be called with `err` set to `undefined` and `publicKey` / `privateKey` representing the generated key pair. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa", - options: RSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "dsa", - options: DSAKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ec", - options: ECKeyPairKeyObjectOptions, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed25519", - options: ED25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "ed448", - options: ED448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x25519", - options: X25519KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - callback: (err: Error | null, publicKey: string, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, - ): void; - function generateKeyPair( - type: "x448", - options: X448KeyPairKeyObjectOptions | undefined, - callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, - ): void; - namespace generateKeyPair { - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa", - options: RSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "rsa-pss", - options: RSAPSSKeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "dsa", - options: DSAKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ec", - options: ECKeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ed25519", - options: ED25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed25519", - options?: ED25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "ed448", - options: ED448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "x25519", - options: X25519KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__( - type: "x25519", - options?: X25519KeyPairKeyObjectOptions, - ): Promise; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "pem">, - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"pem", "der">, - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"der", "pem">, - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: "x448", - options: X448KeyPairOptions<"der", "der">, - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise; - } - /** - * Calculates and returns the signature for `data` using the given private key and - * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is - * dependent upon the key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPrivateKey}. If it is an object, the following - * additional properties can be passed: - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, - ): Buffer; - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, - callback: (error: Error | null, data: Buffer) => void, - ): void; - /** - * Verifies the given signature for `data` using the given key and algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is dependent upon the - * key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPublicKey}. If it is an object, the following - * additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the `data`. - * - * Because public keys can be derived from private keys, a private key or a public - * key may be passed for `key`. - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - ): boolean; - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, - signature: NodeJS.ArrayBufferView, - callback: (error: Error | null, result: boolean) => void, - ): void; - /** - * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. - * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'` (for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). - * @since v13.9.0, v12.17.0 - */ - function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; - /** - * A utility for creating one-shot hash digests of data. It can be faster than the object-based `crypto.createHash()` when hashing a smaller amount of data - * (<= 5MB) that's readily available. If the data can be big or if it is streamed, it's still recommended to use `crypto.createHash()` instead. The `algorithm` - * is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. On recent releases - * of OpenSSL, `openssl list -digest-algorithms` will display the available digest algorithms. - * - * Example: - * - * ```js - * import crypto from 'node:crypto'; - * import { Buffer } from 'node:buffer'; - * - * // Hashing a string and return the result as a hex-encoded string. - * const string = 'Node.js'; - * // 10b3493287f831e81a438811a1ffba01f8cec4b7 - * console.log(crypto.hash('sha1', string)); - * - * // Encode a base64-encoded string into a Buffer, hash it and return - * // the result as a buffer. - * const base64 = 'Tm9kZS5qcw=='; - * // - * console.log(crypto.hash('sha1', Buffer.from(base64, 'base64'), 'buffer')); - * ``` - * @since v21.7.0, v20.12.0 - * @param data When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different input encoding is desired for a string input, user - * could encode the string into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing the encoded `TypedArray` into this API instead. - * @param [outputEncoding='hex'] [Encoding](https://nodejs.org/docs/latest-v22.x/api/buffer.html#buffers-and-character-encodings) used to encode the returned digest. - */ - function hash(algorithm: string, data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string; - function hash(algorithm: string, data: BinaryLike, outputEncoding: "buffer"): Buffer; - function hash( - algorithm: string, - data: BinaryLike, - outputEncoding?: BinaryToTextEncoding | "buffer", - ): string | Buffer; - type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts"; - interface CipherInfoOptions { - /** - * A test key length. - */ - keyLength?: number | undefined; - /** - * A test IV length. - */ - ivLength?: number | undefined; - } - interface CipherInfo { - /** - * The name of the cipher. - */ - name: string; - /** - * The nid of the cipher. - */ - nid: number; - /** - * The block size of the cipher in bytes. - * This property is omitted when mode is 'stream'. - */ - blockSize?: number | undefined; - /** - * The expected or default initialization vector length in bytes. - * This property is omitted if the cipher does not use an initialization vector. - */ - ivLength?: number | undefined; - /** - * The expected or default key length in bytes. - */ - keyLength: number; - /** - * The cipher mode. - */ - mode: CipherMode; - } - /** - * Returns information about a given cipher. - * - * Some ciphers accept variable length keys and initialization vectors. By default, - * the `crypto.getCipherInfo()` method will return the default values for these - * ciphers. To test if a given key length or iv length is acceptable for given - * cipher, use the `keyLength` and `ivLength` options. If the given values are - * unacceptable, `undefined` will be returned. - * @since v15.0.0 - * @param nameOrNid The name or nid of the cipher to query. - */ - function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; - /** - * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. - * - * The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an errors occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. The successfully generated `derivedKey` will - * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any - * of the input arguments specify invalid values or types. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * hkdf, - * } = await import('node:crypto'); - * - * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * }); - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. Must be provided but can be zero-length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdf( - digest: string, - irm: BinaryLike | KeyObject, - salt: BinaryLike, - info: BinaryLike, - keylen: number, - callback: (err: Error | null, derivedKey: ArrayBuffer) => void, - ): void; - /** - * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The - * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. - * - * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). - * - * An error will be thrown if any of the input arguments specify invalid values or - * types, or if the derived key cannot be generated. - * - * ```js - * import { Buffer } from 'node:buffer'; - * const { - * hkdfSync, - * } = await import('node:crypto'); - * - * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. Must be provided but can be zero-length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdfSync( - digest: string, - ikm: BinaryLike | KeyObject, - salt: BinaryLike, - info: BinaryLike, - keylen: number, - ): ArrayBuffer; - interface SecureHeapUsage { - /** - * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. - */ - total: number; - /** - * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. - */ - min: number; - /** - * The total number of bytes currently allocated from the secure heap. - */ - used: number; - /** - * The calculated ratio of `used` to `total` allocated bytes. - */ - utilization: number; - } - /** - * @since v15.6.0 - */ - function secureHeapUsed(): SecureHeapUsage; - interface RandomUUIDOptions { - /** - * By default, to improve performance, - * Node.js will pre-emptively generate and persistently cache enough - * random data to generate up to 128 random UUIDs. To generate a UUID - * without using the cache, set `disableEntropyCache` to `true`. - * - * @default `false` - */ - disableEntropyCache?: boolean | undefined; - } - type UUID = `${string}-${string}-${string}-${string}-${string}`; - /** - * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a - * cryptographic pseudorandom number generator. - * @since v15.6.0, v14.17.0 - */ - function randomUUID(options?: RandomUUIDOptions): UUID; - interface X509CheckOptions { - /** - * @default 'always' - */ - subject?: "always" | "default" | "never"; - /** - * @default true - */ - wildcards?: boolean; - /** - * @default true - */ - partialWildcards?: boolean; - /** - * @default false - */ - multiLabelWildcards?: boolean; - /** - * @default false - */ - singleLabelSubdomains?: boolean; - } - /** - * Encapsulates an X509 certificate and provides read-only access to - * its information. - * - * ```js - * const { X509Certificate } = await import('node:crypto'); - * - * const x509 = new X509Certificate('{... pem encoded cert ...}'); - * - * console.log(x509.subject); - * ``` - * @since v15.6.0 - */ - class X509Certificate { - /** - * Will be \`true\` if this is a Certificate Authority (CA) certificate. - * @since v15.6.0 - */ - readonly ca: boolean; - /** - * The SHA-1 fingerprint of this certificate. - * - * Because SHA-1 is cryptographically broken and because the security of SHA-1 is - * significantly worse than that of algorithms that are commonly used to sign - * certificates, consider using `x509.fingerprint256` instead. - * @since v15.6.0 - */ - readonly fingerprint: string; - /** - * The SHA-256 fingerprint of this certificate. - * @since v15.6.0 - */ - readonly fingerprint256: string; - /** - * The SHA-512 fingerprint of this certificate. - * - * Because computing the SHA-256 fingerprint is usually faster and because it is - * only half the size of the SHA-512 fingerprint, `x509.fingerprint256` may be - * a better choice. While SHA-512 presumably provides a higher level of security in - * general, the security of SHA-256 matches that of most algorithms that are - * commonly used to sign certificates. - * @since v17.2.0, v16.14.0 - */ - readonly fingerprint512: string; - /** - * The complete subject of this certificate. - * @since v15.6.0 - */ - readonly subject: string; - /** - * The subject alternative name specified for this certificate. - * - * This is a comma-separated list of subject alternative names. Each entry begins - * with a string identifying the kind of the subject alternative name followed by - * a colon and the value associated with the entry. - * - * Earlier versions of Node.js incorrectly assumed that it is safe to split this - * property at the two-character sequence `', '` (see [CVE-2021-44532](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532)). However, - * both malicious and legitimate certificates can contain subject alternative names - * that include this sequence when represented as a string. - * - * After the prefix denoting the type of the entry, the remainder of each entry - * might be enclosed in quotes to indicate that the value is a JSON string literal. - * For backward compatibility, Node.js only uses JSON string literals within this - * property when necessary to avoid ambiguity. Third-party code should be prepared - * to handle both possible entry formats. - * @since v15.6.0 - */ - readonly subjectAltName: string | undefined; - /** - * A textual representation of the certificate's authority information access - * extension. - * - * This is a line feed separated list of access descriptions. Each line begins with - * the access method and the kind of the access location, followed by a colon and - * the value associated with the access location. - * - * After the prefix denoting the access method and the kind of the access location, - * the remainder of each line might be enclosed in quotes to indicate that the - * value is a JSON string literal. For backward compatibility, Node.js only uses - * JSON string literals within this property when necessary to avoid ambiguity. - * Third-party code should be prepared to handle both possible entry formats. - * @since v15.6.0 - */ - readonly infoAccess: string | undefined; - /** - * An array detailing the key usages for this certificate. - * @since v15.6.0 - */ - readonly keyUsage: string[]; - /** - * The issuer identification included in this certificate. - * @since v15.6.0 - */ - readonly issuer: string; - /** - * The issuer certificate or `undefined` if the issuer certificate is not - * available. - * @since v15.9.0 - */ - readonly issuerCertificate?: X509Certificate | undefined; - /** - * The public key `KeyObject` for this certificate. - * @since v15.6.0 - */ - readonly publicKey: KeyObject; - /** - * A `Buffer` containing the DER encoding of this certificate. - * @since v15.6.0 - */ - readonly raw: Buffer; - /** - * The serial number of this certificate. - * - * Serial numbers are assigned by certificate authorities and do not uniquely - * identify certificates. Consider using `x509.fingerprint256` as a unique - * identifier instead. - * @since v15.6.0 - */ - readonly serialNumber: string; - /** - * The date/time from which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validFrom: string; - /** - * The date/time until which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validTo: string; - constructor(buffer: BinaryLike); - /** - * Checks whether the certificate matches the given email address. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any email addresses. - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching email - * address, the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns `email` if the certificate matches, `undefined` if it does not. - */ - checkEmail(email: string, options?: Pick): string | undefined; - /** - * Checks whether the certificate matches the given host name. - * - * If the certificate matches the given host name, the matching subject name is - * returned. The returned name might be an exact match (e.g., `foo.example.com`) - * or it might contain wildcards (e.g., `*.example.com`). Because host name - * comparisons are case-insensitive, the returned subject name might also differ - * from the given `name` in capitalization. - * - * If the `'subject'` option is undefined or set to `'default'`, the certificate - * subject is only considered if the subject alternative name extension either does - * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS"). - * - * If the `'subject'` option is set to `'always'` and if the subject alternative - * name extension either does not exist or does not contain a matching DNS name, - * the certificate subject is considered. - * - * If the `'subject'` option is set to `'never'`, the certificate subject is never - * considered, even if the certificate contains no subject alternative names. - * @since v15.6.0 - * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. - */ - checkHost(name: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether the certificate matches the given IP address (IPv4 or IPv6). - * - * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they - * must match the given `ip` address exactly. Other subject alternative names as - * well as the subject field of the certificate are ignored. - * @since v15.6.0 - * @return Returns `ip` if the certificate matches, `undefined` if it does not. - */ - checkIP(ip: string): string | undefined; - /** - * Checks whether this certificate was issued by the given `otherCert`. - * @since v15.6.0 - */ - checkIssued(otherCert: X509Certificate): boolean; - /** - * Checks whether the public key for this certificate is consistent with - * the given private key. - * @since v15.6.0 - * @param privateKey A private key. - */ - checkPrivateKey(privateKey: KeyObject): boolean; - /** - * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded - * certificate. - * @since v15.6.0 - */ - toJSON(): string; - /** - * Returns information about this certificate using the legacy `certificate object` encoding. - * @since v15.6.0 - */ - toLegacyObject(): PeerCertificate; - /** - * Returns the PEM-encoded certificate. - * @since v15.6.0 - */ - toString(): string; - /** - * Verifies that this certificate was signed by the given public key. - * Does not perform any other validation checks on the certificate. - * @since v15.6.0 - * @param publicKey A public key. - */ - verify(publicKey: KeyObject): boolean; - } - type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; - interface GeneratePrimeOptions { - add?: LargeNumberLike | undefined; - rem?: LargeNumberLike | undefined; - /** - * @default false - */ - safe?: boolean | undefined; - bigint?: boolean | undefined; - } - interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { - bigint: true; - } - interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { - bigint?: false | undefined; - } - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime( - size: number, - options: GeneratePrimeOptionsBigInt, - callback: (err: Error | null, prime: bigint) => void, - ): void; - function generatePrime( - size: number, - options: GeneratePrimeOptionsArrayBuffer, - callback: (err: Error | null, prime: ArrayBuffer) => void, - ): void; - function generatePrime( - size: number, - options: GeneratePrimeOptions, - callback: (err: Error | null, prime: ArrayBuffer | bigint) => void, - ): void; - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrimeSync(size: number): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; - interface CheckPrimeOptions { - /** - * The number of Miller-Rabin probabilistic primality iterations to perform. - * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input. - * Care must be used when selecting a number of checks. - * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. - * - * @default 0 - */ - checks?: number | undefined; - } - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - */ - function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; - function checkPrime( - value: LargeNumberLike, - options: CheckPrimeOptions, - callback: (err: Error | null, result: boolean) => void, - ): void; - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. - */ - function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; - /** - * Load and set the `engine` for some or all OpenSSL functions (selected by flags). - * - * `engine` could be either an id or a path to the engine's shared library. - * - * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`): - * - * * `crypto.constants.ENGINE_METHOD_RSA` - * * `crypto.constants.ENGINE_METHOD_DSA` - * * `crypto.constants.ENGINE_METHOD_DH` - * * `crypto.constants.ENGINE_METHOD_RAND` - * * `crypto.constants.ENGINE_METHOD_EC` - * * `crypto.constants.ENGINE_METHOD_CIPHERS` - * * `crypto.constants.ENGINE_METHOD_DIGESTS` - * * `crypto.constants.ENGINE_METHOD_PKEY_METHS` - * * `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS` - * * `crypto.constants.ENGINE_METHOD_ALL` - * * `crypto.constants.ENGINE_METHOD_NONE` - * @since v0.11.11 - * @param flags - */ - function setEngine(engine: string, flags?: number): void; - /** - * A convenient alias for {@link webcrypto.getRandomValues}. This - * implementation is not compliant with the Web Crypto spec, to write - * web-compatible code use {@link webcrypto.getRandomValues} instead. - * @since v17.4.0 - * @return Returns `typedArray`. - */ - function getRandomValues(typedArray: T): T; - /** - * A convenient alias for `crypto.webcrypto.subtle`. - * @since v17.4.0 - */ - const subtle: webcrypto.SubtleCrypto; - /** - * An implementation of the Web Crypto API standard. - * - * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details. - * @since v15.0.0 - */ - const webcrypto: webcrypto.Crypto; - namespace webcrypto { - type BufferSource = ArrayBufferView | ArrayBuffer; - type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki"; - type KeyType = "private" | "public" | "secret"; - type KeyUsage = - | "decrypt" - | "deriveBits" - | "deriveKey" - | "encrypt" - | "sign" - | "unwrapKey" - | "verify" - | "wrapKey"; - type AlgorithmIdentifier = Algorithm | string; - type HashAlgorithmIdentifier = AlgorithmIdentifier; - type NamedCurve = string; - type BigInteger = Uint8Array; - interface AesCbcParams extends Algorithm { - iv: BufferSource; - } - interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; - } - interface AesDerivedKeyParams extends Algorithm { - length: number; - } - interface AesGcmParams extends Algorithm { - additionalData?: BufferSource; - iv: BufferSource; - tagLength?: number; - } - interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; - } - interface AesKeyGenParams extends Algorithm { - length: number; - } - interface Algorithm { - name: string; - } - interface EcKeyAlgorithm extends KeyAlgorithm { - namedCurve: NamedCurve; - } - interface EcKeyGenParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcKeyImportParams extends Algorithm { - namedCurve: NamedCurve; - } - interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; - } - interface EcdsaParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface Ed448Params extends Algorithm { - context?: BufferSource; - } - interface HkdfParams extends Algorithm { - hash: HashAlgorithmIdentifier; - info: BufferSource; - salt: BufferSource; - } - interface HmacImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: KeyAlgorithm; - length: number; - } - interface HmacKeyGenParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; - } - interface JsonWebKey { - alg?: string; - crv?: string; - d?: string; - dp?: string; - dq?: string; - e?: string; - ext?: boolean; - k?: string; - key_ops?: string[]; - kty?: string; - n?: string; - oth?: RsaOtherPrimesInfo[]; - p?: string; - q?: string; - qi?: string; - use?: string; - x?: string; - y?: string; - } - interface KeyAlgorithm { - name: string; - } - interface Pbkdf2Params extends Algorithm { - hash: HashAlgorithmIdentifier; - iterations: number; - salt: BufferSource; - } - interface RsaHashedImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - } - interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: KeyAlgorithm; - } - interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: HashAlgorithmIdentifier; - } - interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: BigInteger; - } - interface RsaOaepParams extends Algorithm { - label?: BufferSource; - } - interface RsaOtherPrimesInfo { - d?: string; - r?: string; - t?: string; - } - interface RsaPssParams extends Algorithm { - saltLength: number; - } - /** - * Importing the `webcrypto` object (`import { webcrypto } from 'node:crypto'`) gives an instance of the `Crypto` class. - * `Crypto` is a singleton that provides access to the remainder of the crypto API. - * @since v15.0.0 - */ - interface Crypto { - /** - * Provides access to the `SubtleCrypto` API. - * @since v15.0.0 - */ - readonly subtle: SubtleCrypto; - /** - * Generates cryptographically strong random values. - * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. - * - * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. - * - * An error will be thrown if the given `typedArray` is larger than 65,536 bytes. - * @since v15.0.0 - */ - getRandomValues>(typedArray: T): T; - /** - * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID. - * The UUID is generated using a cryptographic pseudorandom number generator. - * @since v16.7.0 - */ - randomUUID(): UUID; - CryptoKey: CryptoKeyConstructor; - } - // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable. - interface CryptoKeyConstructor { - /** Illegal constructor */ - (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user. - readonly length: 0; - readonly name: "CryptoKey"; - readonly prototype: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface CryptoKey { - /** - * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. - * @since v15.0.0 - */ - readonly algorithm: KeyAlgorithm; - /** - * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`. - * @since v15.0.0 - */ - readonly extractable: boolean; - /** - * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. - * @since v15.0.0 - */ - readonly type: KeyType; - /** - * An array of strings identifying the operations for which the key may be used. - * - * The possible usages are: - * - `'encrypt'` - The key may be used to encrypt data. - * - `'decrypt'` - The key may be used to decrypt data. - * - `'sign'` - The key may be used to generate digital signatures. - * - `'verify'` - The key may be used to verify digital signatures. - * - `'deriveKey'` - The key may be used to derive a new key. - * - `'deriveBits'` - The key may be used to derive bits. - * - `'wrapKey'` - The key may be used to wrap another key. - * - `'unwrapKey'` - The key may be used to unwrap another key. - * - * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). - * @since v15.0.0 - */ - readonly usages: KeyUsage[]; - } - /** - * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. - * @since v15.0.0 - */ - interface CryptoKeyPair { - /** - * A {@link CryptoKey} whose type will be `'private'`. - * @since v15.0.0 - */ - privateKey: CryptoKey; - /** - * A {@link CryptoKey} whose type will be `'public'`. - * @since v15.0.0 - */ - publicKey: CryptoKey; - } - /** - * @since v15.0.0 - */ - interface SubtleCrypto { - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `key`, - * `subtle.decrypt()` attempts to decipher the provided `data`. If successful, - * the returned promise will be resolved with an `` containing the plaintext result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - decrypt( - algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, - * `subtle.deriveBits()` attempts to generate `length` bits. - * The Node.js implementation requires that when `length` is a number it must be multiple of `8`. - * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed - * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms. - * If successful, the returned promise will be resolved with an `` containing the generated data. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @since v15.0.0 - */ - deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise; - deriveBits( - algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - length: number, - ): Promise; - /** - * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, - * `subtle.deriveKey()` attempts to generate a new ` based on the method and parameters in `derivedKeyAlgorithm`. - * - * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material, - * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. - * - * The algorithms currently supported include: - * - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HKDF'` - * - `'PBKDF2'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - deriveKey( - algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, - baseKey: CryptoKey, - derivedKeyAlgorithm: - | AlgorithmIdentifier - | AesDerivedKeyParams - | HmacImportParams - | HkdfParams - | Pbkdf2Params, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - /** - * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. - * If successful, the returned promise is resolved with an `` containing the computed digest. - * - * If `algorithm` is provided as a ``, it must be one of: - * - * - `'SHA-1'` - * - `'SHA-256'` - * - `'SHA-384'` - * - `'SHA-512'` - * - * If `algorithm` is provided as an ``, it must have a `name` property whose value is one of the above. - * @since v15.0.0 - */ - digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; - /** - * Using the method and parameters specified by `algorithm` and the keying material provided by `key`, - * `subtle.encrypt()` attempts to encipher `data`. If successful, - * the returned promise is resolved with an `` containing the encrypted result. - * - * The algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * @since v15.0.0 - */ - encrypt( - algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * Exports the given key into the specified format, if supported. - * - * If the `` is not extractable, the returned promise will reject. - * - * When `format` is either `'pkcs8'` or `'spki'` and the export is successful, - * the returned promise will be resolved with an `` containing the exported key data. - * - * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a - * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @returns `` containing ``. - * @since v15.0.0 - */ - exportKey(format: "jwk", key: CryptoKey): Promise; - exportKey(format: Exclude, key: CryptoKey): Promise; - /** - * Using the method and parameters provided in `algorithm`, - * `subtle.generateKey()` attempts to generate new keying material. - * Depending the method used, the method may generate either a single `` or a ``. - * - * The `` (public and private key) generating algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * The `` (secret key) generating algorithms supported include: - * - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - generateKey( - algorithm: RsaHashedKeyGenParams | EcKeyGenParams, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - generateKey( - algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - generateKey( - algorithm: AlgorithmIdentifier, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format` - * to create a `` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments. - * If the import is successful, the returned promise will be resolved with the created ``. - * - * If importing a `'PBKDF2'` key, `extractable` must be `false`. - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - importKey( - format: "jwk", - keyData: JsonWebKey, - algorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: readonly KeyUsage[], - ): Promise; - importKey( - format: Exclude, - keyData: BufferSource, - algorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * Using the method and parameters given by `algorithm` and the keying material provided by `key`, - * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful, - * the returned promise is resolved with an `` containing the generated signature. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - sign( - algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, - key: CryptoKey, - data: BufferSource, - ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `` instance. - * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) - * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. - * If successful, the returned promise is resolved with a `` object. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * - * The unwrapped key algorithms supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'RSA-OAEP'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'ECDH'` - * - `'X25519'` - * - `'X448'` - * - `'HMAC'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. - * @since v15.0.0 - */ - unwrapKey( - format: KeyFormat, - wrappedKey: BufferSource, - unwrappingKey: CryptoKey, - unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - unwrappedKeyAlgorithm: - | AlgorithmIdentifier - | RsaHashedImportParams - | EcKeyImportParams - | HmacImportParams - | AesKeyAlgorithm, - extractable: boolean, - keyUsages: KeyUsage[], - ): Promise; - /** - * Using the method and parameters given in `algorithm` and the keying material provided by `key`, - * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`. - * The returned promise is resolved with either `true` or `false`. - * - * The algorithms currently supported include: - * - * - `'RSASSA-PKCS1-v1_5'` - * - `'RSA-PSS'` - * - `'ECDSA'` - * - `'Ed25519'` - * - `'Ed448'` - * - `'HMAC'` - * @since v15.0.0 - */ - verify( - algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, - key: CryptoKey, - signature: BufferSource, - data: BufferSource, - ): Promise; - /** - * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. - * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`, - * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. - * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments, - * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs. - * If successful, the returned promise will be resolved with an `` containing the encrypted key data. - * - * The wrapping algorithms currently supported include: - * - * - `'RSA-OAEP'` - * - `'AES-CTR'` - * - `'AES-CBC'` - * - `'AES-GCM'` - * - `'AES-KW'` - * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. - * @since v15.0.0 - */ - wrapKey( - format: KeyFormat, - key: CryptoKey, - wrappingKey: CryptoKey, - wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, - ): Promise; - } - } - - global { - var crypto: typeof globalThis extends { - crypto: infer T; - onmessage: any; - } ? T - : webcrypto.Crypto; - } -} -declare module "node:crypto" { - export * from "crypto"; -} diff --git a/node_modules/@types/node/dgram.d.ts b/node_modules/@types/node/dgram.d.ts deleted file mode 100644 index 8c2ac9b..0000000 --- a/node_modules/@types/node/dgram.d.ts +++ /dev/null @@ -1,596 +0,0 @@ -/** - * The `node:dgram` module provides an implementation of UDP datagram sockets. - * - * ```js - * import dgram from 'node:dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.error(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/dgram.js) - */ -declare module "dgram" { - import { AddressInfo } from "node:net"; - import * as dns from "node:dns"; - import { Abortable, EventEmitter } from "node:events"; - interface RemoteInfo { - address: string; - family: "IPv4" | "IPv6"; - port: number; - size: number; - } - interface BindOptions { - port?: number | undefined; - address?: string | undefined; - exclusive?: boolean | undefined; - fd?: number | undefined; - } - type SocketType = "udp4" | "udp6"; - interface SocketOptions extends Abortable { - type: SocketType; - reuseAddr?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - recvBufferSize?: number | undefined; - sendBufferSize?: number | undefined; - lookup?: - | (( - hostname: string, - options: dns.LookupOneOptions, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ) => void) - | undefined; - } - /** - * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram - * messages. When `address` and `port` are not passed to `socket.bind()` the - * method will bind the socket to the "all interfaces" address on a random port - * (it does the right thing for both `udp4` and `udp6` sockets). The bound address - * and port can be retrieved using `socket.address().address` and `socket.address().port`. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.close()` on the socket: - * - * ```js - * const controller = new AbortController(); - * const { signal } = controller; - * const server = dgram.createSocket({ type: 'udp4', signal }); - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * // Later, when you want to close the server. - * controller.abort(); - * ``` - * @since v0.11.13 - * @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; - /** - * Encapsulates the datagram functionality. - * - * New instances of `dgram.Socket` are created using {@link createSocket}. - * The `new` keyword is not to be used to create `dgram.Socket` instances. - * @since v0.1.99 - */ - class Socket extends EventEmitter { - /** - * Tells the kernel to join a multicast group at the given `multicastAddress` and `multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the `multicastInterface` argument is not - * specified, the operating system will choose - * one interface and will add membership to it. To add membership to every - * available interface, call `addMembership` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * - * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: - * - * ```js - * import cluster from 'node:cluster'; - * import dgram from 'node:dgram'; - * - * if (cluster.isPrimary) { - * cluster.fork(); // Works ok. - * cluster.fork(); // Fails with EADDRINUSE. - * } else { - * const s = dgram.createSocket('udp4'); - * s.bind(1234, () => { - * s.addMembership('224.0.0.114'); - * }); - * } - * ``` - * @since v0.6.9 - */ - addMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * Returns an object containing the address information for a socket. - * For UDP sockets, this object will contain `address`, `family`, and `port` properties. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.99 - */ - address(): AddressInfo; - /** - * For UDP sockets, causes the `dgram.Socket` to listen for datagram - * messages on a named `port` and optional `address`. If `port` is not - * specified or is `0`, the operating system will attempt to bind to a - * random port. If `address` is not specified, the operating system will - * attempt to listen on all addresses. Once binding is complete, a `'listening'` event is emitted and the optional `callback` function is - * called. - * - * Specifying both a `'listening'` event listener and passing a `callback` to the `socket.bind()` method is not harmful but not very - * useful. - * - * A bound datagram socket keeps the Node.js process running to receive - * datagram messages. - * - * If binding fails, an `'error'` event is generated. In rare case (e.g. - * attempting to bind with a closed socket), an `Error` may be thrown. - * - * Example of a UDP server listening on port 41234: - * - * ```js - * import dgram from 'node:dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.error(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @since v0.1.99 - * @param callback with no parameters. Called when binding is complete. - */ - bind(port?: number, address?: string, callback?: () => void): this; - bind(port?: number, callback?: () => void): this; - bind(callback?: () => void): this; - bind(options: BindOptions, callback?: () => void): this; - /** - * Close the underlying socket and stop listening for data on it. If a callback is - * provided, it is added as a listener for the `'close'` event. - * @since v0.1.99 - * @param callback Called when the socket has been closed. - */ - close(callback?: () => void): this; - /** - * Associates the `dgram.Socket` to a remote address and port. Every - * message sent by this handle is automatically sent to that destination. Also, - * the socket will only receive messages from that remote peer. - * Trying to call `connect()` on an already connected socket will result - * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not - * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) - * will be used by default. Once the connection is complete, a `'connect'` event - * is emitted and the optional `callback` function is called. In case of failure, - * the `callback` is called or, failing this, an `'error'` event is emitted. - * @since v12.0.0 - * @param callback Called when the connection is completed or on error. - */ - connect(port: number, address?: string, callback?: () => void): void; - connect(port: number, callback: () => void): void; - /** - * A synchronous function that disassociates a connected `dgram.Socket` from - * its remote address. Trying to call `disconnect()` on an unbound or already - * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. - * @since v12.0.0 - */ - disconnect(): void; - /** - * Instructs the kernel to leave a multicast group at `multicastAddress` using the `IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the - * kernel when the socket is closed or the process terminates, so most apps will - * never have reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v0.6.9 - */ - dropMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_RCVBUF` socket receive buffer size in bytes. - */ - getRecvBufferSize(): number; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_SNDBUF` socket send buffer size in bytes. - */ - getSendBufferSize(): number; - /** - * @since v18.8.0, v16.19.0 - * @return Number of bytes queued for sending. - */ - getSendQueueSize(): number; - /** - * @since v18.8.0, v16.19.0 - * @return Number of send requests currently in the queue awaiting to be processed. - */ - getSendQueueCount(): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active. The `socket.ref()` method adds the socket back to the reference - * counting and restores the default behavior. - * - * Calling `socket.ref()` multiples times will have no additional effect. - * - * The `socket.ref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - ref(): this; - /** - * Returns an object containing the `address`, `family`, and `port` of the remote - * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception - * if the socket is not connected. - * @since v12.0.0 - */ - remoteAddress(): AddressInfo; - /** - * Broadcasts a datagram on the socket. - * For connectionless sockets, the destination `port` and `address` must be - * specified. Connected sockets, on the other hand, will use their associated - * remote endpoint, so the `port` and `address` arguments must not be set. - * - * The `msg` argument contains the message to be sent. - * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, - * any `TypedArray` or a `DataView`, - * the `offset` and `length` specify the offset within the `Buffer` where the - * message begins and the number of bytes in the message, respectively. - * If `msg` is a `String`, then it is automatically converted to a `Buffer` with `'utf8'` encoding. With messages that - * contain multi-byte characters, `offset` and `length` will be calculated with - * respect to `byte length` and not the character position. - * If `msg` is an array, `offset` and `length` must not be specified. - * - * The `address` argument is a string. If the value of `address` is a host name, - * DNS will be used to resolve the address of the host. If `address` is not - * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) will be used by default. - * - * If the socket has not been previously bound with a call to `bind`, the socket - * is assigned a random port number and is bound to the "all interfaces" address - * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) - * - * An optional `callback` function may be specified to as a way of reporting - * DNS errors or for determining when it is safe to reuse the `buf` object. - * DNS lookups delay the time to send for at least one tick of the - * Node.js event loop. - * - * The only way to know for sure that the datagram has been sent is by using a `callback`. If an error occurs and a `callback` is given, the error will be - * passed as the first argument to the `callback`. If a `callback` is not given, - * the error is emitted as an `'error'` event on the `socket` object. - * - * Offset and length are optional but both _must_ be set if either are used. - * They are supported only when the first argument is a `Buffer`, a `TypedArray`, - * or a `DataView`. - * - * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. - * - * Example of sending a UDP packet to a port on `localhost`; - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.send(message, 41234, 'localhost', (err) => { - * client.close(); - * }); - * ``` - * - * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const buf1 = Buffer.from('Some '); - * const buf2 = Buffer.from('bytes'); - * const client = dgram.createSocket('udp4'); - * client.send([buf1, buf2], 41234, (err) => { - * client.close(); - * }); - * ``` - * - * Sending multiple buffers might be faster or slower depending on the - * application and operating system. Run benchmarks to - * determine the optimal strategy on a case-by-case basis. Generally speaking, - * however, sending multiple buffers is faster. - * - * Example of sending a UDP packet using a socket connected to a port on `localhost`: - * - * ```js - * import dgram from 'node:dgram'; - * import { Buffer } from 'node:buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.connect(41234, 'localhost', (err) => { - * client.send(message, (err) => { - * client.close(); - * }); - * }); - * ``` - * @since v0.1.99 - * @param msg Message to be sent. - * @param offset Offset in the buffer where the message starts. - * @param length Number of bytes in the message. - * @param port Destination port. - * @param address Destination host name or IP address. - * @param callback Called when the message has been sent. - */ - send( - msg: string | Uint8Array | readonly any[], - port?: number, - address?: string, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array | readonly any[], - port?: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array | readonly any[], - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - port?: number, - address?: string, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - port?: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - send( - msg: string | Uint8Array, - offset: number, - length: number, - callback?: (error: Error | null, bytes: number) => void, - ): void; - /** - * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP - * packets may be sent to a local interface's broadcast address. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.6.9 - */ - setBroadcast(flag: boolean): void; - /** - * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC - * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ - * _with a scope index is written as `'IP%scope'` where scope is an interface name_ - * _or interface number._ - * - * Sets the default outgoing multicast interface of the socket to a chosen - * interface or back to system interface selection. The `multicastInterface` must - * be a valid string representation of an IP from the socket's family. - * - * For IPv4 sockets, this should be the IP configured for the desired physical - * interface. All packets sent to multicast on the socket will be sent on the - * interface determined by the most recent successful use of this call. - * - * For IPv6 sockets, `multicastInterface` should include a scope to indicate the - * interface as in the examples that follow. In IPv6, individual `send` calls can - * also use explicit scope in addresses, so only packets sent to a multicast - * address without specifying an explicit scope are affected by the most recent - * successful use of this call. - * - * This method throws `EBADF` if called on an unbound socket. - * - * #### Example: IPv6 outgoing multicast interface - * - * On most systems, where scope format uses the interface name: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%eth1'); - * }); - * ``` - * - * On Windows, where scope format uses an interface number: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%2'); - * }); - * ``` - * - * #### Example: IPv4 outgoing multicast interface - * - * All systems use an IP of the host on the desired physical interface: - * - * ```js - * const socket = dgram.createSocket('udp4'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('10.0.0.2'); - * }); - * ``` - * @since v8.6.0 - */ - setMulticastInterface(multicastInterface: string): void; - /** - * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, - * multicast packets will also be received on the local interface. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastLoopback(flag: boolean): boolean; - /** - * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for - * "Time to Live", in this context it specifies the number of IP hops that a - * packet is allowed to travel through, specifically for multicast traffic. Each - * router or gateway that forwards a packet decrements the TTL. If the TTL is - * decremented to 0 by a router, it will not be forwarded. - * - * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastTTL(ttl: number): number; - /** - * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setRecvBufferSize(size: number): void; - /** - * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setSendBufferSize(size: number): void; - /** - * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", - * in this context it specifies the number of IP hops that a packet is allowed to - * travel through. Each router or gateway that forwards a packet decrements the - * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. - * Changing TTL values is typically done for network probes or when multicasting. - * - * The `ttl` argument may be between 1 and 255\. The default on most systems - * is 64. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.101 - */ - setTTL(ttl: number): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active, allowing the process to exit even if the socket is still - * listening. - * - * Calling `socket.unref()` multiple times will have no additional effect. - * - * The `socket.unref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - unref(): this; - /** - * Tells the kernel to join a source-specific multicast channel at the given `sourceAddress` and `groupAddress`, using the `multicastInterface` with the `IP_ADD_SOURCE_MEMBERSHIP` socket - * option. If the `multicastInterface` argument - * is not specified, the operating system will choose one interface and will add - * membership to it. To add membership to every available interface, call `socket.addSourceSpecificMembership()` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * @since v13.1.0, v12.16.0 - */ - addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * Instructs the kernel to leave a source-specific multicast channel at the given `sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP` socket option. This method is - * automatically called by the kernel when the - * socket is closed or the process terminates, so most apps will never have - * reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v13.1.0, v12.16.0 - */ - dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. error - * 4. listening - * 5. message - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - 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; - 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; - 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; - 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; - 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; - 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; - /** - * Calls `socket.close()` and returns a promise that fulfills when the socket has closed. - * @since v20.5.0 - */ - [Symbol.asyncDispose](): Promise; - } -} -declare module "node:dgram" { - export * from "dgram"; -} diff --git a/node_modules/@types/node/diagnostics_channel.d.ts b/node_modules/@types/node/diagnostics_channel.d.ts deleted file mode 100644 index 1cc7486..0000000 --- a/node_modules/@types/node/diagnostics_channel.d.ts +++ /dev/null @@ -1,554 +0,0 @@ -/** - * The `node:diagnostics_channel` module provides an API to create named channels - * to report arbitrary message data for diagnostics purposes. - * - * It can be accessed using: - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * ``` - * - * It is intended that a module writer wanting to report diagnostics messages - * will create one or many top-level channels to report messages through. - * Channels may also be acquired at runtime but it is not encouraged - * due to the additional overhead of doing so. Channels may be exported for - * convenience, but as long as the name is known it can be acquired anywhere. - * - * If you intend for your module to produce diagnostics data for others to - * consume it is recommended that you include documentation of what named - * channels are used along with the shape of the message data. Channel names - * 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/v22.x/lib/diagnostics_channel.js) - */ -declare module "diagnostics_channel" { - import { AsyncLocalStorage } from "node:async_hooks"; - /** - * Check if there are active subscribers to the named channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * if (diagnostics_channel.hasSubscribers('my-channel')) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return If there are active subscribers - */ - function hasSubscribers(name: string | symbol): boolean; - /** - * This is the primary entry-point for anyone wanting to publish to a named - * channel. It produces a channel object which is optimized to reduce overhead at - * publish time as much as possible. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * ``` - * @since v15.1.0, v14.17.0 - * @param name The channel name - * @return The named channel object - */ - function channel(name: string | symbol): Channel; - type ChannelListener = (message: unknown, name: string | symbol) => void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * diagnostics_channel.subscribe('my-channel', (message, name) => { - * // Received data - * }); - * ``` - * @since v18.7.0, v16.17.0 - * @param name The channel name - * @param onMessage The handler to receive channel messages - */ - function subscribe(name: string | symbol, onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with {@link subscribe}. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * function onMessage(message, name) { - * // Received data - * } - * - * diagnostics_channel.subscribe('my-channel', onMessage); - * - * diagnostics_channel.unsubscribe('my-channel', onMessage); - * ``` - * @since v18.7.0, v16.17.0 - * @param name The channel name - * @param onMessage The previous subscribed handler to remove - * @return `true` if the handler was found, `false` otherwise. - */ - function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean; - /** - * Creates a `TracingChannel` wrapper for the given `TracingChannel Channels`. If a name is given, the corresponding tracing - * channels will be created in the form of `tracing:${name}:${eventType}` where `eventType` corresponds to the types of `TracingChannel Channels`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channelsByName = diagnostics_channel.tracingChannel('my-channel'); - * - * // or... - * - * const channelsByCollection = diagnostics_channel.tracingChannel({ - * start: diagnostics_channel.channel('tracing:my-channel:start'), - * end: diagnostics_channel.channel('tracing:my-channel:end'), - * asyncStart: diagnostics_channel.channel('tracing:my-channel:asyncStart'), - * asyncEnd: diagnostics_channel.channel('tracing:my-channel:asyncEnd'), - * error: diagnostics_channel.channel('tracing:my-channel:error'), - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param nameOrChannels Channel name or object containing all the `TracingChannel Channels` - * @return Collection of channels to trace with - */ - function tracingChannel< - StoreType = unknown, - ContextType extends object = StoreType extends object ? StoreType : object, - >( - nameOrChannels: string | TracingChannelCollection, - ): TracingChannel; - /** - * The class `Channel` represents an individual named channel within the data - * pipeline. It is used to track subscribers and to publish messages when there - * are subscribers present. It exists as a separate object to avoid channel - * lookups at publish time, enabling very fast publish speeds and allowing - * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly - * with `new Channel(name)` is not supported. - * @since v15.1.0, v14.17.0 - */ - class Channel { - readonly name: string | symbol; - /** - * Check if there are active subscribers to this channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * if (channel.hasSubscribers) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @since v15.1.0, v14.17.0 - */ - readonly hasSubscribers: boolean; - private constructor(name: string | symbol); - /** - * Publish a message to any subscribers to the channel. This will trigger - * message handlers synchronously so they will execute within the same context. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.publish({ - * some: 'message', - * }); - * ``` - * @since v15.1.0, v14.17.0 - * @param message The message to send to the channel subscribers - */ - publish(message: unknown): void; - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.subscribe((message, name) => { - * // Received data - * }); - * ``` - * @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; - /** - * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * function onMessage(message, name) { - * // Received data - * } - * - * channel.subscribe(onMessage); - * - * 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. - */ - unsubscribe(onMessage: ChannelListener): void; - /** - * When `channel.runStores(context, ...)` is called, the given context data - * will be applied to any store bound to the channel. If the store has already been - * bound the previous `transform` function will be replaced with the new one. - * The `transform` function may be omitted to set the given context data as the - * context directly. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store, (data) => { - * return { data }; - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param store The store to which to bind the context data - * @param transform Transform context data before setting the store context - */ - bindStore(store: AsyncLocalStorage, transform?: (context: ContextType) => StoreType): void; - /** - * Remove a message handler previously registered to this channel with `channel.bindStore(store)`. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store); - * channel.unbindStore(store); - * ``` - * @since v19.9.0 - * @experimental - * @param store The store to unbind from the channel. - * @return `true` if the store was found, `false` otherwise. - */ - unbindStore(store: any): void; - /** - * 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 - * the scope of that data is applied to the stores. - * - * If a transform function was given to `channel.bindStore(store)` it will be - * applied to transform the message data before it becomes the context value for - * the store. The prior storage context is accessible from within the transform - * function in cases where context linking is required. - * - * The context applied to the store should be accessible in any async code which - * continues from execution which began during the given function, however - * there are some situations in which `context loss` may occur. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const store = new AsyncLocalStorage(); - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.bindStore(store, (message) => { - * const parent = store.getStore(); - * return new Span(message, parent); - * }); - * channel.runStores({ some: 'message' }, () => { - * store.getStore(); // Span({ some: 'message' }) - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param context Message to send to subscribers and bind to stores - * @param fn Handler to run within the entered storage context - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runStores(): void; - } - interface TracingChannelSubscribers { - start: (message: ContextType) => void; - end: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - asyncStart: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - asyncEnd: ( - message: ContextType & { - error?: unknown; - result?: unknown; - }, - ) => void; - error: ( - message: ContextType & { - error: unknown; - }, - ) => void; - } - interface TracingChannelCollection { - start: Channel; - end: Channel; - asyncStart: Channel; - asyncEnd: Channel; - error: Channel; - } - /** - * The class `TracingChannel` is a collection of `TracingChannel Channels` which - * together express a single traceable action. It is used to formalize and - * simplify the process of producing events for tracing application flow. {@link tracingChannel} is used to construct a `TracingChannel`. As with `Channel` it is recommended to create and reuse a - * single `TracingChannel` at the top-level of the file rather than creating them - * dynamically. - * @since v19.9.0 - * @experimental - */ - class TracingChannel implements TracingChannelCollection { - start: Channel; - end: Channel; - asyncStart: Channel; - asyncEnd: Channel; - error: Channel; - /** - * Helper to subscribe a collection of functions to the corresponding channels. - * This is the same as calling `channel.subscribe(onMessage)` on each channel - * individually. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.subscribe({ - * start(message) { - * // Handle start message - * }, - * end(message) { - * // Handle end message - * }, - * asyncStart(message) { - * // Handle asyncStart message - * }, - * asyncEnd(message) { - * // Handle asyncEnd message - * }, - * error(message) { - * // Handle error message - * }, - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param subscribers Set of `TracingChannel Channels` subscribers - */ - subscribe(subscribers: TracingChannelSubscribers): void; - /** - * Helper to unsubscribe a collection of functions from the corresponding channels. - * This is the same as calling `channel.unsubscribe(onMessage)` on each channel - * individually. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.unsubscribe({ - * start(message) { - * // Handle start message - * }, - * end(message) { - * // Handle end message - * }, - * asyncStart(message) { - * // Handle asyncStart message - * }, - * asyncEnd(message) { - * // Handle asyncEnd message - * }, - * error(message) { - * // Handle error message - * }, - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param subscribers Set of `TracingChannel Channels` subscribers - * @return `true` if all handlers were successfully unsubscribed, and `false` otherwise. - */ - unsubscribe(subscribers: TracingChannelSubscribers): void; - /** - * Trace a synchronous function call. This will always produce a `start event` and `end event` around the execution and may produce an `error event` if the given function throws an error. - * This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions - * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.traceSync(() => { - * // Do something - * }, { - * some: 'thing', - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn Function to wrap a trace around - * @param context Shared object to correlate events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return The return value of the given function - */ - traceSync( - fn: (this: ThisArg, ...args: Args) => any, - context?: ContextType, - thisArg?: ThisArg, - ...args: Args - ): void; - /** - * 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 - * produce an `error event` if the given function throws an error or the - * returned promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions - * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.tracePromise(async () => { - * // Do something - * }, { - * some: 'thing', - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn Promise-returning function to wrap a trace around - * @param context Shared object to correlate trace events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return Chained from promise returned by the given function - */ - tracePromise( - fn: (this: ThisArg, ...args: Args) => Promise, - context?: ContextType, - thisArg?: ThisArg, - ...args: Args - ): void; - /** - * 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 - * the returned - * promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all - * events should have any bound stores set to match this trace context. - * - * The `position` will be -1 by default to indicate the final argument should - * be used as the callback. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * - * channels.traceCallback((arg1, callback) => { - * // Do something - * callback(null, 'result'); - * }, 1, { - * some: 'thing', - * }, thisArg, arg1, callback); - * ``` - * - * The callback will also be run with `channel.runStores(context, ...)` which - * enables context loss recovery in some cases. - * - * To ensure only correct trace graphs are formed, events will only be published if subscribers are present prior to starting the trace. Subscriptions - * which are added after the trace begins will not receive future events from that trace, only future traces will be seen. - * - * ```js - * import diagnostics_channel from 'node:diagnostics_channel'; - * import { AsyncLocalStorage } from 'node:async_hooks'; - * - * const channels = diagnostics_channel.tracingChannel('my-channel'); - * const myStore = new AsyncLocalStorage(); - * - * // The start channel sets the initial store data to something - * // and stores that store data value on the trace context object - * channels.start.bindStore(myStore, (data) => { - * const span = new Span(data); - * data.span = span; - * return span; - * }); - * - * // Then asyncStart can restore from that data it stored previously - * channels.asyncStart.bindStore(myStore, (data) => { - * return data.span; - * }); - * ``` - * @since v19.9.0 - * @experimental - * @param fn callback using function to wrap a trace around - * @param position Zero-indexed argument position of expected callback - * @param context Shared object to correlate trace events through - * @param thisArg The receiver to be used for the function call - * @param args Optional arguments to pass to the function - * @return The return value of the given function - */ - traceCallback any>( - fn: Fn, - position?: number, - context?: ContextType, - thisArg?: any, - ...args: Parameters - ): void; - } -} -declare module "node:diagnostics_channel" { - export * from "diagnostics_channel"; -} diff --git a/node_modules/@types/node/dns.d.ts b/node_modules/@types/node/dns.d.ts deleted file mode 100644 index af10fd9..0000000 --- a/node_modules/@types/node/dns.d.ts +++ /dev/null @@ -1,865 +0,0 @@ -/** - * The `node:dns` module enables name resolution. For example, use it to look up IP - * addresses of host names. - * - * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the - * DNS protocol for lookups. {@link lookup} uses the operating system - * facilities to perform name resolution. It may not need to perform any network - * communication. To perform name resolution the way other applications on the same - * system do, use {@link lookup}. - * - * ```js - * import dns from 'node:dns'; - * - * dns.lookup('example.org', (err, address, family) => { - * console.log('address: %j family: IPv%s', address, family); - * }); - * // address: "93.184.216.34" family: IPv4 - * ``` - * - * All other functions in the `node:dns` module connect to an actual DNS server to - * perform name resolution. They will always use the network to perform DNS - * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform - * DNS queries, bypassing other name-resolution facilities. - * - * ```js - * import dns from 'node:dns'; - * - * dns.resolve4('archive.org', (err, addresses) => { - * if (err) throw err; - * - * console.log(`addresses: ${JSON.stringify(addresses)}`); - * - * addresses.forEach((a) => { - * dns.reverse(a, (err, hostnames) => { - * if (err) { - * throw err; - * } - * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); - * }); - * }); - * }); - * ``` - * - * See the [Implementation considerations section](https://nodejs.org/docs/latest-v22.x/api/dns.html#implementation-considerations) for more information. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/dns.js) - */ -declare module "dns" { - import * as dnsPromises from "node:dns/promises"; - // Supported getaddrinfo flags. - /** - * Limits returned address types to the types of non-loopback addresses configured on the system. For example, IPv4 addresses are - * only returned if the current system has at least one IPv4 address configured. - */ - export const ADDRCONFIG: number; - /** - * If the IPv6 family was specified, but no IPv6 addresses were found, then return IPv4 mapped IPv6 addresses. It is not supported - * on some operating systems (e.g. FreeBSD 10.1). - */ - export const V4MAPPED: number; - /** - * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as - * well as IPv4 mapped IPv6 addresses. - */ - export const ALL: number; - export interface LookupOptions { - /** - * The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons, `'IPv4'` and `'IPv6'` are interpreted - * as `4` and `6` respectively. The value 0 indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used - * with `{ all: true } (see below)`, both IPv4 and IPv6 addresses are returned. - * @default 0 - */ - family?: number | "IPv4" | "IPv6" | undefined; - /** - * One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v22.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be - * passed by bitwise `OR`ing their values. - */ - hints?: number | undefined; - /** - * When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address. - * @default false - */ - all?: boolean | undefined; - /** - * 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-v22.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} - * @default true (addresses are not reordered) - * @deprecated Please use `order` option - */ - verbatim?: boolean | undefined; - } - export interface LookupOneOptions extends LookupOptions { - all?: false | undefined; - } - export interface LookupAllOptions extends LookupOptions { - all: true; - } - export interface LookupAddress { - /** - * A string representation of an IPv4 or IPv6 address. - */ - address: string; - /** - * `4` or `6`, denoting the family of `address`, or `0` if the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a - * bug in the name resolution service used by the operating system. - */ - family: number; - } - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is `0` or not provided, then - * IPv4 and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the arguments for `callback` change to `(err, addresses)`, with `addresses` being an array of objects with the - * properties `address` and `family`. - * - * On error, `err` is an `Error` object, where `err.code` is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. - * 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-v22.x/api/dns.html#implementation-considerations) - * before using `dns.lookup()`. - * - * Example usage: - * - * ```js - * import dns from 'node:dns'; - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * dns.lookup('example.com', options, (err, address, family) => - * console.log('address: %j family: IPv%s', address, family)); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dns.lookup('example.com', options, (err, addresses) => - * console.log('addresses: %j', addresses)); - * // 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-v22.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 - */ - export function lookup( - hostname: string, - family: number, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export function lookup( - hostname: string, - options: LookupOneOptions, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export function lookup( - hostname: string, - options: LookupAllOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void, - ): void; - export function lookup( - hostname: string, - options: LookupOptions, - callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void, - ): void; - export function lookup( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, - ): void; - export namespace lookup { - function __promisify__(hostname: string, options: LookupAllOptions): Promise; - function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; - function __promisify__(hostname: string, options: LookupOptions): Promise; - } - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * 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-v22.x/api/errors.html#class-error) object, - * where `err.code` is the error code. - * - * ```js - * 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-v22.x/api/util.html#utilpromisifyoriginal) ed - * version, it returns a `Promise` for an `Object` with `hostname` and `service` properties. - * @since v0.11.14 - */ - export function lookupService( - address: string, - port: number, - callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void, - ): void; - export namespace lookupService { - function __promisify__( - address: string, - port: number, - ): Promise<{ - hostname: string; - service: string; - }>; - } - export interface ResolveOptions { - ttl: boolean; - } - export interface ResolveWithTtlOptions extends ResolveOptions { - ttl: true; - } - export interface RecordWithTtl { - address: string; - ttl: number; - } - /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ - export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; - export interface AnyARecord extends RecordWithTtl { - type: "A"; - } - export interface AnyAaaaRecord extends RecordWithTtl { - type: "AAAA"; - } - export interface CaaRecord { - critical: number; - issue?: string | undefined; - issuewild?: string | undefined; - iodef?: string | undefined; - contactemail?: string | undefined; - contactphone?: string | undefined; - } - export interface MxRecord { - priority: number; - exchange: string; - } - export interface AnyMxRecord extends MxRecord { - type: "MX"; - } - export interface NaptrRecord { - flags: string; - service: string; - regexp: string; - replacement: string; - order: number; - preference: number; - } - export interface AnyNaptrRecord extends NaptrRecord { - type: "NAPTR"; - } - export interface SoaRecord { - nsname: string; - hostmaster: string; - serial: number; - refresh: number; - retry: number; - expire: number; - minttl: number; - } - export interface AnySoaRecord extends SoaRecord { - type: "SOA"; - } - export interface SrvRecord { - priority: number; - weight: number; - port: number; - name: string; - } - export interface AnySrvRecord extends SrvRecord { - type: "SRV"; - } - export interface AnyTxtRecord { - type: "TXT"; - entries: string[]; - } - export interface AnyNsRecord { - type: "NS"; - value: string; - } - export interface AnyPtrRecord { - type: "PTR"; - value: string; - } - export interface AnyCnameRecord { - type: "CNAME"; - value: string; - } - export type AnyRecord = - | AnyARecord - | AnyAaaaRecord - | AnyCnameRecord - | AnyMxRecord - | AnyNaptrRecord - | AnyNsRecord - | AnyPtrRecord - | AnySoaRecord - | AnySrvRecord - | AnyTxtRecord; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. The `callback` function has arguments `(err, records)`. When successful, `records` will be an array of resource - * records. The type and structure of individual results varies based on `rrtype`: - * - * - * - * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v22.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. - * @param [rrtype='A'] Resource record type. - */ - export function resolve( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "A", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "AAAA", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "ANY", - callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "CNAME", - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "MX", - callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, - ): void; - export function resolve( - hostname: string, - 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", - callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "SRV", - callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: "TXT", - callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, - ): void; - export function resolve( - hostname: string, - rrtype: string, - callback: ( - err: NodeJS.ErrnoException | null, - addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[], - ) => void, - ): void; - export namespace resolve { - function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; - function __promisify__(hostname: string, rrtype: "ANY"): Promise; - function __promisify__(hostname: string, rrtype: "MX"): Promise; - function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; - function __promisify__(hostname: string, rrtype: "SOA"): Promise; - function __promisify__(hostname: string, rrtype: "SRV"): Promise; - function __promisify__(hostname: string, rrtype: "TXT"): Promise; - function __promisify__( - hostname: string, - rrtype: string, - ): Promise; - } - /** - * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the `hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve4( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve4( - hostname: string, - options: ResolveWithTtlOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, - ): void; - export function resolve4( - hostname: string, - options: ResolveOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, - ): void; - export namespace resolve4 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv6 addresses. - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve6( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export function resolve6( - hostname: string, - options: ResolveWithTtlOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void, - ): void; - export function resolve6( - hostname: string, - options: ResolveOptions, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void, - ): void; - export namespace resolve6 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of canonical name records available for the `hostname` (e.g. `['bar.example.com']`). - * @since v0.3.2 - */ - export function resolveCname( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolveCname { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of certification authority authorization records - * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - export function resolveCaa( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void, - ): void; - export namespace resolveCaa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of objects containing both a `priority` and `exchange` property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v0.1.27 - */ - export function resolveMx( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void, - ): void; - export namespace resolveMx { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of - * objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v0.9.12 - */ - export function resolveNaptr( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void, - ): void; - export namespace resolveNaptr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of name server records available for `hostname` (e.g. `['ns1.example.com', 'ns2.example.com']`). - * @since v0.1.90 - */ - export function resolveNs( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolveNs { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will - * be an array of strings containing the reply records. - * @since v6.0.0 - */ - export function resolvePtr( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void, - ): void; - export namespace resolvePtr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. The `address` argument passed to the `callback` function will - * be an object with the following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v0.11.10 - */ - export function resolveSoa( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void, - ): void; - export namespace resolveSoa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. The `addresses` argument passed to the `callback` function will - * be an array of objects with the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v0.1.27 - */ - export function resolveSrv( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void, - ): void; - export namespace resolveSrv { - function __promisify__(hostname: string): Promise; - } - /** - * 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 - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v0.1.27 - */ - export function resolveTxt( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void, - ): void; - export namespace resolveTxt { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * The `ret` argument passed to the `callback` function will be an array containing - * various types of records. Each object has a property `type` that indicates the - * type of the current record. And depending on the `type`, additional properties - * will be present on the object: - * - * - * - * Here is an example of the `ret` object passed to the callback: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * - * DNS server operators may choose not to respond to `ANY` queries. It may be better to call individual methods like {@link resolve4}, {@link resolveMx}, and so on. For more details, see - * [RFC 8482](https://tools.ietf.org/html/rfc8482). - */ - export function resolveAny( - hostname: string, - callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void, - ): void; - export namespace resolveAny { - function __promisify__(hostname: string): Promise; - } - /** - * 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-v22.x/api/errors.html#class-error) object, where `err.code` is - * one of the [DNS error codes](https://nodejs.org/docs/latest-v22.x/api/dns.html#error-codes). - * @since v0.1.16 - */ - export function reverse( - ip: string, - 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-v22.x/api/dns.html#dnspromiseslookuphostname-options). - * The value could be: - * - * * `ipv4first`: for `order` defaulting to `ipv4first`. - * * `ipv6first`: for `order` defaulting to `ipv6first`. - * * `verbatim`: for `order` defaulting to `verbatim`. - * @since v18.17.0 - */ - export function getDefaultResultOrder(): "ipv4first" | "ipv6first" | "verbatim"; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dns.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dns.setServers()` method must not be called while a DNS query is in - * progress. - * - * The {@link setServers} method affects only {@link resolve}, `dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v0.11.3 - * @param servers array of [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952#section-6) formatted addresses - */ - export function setServers(servers: readonly string[]): void; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v0.11.3 - */ - export function getServers(): string[]; - /** - * Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options). - * The value could be: - * - * * `ipv4first`: sets default `order` to `ipv4first`. - * * `ipv6first`: sets default `order` to `ipv6first`. - * * `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-v22.x/api/cli.html#--dns-result-orderorder). When using - * [worker threads](https://nodejs.org/docs/latest-v22.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'`. - */ - export function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void; - // Error codes - export const NODATA: "ENODATA"; - export const FORMERR: "EFORMERR"; - export const SERVFAIL: "ESERVFAIL"; - export const NOTFOUND: "ENOTFOUND"; - export const NOTIMP: "ENOTIMP"; - export const REFUSED: "EREFUSED"; - export const BADQUERY: "EBADQUERY"; - export const BADNAME: "EBADNAME"; - export const BADFAMILY: "EBADFAMILY"; - export const BADRESP: "EBADRESP"; - export const CONNREFUSED: "ECONNREFUSED"; - export const TIMEOUT: "ETIMEOUT"; - export const EOF: "EOF"; - export const FILE: "EFILE"; - export const NOMEM: "ENOMEM"; - export const DESTRUCTION: "EDESTRUCTION"; - export const BADSTR: "EBADSTR"; - export const BADFLAGS: "EBADFLAGS"; - export const NONAME: "ENONAME"; - export const BADHINTS: "EBADHINTS"; - export const NOTINITIALIZED: "ENOTINITIALIZED"; - export const LOADIPHLPAPI: "ELOADIPHLPAPI"; - export const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS"; - export const CANCELLED: "ECANCELLED"; - export interface ResolverOptions { - /** - * Query timeout in milliseconds, or `-1` to use the default timeout. - */ - timeout?: number | undefined; - /** - * The number of tries the resolver will try contacting each name server before giving up. - * @default 4 - */ - tries?: number; - } - /** - * 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-v22.x/api/dns.html#dnssetserversservers) does not affect - * other resolvers: - * - * ```js - * import { Resolver } from 'node:dns'; - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org', (err, addresses) => { - * // ... - * }); - * ``` - * - * The following methods from the `node:dns` module are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v8.3.0 - */ - export class Resolver { - constructor(options?: ResolverOptions); - /** - * Cancel all outstanding DNS queries made by this resolver. The corresponding - * callbacks will be called with an error with code `ECANCELLED`. - * @since v8.3.0 - */ - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCaa: typeof resolveCaa; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - /** - * The resolver instance will send its requests from the specified IP address. - * This allows programs to specify outbound interfaces when used on multi-homed - * systems. - * - * If a v4 or v6 address is not specified, it is set to the default and the - * operating system will choose a local address automatically. - * - * The resolver will use the v4 local address when making requests to IPv4 DNS - * servers, and the v6 local address when making requests to IPv6 DNS servers. - * The `rrtype` of resolution requests has no impact on the local address used. - * @since v15.1.0, v14.17.0 - * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. - * @param [ipv6='::0'] A string representation of an IPv6 address. - */ - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } - export { dnsPromises as promises }; -} -declare module "node:dns" { - export * from "dns"; -} diff --git a/node_modules/@types/node/dns/promises.d.ts b/node_modules/@types/node/dns/promises.d.ts deleted file mode 100644 index 2b5dff0..0000000 --- a/node_modules/@types/node/dns/promises.d.ts +++ /dev/null @@ -1,476 +0,0 @@ -/** - * 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 `import { promises as dnsPromises } from 'node:dns'` or `import dnsPromises from 'node:dns/promises'`. - * @since v10.6.0 - */ -declare module "dns/promises" { - import { - AnyRecord, - CaaRecord, - LookupAddress, - LookupAllOptions, - LookupOneOptions, - LookupOptions, - MxRecord, - NaptrRecord, - RecordWithTtl, - ResolveOptions, - ResolverOptions, - ResolveWithTtlOptions, - SoaRecord, - SrvRecord, - } from "node:dns"; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v10.6.0 - */ - function getServers(): string[]; - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the `Promise` is resolved with `addresses` being an array of objects with the properties `address` and `family`. - * - * 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. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options) does not necessarily have anything to do with the DNS - * protocol. 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) before - * using `dnsPromises.lookup()`. - * - * Example usage: - * - * ```js - * import dns from 'node:dns'; - * const dnsPromises = dns.promises; - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('address: %j family: IPv%s', result.address, result.family); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * }); - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('addresses: %j', result); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * }); - * ``` - * @since v10.6.0 - */ - function lookup(hostname: string, family: number): Promise; - function lookup(hostname: string, options: LookupOneOptions): Promise; - function lookup(hostname: string, options: LookupAllOptions): Promise; - function lookup(hostname: string, options: LookupOptions): Promise; - function lookup(hostname: string): Promise; - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * 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 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 - * import dnsPromises from 'node:dns'; - * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { - * console.log(result.hostname, result.service); - * // Prints: localhost ssh - * }); - * ``` - * @since v10.6.0 - */ - function lookupService( - address: string, - port: number, - ): Promise<{ - hostname: string; - service: string; - }>; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. When successful, the `Promise` is resolved with an - * array of resource records. The type and structure of individual results vary - * based on `rrtype`: - * - * - * - * 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 one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). - * @since v10.6.0 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - function resolve(hostname: string): Promise; - function resolve(hostname: string, rrtype: "A"): Promise; - function resolve(hostname: string, rrtype: "AAAA"): Promise; - function resolve(hostname: string, rrtype: "ANY"): Promise; - function resolve(hostname: string, rrtype: "CAA"): Promise; - function resolve(hostname: string, rrtype: "CNAME"): Promise; - function resolve(hostname: string, rrtype: "MX"): Promise; - function resolve(hostname: string, rrtype: "NAPTR"): Promise; - function resolve(hostname: string, rrtype: "NS"): Promise; - function resolve(hostname: string, rrtype: "PTR"): Promise; - function resolve(hostname: string, rrtype: "SOA"): Promise; - function resolve(hostname: string, rrtype: "SRV"): Promise; - function resolve(hostname: string, rrtype: "TXT"): Promise; - function resolve( - hostname: string, - rrtype: string, - ): Promise; - /** - * 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']`). - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve4(hostname: string): Promise; - function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve4(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv6 - * addresses. - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve6(hostname: string): Promise; - function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve6(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * On success, the `Promise` is resolved with an array containing various types of - * records. Each object has a property `type` that indicates the type of the - * current record. And depending on the `type`, additional properties will be - * present on the object: - * - * - * - * Here is an example of the result object: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * @since v10.6.0 - */ - function resolveAny(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, - * the `Promise` is resolved with an array of objects containing available - * certification authority authorization records available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0, v14.17.0 - */ - function resolveCaa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, - * the `Promise` is resolved with an array of canonical name records available for - * the `hostname` (e.g. `['bar.example.com']`). - * @since v10.6.0 - */ - function resolveCname(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects - * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v10.6.0 - */ - function resolveMx(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. On success, the `Promise` is resolved with an array - * of objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v10.6.0 - */ - function resolveNaptr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. On success, the `Promise` is resolved with an array of name server - * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). - * @since v10.6.0 - */ - function resolveNs(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of strings - * containing the reply records. - * @since v10.6.0 - */ - function resolvePtr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. On success, the `Promise` is resolved with an object with the - * following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v10.6.0 - */ - function resolveSoa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with - * the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v10.6.0 - */ - function resolveSrv(hostname: string): Promise; - /** - * 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 - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v10.6.0 - */ - function resolveTxt(hostname: string): Promise; - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * 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 one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes). - * @since v10.6.0 - */ - function reverse(ip: string): Promise; - /** - * Get the default value for `verbatim` in {@link lookup} and [dnsPromises.lookup()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options). - * The value could be: - * - * * `ipv4first`: for `verbatim` defaulting to `false`. - * * `verbatim`: for `verbatim` defaulting to `true`. - * @since v20.1.0 - */ - function getDefaultResultOrder(): "ipv4first" | "verbatim"; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dnsPromises.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dnsPromises.setServers()` method must not be called while a DNS query is in - * progress. - * - * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v10.6.0 - * @param servers array of `RFC 5952` formatted addresses - */ - function setServers(servers: readonly string[]): void; - /** - * Set the default value of `order` in `dns.lookup()` and `{@link lookup}`. The value could be: - * - * * `ipv4first`: sets default `order` to `ipv4first`. - * * `ipv6first`: sets default `order` to `ipv6first`. - * * `verbatim`: sets default `order` to `verbatim`. - * - * The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) - * 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), [`dnsPromises.setDefaultResultOrder()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder) - * 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'`. - */ - function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void; - // Error codes - const NODATA: "ENODATA"; - const FORMERR: "EFORMERR"; - const SERVFAIL: "ESERVFAIL"; - const NOTFOUND: "ENOTFOUND"; - const NOTIMP: "ENOTIMP"; - const REFUSED: "EREFUSED"; - const BADQUERY: "EBADQUERY"; - const BADNAME: "EBADNAME"; - const BADFAMILY: "EBADFAMILY"; - const BADRESP: "EBADRESP"; - const CONNREFUSED: "ECONNREFUSED"; - const TIMEOUT: "ETIMEOUT"; - const EOF: "EOF"; - const FILE: "EFILE"; - const NOMEM: "ENOMEM"; - const DESTRUCTION: "EDESTRUCTION"; - const BADSTR: "EBADSTR"; - const BADFLAGS: "EBADFLAGS"; - const NONAME: "ENONAME"; - const BADHINTS: "EBADHINTS"; - const NOTINITIALIZED: "ENOTINITIALIZED"; - const LOADIPHLPAPI: "ELOADIPHLPAPI"; - const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS"; - const CANCELLED: "ECANCELLED"; - - /** - * 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#dnspromisessetserversservers) does not affect - * other resolvers: - * - * ```js - * 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. - * resolver.resolve4('example.org').then((addresses) => { - * // ... - * }); - * - * // Alternatively, the same code can be written using async-await style. - * (async function() { - * const addresses = await resolver.resolve4('example.org'); - * })(); - * ``` - * - * The following methods from the `dnsPromises` API are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v10.6.0 - */ - class Resolver { - constructor(options?: ResolverOptions); - /** - * Cancel all outstanding DNS queries made by this resolver. The corresponding - * callbacks will be called with an error with code `ECANCELLED`. - * @since v8.3.0 - */ - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCaa: typeof resolveCaa; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - /** - * The resolver instance will send its requests from the specified IP address. - * This allows programs to specify outbound interfaces when used on multi-homed - * systems. - * - * If a v4 or v6 address is not specified, it is set to the default and the - * operating system will choose a local address automatically. - * - * The resolver will use the v4 local address when making requests to IPv4 DNS - * servers, and the v6 local address when making requests to IPv6 DNS servers. - * The `rrtype` of resolution requests has no impact on the local address used. - * @since v15.1.0, v14.17.0 - * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. - * @param [ipv6='::0'] A string representation of an IPv6 address. - */ - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } -} -declare module "node:dns/promises" { - export * from "dns/promises"; -} diff --git a/node_modules/@types/node/dom-events.d.ts b/node_modules/@types/node/dom-events.d.ts deleted file mode 100644 index f47f71d..0000000 --- a/node_modules/@types/node/dom-events.d.ts +++ /dev/null @@ -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; - }; -} diff --git a/node_modules/@types/node/domain.d.ts b/node_modules/@types/node/domain.d.ts deleted file mode 100644 index ba8a02c..0000000 --- a/node_modules/@types/node/domain.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -/** - * **This module is pending deprecation.** Once a replacement API has been - * finalized, this module will be fully deprecated. Most developers should - * **not** have cause to use this module. Users who absolutely must have - * the functionality that domains provide may rely on it for the time being - * but should expect to have to migrate to a different solution - * in the future. - * - * Domains provide a way to handle multiple different IO operations as a - * single group. If any of the event emitters or callbacks registered to a - * domain emit an `'error'` event, or throw an error, then the domain object - * 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/v22.x/lib/domain.js) - */ -declare module "domain" { - import EventEmitter = require("node:events"); - /** - * The `Domain` class encapsulates the functionality of routing errors and - * uncaught exceptions to the active `Domain` object. - * - * To handle the errors that it catches, listen to its `'error'` event. - */ - class Domain extends EventEmitter { - /** - * An array of timers and event emitters that have been explicitly added - * to the domain. - */ - members: Array; - /** - * The `enter()` method is plumbing used by the `run()`, `bind()`, and `intercept()` methods to set the active domain. It sets `domain.active` and `process.domain` to the domain, and implicitly - * pushes the domain onto the domain - * stack managed by the domain module (see {@link exit} for details on the - * domain stack). The call to `enter()` delimits the beginning of a chain of - * asynchronous calls and I/O operations bound to a domain. - * - * Calling `enter()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - enter(): void; - /** - * The `exit()` method exits the current domain, popping it off the domain stack. - * Any time execution is going to switch to the context of a different chain of - * asynchronous calls, it's important to ensure that the current domain is exited. - * The call to `exit()` delimits either the end of or an interruption to the chain - * of asynchronous calls and I/O operations bound to a domain. - * - * If there are multiple, nested domains bound to the current execution context, `exit()` will exit any domains nested within this domain. - * - * Calling `exit()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - exit(): void; - /** - * Run the supplied function in the context of the domain, implicitly - * binding all event emitters, timers, and low-level requests that are - * created in that context. Optionally, arguments can be passed to - * the function. - * - * This is the most basic way to use a domain. - * - * ```js - * import domain from 'node:domain'; - * import fs from 'node:fs'; - * const d = domain.create(); - * d.on('error', (er) => { - * console.error('Caught error!', er); - * }); - * d.run(() => { - * process.nextTick(() => { - * setTimeout(() => { // Simulating some various async stuff - * fs.open('non-existent file', 'r', (er, fd) => { - * if (er) throw er; - * // proceed... - * }); - * }, 100); - * }); - * }); - * ``` - * - * In this example, the `d.on('error')` handler will be triggered, rather - * than crashing the program. - */ - run(fn: (...args: any[]) => T, ...args: any[]): T; - /** - * Explicitly adds an emitter to the domain. If any event handlers called by - * the emitter throw an error, or if the emitter emits an `'error'` event, it - * will be routed to the domain's `'error'` event, just like with implicit - * binding. - * - * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by - * the domain `'error'` handler. - * - * If the Timer or `EventEmitter` was already bound to a domain, it is removed - * from that one, and bound to this one instead. - * @param emitter emitter or timer to be added to the domain - */ - add(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The opposite of {@link add}. Removes domain handling from the - * specified emitter. - * @param emitter emitter or timer to be removed from the domain - */ - remove(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The returned function will be a wrapper around the supplied callback - * function. When the returned function is called, any errors that are - * thrown will be routed to the domain's `'error'` event. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.bind((er, data) => { - * // If this throws, it will also be passed to the domain. - * return cb(er, data ? JSON.parse(data) : null); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The bound function - */ - bind(callback: T): T; - /** - * This method is almost identical to {@link bind}. However, in - * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. - * - * In this way, the common `if (err) return callback(err);` pattern can be replaced - * with a single error handler in a single place. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.intercept((data) => { - * // Note, the first argument is never passed to the - * // callback since it is assumed to be the 'Error' argument - * // and thus intercepted by the domain. - * - * // If this throws, it will also be passed to the domain - * // so the error-handling logic can be moved to the 'error' - * // event on the domain instead of being repeated throughout - * // the program. - * return cb(null, JSON.parse(data)); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The intercepted function - */ - intercept(callback: T): T; - } - function create(): Domain; -} -declare module "node:domain" { - export * from "domain"; -} diff --git a/node_modules/@types/node/events.d.ts b/node_modules/@types/node/events.d.ts deleted file mode 100644 index 63b9433..0000000 --- a/node_modules/@types/node/events.d.ts +++ /dev/null @@ -1,931 +0,0 @@ -/** - * Much of the Node.js core API is built around an idiomatic asynchronous - * event-driven architecture in which certain kinds of objects (called "emitters") - * emit named events that cause `Function` objects ("listeners") to be called. - * - * For instance: a `net.Server` object emits an event each time a peer - * connects to it; a `fs.ReadStream` emits an event when the file is opened; - * a `stream` emits an event whenever data is available to be read. - * - * All objects that emit events are instances of the `EventEmitter` class. These - * objects expose an `eventEmitter.on()` function that allows one or more - * functions to be attached to named events emitted by the object. Typically, - * event names are camel-cased strings but any valid JavaScript property key - * can be used. - * - * When the `EventEmitter` object emits an event, all of the functions attached - * to that specific event are called _synchronously_. Any values returned by the - * called listeners are _ignored_ and discarded. - * - * The following example shows a simple `EventEmitter` instance with a single - * listener. The `eventEmitter.on()` method is used to register listeners, while - * the `eventEmitter.emit()` method is used to trigger the event. - * - * ```js - * import { EventEmitter } from 'node:events'; - * - * class MyEmitter extends EventEmitter {} - * - * const myEmitter = new MyEmitter(); - * myEmitter.on('event', () => { - * console.log('an event occurred!'); - * }); - * myEmitter.emit('event'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.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. - */ - captureRejections?: boolean | undefined; - } - interface StaticEventEmitterOptions { - /** - * Can be used to cancel awaiting events. - */ - signal?: AbortSignal | undefined; - } - interface StaticEventEmitterIteratorOptions extends StaticEventEmitterOptions { - /** - * Names of events that will end the iteration. - */ - close?: string[] | undefined; - /** - * The high watermark. The emitter is paused every time the size of events being buffered is higher than it. - * Supported only on emitters implementing `pause()` and `resume()` methods. - * @default Number.MAX_SAFE_INTEGER - */ - highWaterMark?: number | undefined; - /** - * The low watermark. The emitter is resumed every time the size of events being buffered is lower than it. - * Supported only on emitters implementing `pause()` and `resume()` methods. - * @default 1 - */ - lowWaterMark?: number | undefined; - } - interface EventEmitter = DefaultEventMap> extends NodeJS.EventEmitter {} - type EventMap = Record | DefaultEventMap; - type DefaultEventMap = [never]; - type AnyRest = [...args: any[]]; - type Args = T extends DefaultEventMap ? AnyRest : ( - K extends keyof T ? T[K] : never - ); - type Key = T extends DefaultEventMap ? string | symbol : K | keyof T; - type Key2 = T extends DefaultEventMap ? string | symbol : K & keyof T; - type Listener = T extends DefaultEventMap ? F : ( - K extends keyof T ? ( - T[K] extends unknown[] ? (...args: T[K]) => void : never - ) - : never - ); - type Listener1 = Listener void>; - type Listener2 = Listener; - - /** - * The `EventEmitter` class is defined and exposed by the `node:events` module: - * - * ```js - * import { EventEmitter } from 'node:events'; - * ``` - * - * All `EventEmitter`s emit the event `'newListener'` when new listeners are - * added and `'removeListener'` when existing listeners are removed. - * - * It supports the following option: - * @since v0.1.26 - */ - class EventEmitter = DefaultEventMap> { - constructor(options?: EventEmitterOptions); - - [EventEmitter.captureRejectionSymbol]?(error: Error, event: Key, ...args: Args): void; - - /** - * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given - * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. - * The `Promise` will resolve with an array of all the arguments emitted to the - * given event. - * - * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event - * semantics and does not listen to the `'error'` event. - * - * ```js - * import { once, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * process.nextTick(() => { - * ee.emit('myevent', 42); - * }); - * - * const [value] = await once(ee, 'myevent'); - * console.log(value); - * - * const err = new Error('kaboom'); - * process.nextTick(() => { - * ee.emit('error', err); - * }); - * - * try { - * await once(ee, 'myevent'); - * } catch (err) { - * console.error('error happened', err); - * } - * ``` - * - * The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the - * '`error'` event itself, then it is treated as any other kind of event without - * special handling: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * - * once(ee, 'error') - * .then(([err]) => console.log('ok', err.message)) - * .catch((err) => console.error('error', err.message)); - * - * ee.emit('error', new Error('boom')); - * - * // Prints: ok boom - * ``` - * - * An `AbortSignal` can be used to cancel waiting for the event: - * - * ```js - * import { EventEmitter, once } from 'node:events'; - * - * const ee = new EventEmitter(); - * const ac = new AbortController(); - * - * async function foo(emitter, event, signal) { - * try { - * await once(emitter, event, { signal }); - * console.log('event emitted!'); - * } catch (error) { - * if (error.name === 'AbortError') { - * console.error('Waiting for the event was canceled!'); - * } else { - * console.error('There was an error', error.message); - * } - * } - * } - * - * foo(ee, 'foo', ac.signal); - * ac.abort(); // Abort waiting for the event - * ee.emit('foo'); // Prints: Waiting for the event was canceled! - * ``` - * @since v11.13.0, v10.16.0 - */ - static once( - emitter: NodeJS.EventEmitter, - eventName: string | symbol, - options?: StaticEventEmitterOptions, - ): Promise; - static once(emitter: EventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; - /** - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo')) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * ``` - * - * Returns an `AsyncIterator` that iterates `eventName` events. It will throw - * if the `EventEmitter` emits `'error'`. It removes all listeners when - * exiting the loop. The `value` returned by each iteration is an array - * composed of the emitted event arguments. - * - * An `AbortSignal` can be used to cancel waiting on events: - * - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ac = new AbortController(); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo', { signal: ac.signal })) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * - * process.nextTick(() => ac.abort()); - * ``` - * - * Use the `close` option to specify an array of event names that will end the iteration: - * - * ```js - * import { on, EventEmitter } from 'node:events'; - * import process from 'node:process'; - * - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * ee.emit('close'); - * }); - * - * for await (const event of on(ee, 'foo', { close: ['close'] })) { - * console.log(event); // prints ['bar'] [42] - * } - * // the loop will exit after 'close' is emitted - * console.log('done'); // prints 'done' - * ``` - * @since v13.6.0, v12.16.0 - * @return An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` - */ - static on( - emitter: NodeJS.EventEmitter, - eventName: string | symbol, - options?: StaticEventEmitterIteratorOptions, - ): NodeJS.AsyncIterator; - static on( - emitter: EventTarget, - eventName: string, - options?: StaticEventEmitterIteratorOptions, - ): NodeJS.AsyncIterator; - /** - * A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. - * - * ```js - * import { EventEmitter, listenerCount } from 'node:events'; - * - * const myEmitter = new EventEmitter(); - * myEmitter.on('event', () => {}); - * myEmitter.on('event', () => {}); - * console.log(listenerCount(myEmitter, 'event')); - * // Prints: 2 - * ``` - * @since v0.9.12 - * @deprecated Since v3.2.0 - Use `listenerCount` instead. - * @param emitter The emitter to query - * @param eventName The event name - */ - static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the event listeners for the - * event target. This is useful for debugging and diagnostic purposes. - * - * ```js - * import { getEventListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * const listener = () => console.log('Events are fun'); - * ee.on('foo', listener); - * console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] - * } - * { - * const et = new EventTarget(); - * const listener = () => console.log('Events are fun'); - * et.addEventListener('foo', listener); - * console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] - * } - * ``` - * @since v15.2.0, v14.17.0 - */ - static getEventListeners(emitter: EventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; - /** - * Returns the currently set max amount of listeners. - * - * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the max event listeners for the - * event target. If the number of event handlers on a single EventTarget exceeds - * the max set, the EventTarget will print a warning. - * - * ```js - * import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; - * - * { - * const ee = new EventEmitter(); - * console.log(getMaxListeners(ee)); // 10 - * setMaxListeners(11, ee); - * console.log(getMaxListeners(ee)); // 11 - * } - * { - * const et = new EventTarget(); - * console.log(getMaxListeners(et)); // 10 - * setMaxListeners(11, et); - * console.log(getMaxListeners(et)); // 11 - * } - * ``` - * @since v19.9.0 - */ - static getMaxListeners(emitter: EventTarget | NodeJS.EventEmitter): number; - /** - * ```js - * import { setMaxListeners, EventEmitter } from 'node:events'; - * - * const target = new EventTarget(); - * const emitter = new EventEmitter(); - * - * setMaxListeners(5, target, emitter); - * ``` - * @since v15.4.0 - * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. - * @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): void; - /** - * Listens once to the `abort` event on the provided `signal`. - * - * Listening to the `abort` event on abort signals is unsafe and may - * lead to resource leaks since another third party with the signal can - * call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change - * this since it would violate the web standard. Additionally, the original - * API makes it easy to forget to remove listeners. - * - * This API allows safely using `AbortSignal`s in Node.js APIs by solving these - * two issues by listening to the event such that `stopImmediatePropagation` does - * not prevent the listener from running. - * - * Returns a disposable so that it may be unsubscribed from more easily. - * - * ```js - * import { addAbortListener } from 'node:events'; - * - * function example(signal) { - * let disposable; - * try { - * signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); - * disposable = addAbortListener(signal, (e) => { - * // Do something when signal is aborted. - * }); - * } finally { - * disposable?.[Symbol.dispose](); - * } - * } - * ``` - * @since v20.5.0 - * @experimental - * @return Disposable that removes the `abort` listener. - */ - static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable; - /** - * This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. - * - * Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no - * regular `'error'` listener is installed. - * @since v13.6.0, v12.17.0 - */ - static readonly errorMonitor: unique symbol; - /** - * Value: `Symbol.for('nodejs.rejection')` - * - * See how to write a custom `rejection handler`. - * @since v13.4.0, v12.16.0 - */ - static readonly captureRejectionSymbol: unique symbol; - /** - * Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) - * - * Change the default `captureRejections` option on all new `EventEmitter` objects. - * @since v13.4.0, v12.16.0 - */ - static captureRejections: boolean; - /** - * By default, a maximum of `10` listeners can be registered for any single - * event. This limit can be changed for individual `EventEmitter` instances - * using the `emitter.setMaxListeners(n)` method. To change the default - * for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property - * can be used. If this value is not a positive number, a `RangeError` is thrown. - * - * Take caution when setting the `events.defaultMaxListeners` because the - * change affects _all_ `EventEmitter` instances, including those created before - * the change is made. However, calling `emitter.setMaxListeners(n)` still has - * precedence over `events.defaultMaxListeners`. - * - * This is not a hard limit. The `EventEmitter` instance will allow - * more listeners to be added but will output a trace warning to stderr indicating - * that a "possible EventEmitter memory leak" has been detected. For any single - * `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to - * temporarily avoid this warning: - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.setMaxListeners(emitter.getMaxListeners() + 1); - * emitter.once('event', () => { - * // do stuff - * emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); - * }); - * ``` - * - * The `--trace-warnings` command-line flag can be used to display the - * stack trace for such warnings. - * - * The emitted warning can be inspected with `process.on('warning')` and will - * have the additional `emitter`, `type`, and `count` properties, referring to - * the event emitter instance, the event's name and the number of attached - * listeners, respectively. - * Its `name` property is set to `'MaxListenersExceededWarning'`. - * @since v0.11.2 - */ - static defaultMaxListeners: number; - } - import internal = require("node:events"); - namespace EventEmitter { - // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 - export { internal as EventEmitter }; - export interface Abortable { - /** - * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. - */ - signal?: AbortSignal | undefined; - } - - export interface EventEmitterReferencingAsyncResource extends AsyncResource { - readonly eventEmitter: EventEmitterAsyncResource; - } - - export interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions { - /** - * The type of async event, this is required when instantiating `EventEmitterAsyncResource` - * directly rather than as a child class. - * @default new.target.name if instantiated as a child class. - */ - name?: string; - } - - /** - * Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that - * require manual async tracking. Specifically, all events emitted by instances - * of `events.EventEmitterAsyncResource` will run within its `async context`. - * - * ```js - * import { EventEmitterAsyncResource, EventEmitter } from 'node:events'; - * import { notStrictEqual, strictEqual } from 'node:assert'; - * import { executionAsyncId, triggerAsyncId } from 'node:async_hooks'; - * - * // Async tracking tooling will identify this as 'Q'. - * const ee1 = new EventEmitterAsyncResource({ name: 'Q' }); - * - * // 'foo' listeners will run in the EventEmitters async context. - * ee1.on('foo', () => { - * strictEqual(executionAsyncId(), ee1.asyncId); - * strictEqual(triggerAsyncId(), ee1.triggerAsyncId); - * }); - * - * const ee2 = new EventEmitter(); - * - * // 'foo' listeners on ordinary EventEmitters that do not track async - * // context, however, run in the same async context as the emit(). - * ee2.on('foo', () => { - * notStrictEqual(executionAsyncId(), ee2.asyncId); - * notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId); - * }); - * - * Promise.resolve().then(() => { - * ee1.emit('foo'); - * ee2.emit('foo'); - * }); - * ``` - * - * The `EventEmitterAsyncResource` class has the same methods and takes the - * same options as `EventEmitter` and `AsyncResource` themselves. - * @since v17.4.0, v16.14.0 - */ - export class EventEmitterAsyncResource extends EventEmitter { - /** - * @param options Only optional in child class. - */ - constructor(options?: EventEmitterAsyncResourceOptions); - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - */ - emitDestroy(): void; - /** - * The unique `asyncId` assigned to the resource. - */ - readonly asyncId: number; - /** - * The same triggerAsyncId that is passed to the AsyncResource constructor. - */ - readonly triggerAsyncId: number; - /** - * The returned `AsyncResource` object has an additional `eventEmitter` property - * that provides a reference to this `EventEmitterAsyncResource`. - */ - readonly asyncResource: EventEmitterReferencingAsyncResource; - } - } - global { - namespace NodeJS { - interface EventEmitter = DefaultEventMap> { - [EventEmitter.captureRejectionSymbol]?(error: Error, event: Key, ...args: Args): void; - /** - * Alias for `emitter.on(eventName, listener)`. - * @since v0.1.26 - */ - addListener(eventName: Key, listener: Listener1): this; - /** - * Adds the `listener` function to the end of the listeners array for the event - * named `eventName`. No checks are made to see if the `listener` has already - * been added. Multiple calls passing the same combination of `eventName` and - * `listener` will result in the `listener` being added, and called, multiple times. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEE = new EventEmitter(); - * myEE.on('foo', () => console.log('a')); - * myEE.prependListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.1.101 - * @param eventName The name of the event. - * @param listener The callback function - */ - on(eventName: Key, listener: Listener1): this; - /** - * Adds a **one-time** `listener` function for the event named `eventName`. The - * next time `eventName` is triggered, this listener is removed and then invoked. - * - * ```js - * server.once('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEE = new EventEmitter(); - * myEE.once('foo', () => console.log('a')); - * myEE.prependOnceListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.3.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - once(eventName: Key, listener: Listener1): this; - /** - * Removes the specified `listener` from the listener array for the event named `eventName`. - * - * ```js - * const callback = (stream) => { - * console.log('someone connected!'); - * }; - * server.on('connection', callback); - * // ... - * server.removeListener('connection', callback); - * ``` - * - * `removeListener()` will remove, at most, one instance of a listener from the - * listener array. If any single listener has been added multiple times to the - * listener array for the specified `eventName`, then `removeListener()` must be - * called multiple times to remove each instance. - * - * Once an event is emitted, all listeners attached to it at the - * time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution - * will not remove them from`emit()` in progress. Subsequent events behave as expected. - * - * ```js - * import { EventEmitter } from 'node:events'; - * class MyEmitter extends EventEmitter {} - * const myEmitter = new MyEmitter(); - * - * const callbackA = () => { - * console.log('A'); - * myEmitter.removeListener('event', callbackB); - * }; - * - * const callbackB = () => { - * console.log('B'); - * }; - * - * myEmitter.on('event', callbackA); - * - * myEmitter.on('event', callbackB); - * - * // callbackA removes listener callbackB but it will still be called. - * // Internal listener array at time of emit [callbackA, callbackB] - * myEmitter.emit('event'); - * // Prints: - * // A - * // B - * - * // callbackB is now removed. - * // Internal listener array [callbackA] - * myEmitter.emit('event'); - * // Prints: - * // A - * ``` - * - * Because listeners are managed using an internal array, calling this will - * change the position indices of any listener registered _after_ the listener - * being removed. This will not impact the order in which listeners are called, - * but it means that any copies of the listener array as returned by - * the `emitter.listeners()` method will need to be recreated. - * - * When a single function has been added as a handler multiple times for a single - * event (as in the example below), `removeListener()` will remove the most - * recently added instance. In the example the `once('ping')` listener is removed: - * - * ```js - * import { EventEmitter } from 'node:events'; - * const ee = new EventEmitter(); - * - * function pong() { - * console.log('pong'); - * } - * - * ee.on('ping', pong); - * ee.once('ping', pong); - * ee.removeListener('ping', pong); - * - * ee.emit('ping'); - * ee.emit('ping'); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeListener(eventName: Key, listener: Listener1): this; - /** - * Alias for `emitter.removeListener()`. - * @since v10.0.0 - */ - off(eventName: Key, listener: Listener1): this; - /** - * Removes all listeners, or those of the specified `eventName`. - * - * It is bad practice to remove listeners added elsewhere in the code, - * particularly when the `EventEmitter` instance was created by some other - * component or module (e.g. sockets or file streams). - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeAllListeners(eventName?: Key): this; - /** - * By default `EventEmitter`s will print a warning if more than `10` listeners are - * added for a particular event. This is a useful default that helps finding - * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be - * modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.3.5 - */ - 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}. - * @since v1.0.0 - */ - getMaxListeners(): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * console.log(util.inspect(server.listeners('connection'))); - * // Prints: [ [Function] ] - * ``` - * @since v0.1.26 - */ - listeners(eventName: Key): Array>; - /** - * Returns a copy of the array of listeners for the event named `eventName`, - * including any wrappers (such as those created by `.once()`). - * - * ```js - * import { EventEmitter } from 'node:events'; - * const emitter = new EventEmitter(); - * emitter.once('log', () => console.log('log once')); - * - * // Returns a new Array with a function `onceWrapper` which has a property - * // `listener` which contains the original listener bound above - * const listeners = emitter.rawListeners('log'); - * const logFnWrapper = listeners[0]; - * - * // Logs "log once" to the console and does not unbind the `once` event - * logFnWrapper.listener(); - * - * // Logs "log once" to the console and removes the listener - * logFnWrapper(); - * - * emitter.on('log', () => console.log('log persistently')); - * // Will return a new Array with a single function bound by `.on()` above - * const newListeners = emitter.rawListeners('log'); - * - * // Logs "log persistently" twice - * newListeners[0](); - * emitter.emit('log'); - * ``` - * @since v9.4.0 - */ - rawListeners(eventName: Key): Array>; - /** - * Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments - * to each. - * - * Returns `true` if the event had listeners, `false` otherwise. - * - * ```js - * import { EventEmitter } from 'node:events'; - * const myEmitter = new EventEmitter(); - * - * // First listener - * myEmitter.on('event', function firstListener() { - * console.log('Helloooo! first listener'); - * }); - * // Second listener - * myEmitter.on('event', function secondListener(arg1, arg2) { - * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); - * }); - * // Third listener - * myEmitter.on('event', function thirdListener(...args) { - * const parameters = args.join(', '); - * console.log(`event with parameters ${parameters} in third listener`); - * }); - * - * console.log(myEmitter.listeners('event')); - * - * myEmitter.emit('event', 1, 2, 3, 4, 5); - * - * // Prints: - * // [ - * // [Function: firstListener], - * // [Function: secondListener], - * // [Function: thirdListener] - * // ] - * // Helloooo! first listener - * // event with parameters 1, 2 in second listener - * // event with parameters 1, 2, 3, 4, 5 in third listener - * ``` - * @since v0.1.26 - */ - emit(eventName: Key, ...args: Args): boolean; - /** - * Returns the number of listeners listening for the event named `eventName`. - * If `listener` is provided, it will return how many times the listener is found - * in the list of the listeners of the event. - * @since v3.2.0 - * @param eventName The name of the event being listened for - * @param listener The event handler function - */ - listenerCount(eventName: Key, listener?: Listener2): number; - /** - * Adds the `listener` function to the _beginning_ of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName` - * and `listener` will result in the `listener` being added, and called, multiple times. - * - * ```js - * server.prependListener('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependListener(eventName: Key, listener: Listener1): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this - * listener is removed, and then invoked. - * - * ```js - * server.prependOnceListener('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependOnceListener(eventName: Key, listener: Listener1): this; - /** - * Returns an array listing the events for which the emitter has registered - * listeners. The values in the array are strings or `Symbol`s. - * - * ```js - * import { EventEmitter } from 'node:events'; - * - * const myEE = new EventEmitter(); - * myEE.on('foo', () => {}); - * myEE.on('bar', () => {}); - * - * const sym = Symbol('symbol'); - * myEE.on(sym, () => {}); - * - * console.log(myEE.eventNames()); - * // Prints: [ 'foo', 'bar', Symbol(symbol) ] - * ``` - * @since v6.0.0 - */ - eventNames(): Array<(string | symbol) & Key2>; - } - } - } - export = EventEmitter; -} -declare module "node:events" { - import events = require("events"); - export = events; -} diff --git a/node_modules/@types/node/fs.d.ts b/node_modules/@types/node/fs.d.ts deleted file mode 100644 index cffa62d..0000000 --- a/node_modules/@types/node/fs.d.ts +++ /dev/null @@ -1,4390 +0,0 @@ -/** - * The `node:fs` module enables interacting with the file system in a - * way modeled on standard POSIX functions. - * - * To use the promise-based APIs: - * - * ```js - * import * as fs from 'node:fs/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as fs from 'node:fs'; - * ``` - * - * All file system operations have synchronous, callback, and promise-based - * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/fs.js) - */ -declare module "fs" { - import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; - import { URL } from "node:url"; - import * as promises from "node:fs/promises"; - export { promises }; - /** - * Valid types for path values in "fs". - */ - export type PathLike = string | Buffer | URL; - export type PathOrFileDescriptor = PathLike | number; - export type TimeLike = string | number | Date; - export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; - export type BufferEncodingOption = - | "buffer" - | { - encoding: "buffer"; - }; - export interface ObjectEncodingOptions { - encoding?: BufferEncoding | null | undefined; - } - export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; - export type OpenMode = number | string; - export type Mode = number | string; - export interface StatsBase { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: T; - ino: T; - mode: T; - nlink: T; - uid: T; - gid: T; - rdev: T; - size: T; - blksize: T; - blocks: T; - atimeMs: T; - mtimeMs: T; - ctimeMs: T; - birthtimeMs: T; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - } - export interface Stats extends StatsBase {} - /** - * A `fs.Stats` object provides information about a file. - * - * Objects returned from {@link stat}, {@link lstat}, {@link fstat}, and - * their synchronous counterparts are of this type. - * If `bigint` in the `options` passed to those methods is true, the numeric values - * will be `bigint` instead of `number`, and the object will contain additional - * nanosecond-precision properties suffixed with `Ns`. `Stat` objects are not to be created directly using the `new` keyword. - * - * ```console - * Stats { - * dev: 2114, - * ino: 48064969, - * mode: 33188, - * nlink: 1, - * uid: 85, - * gid: 100, - * rdev: 0, - * size: 527, - * blksize: 4096, - * blocks: 8, - * atimeMs: 1318289051000.1, - * mtimeMs: 1318289051000.1, - * ctimeMs: 1318289051000.1, - * birthtimeMs: 1318289051000.1, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * - * `bigint` version: - * - * ```console - * BigIntStats { - * dev: 2114n, - * ino: 48064969n, - * mode: 33188n, - * nlink: 1n, - * uid: 85n, - * gid: 100n, - * rdev: 0n, - * size: 527n, - * blksize: 4096n, - * blocks: 8n, - * atimeMs: 1318289051000n, - * mtimeMs: 1318289051000n, - * ctimeMs: 1318289051000n, - * birthtimeMs: 1318289051000n, - * atimeNs: 1318289051000000000n, - * mtimeNs: 1318289051000000000n, - * ctimeNs: 1318289051000000000n, - * birthtimeNs: 1318289051000000000n, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * @since v0.1.21 - */ - export class Stats { - private constructor(); - } - export interface StatsFsBase { - /** Type of file system. */ - type: T; - /** Optimal transfer block size. */ - bsize: T; - /** Total data blocks in file system. */ - blocks: T; - /** Free blocks in file system. */ - bfree: T; - /** Available blocks for unprivileged users */ - bavail: T; - /** Total file nodes in file system. */ - files: T; - /** Free file nodes in file system. */ - ffree: T; - } - export interface StatsFs extends StatsFsBase {} - /** - * Provides information about a mounted file system. - * - * Objects returned from {@link statfs} and its synchronous counterpart are of - * this type. If `bigint` in the `options` passed to those methods is `true`, the - * numeric values will be `bigint` instead of `number`. - * - * ```console - * StatFs { - * type: 1397114950, - * bsize: 4096, - * blocks: 121938943, - * bfree: 61058895, - * bavail: 61058895, - * files: 999, - * ffree: 1000000 - * } - * ``` - * - * `bigint` version: - * - * ```console - * StatFs { - * type: 1397114950n, - * bsize: 4096n, - * blocks: 121938943n, - * bfree: 61058895n, - * bavail: 61058895n, - * files: 999n, - * ffree: 1000000n - * } - * ``` - * @since v19.6.0, v18.15.0 - */ - export class StatsFs {} - export interface BigIntStatsFs extends StatsFsBase {} - export interface StatFsOptions { - bigint?: boolean | undefined; - } - /** - * A representation of a directory entry, which can be a file or a subdirectory - * within the directory, as returned by reading from an `fs.Dir`. The - * directory entry is a combination of the file name and file type pairs. - * - * Additionally, when {@link readdir} or {@link readdirSync} is called with - * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. - * @since v10.10.0 - */ - export class Dirent { - /** - * Returns `true` if the `fs.Dirent` object describes a regular file. - * @since v10.10.0 - */ - isFile(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a file system - * directory. - * @since v10.10.0 - */ - isDirectory(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a block device. - * @since v10.10.0 - */ - isBlockDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a character device. - * @since v10.10.0 - */ - isCharacterDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a symbolic link. - * @since v10.10.0 - */ - isSymbolicLink(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a first-in-first-out - * (FIFO) pipe. - * @since v10.10.0 - */ - isFIFO(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a socket. - * @since v10.10.0 - */ - isSocket(): boolean; - /** - * The file name that this `fs.Dirent` object refers to. The type of this - * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. - * @since v10.10.0 - */ - name: string; - /** - * The base path that this `fs.Dirent` object refers to. - * @since v20.12.0 - */ - parentPath: string; - /** - * Alias for `dirent.parentPath`. - * @since v20.1.0 - * @deprecated Since v20.12.0 - */ - path: string; - } - /** - * A class representing a directory stream. - * - * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. - * - * ```js - * import { opendir } from 'node:fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - */ - export class Dir implements AsyncIterable { - /** - * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. - * @since v12.12.0 - */ - readonly path: string; - /** - * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. - */ - [Symbol.asyncIterator](): NodeJS.AsyncIterator; - /** - * Asynchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * - * A promise is returned that will be fulfilled after the resource has been - * closed. - * @since v12.12.0 - */ - close(): Promise; - close(cb: NoParamCallback): void; - /** - * Synchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * @since v12.12.0 - */ - closeSync(): void; - /** - * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. - * - * A promise is returned that will be fulfilled with an `fs.Dirent`, or `null` if there are no more directory entries to read. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - * @return containing {fs.Dirent|null} - */ - read(): Promise; - read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; - /** - * Synchronously read the next directory entry as an `fs.Dirent`. See the - * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. - * - * If there are no more directory entries to read, `null` will be returned. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - */ - readSync(): Dirent | null; - } - /** - * Class: fs.StatWatcher - * @since v14.3.0, v12.20.0 - * Extends `EventEmitter` - * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. - */ - export interface StatWatcher extends EventEmitter { - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have - * no effect. - * - * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally - * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been - * called previously. - * @since v14.3.0, v12.20.0 - */ - ref(): this; - /** - * When called, the active `fs.StatWatcher` 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 `fs.StatWatcher` object's - * callback is invoked. Calling `watcher.unref()` multiple times will have - * no effect. - * @since v14.3.0, v12.20.0 - */ - unref(): this; - } - export interface FSWatcher extends EventEmitter { - /** - * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. - * @since v0.5.8 - */ - close(): void; - /** - * When called, requests that the Node.js event loop _not_ exit so long as the `fs.FSWatcher` is active. Calling `watcher.ref()` multiple times will have - * no effect. - * - * By default, all `fs.FSWatcher` objects are "ref'ed", making it normally - * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been - * called previously. - * @since v14.3.0, v12.20.0 - */ - ref(): this; - /** - * When called, the active `fs.FSWatcher` 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 `fs.FSWatcher` object's - * callback is invoked. Calling `watcher.unref()` multiple times will have - * no effect. - * @since v14.3.0, v12.20.0 - */ - unref(): this; - /** - * events.EventEmitter - * 1. change - * 2. close - * 3. error - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - on(event: "close", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - once(event: "close", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - } - /** - * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. - * @since v0.1.93 - */ - export class ReadStream extends stream.Readable { - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes that have been read so far. - * @since v6.4.0 - */ - bytesRead: number; - /** - * The path to the file the stream is reading from as specified in the first - * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a - * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0, v10.16.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "open", listener: (fd: number) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "open", listener: (fd: number) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "ready", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "open", listener: (fd: number) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "ready", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "open", listener: (fd: number) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "open", listener: (fd: number) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * * Extends `stream.Writable` - * - * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. - * @since v0.1.93 - */ - export class WriteStream extends stream.Writable { - /** - * Closes `writeStream`. Optionally accepts a - * callback that will be executed once the `writeStream`is closed. - * @since v0.9.4 - */ - close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; - /** - * The number of bytes written so far. Does not include data that is still queued - * for writing. - * @since v0.4.7 - */ - bytesWritten: number; - /** - * The path to the file the stream is writing to as specified in the first - * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a - * `Buffer`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "open", listener: (fd: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "open", listener: (fd: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "ready", listener: () => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "open", listener: (fd: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "ready", listener: () => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "open", listener: (fd: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "open", listener: (fd: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * Asynchronously rename file at `oldPath` to the pathname provided - * as `newPath`. In the case that `newPath` already exists, it will - * be overwritten. If there is a directory at `newPath`, an error will - * be raised instead. No arguments other than a possible exception are - * given to the completion callback. - * - * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). - * - * ```js - * import { rename } from 'node:fs'; - * - * rename('oldFile.txt', 'newFile.txt', (err) => { - * if (err) throw err; - * console.log('Rename complete!'); - * }); - * ``` - * @since v0.0.2 - */ - export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace rename { - /** - * Asynchronous rename(2) - Change the name or location of a file or directory. - * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; - } - /** - * Renames the file from `oldPath` to `newPath`. Returns `undefined`. - * - * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. - * @since v0.1.21 - */ - export function renameSync(oldPath: PathLike, newPath: PathLike): void; - /** - * Truncates the file. No arguments other than a possible exception are - * given to the completion callback. A file descriptor can also be passed as the - * first argument. In this case, `fs.ftruncate()` is called. - * - * ```js - * import { truncate } from 'node:fs'; - * // Assuming that 'path/file.txt' is a regular file. - * truncate('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was truncated'); - * }); - * ``` - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * - * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. - * @since v0.8.6 - * @param [len=0] - */ - export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function truncate(path: PathLike, callback: NoParamCallback): void; - export namespace truncate { - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(path: PathLike, len?: number | null): Promise; - } - /** - * Truncates the file. Returns `undefined`. A file descriptor can also be - * passed as the first argument. In this case, `fs.ftruncateSync()` is called. - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * @since v0.8.6 - * @param [len=0] - */ - export function truncateSync(path: PathLike, len?: number | null): void; - /** - * Truncates the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. - * - * If the file referred to by the file descriptor was larger than `len` bytes, only - * the first `len` bytes will be retained in the file. - * - * For example, the following program retains only the first four bytes of the - * file: - * - * ```js - * import { open, close, ftruncate } from 'node:fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('temp.txt', 'r+', (err, fd) => { - * if (err) throw err; - * - * try { - * ftruncate(fd, 4, (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * if (err) throw err; - * } - * }); - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - */ - export function ftruncate(fd: number, callback: NoParamCallback): void; - export namespace ftruncate { - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(fd: number, len?: number | null): Promise; - } - /** - * Truncates the file descriptor. Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link ftruncate}. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncateSync(fd: number, len?: number | null): void; - /** - * Asynchronously changes owner and group of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace chown { - /** - * Asynchronous chown(2) - Change ownership of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Synchronously changes owner and group of a file. Returns `undefined`. - * This is the synchronous version of {@link chown}. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chownSync(path: PathLike, uid: number, gid: number): void; - /** - * Sets the owner of the file. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; - export namespace fchown { - /** - * Asynchronous fchown(2) - Change ownership of a file. - * @param fd A file descriptor. - */ - function __promisify__(fd: number, uid: number, gid: number): Promise; - } - /** - * Sets the owner of the file. Returns `undefined`. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function fchownSync(fd: number, uid: number, gid: number): void; - /** - * Set the owner of the symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. - */ - export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace lchown { - /** - * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Set the owner for the path. Returns `undefined`. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function lchownSync(path: PathLike, uid: number, gid: number): void; - /** - * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic - * link, then the link is not dereferenced: instead, the timestamps of the - * symbolic link itself are changed. - * - * No arguments other than a possible exception are given to the completion - * callback. - * @since v14.5.0, v12.19.0 - */ - export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace lutimes { - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, - * with the difference that if the path refers to a symbolic link, then the link is not - * dereferenced: instead, the timestamps of the symbolic link itself are changed. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Change the file system timestamps of the symbolic link referenced by `path`. - * Returns `undefined`, or throws an exception when parameters are incorrect or - * the operation fails. This is the synchronous version of {@link lutimes}. - * @since v14.5.0, v12.19.0 - */ - export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Asynchronously changes the permissions of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * - * ```js - * import { chmod } from 'node:fs'; - * - * chmod('my_file.txt', 0o775, (err) => { - * if (err) throw err; - * console.log('The permissions for file "my_file.txt" have been changed!'); - * }); - * ``` - * @since v0.1.30 - */ - export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - export namespace chmod { - /** - * Asynchronous chmod(2) - Change permissions of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link chmod}. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * @since v0.6.7 - */ - export function chmodSync(path: PathLike, mode: Mode): void; - /** - * Sets the permissions on the file. No arguments other than a possible exception - * are given to the completion callback. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; - export namespace fchmod { - /** - * Asynchronous fchmod(2) - Change permissions of a file. - * @param fd A file descriptor. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(fd: number, mode: Mode): Promise; - } - /** - * Sets the permissions on the file. Returns `undefined`. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmodSync(fd: number, mode: Mode): void; - /** - * Changes the permissions on a symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - /** @deprecated */ - export namespace lchmod { - /** - * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * Changes the permissions on a symbolic link. Returns `undefined`. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmodSync(path: PathLike, mode: Mode): void; - /** - * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * - * {@link stat} follows symbolic links. Use {@link lstat} to look at the - * links themselves. - * - * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. - * Instead, user code should open/read/write the file directly and handle the - * error raised if the file is not available. - * - * To check if a file exists without manipulating it afterwards, {@link access} is recommended. - * - * For example, given the following directory structure: - * - * ```text - * - txtDir - * -- file.txt - * - app.js - * ``` - * - * The next program will check for the stats of the given paths: - * - * ```js - * import { stat } from 'node:fs'; - * - * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; - * - * for (let i = 0; i < pathsToCheck.length; i++) { - * stat(pathsToCheck[i], (err, stats) => { - * console.log(stats.isDirectory()); - * console.log(stats); - * }); - * } - * ``` - * - * The resulting output will resemble: - * - * ```console - * true - * Stats { - * dev: 16777220, - * mode: 16877, - * nlink: 3, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214262, - * size: 96, - * blocks: 0, - * atimeMs: 1561174653071.963, - * mtimeMs: 1561174614583.3518, - * ctimeMs: 1561174626623.5366, - * birthtimeMs: 1561174126937.2893, - * atime: 2019-06-22T03:37:33.072Z, - * mtime: 2019-06-22T03:36:54.583Z, - * ctime: 2019-06-22T03:37:06.624Z, - * birthtime: 2019-06-22T03:28:46.937Z - * } - * false - * Stats { - * dev: 16777220, - * mode: 33188, - * nlink: 1, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214074, - * size: 8, - * blocks: 8, - * atimeMs: 1561174616618.8555, - * mtimeMs: 1561174614584, - * ctimeMs: 1561174614583.8145, - * birthtimeMs: 1561174007710.7478, - * atime: 2019-06-22T03:36:56.619Z, - * mtime: 2019-06-22T03:36:54.584Z, - * ctime: 2019-06-22T03:36:54.584Z, - * birthtime: 2019-06-22T03:26:47.711Z - * } - * ``` - * @since v0.0.2 - */ - export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function stat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function stat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function stat( - path: PathLike, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace stat { - /** - * Asynchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - export interface StatSyncFn extends Function { - (path: PathLike, options?: undefined): Stats; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - throwIfNoEntry: false; - }, - ): Stats | undefined; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - throwIfNoEntry: false; - }, - ): BigIntStats | undefined; - ( - path: PathLike, - options?: StatSyncOptions & { - bigint?: false | undefined; - }, - ): Stats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: true; - }, - ): BigIntStats; - ( - path: PathLike, - options: StatSyncOptions & { - bigint: boolean; - throwIfNoEntry?: false | undefined; - }, - ): Stats | BigIntStats; - (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined; - } - /** - * Synchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const statSync: StatSyncFn; - /** - * Invokes the callback with the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function fstat( - fd: number, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function fstat( - fd: number, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function fstat( - fd: number, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace fstat { - /** - * Asynchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - function __promisify__( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - fd: number, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(fd: number, options?: StatOptions): Promise; - } - /** - * Retrieves the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstatSync( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Stats; - export function fstatSync( - fd: number, - options: StatOptions & { - bigint: true; - }, - ): BigIntStats; - export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; - /** - * Retrieves the `fs.Stats` for the symbolic link referred to by the path. - * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic - * link, then the link itself is stat-ed, not the file that it refers to. - * - * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. - * @since v0.1.30 - */ - export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function lstat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void, - ): void; - export function lstat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void, - ): void; - export function lstat( - path: PathLike, - options: StatOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void, - ): void; - export namespace lstat { - /** - * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - /** - * Asynchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which - * contains `path`. The callback gets two arguments `(err, stats)` where `stats`is an `fs.StatFs` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * @since v19.6.0, v18.15.0 - * @param path A path to an existing file or directory on the file system to be queried. - */ - export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void; - export function statfs( - path: PathLike, - options: - | (StatFsOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void, - ): void; - export function statfs( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void, - ): void; - export function statfs( - path: PathLike, - options: StatFsOptions | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void, - ): void; - export namespace statfs { - /** - * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an object. - * @param path A path to an existing file or directory on the file system to be queried. - */ - function __promisify__( - path: PathLike, - options?: StatFsOptions & { - bigint?: false | undefined; - }, - ): Promise; - function __promisify__( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - ): Promise; - function __promisify__(path: PathLike, options?: StatFsOptions): Promise; - } - /** - * Synchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which - * contains `path`. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * @since v19.6.0, v18.15.0 - * @param path A path to an existing file or directory on the file system to be queried. - */ - export function statfsSync( - path: PathLike, - options?: StatFsOptions & { - bigint?: false | undefined; - }, - ): StatsFs; - export function statfsSync( - path: PathLike, - options: StatFsOptions & { - bigint: true; - }, - ): BigIntStatsFs; - export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs; - /** - * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const lstatSync: StatSyncFn; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than - * a possible - * exception are given to the completion callback. - * @since v0.1.31 - */ - export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace link { - /** - * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. - * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; - } - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.31 - */ - export function linkSync(existingPath: PathLike, newPath: PathLike): void; - /** - * Creates the link called `path` pointing to `target`. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. - * - * The `type` argument is only available on Windows and ignored on other platforms. - * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is - * not a string, Node.js will autodetect `target` type and use `'file'` or `'dir'`. - * If the `target` does not exist, `'file'` will be used. Windows junction points - * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. Junction - * points on NTFS volumes can only point to directories. - * - * Relative targets are relative to the link's parent directory. - * - * ```js - * import { symlink } from 'node:fs'; - * - * symlink('./mew', './mewtwo', callback); - * ``` - * - * The above example creates a symbolic link `mewtwo` which points to `mew` in the - * same directory: - * - * ```bash - * $ tree . - * . - * ├── mew - * └── mewtwo -> ./mew - * ``` - * @since v0.1.31 - * @param [type='null'] - */ - export function symlink( - target: PathLike, - path: PathLike, - type: symlink.Type | undefined | null, - callback: NoParamCallback, - ): void; - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - */ - export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; - export namespace symlink { - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). - * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. - */ - function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; - type Type = "dir" | "file" | "junction"; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link symlink}. - * @since v0.1.31 - * @param [type='null'] - */ - export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; - /** - * Reads the contents of the symbolic link referred to by `path`. The callback gets - * two arguments `(err, linkString)`. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path passed to the callback. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlink( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, - ): void; - /** - * 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. - */ - export function readlink( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void, - ): void; - /** - * 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. - */ - export function readlink( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void, - ): void; - /** - * 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. - */ - export function readlink( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, linkString: string) => void, - ): void; - export namespace readlink { - /** - * 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 __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * 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 __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * 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 __promisify__(path: PathLike, options?: EncodingOption): Promise; - } - /** - * Returns the symbolic link's string value. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous 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. - */ - export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous 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. - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer; - /** - * Asynchronously computes the canonical pathname by resolving `.`, `..`, and - * symbolic links. - * - * A canonical pathname is not necessarily unique. Hard links and bind mounts can - * expose a file system entity through many pathnames. - * - * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: - * - * 1. No case conversion is performed on case-insensitive file systems. - * 2. The maximum number of symbolic links is platform-independent and generally - * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. - * - * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd` to resolve relative paths. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * If `path` resolves to a socket or a pipe, the function will return a system - * dependent name for that object. - * @since v0.1.31 - */ - export function realpath( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - /** - * 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. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void, - ): void; - /** - * 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. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void, - ): void; - /** - * 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. - */ - export function realpath( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - export namespace realpath { - /** - * 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. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * 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. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * 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. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). - * - * The `callback` gets two arguments `(err, resolvedPath)`. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v9.2.0 - */ - function native( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - function native( - path: PathLike, - options: BufferEncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void, - ): void; - function native( - path: PathLike, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void, - ): void; - function native( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void, - ): void; - } - /** - * Returns the resolved pathname. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link realpath}. - * @since v0.1.31 - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous 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. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous 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. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer; - export namespace realpathSync { - function native(path: PathLike, options?: EncodingOption): string; - function native(path: PathLike, options: BufferEncodingOption): Buffer; - function native(path: PathLike, options?: EncodingOption): string | Buffer; - } - /** - * Asynchronously removes a file or symbolic link. No arguments other than a - * possible exception are given to the completion callback. - * - * ```js - * import { unlink } from 'node:fs'; - * // Assuming that 'path/file.txt' is a regular file. - * unlink('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was deleted'); - * }); - * ``` - * - * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a - * directory, use {@link rmdir}. - * - * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. - * @since v0.0.2 - */ - export function unlink(path: PathLike, callback: NoParamCallback): void; - export namespace unlink { - /** - * Asynchronous unlink(2) - delete a name and possibly the file it refers to. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. - * @since v0.1.21 - */ - export function unlinkSync(path: PathLike): void; - export interface RmDirOptions { - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning - * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. - * Use `fs.rm(path, { recursive: true, force: true })` instead. - * - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given - * to the completion callback. - * - * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on - * Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. - * @since v0.0.2 - */ - export function rmdir(path: PathLike, callback: NoParamCallback): void; - export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; - export namespace rmdir { - /** - * Asynchronous rmdir(2) - delete a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, options?: RmDirOptions): Promise; - } - /** - * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. - * - * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error - * on Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. - * @since v0.1.21 - */ - export function rmdirSync(path: PathLike, options?: RmDirOptions): void; - export interface RmOptions { - /** - * When `true`, exceptions will be ignored if `path` does not exist. - * @default false - */ - force?: boolean | undefined; - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). No arguments other than a possible exception are given to the - * completion callback. - * @since v14.14.0 - */ - export function rm(path: PathLike, callback: NoParamCallback): void; - export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; - export namespace rm { - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). - */ - function __promisify__(path: PathLike, options?: RmOptions): Promise; - } - /** - * Synchronously removes files and directories (modeled on the standard POSIX `rm` utility). Returns `undefined`. - * @since v14.14.0 - */ - export function rmSync(path: PathLike, options?: RmOptions): void; - export interface MakeDirectoryOptions { - /** - * Indicates whether parent folders should be created. - * If a folder was created, the path to the first created folder will be returned. - * @default false - */ - recursive?: boolean | undefined; - /** - * A file mode. If a string is passed, it is parsed as an octal integer. If not specified - * @default 0o777 - */ - mode?: Mode | undefined; - } - /** - * Asynchronously creates a directory. - * - * The callback is given a possible exception and, if `recursive` is `true`, the - * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was - * created (for instance, if it was previously created). - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive` property indicating whether parent directories should be created. Calling `fs.mkdir()` when `path` is a directory that - * exists results in an error only - * when `recursive` is false. If `recursive` is false and the directory exists, - * an `EEXIST` error occurs. - * - * ```js - * import { mkdir } from 'node:fs'; - * - * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist. - * mkdir('./tmp/a/apple', { recursive: true }, (err) => { - * if (err) throw err; - * }); - * ``` - * - * On Windows, using `fs.mkdir()` on the root directory even with recursion will - * result in an error: - * - * ```js - * import { mkdir } from 'node:fs'; - * - * mkdir('/', { recursive: true }, (err) => { - * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] - * }); - * ``` - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.8 - */ - export function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void, - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - | undefined, - callback: NoParamCallback, - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: Mode | MakeDirectoryOptions | null | undefined, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void, - ): void; - /** - * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function mkdir(path: PathLike, callback: NoParamCallback): void; - export namespace mkdir { - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: Mode | MakeDirectoryOptions | null, - ): Promise; - } - /** - * Synchronously creates a directory. Returns `undefined`, or if `recursive` is `true`, the first directory path created. - * This is the synchronous version of {@link mkdir}. - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.21 - */ - export function mkdirSync( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): string | undefined; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): void; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; - /** - * Creates a unique temporary directory. - * - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. Due to platform - * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, - * notably the BSDs, can return more than six random characters, and replace - * trailing `X` characters in `prefix` with random characters. - * - * The created directory path is passed as a string to the callback's second - * parameter. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'node:fs'; - * import { join } from 'node:path'; - * import { tmpdir } from 'node:os'; - * - * mkdtemp(join(tmpdir(), 'foo-'), (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 - * }); - * ``` - * - * The `fs.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 - * (`import { sep } from 'node:path'`). - * - * ```js - * import { tmpdir } from 'node:os'; - * import { mkdtemp } from 'node:fs'; - * - * // The parent directory for the new temporary directory - * const tmpDir = tmpdir(); - * - * // This method is *INCORRECT*: - * mkdtemp(tmpDir, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmpabc123`. - * // A new temporary directory is created at the file system root - * // rather than *within* the /tmp directory. - * }); - * - * // This method is *CORRECT*: - * import { sep } from 'node:path'; - * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmp/abc123`. - * // A new temporary directory is created within - * // the /tmp directory. - * }); - * ``` - * @since v5.10.0 - */ - export function mkdtemp( - prefix: string, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, folder: string) => void, - ): void; - /** - * 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. - */ - export function mkdtemp( - prefix: string, - options: - | "buffer" - | { - encoding: "buffer"; - }, - callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void, - ): void; - /** - * 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. - */ - export function mkdtemp( - prefix: string, - options: EncodingOption, - callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void, - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - */ - export function mkdtemp( - prefix: string, - callback: (err: NodeJS.ErrnoException | null, folder: string) => void, - ): void; - export namespace mkdtemp { - /** - * 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 __promisify__(prefix: string, options?: EncodingOption): Promise; - /** - * 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 __promisify__(prefix: string, options: BufferEncodingOption): Promise; - /** - * 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 __promisify__(prefix: string, options?: EncodingOption): Promise; - } - /** - * Returns the created directory path. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link 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 v5.10.0 - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string; - /** - * Synchronously 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. - */ - export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; - /** - * Synchronously 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. - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; - /** - * Reads the contents of a directory. The callback gets two arguments `(err, files)` where `files` is an array of the names of the files in the directory excluding `'.'` and `'..'`. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. - * @since v0.1.8 - */ - export function readdir( - path: PathLike, - options: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @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. - */ - export function readdir( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @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. - */ - export function readdir( - path: PathLike, - options: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readdir( - path: PathLike, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void, - ): void; - export namespace readdir { - /** - * Asynchronous readdir(3) - read a directory. - * @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 __promisify__( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @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 __promisify__( - path: PathLike, - options: - | "buffer" - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @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 __promisify__( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent - */ - function __promisify__( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise; - } - /** - * Reads the contents of the directory. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames returned. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. - * @since v0.1.21 - */ - export function readdirSync( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | BufferEncoding - | null, - ): string[]; - /** - * Synchronous readdir(3) - read a directory. - * @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. - */ - export function readdirSync( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - ): Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @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. - */ - export function readdirSync( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): string[] | Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdirSync( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Dirent[]; - /** - * Closes the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.0.2 - */ - export function close(fd: number, callback?: NoParamCallback): void; - export namespace close { - /** - * Asynchronous close(2) - close a file descriptor. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Closes the file descriptor. Returns `undefined`. - * - * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.1.21 - */ - export function closeSync(fd: number): void; - /** - * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. - * - * `mode` sets the file mode (permission and sticky bits), but only if the file was - * created. On Windows, only the write permission can be manipulated; see {@link chmod}. - * - * The callback gets two arguments `(err, fd)`. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * - * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. - * @since v0.0.2 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] - */ - export function open( - path: PathLike, - flags: OpenMode | undefined, - mode: Mode | undefined | null, - callback: (err: NodeJS.ErrnoException | null, fd: number) => void, - ): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param [flags='r'] See `support of file system `flags``. - */ - export function open( - path: PathLike, - flags: OpenMode | undefined, - callback: (err: NodeJS.ErrnoException | null, fd: number) => void, - ): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - export namespace open { - /** - * Asynchronous open(2) - open and possibly create a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. - */ - function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; - } - /** - * Returns an integer representing the file descriptor. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link open}. - * @since v0.1.21 - * @param [flags='r'] - * @param [mode=0o666] - */ - export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time in seconds, `Date`s, or a numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown. - * @since v0.4.2 - */ - export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace utimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied path. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link utimes}. - * @since v0.4.2 - */ - export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Change the file system timestamps of the object referenced by the supplied file - * descriptor. See {@link utimes}. - * @since v0.4.2 - */ - export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace futimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Synchronous version of {@link futimes}. Returns `undefined`. - * @since v0.4.2 - */ - export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other - * than a possible exception are given to the completion callback. - * @since v0.1.96 - */ - export function fsync(fd: number, callback: NoParamCallback): void; - export namespace fsync { - /** - * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.96 - */ - export function fsyncSync(fd: number): void; - /** - * Write `buffer` to the file specified by `fd`. - * - * `offset` determines the part of the buffer to be written, and `length` is - * an integer specifying the number of bytes to write. - * - * `position` refers to the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). - * - * The callback will be given three arguments `(err, bytesWritten, buffer)` where `bytesWritten` specifies how many _bytes_ were written from `buffer`. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesWritten` and `buffer` properties. - * - * It is unsafe to use `fs.write()` multiple times on the same file without waiting - * for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v0.0.2 - * @param [offset=0] - * @param [length=buffer.byteLength - offset] - * @param [position='null'] - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - */ - export function write( - fd: number, - buffer: TBuffer, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - encoding: BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - */ - export function write( - fd: number, - string: string, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - export namespace write { - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - function __promisify__( - fd: number, - buffer?: TBuffer, - offset?: number, - length?: number, - position?: number | null, - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - function __promisify__( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link write}. - * @since v0.1.21 - * @param [offset=0] - * @param [length=buffer.byteLength - offset] - * @param [position='null'] - * @return The number of bytes written. - */ - export function writeSync( - fd: number, - buffer: NodeJS.ArrayBufferView, - offset?: number | null, - length?: number | null, - position?: number | null, - ): number; - /** - * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function writeSync( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): number; - export type ReadPosition = number | bigint; - export interface ReadSyncOptions { - /** - * @default 0 - */ - offset?: number | undefined; - /** - * @default `length of buffer` - */ - length?: number | undefined; - /** - * @default null - */ - position?: ReadPosition | null | undefined; - } - export interface ReadAsyncOptions extends ReadSyncOptions { - buffer?: TBuffer; - } - /** - * Read data from the file specified by `fd`. - * - * The callback is given the three arguments, `(err, bytesRead, buffer)`. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffer` properties. - * @since v0.0.2 - * @param buffer The buffer that the data will be written to. - * @param offset The position in `buffer` to write the data to. - * @param length The number of bytes to read. - * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If - * `position` is an integer, the file position will be unchanged. - */ - export function read( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: ReadPosition | null, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - /** - * Similar to the above `fs.read` function, this version takes an optional `options` object. - * If not otherwise specified in an `options` object, - * `buffer` defaults to `Buffer.alloc(16384)`, - * `offset` defaults to `0`, - * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0 - * `position` defaults to `null` - * @since v12.17.0, 13.11.0 - */ - export function read( - fd: number, - options: ReadAsyncOptions, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - export function read( - fd: number, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void, - ): void; - export namespace read { - /** - * @param fd A file descriptor. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. - */ - function __promisify__( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: number | null, - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__( - fd: number, - options: ReadAsyncOptions, - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - function __promisify__(fd: number): Promise<{ - bytesRead: number; - buffer: NodeJS.ArrayBufferView; - }>; - } - /** - * Returns the number of `bytesRead`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link read}. - * @since v0.1.21 - * @param [position='null'] - */ - export function readSync( - fd: number, - buffer: NodeJS.ArrayBufferView, - offset: number, - length: number, - position: ReadPosition | null, - ): number; - /** - * Similar to the above `fs.readSync` function, this version takes an optional `options` object. - * If no `options` object is specified, it will default with the above values. - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; - /** - * Asynchronously reads the entire contents of a file. - * - * ```js - * import { readFile } from 'node:fs'; - * - * readFile('/etc/passwd', (err, data) => { - * if (err) throw err; - * console.log(data); - * }); - * ``` - * - * The callback is passed two arguments `(err, data)`, where `data` is the - * contents of the file. - * - * If no encoding is specified, then the raw buffer is returned. - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { readFile } from 'node:fs'; - * - * readFile('/etc/passwd', 'utf8', callback); - * ``` - * - * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an - * error will be returned. On FreeBSD, a representation of the directory's contents - * will be returned. - * - * ```js - * import { readFile } from 'node:fs'; - * - * // macOS, Linux, and Windows - * readFile('', (err, data) => { - * // => [Error: EISDIR: illegal operation on a directory, read ] - * }); - * - * // FreeBSD - * readFile('', (err, data) => { - * // => null, - * }); - * ``` - * - * It is possible to abort an ongoing request using an `AbortSignal`. If a - * request is aborted the callback is called with an `AbortError`: - * - * ```js - * import { readFile } from 'node:fs'; - * - * const controller = new AbortController(); - * const signal = controller.signal; - * readFile(fileInfo[0].name, { signal }, (err, buf) => { - * // ... - * }); - * // When you want to abort the request - * controller.abort(); - * ``` - * - * The `fs.readFile()` function buffers the entire file. To minimize memory costs, - * when possible prefer streaming via `fs.createReadStream()`. - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * @since v0.1.29 - * @param path filename or file descriptor - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding?: null | undefined; - flag?: string | undefined; - } & Abortable) - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void, - ): void; - /** - * 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. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding: BufferEncoding; - flag?: string | undefined; - } & Abortable) - | BufferEncoding, - callback: (err: NodeJS.ErrnoException | null, data: string) => void, - ): void; - /** - * 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. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | (ObjectEncodingOptions & { - flag?: string | undefined; - } & Abortable) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void, - ): void; - /** - * 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. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - */ - export function readFile( - path: PathOrFileDescriptor, - callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void, - ): void; - export namespace readFile { - /** - * 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. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null, - ): Promise; - /** - * 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. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding, - ): Promise; - /** - * 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. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null, - ): Promise; - } - /** - * Returns the contents of the `path`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readFile}. - * - * If the `encoding` option is specified then this function returns a - * string. Otherwise it returns a buffer. - * - * Similar to {@link readFile}, when the path is a directory, the behavior of `fs.readFileSync()` is platform-specific. - * - * ```js - * import { readFileSync } from 'node:fs'; - * - * // macOS, Linux, and Windows - * readFileSync(''); - * // => [Error: EISDIR: illegal operation on a directory, read ] - * - * // FreeBSD - * readFileSync(''); // => - * ``` - * @since v0.1.8 - * @param path filename or file descriptor - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null, - ): Buffer; - /** - * Synchronously 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. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding, - ): string; - /** - * Synchronously 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. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null, - ): string | Buffer; - export type WriteFileOptions = - | ( - & ObjectEncodingOptions - & Abortable - & { - mode?: Mode | undefined; - flag?: string | undefined; - flush?: boolean | undefined; - } - ) - | BufferEncoding - | null; - /** - * When `file` is a filename, asynchronously writes data to the file, replacing the - * file if it already exists. `data` can be a string or a buffer. - * - * When `file` is a file descriptor, the behavior is similar to calling `fs.write()` directly (which is recommended). See the notes below on using - * a file descriptor. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { writeFile } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, (err) => { - * if (err) throw err; - * console.log('The file has been saved!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { writeFile } from 'node:fs'; - * - * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); - * ``` - * - * It is unsafe to use `fs.writeFile()` multiple times on the same file without - * waiting for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that - * performs multiple `write` calls internally to write the buffer passed to it. - * For performance sensitive code consider using {@link createWriteStream}. - * - * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'node:fs'; - * import { Buffer } from 'node:buffer'; - * - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, { signal }, (err) => { - * // When a request is aborted - the callback is called with an AbortError - * }); - * // When the request should be aborted - * controller.abort(); - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFile( - file: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options: WriteFileOptions, - callback: NoParamCallback, - ): void; - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function writeFile( - path: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - callback: NoParamCallback, - ): void; - export namespace writeFile { - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - function __promisify__( - path: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options?: WriteFileOptions, - ): Promise; - } - /** - * Returns `undefined`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writeFile}. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFileSync( - file: PathOrFileDescriptor, - data: string | NodeJS.ArrayBufferView, - options?: WriteFileOptions, - ): void; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFile } from 'node:fs'; - * - * appendFile('message.txt', 'data to append', (err) => { - * if (err) throw err; - * console.log('The "data to append" was appended to file!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFile } from 'node:fs'; - * - * appendFile('message.txt', 'data to append', 'utf8', callback); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { open, close, appendFile } from 'node:fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('message.txt', 'a', (err, fd) => { - * if (err) throw err; - * - * try { - * appendFile(fd, 'data to append', 'utf8', (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * throw err; - * } - * }); - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFile( - path: PathOrFileDescriptor, - data: string | Uint8Array, - options: WriteFileOptions, - callback: NoParamCallback, - ): void; - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; - export namespace appendFile { - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - function __promisify__( - file: PathOrFileDescriptor, - data: string | Uint8Array, - options?: WriteFileOptions, - ): Promise; - } - /** - * Synchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * The `mode` option only affects the newly created file. See {@link open} for more details. - * - * ```js - * import { appendFileSync } from 'node:fs'; - * - * try { - * appendFileSync('message.txt', 'data to append'); - * console.log('The "data to append" was appended to file!'); - * } catch (err) { - * // Handle the error - * } - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFileSync } from 'node:fs'; - * - * appendFileSync('message.txt', 'data to append', 'utf8'); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { openSync, closeSync, appendFileSync } from 'node:fs'; - * - * let fd; - * - * try { - * fd = openSync('message.txt', 'a'); - * appendFileSync(fd, 'data to append', 'utf8'); - * } catch (err) { - * // Handle the error - * } finally { - * if (fd !== undefined) - * closeSync(fd); - * } - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFileSync( - path: PathOrFileDescriptor, - data: string | Uint8Array, - options?: WriteFileOptions, - ): void; - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The `options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'node:fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export interface WatchFileOptions { - bigint?: boolean | undefined; - persistent?: boolean | undefined; - interval?: number | undefined; - } - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The `options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'node:fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtimeMs` and `prev.mtimeMs`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint?: false | undefined; - }) - | undefined, - listener: StatsListener, - ): StatWatcher; - export function watchFile( - filename: PathLike, - options: - | (WatchFileOptions & { - bigint: true; - }) - | undefined, - listener: BigIntStatsListener, - ): StatWatcher; - /** - * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher; - /** - * Stop watching for changes on `filename`. If `listener` is specified, only that - * particular listener is removed. Otherwise, _all_ listeners are removed, - * effectively stopping watching of `filename`. - * - * Calling `fs.unwatchFile()` with a filename that is not being watched is a - * no-op, not an error. - * - * Using {@link watch} is more efficient than `fs.watchFile()` and `fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()` and `fs.unwatchFile()` when possible. - * @since v0.1.31 - * @param listener Optional, a listener previously attached using `fs.watchFile()` - */ - export function unwatchFile(filename: PathLike, listener?: StatsListener): void; - export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void; - export interface WatchOptions extends Abortable { - encoding?: BufferEncoding | "buffer" | undefined; - persistent?: boolean | undefined; - recursive?: boolean | undefined; - } - export type WatchEventType = "rename" | "change"; - export type WatchListener = (event: WatchEventType, filename: T | null) => void; - export type StatsListener = (curr: Stats, prev: Stats) => void; - export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void; - /** - * Watch for changes on `filename`, where `filename` is either a file or a - * directory. - * - * The second argument is optional. If `options` is provided as a string, it - * specifies the `encoding`. Otherwise `options` should be passed as an object. - * - * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file - * which triggered the event. - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of `eventType`. - * - * If a `signal` is passed, aborting the corresponding AbortController will close - * the returned `fs.FSWatcher`. - * @since v0.5.10 - * @param listener - */ - export function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: "buffer"; - }) - | "buffer", - listener?: WatchListener, - ): FSWatcher; - /** - * 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. - */ - export function watch( - filename: PathLike, - options?: WatchOptions | BufferEncoding | null, - listener?: WatchListener, - ): FSWatcher; - /** - * 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. - */ - export function watch( - filename: PathLike, - options: WatchOptions | string, - listener?: WatchListener, - ): FSWatcher; - /** - * 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. - */ - export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; - /** - * Test whether or not the given path exists by checking with the file system. - * Then call the `callback` argument with either true or false: - * - * ```js - * import { exists } from 'node:fs'; - * - * exists('/etc/passwd', (e) => { - * console.log(e ? 'it exists' : 'no passwd!'); - * }); - * ``` - * - * **The parameters for this callback are not consistent with other Node.js** - * **callbacks.** Normally, the first parameter to a Node.js callback is an `err` parameter, optionally followed by other parameters. The `fs.exists()` callback - * has only one boolean parameter. This is one reason `fs.access()` is recommended - * instead of `fs.exists()`. - * - * Using `fs.exists()` to check for the existence of a file before calling `fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file does not exist. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { exists, open, close } from 'node:fs'; - * - * exists('myfile', (e) => { - * if (e) { - * console.error('myfile already exists'); - * } else { - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { open, close, exists } from 'node:fs'; - * - * exists('myfile', (e) => { - * if (e) { - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } else { - * console.error('myfile does not exist'); - * } - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for existence and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the existence of a file only if the file won't be - * used directly, for example when its existence is a signal from another - * process. - * @since v0.0.2 - * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. - */ - export function exists(path: PathLike, callback: (exists: boolean) => void): void; - /** @deprecated */ - export namespace exists { - /** - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Returns `true` if the path exists, `false` otherwise. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link exists}. - * - * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback` parameter to `fs.exists()` accepts parameters that are inconsistent with other - * Node.js callbacks. `fs.existsSync()` does not use a callback. - * - * ```js - * import { existsSync } from 'node:fs'; - * - * if (existsSync('/etc/passwd')) - * console.log('The path exists.'); - * ``` - * @since v0.1.21 - */ - export function existsSync(path: PathLike): boolean; - export namespace constants { - // File Access Constants - /** Constant for fs.access(). File is visible to the calling process. */ - const F_OK: number; - /** Constant for fs.access(). File can be read by the calling process. */ - const R_OK: number; - /** Constant for fs.access(). File can be written by the calling process. */ - const W_OK: number; - /** Constant for fs.access(). File can be executed by the calling process. */ - const X_OK: number; - // File Copy Constants - /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ - const COPYFILE_EXCL: number; - /** - * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. - */ - const COPYFILE_FICLONE: number; - /** - * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then the operation will fail with an error. - */ - const COPYFILE_FICLONE_FORCE: number; - // File Open Constants - /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ - const O_RDONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ - const O_WRONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ - const O_RDWR: number; - /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ - const O_CREAT: number; - /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ - const O_EXCL: number; - /** - * Constant for fs.open(). Flag indicating that if path identifies a terminal device, - * opening the path shall not cause that terminal to become the controlling terminal for the process - * (if the process does not already have one). - */ - const O_NOCTTY: number; - /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ - const O_TRUNC: number; - /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ - const O_APPEND: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ - const O_DIRECTORY: number; - /** - * constant for fs.open(). - * Flag indicating reading accesses to the file system will no longer result in - * an update to the atime information associated with the file. - * This flag is available on Linux operating systems only. - */ - const O_NOATIME: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ - const O_NOFOLLOW: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ - const O_SYNC: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ - const O_DSYNC: number; - /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ - const O_SYMLINK: number; - /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ - const O_DIRECT: number; - /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ - const O_NONBLOCK: number; - // File Type Constants - /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ - const S_IFMT: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ - const S_IFREG: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ - const S_IFDIR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ - const S_IFCHR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ - const S_IFBLK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ - const S_IFIFO: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ - const S_IFLNK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ - const S_IFSOCK: number; - // File Mode Constants - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ - const S_IRWXU: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ - const S_IRUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ - const S_IWUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ - const S_IXUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ - const S_IRWXG: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ - const S_IRGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ - const S_IWGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ - const S_IXGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ - const S_IRWXO: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ - const S_IROTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ - const S_IWOTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ - const S_IXOTH: number; - /** - * When set, a memory file mapping is used to access the file. This flag - * is available on Windows operating systems only. On other operating systems, - * this flag is ignored. - */ - const UV_FS_O_FILEMAP: number; - } - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * The final argument, `callback`, is a callback function that is invoked with - * a possible error argument. If any of the accessibility checks fail, the error - * argument will be an `Error` object. The following examples check if `package.json` exists, and if it is readable or writable. - * - * ```js - * import { access, constants } from 'node:fs'; - * - * const file = 'package.json'; - * - * // Check if the file exists in the current directory. - * access(file, constants.F_OK, (err) => { - * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); - * }); - * - * // Check if the file is readable. - * access(file, constants.R_OK, (err) => { - * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); - * }); - * - * // Check if the file is writable. - * access(file, constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); - * }); - * - * // Check if the file is readable and writable. - * access(file, constants.R_OK | constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`); - * }); - * ``` - * - * Do not use `fs.access()` to check for the accessibility of a file before calling `fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file is not accessible. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'node:fs'; - * - * access('myfile', (err) => { - * if (!err) { - * console.error('myfile already exists'); - * return; - * } - * - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'node:fs'; - * access('myfile', (err) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'node:fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for accessibility and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the accessibility of a file only if the file will not be - * used directly, for example when its accessibility is a signal from another - * process. - * - * On Windows, access-control policies (ACLs) on a directory may limit access to - * a file or directory. The `fs.access()` function, however, does not check the - * ACL and therefore may report that a path is accessible even if the ACL restricts - * the user from reading or writing to it. - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function access(path: PathLike, callback: NoParamCallback): void; - export namespace access { - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike, mode?: number): Promise; - } - /** - * Synchronously tests a user's permissions for the file or directory specified - * by `path`. The `mode` argument is an optional integer that specifies the - * accessibility checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and - * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, - * the method will return `undefined`. - * - * ```js - * import { accessSync, constants } from 'node:fs'; - * - * try { - * accessSync('etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can read/write'); - * } catch (err) { - * console.error('no access!'); - * } - * ``` - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function accessSync(path: PathLike, mode?: number): void; - interface StreamOptions { - flags?: string | undefined; - encoding?: BufferEncoding | undefined; - fd?: number | promises.FileHandle | undefined; - mode?: number | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - signal?: AbortSignal | null | undefined; - highWaterMark?: number | undefined; - } - interface FSImplementation { - open?: (...args: any[]) => any; - close?: (...args: any[]) => any; - } - interface CreateReadStreamFSImplementation extends FSImplementation { - read: (...args: any[]) => any; - } - interface CreateWriteStreamFSImplementation extends FSImplementation { - write: (...args: any[]) => any; - writev?: (...args: any[]) => any; - } - interface ReadStreamOptions extends StreamOptions { - fs?: CreateReadStreamFSImplementation | null | undefined; - end?: number | undefined; - } - interface WriteStreamOptions extends StreamOptions { - fs?: CreateWriteStreamFSImplementation | null | undefined; - flush?: boolean | undefined; - } - /** - * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 KiB. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is - * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the - * current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use - * the specified file descriptor. This means that no `'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. - * - * If `fd` points to a character device that only supports blocking reads - * (such as keyboard or sound card), read operations do not finish until data is - * available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option, it is possible to override the corresponding `fs` implementations for `open`, `read`, and `close`. When providing the `fs` option, - * an override for `read` is required. If no `fd` is provided, an override for `open` is also required. If `autoClose` is `true`, an override for `close` is - * also required. - * - * ```js - * import { createReadStream } from 'node:fs'; - * - * // Create a stream from some character device. - * const stream = createReadStream('/dev/input/event0'); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * `mode` sets the file mode (permission and sticky bits), but only if the - * file was created. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { createReadStream } from 'node:fs'; - * - * createReadStream('sample.txt', { start: 90, end: 99 }); - * ``` - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` option to be set to `r+` rather than the - * default `w`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * By providing the `fs` option it is possible to override the corresponding `fs` implementations for `open`, `write`, `writev`, and `close`. Overriding `write()` without `writev()` can reduce - * performance as some optimizations (`_writev()`) - * will be disabled. When providing the `fs` option, overrides for at least one of `write` and `writev` are required. If no `fd` option is supplied, an override - * for `open` is also required. If `autoClose` is `true`, an override for `close` is also required. - * - * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the `path` argument and will use the specified file descriptor. This means that no `'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s - * should be passed to `net.Socket`. - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - */ - export function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other - * than a possible - * exception are given to the completion callback. - * @since v0.1.96 - */ - export function fdatasync(fd: number, callback: NoParamCallback): void; - export namespace fdatasync { - /** - * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. - * @since v0.1.96 - */ - export function fdatasyncSync(fd: number): void; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. No arguments other than a possible exception are given to the - * callback function. Node.js makes no guarantees about the atomicity of the copy - * operation. If an error occurs after the destination file has been opened for - * writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFile, constants } from 'node:fs'; - * - * function callback(err) { - * if (err) throw err; - * console.log('source.txt was copied to destination.txt'); - * } - * - * // destination.txt will be created or overwritten by default. - * copyFile('source.txt', 'destination.txt', callback); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; - export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; - export namespace copyFile { - function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; - } - /** - * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. Returns `undefined`. Node.js makes no guarantees about the - * atomicity of the copy operation. If an error occurs after the destination file - * has been opened for writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFileSync, constants } from 'node:fs'; - * - * // destination.txt will be created or overwritten by default. - * copyFileSync('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; - /** - * Write an array of `ArrayBufferView`s to the file specified by `fd` using `writev()`. - * - * `position` is the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. - * - * The callback will be given three arguments: `err`, `bytesWritten`, and `buffers`. `bytesWritten` is how many bytes were written from `buffers`. - * - * If this method is `util.promisify()` ed, it returns a promise for an `Object` with `bytesWritten` and `buffers` properties. - * - * It is unsafe to use `fs.writev()` multiple times on the same file without - * waiting for the callback. For this scenario, use {@link createWriteStream}. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param [position='null'] - */ - export function writev( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export function writev( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export interface WriteVResult { - bytesWritten: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace writev { - function __promisify__( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position?: number, - ): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writev}. - * @since v12.9.0 - * @param [position='null'] - * @return The number of bytes written. - */ - export function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; - /** - * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s - * using `readv()`. - * - * `position` is the offset from the beginning of the file from where data - * should be read. If `typeof position !== 'number'`, the data will be read - * from the current position. - * - * The callback will be given three arguments: `err`, `bytesRead`, and `buffers`. `bytesRead` is how many bytes were read from the file. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffers` properties. - * @since v13.13.0, v12.17.0 - * @param [position='null'] - */ - export function readv( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export function readv( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void, - ): void; - export interface ReadVResult { - bytesRead: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace readv { - function __promisify__( - fd: number, - buffers: readonly NodeJS.ArrayBufferView[], - position?: number, - ): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readv}. - * @since v13.13.0, v12.17.0 - * @param [position='null'] - * @return The number of bytes read. - */ - export function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number; - - export interface OpenAsBlobOptions { - /** - * An optional mime type for the blob. - * - * @default 'undefined' - */ - type?: string | undefined; - } - - /** - * Returns a `Blob` whose data is backed by the given file. - * - * The file must not be modified after the `Blob` is created. Any modifications - * will cause reading the `Blob` data to fail with a `DOMException` error. - * Synchronous stat operations on the file when the `Blob` is created, and before - * each read in order to detect whether the file data has been modified on disk. - * - * ```js - * import { openAsBlob } from 'node:fs'; - * - * const blob = await openAsBlob('the.file.txt'); - * const ab = await blob.arrayBuffer(); - * blob.stream(); - * ``` - * @since v19.8.0 - * @experimental - */ - export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise; - - export interface OpenDirOptions { - /** - * @default 'utf8' - */ - encoding?: BufferEncoding | undefined; - /** - * Number of directory entries that are buffered - * internally when reading from the directory. Higher values lead to better - * performance but higher memory usage. - * @default 32 - */ - bufferSize?: number | undefined; - /** - * @default false - */ - recursive?: boolean; - } - /** - * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; - /** - * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for - * more details. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export function opendir( - path: PathLike, - options: OpenDirOptions, - cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void, - ): void; - export namespace opendir { - function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; - } - export interface BigIntStats extends StatsBase { - atimeNs: bigint; - mtimeNs: bigint; - ctimeNs: bigint; - birthtimeNs: bigint; - } - export interface BigIntOptions { - bigint: true; - } - export interface StatOptions { - bigint?: boolean | undefined; - } - export interface StatSyncOptions extends StatOptions { - throwIfNoEntry?: boolean | undefined; - } - interface CopyOptionsBase { - /** - * Dereference symlinks - * @default false - */ - dereference?: boolean; - /** - * When `force` is `false`, and the destination - * exists, throw an error. - * @default false - */ - errorOnExist?: boolean; - /** - * Overwrite existing file or directory. _The copy - * operation will ignore errors if you set this to false and the destination - * exists. Use the `errorOnExist` option to change this behavior. - * @default true - */ - force?: boolean; - /** - * Modifiers for copy operation. See `mode` flag of {@link copyFileSync()} - */ - mode?: number; - /** - * When `true` timestamps from `src` will - * be preserved. - * @default false - */ - preserveTimestamps?: boolean; - /** - * Copy directories recursively. - * @default false - */ - recursive?: boolean; - /** - * When true, path resolution for symlinks will be skipped - * @default false - */ - verbatimSymlinks?: boolean; - } - export interface CopyOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean | Promise; - } - export interface CopySyncOptions extends CopyOptionsBase { - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean; - } - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cp( - source: string | URL, - destination: string | URL, - callback: (err: NodeJS.ErrnoException | null) => void, - ): void; - export function cp( - source: string | URL, - destination: string | URL, - opts: CopyOptions, - callback: (err: NodeJS.ErrnoException | null) => void, - ): void; - /** - * Synchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; - - export interface GlobOptions { - /** - * Current working directory. - * @default process.cwd() - */ - cwd?: string | undefined; - /** - * Function to filter out files/directories. Return true to exclude the item, false to include it. - */ - exclude?: ((fileName: string) => boolean) | undefined; - /** - * `true` if the glob should return paths as `Dirent`s, `false` otherwise. - * @default false - * @since v22.2.0 - */ - withFileTypes?: boolean | undefined; - } - export interface GlobOptionsWithFileTypes extends GlobOptions { - withFileTypes: true; - } - export interface GlobOptionsWithoutFileTypes extends GlobOptions { - withFileTypes?: false | undefined; - } - /** - * Retrieves the files matching the specified pattern. - */ - export function glob( - pattern: string | string[], - callback: (err: NodeJS.ErrnoException | null, matches: string[]) => void, - ): void; - export function glob( - pattern: string | string[], - options: GlobOptionsWithFileTypes, - callback: ( - err: NodeJS.ErrnoException | null, - matches: Dirent[], - ) => void, - ): void; - export function glob( - pattern: string | string[], - options: GlobOptionsWithoutFileTypes, - callback: ( - err: NodeJS.ErrnoException | null, - matches: string[], - ) => void, - ): void; - export function glob( - pattern: string | string[], - options: GlobOptions, - callback: ( - err: NodeJS.ErrnoException | null, - matches: Dirent[] | string[], - ) => void, - ): void; - /** - * Retrieves the files matching the specified pattern. - */ - export function globSync(pattern: string | string[]): string[]; - export function globSync( - pattern: string | string[], - options: GlobOptionsWithFileTypes, - ): Dirent[]; - export function globSync( - pattern: string | string[], - options: GlobOptionsWithoutFileTypes, - ): string[]; - export function globSync( - pattern: string | string[], - options: GlobOptions, - ): Dirent[] | string[]; -} -declare module "node:fs" { - export * from "fs"; -} diff --git a/node_modules/@types/node/fs/promises.d.ts b/node_modules/@types/node/fs/promises.d.ts deleted file mode 100644 index 79726bd..0000000 --- a/node_modules/@types/node/fs/promises.d.ts +++ /dev/null @@ -1,1264 +0,0 @@ -/** - * The `fs/promises` API provides asynchronous file system methods that return - * promises. - * - * The promise APIs use the underlying Node.js threadpool to perform file - * system operations off the event loop thread. These operations are not - * synchronized or threadsafe. Care must be taken when performing multiple - * concurrent modifications on the same file or data corruption may occur. - * @since v10.0.0 - */ -declare module "fs/promises" { - import { Abortable } from "node:events"; - import { Stream } from "node:stream"; - import { ReadableStream } from "node:stream/web"; - import { - BigIntStats, - BigIntStatsFs, - BufferEncodingOption, - constants as fsConstants, - CopyOptions, - Dir, - Dirent, - GlobOptions, - GlobOptionsWithFileTypes, - GlobOptionsWithoutFileTypes, - MakeDirectoryOptions, - Mode, - ObjectEncodingOptions, - OpenDirOptions, - OpenMode, - PathLike, - ReadStream, - ReadVResult, - RmDirOptions, - RmOptions, - StatFsOptions, - StatOptions, - Stats, - StatsFs, - TimeLike, - WatchEventType, - WatchOptions, - WriteStream, - WriteVResult, - } from "node:fs"; - import { Interface as ReadlineInterface } from "node:readline"; - interface FileChangeInfo { - eventType: WatchEventType; - filename: T | null; - } - interface FlagAndOpenMode { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } - interface FileReadResult { - bytesRead: number; - buffer: T; - } - interface FileReadOptions { - /** - * @default `Buffer.alloc(0xffff)` - */ - buffer?: T; - /** - * @default 0 - */ - offset?: number | null; - /** - * @default `buffer.byteLength` - */ - length?: number | null; - position?: number | null; - } - interface CreateReadStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - end?: number | undefined; - highWaterMark?: number | undefined; - } - interface CreateWriteStreamOptions { - encoding?: BufferEncoding | null | undefined; - autoClose?: boolean | undefined; - emitClose?: boolean | undefined; - start?: number | undefined; - highWaterMark?: number | undefined; - flush?: boolean | undefined; - } - interface ReadableWebStreamOptions { - /** - * Whether to open a normal or a `'bytes'` stream. - * @since v20.0.0 - */ - type?: "bytes" | undefined; - } - // TODO: Add `EventEmitter` close - interface FileHandle { - /** - * The numeric file descriptor managed by the {FileHandle} object. - * @since v10.0.0 - */ - readonly fd: number; - /** - * Alias of `filehandle.writeFile()`. - * - * When operating on file handles, the mode cannot be changed from what it was set - * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - appendFile( - data: string | Uint8Array, - options?: - | (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined }) - | BufferEncoding - | null, - ): Promise; - /** - * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). - * @since v10.0.0 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - * @return Fulfills with `undefined` upon success. - */ - chown(uid: number, gid: number): Promise; - /** - * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). - * @since v10.0.0 - * @param mode the file mode bit mask. - * @return Fulfills with `undefined` upon success. - */ - chmod(mode: Mode): Promise; - /** - * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream - * returned by this method has a default `highWaterMark` of 64 KiB. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is - * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from - * the current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If the `FileHandle` points to a character device that only supports blocking - * reads (such as keyboard or sound card), read operations do not finish until data - * is available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const fd = await open('/dev/input/event0'); - * // Create a stream from some character device. - * const stream = fd.createReadStream(); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const fd = await open('sample.txt'); - * fd.createReadStream({ start: 90, end: 99 }); - * ``` - * @since v16.11.0 - */ - createReadStream(options?: CreateReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than - * replacing it may require the `flags` `open` option to be set to `r+` rather than - * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed. Set the `emitClose` option to `false` to change this behavior. - * @since v16.11.0 - */ - createWriteStream(options?: CreateWriteStreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. - * - * Unlike `filehandle.sync` this method does not flush modified metadata. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - datasync(): Promise; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - sync(): Promise; - /** - * Reads data from the file and stores that in the given buffer. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * @since v10.0.0 - * @param buffer A buffer that will be filled with the file data read. - * @param offset The location in the buffer at which to start filling. - * @param length The number of bytes to read. - * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an - * integer, the current file position will remain unchanged. - * @return Fulfills upon success with an object with two properties: - */ - read( - buffer: T, - offset?: number | null, - length?: number | null, - position?: number | null, - ): Promise>; - read(options?: FileReadOptions): Promise>; - /** - * Returns a `ReadableStream` that may be used to read the files data. - * - * An error will be thrown if this method is called more than once or is called - * after the `FileHandle` is closed or closing. - * - * ```js - * import { - * open, - * } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const chunk of file.readableWebStream()) - * console.log(chunk); - * - * await file.close(); - * ``` - * - * 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; - /** - * Asynchronously reads the entire contents of a file. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support reading. - * - * If one or more `filehandle.read()` calls are made on a file handle and then a `filehandle.readFile()` call is made, the data will be read from the current - * position till the end of the file. It doesn't always read from the beginning - * of the file. - * @since v10.0.0 - * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the - * data will be a string. - */ - readFile( - options?: { - encoding?: null | undefined; - flag?: OpenMode | undefined; - } | null, - ): Promise; - /** - * 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; - } - | BufferEncoding, - ): Promise; - /** - * 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; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Convenience method to create a `readline` interface and stream over the file. - * See `filehandle.createReadStream()` for the options. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * const file = await open('./some/file/to/read'); - * - * for await (const line of file.readLines()) { - * console.log(line); - * } - * ``` - * @since v18.11.0 - */ - readLines(options?: CreateReadStreamOptions): ReadlineInterface; - /** - * @since v10.0.0 - * @return Fulfills with an {fs.Stats} for the file. - */ - stat( - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - stat( - opts: StatOptions & { - bigint: true; - }, - ): Promise; - stat(opts?: StatOptions): Promise; - /** - * Truncates the file. - * - * If the file was larger than `len` bytes, only the first `len` bytes will be - * retained in the file. - * - * The following example retains only the first four bytes of the file: - * - * ```js - * import { open } from 'node:fs/promises'; - * - * let filehandle = null; - * try { - * filehandle = await open('temp.txt', 'r+'); - * await filehandle.truncate(4); - * } finally { - * await filehandle?.close(); - * } - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - truncate(len?: number): Promise; - /** - * Change the file system timestamps of the object referenced by the `FileHandle` then fulfills the promise with no arguments upon success. - * @since v10.0.0 - */ - utimes(atime: TimeLike, mtime: TimeLike): Promise; - /** - * 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 - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * The promise is fulfilled with no arguments upon success. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support writing. - * - * It is unsafe to use `filehandle.writeFile()` multiple times on the same file - * without waiting for the promise to be fulfilled (or rejected). - * - * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the - * current position till the end of the file. It doesn't always write from the - * beginning of the file. - * @since v10.0.0 - */ - writeFile( - data: string | Uint8Array, - options?: - | (ObjectEncodingOptions & FlagAndOpenMode & Abortable & { flush?: boolean | undefined }) - | BufferEncoding - | null, - ): Promise; - /** - * Write `buffer` to the file. - * - * The promise is fulfilled with an object containing two properties: - * - * It is unsafe to use `filehandle.write()` multiple times on the same file - * without waiting for the promise to be fulfilled (or rejected). For this - * scenario, use `filehandle.createWriteStream()`. - * - * On Linux, positional writes do not work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v10.0.0 - * @param offset The start position from within `buffer` where the data to write begins. - * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write. - * @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( - buffer: TBuffer, - offset?: number | null, - length?: number | null, - position?: number | null, - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - write( - data: string, - position?: number | null, - encoding?: BufferEncoding | null, - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - /** - * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. - * - * The promise is fulfilled with an object containing a two properties: - * - * It is unsafe to call `writev()` multiple times on the same file without waiting - * for the promise to be fulfilled (or rejected). - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @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; - /** - * 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; - /** - * Closes the file handle after waiting for any pending operation on the handle to - * complete. - * - * ```js - * import { open } from 'node:fs/promises'; - * - * let filehandle; - * try { - * filehandle = await open('thefile.txt', 'r'); - * } finally { - * await filehandle?.close(); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - close(): Promise; - /** - * An alias for {@link FileHandle.close()}. - * @since v20.4.0 - */ - [Symbol.asyncDispose](): Promise; - } - const constants: typeof fsConstants; - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and `fs.constants.X_OK` - * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for - * possible values of `mode`. - * - * If the accessibility check is successful, the promise is fulfilled with no - * value. If any of the accessibility checks fail, the promise is rejected - * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and - * written by the current process. - * - * ```js - * import { access, constants } from 'node:fs/promises'; - * - * try { - * await access('/etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can access'); - * } catch { - * console.error('cannot access'); - * } - * ``` - * - * Using `fsPromises.access()` to check for the accessibility of a file before - * calling `fsPromises.open()` is not recommended. Doing so introduces a race - * condition, since other processes may change the file's state between the two - * calls. Instead, user code should open/read/write the file directly and handle - * the error raised if the file is not accessible. - * @since v10.0.0 - * @param [mode=fs.constants.F_OK] - * @return Fulfills with `undefined` upon success. - */ - function access(path: PathLike, mode?: number): Promise; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. - * - * No guarantees are made about the atomicity of the copy operation. If an - * error occurs after the destination file has been opened for writing, an attempt - * will be made to remove the destination. - * - * ```js - * import { copyFile, constants } from 'node:fs/promises'; - * - * try { - * await copyFile('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.error('The file could not be copied'); - * } - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * try { - * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.error('The file could not be copied'); - * } - * ``` - * @since v10.0.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. - * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) - * @return Fulfills with `undefined` upon success. - */ - function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; - /** - * Opens a `FileHandle`. - * - * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * @since v10.0.0 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. - * @return Fulfills with a {FileHandle} object. - */ - function open(path: PathLike, flags?: string | number, mode?: Mode): Promise; - /** - * Renames `oldPath` to `newPath`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rename(oldPath: PathLike, newPath: PathLike): Promise; - /** - * Truncates (shortens or extends the length) of the content at `path` to `len` bytes. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - function truncate(path: PathLike, len?: number): Promise; - /** - * Removes the directory identified by `path`. - * - * Using `fsPromises.rmdir()` on a file (not a directory) results in the - * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rmdir(path: PathLike, options?: RmDirOptions): Promise; - /** - * Removes files and directories (modeled on the standard POSIX `rm` utility). - * @since v14.14.0 - * @return Fulfills with `undefined` upon success. - */ - function rm(path: PathLike, options?: RmOptions): Promise; - /** - * Asynchronously creates a directory. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive` property indicating whether parent directories should be created. Calling `fsPromises.mkdir()` when `path` is a directory - * that exists results in a - * rejection only when `recursive` is false. - * - * ```js - * import { mkdir } from 'node:fs/promises'; - * - * try { - * const projectFolder = new URL('./test/project/', import.meta.url); - * const createDir = await mkdir(projectFolder, { recursive: true }); - * - * console.log(`created ${createDir}`); - * } catch (err) { - * console.error(err.message); - * } - * ``` - * @since v10.0.0 - * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. - */ - function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null, - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - /** - * Reads the contents of a directory. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned - * will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the returned array will contain `fs.Dirent` objects. - * - * ```js - * import { readdir } from 'node:fs/promises'; - * - * try { - * const files = await readdir(path); - * for (const file of files) - * console.log(file); - * } catch (err) { - * console.error(err); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @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 readdir( - path: PathLike, - options: - | { - encoding: "buffer"; - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - } - | "buffer", - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @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 readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - recursive?: boolean | undefined; - }) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - recursive?: boolean | undefined; - }, - ): Promise; - /** - * 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. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, the link path - * returned will be passed as a `Buffer` object. - * @since v10.0.0 - * @return Fulfills with the `linkString` upon success. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * 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: BufferEncodingOption): Promise; - /** - * 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; - /** - * Creates a symbolic link. - * - * The `type` argument is only used on Windows platforms and can be one of `'dir'`, `'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will - * autodetect `target` type and use `'file'` or `'dir'`. If the `target` does not - * exist, `'file'` will be used. Windows junction points require the destination - * path to be absolute. When using `'junction'`, the `target` argument will - * automatically be normalized to absolute path. Junction points on NTFS volumes - * can only point to directories. - * @since v10.0.0 - * @param [type='null'] - * @return Fulfills with `undefined` upon success. - */ - function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; - /** - * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, - * in which case the link itself is stat-ed, not the file that it refers to. - * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. - */ - function lstat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function lstat( - path: PathLike, - opts: StatOptions & { - bigint: true; - }, - ): Promise; - function lstat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given `path`. - */ - function stat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - }, - ): Promise; - function stat( - path: PathLike, - opts: StatOptions & { - bigint: true; - }, - ): Promise; - function stat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v19.6.0, v18.15.0 - * @return Fulfills with the {fs.StatFs} object for the given `path`. - */ - function statfs( - path: PathLike, - opts?: StatFsOptions & { - bigint?: false | undefined; - }, - ): Promise; - function statfs( - path: PathLike, - opts: StatFsOptions & { - bigint: true; - }, - ): Promise; - function statfs(path: PathLike, opts?: StatFsOptions): Promise; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function link(existingPath: PathLike, newPath: PathLike): Promise; - /** - * If `path` refers to a symbolic link, then the link is removed without affecting - * the file or directory to which that link refers. If the `path` refers to a file - * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function unlink(path: PathLike): Promise; - /** - * Changes the permissions of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the permissions on a symbolic link. - * - * This method is only implemented on macOS. - * @deprecated Since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the ownership on a symbolic link. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchown(path: PathLike, uid: number, gid: number): Promise; - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a - * symbolic link, then the link is not dereferenced: instead, the timestamps of - * the symbolic link itself are changed. - * @since v14.5.0, v12.19.0 - * @return Fulfills with `undefined` upon success. - */ - function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Changes the ownership of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chown(path: PathLike, uid: number, gid: number): Promise; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time, `Date`s, or a - * numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - /** - * Determines the actual location of `path` using the same semantics as the `fs.realpath.native()` function. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path. If the `encoding` is set to `'buffer'`, the path returned will be - * passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v10.0.0 - * @return Fulfills with the resolved path upon success. - */ - function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * 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. - * @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; - /** - * 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. - * @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?: ObjectEncodingOptions | BufferEncoding | null, - ): Promise; - /** - * 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 - * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some - * platforms, notably the BSDs, can return more than six random characters, and - * replace trailing `X` characters in `prefix` with random characters. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'node:fs/promises'; - * import { join } from 'node:path'; - * import { tmpdir } from 'node:os'; - * - * try { - * await mkdtemp(join(tmpdir(), 'foo-')); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * 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 - * (`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. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * 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: BufferEncodingOption): Promise; - /** - * 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; - /** - * 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 - * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * If `options` is a string, then it specifies the encoding. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * Any specified `FileHandle` has to support writing. - * - * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file - * without waiting for the promise to be settled. - * - * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience - * method that performs multiple `write` calls internally to write the buffer - * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`. - * - * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'node:fs/promises'; - * import { Buffer } from 'node:buffer'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * const promise = writeFile('message.txt', data, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v10.0.0 - * @param file filename or `FileHandle` - * @return Fulfills with `undefined` upon success. - */ - function writeFile( - file: PathLike | FileHandle, - data: - | string - | NodeJS.ArrayBufferView - | Iterable - | AsyncIterable - | Stream, - options?: - | (ObjectEncodingOptions & { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - /** - * If all data is successfully written to the file, and `flush` - * is `true`, `filehandle.sync()` is used to flush the data. - * @default false - */ - flush?: boolean | undefined; - } & Abortable) - | BufferEncoding - | null, - ): Promise; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `mode` option only affects the newly created file. See `fs.open()` for more details. - * - * The `path` may be specified as a `FileHandle` that has been opened - * for appending (using `fsPromises.open()`). - * @since v10.0.0 - * @param path filename or {FileHandle} - * @return Fulfills with `undefined` upon success. - */ - function appendFile( - path: PathLike | FileHandle, - data: string | Uint8Array, - options?: (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined }) | BufferEncoding | null, - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * - * If no encoding is specified (using `options.encoding`), the data is returned - * as a `Buffer` object. Otherwise, the data will be a string. - * - * If `options` is a string, then it specifies the encoding. - * - * When the `path` is a directory, the behavior of `fsPromises.readFile()` is - * platform-specific. On macOS, Linux, and Windows, the promise will be rejected - * with an error. On FreeBSD, a representation of the directory's contents will be - * returned. - * - * An example of reading a `package.json` file located in the same directory of the - * running code: - * - * ```js - * import { readFile } from 'node:fs/promises'; - * try { - * const filePath = new URL('./package.json', import.meta.url); - * const contents = await readFile(filePath, { encoding: 'utf8' }); - * console.log(contents); - * } catch (err) { - * console.error(err.message); - * } - * ``` - * - * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a - * request is aborted the promise returned is rejected with an `AbortError`: - * - * ```js - * import { readFile } from 'node:fs/promises'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const promise = readFile(fileName, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * - * Any specified `FileHandle` has to support reading. - * @since v10.0.0 - * @param path filename or `FileHandle` - * @return Fulfills with the contents of the file. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ({ - encoding?: null | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | null, - ): Promise; - /** - * 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. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options: - | ({ - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding, - ): Promise; - /** - * 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. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ( - & ObjectEncodingOptions - & Abortable - & { - flag?: OpenMode | undefined; - } - ) - | BufferEncoding - | null, - ): Promise; - /** - * 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. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * - * Example using async iteration: - * - * ```js - * import { opendir } from 'node:fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - * @return Fulfills with an {fs.Dir}. - */ - function opendir(path: PathLike, options?: OpenDirOptions): Promise; - /** - * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. - * - * ```js - * import { watch } from 'node:fs/promises'; - * - * const ac = new AbortController(); - * const { signal } = ac; - * setTimeout(() => ac.abort(), 10000); - * - * (async () => { - * try { - * const watcher = watch(__filename, { signal }); - * for await (const event of watcher) - * console.log(event); - * } catch (err) { - * if (err.name === 'AbortError') - * return; - * throw err; - * } - * })(); - * ``` - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. - * @since v15.9.0, v14.18.0 - * @return of objects with the properties: - */ - function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: "buffer"; - }) - | "buffer", - ): AsyncIterable>; - /** - * 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>; - /** - * 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 | string, - ): AsyncIterable> | AsyncIterable>; - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - * @return Fulfills with `undefined` upon success. - */ - function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise; - /** - * Retrieves the files matching the specified pattern. - */ - function glob(pattern: string | string[]): NodeJS.AsyncIterator; - function glob( - pattern: string | string[], - opt: GlobOptionsWithFileTypes, - ): NodeJS.AsyncIterator; - function glob( - pattern: string | string[], - opt: GlobOptionsWithoutFileTypes, - ): NodeJS.AsyncIterator; - function glob( - pattern: string | string[], - opt: GlobOptions, - ): NodeJS.AsyncIterator; -} -declare module "node:fs/promises" { - export * from "fs/promises"; -} diff --git a/node_modules/@types/node/globals.d.ts b/node_modules/@types/node/globals.d.ts deleted file mode 100644 index e223aed..0000000 --- a/node_modules/@types/node/globals.d.ts +++ /dev/null @@ -1,566 +0,0 @@ -export {}; // Make this a module - -// #region Fetch and friends -// Conditional type aliases, used at the end of this file. -// Will either be empty if lib.dom (or lib.webworker) 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 _MessageEvent = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").MessageEvent; -type _RequestInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").RequestInit; -type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} - : import("undici-types").ResponseInit; -type _WebSocket = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").WebSocket; -type _EventSource = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").EventSource; -// #endregion Fetch and friends - -// Conditional type definitions for webstorage interface, which conflicts with lib.dom otherwise. -type _Storage = typeof globalThis extends { onabort: any } ? {} : { - /** - * Returns the number of key/value pairs. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/length) - */ - readonly length: number; - /** - * Removes all key/value pairs, if there are any. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/clear) - */ - clear(): void; - /** - * Returns the current value associated with the given key, or null if the given key does not exist. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/getItem) - */ - getItem(key: string): string | null; - /** - * Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/key) - */ - key(index: number): string | null; - /** - * Removes the key/value pair with the given key, if a key/value pair with the given key exists. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/removeItem) - */ - removeItem(key: string): void; - /** - * Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously. - * - * Throws a "QuotaExceededError" DOMException exception if the new value couldn't be set. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/setItem) - */ - setItem(key: string, value: string): void; - [key: string]: any; -}; - -// #region DOMException -type _DOMException = typeof globalThis extends { onmessage: any } ? {} : NodeDOMException; -interface NodeDOMException extends Error { - /** - * @deprecated - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code) - */ - readonly code: number; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */ - readonly message: string; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */ - readonly name: string; - readonly INDEX_SIZE_ERR: 1; - readonly DOMSTRING_SIZE_ERR: 2; - readonly HIERARCHY_REQUEST_ERR: 3; - readonly WRONG_DOCUMENT_ERR: 4; - readonly INVALID_CHARACTER_ERR: 5; - readonly NO_DATA_ALLOWED_ERR: 6; - readonly NO_MODIFICATION_ALLOWED_ERR: 7; - readonly NOT_FOUND_ERR: 8; - readonly NOT_SUPPORTED_ERR: 9; - readonly INUSE_ATTRIBUTE_ERR: 10; - readonly INVALID_STATE_ERR: 11; - readonly SYNTAX_ERR: 12; - readonly INVALID_MODIFICATION_ERR: 13; - readonly NAMESPACE_ERR: 14; - readonly INVALID_ACCESS_ERR: 15; - readonly VALIDATION_ERR: 16; - readonly TYPE_MISMATCH_ERR: 17; - readonly SECURITY_ERR: 18; - readonly NETWORK_ERR: 19; - readonly ABORT_ERR: 20; - readonly URL_MISMATCH_ERR: 21; - readonly QUOTA_EXCEEDED_ERR: 22; - readonly TIMEOUT_ERR: 23; - readonly INVALID_NODE_TYPE_ERR: 24; - readonly DATA_CLONE_ERR: 25; -} -interface NodeDOMExceptionConstructor { - prototype: DOMException; - new(message?: string, nameOrOptions?: string | { name?: string; cause?: unknown }): DOMException; - readonly INDEX_SIZE_ERR: 1; - readonly DOMSTRING_SIZE_ERR: 2; - readonly HIERARCHY_REQUEST_ERR: 3; - readonly WRONG_DOCUMENT_ERR: 4; - readonly INVALID_CHARACTER_ERR: 5; - readonly NO_DATA_ALLOWED_ERR: 6; - readonly NO_MODIFICATION_ALLOWED_ERR: 7; - readonly NOT_FOUND_ERR: 8; - readonly NOT_SUPPORTED_ERR: 9; - readonly INUSE_ATTRIBUTE_ERR: 10; - readonly INVALID_STATE_ERR: 11; - readonly SYNTAX_ERR: 12; - readonly INVALID_MODIFICATION_ERR: 13; - readonly NAMESPACE_ERR: 14; - readonly INVALID_ACCESS_ERR: 15; - readonly VALIDATION_ERR: 16; - readonly TYPE_MISMATCH_ERR: 17; - readonly SECURITY_ERR: 18; - readonly NETWORK_ERR: 19; - readonly ABORT_ERR: 20; - readonly URL_MISMATCH_ERR: 21; - readonly QUOTA_EXCEEDED_ERR: 22; - readonly TIMEOUT_ERR: 23; - readonly INVALID_NODE_TYPE_ERR: 24; - readonly DATA_CLONE_ERR: 25; -} -// #endregion DOMException - -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 global: typeof globalThis; - - 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; - - interface GCFunction { - (options: { - execution?: "sync"; - flavor?: "regular" | "last-resort"; - type?: "major-snapshot" | "major" | "minor"; - filename?: string; - }): void; - (options: { - execution: "async"; - flavor?: "regular" | "last-resort"; - type?: "major-snapshot" | "major" | "minor"; - filename?: string; - }): Promise; - (options?: boolean): void; - } - - /** - * Only available if `--expose-gc` is passed to the process. - */ - var gc: undefined | GCFunction; - - // #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 Storage - /** - * This Web Storage API interface provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage) - */ - interface Storage extends _Storage {} - - // Conditional on `onabort` rather than `onmessage`, in order to exclude lib.webworker - var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T - : { - prototype: Storage; - new(): Storage; - }; - - /** - * A browser-compatible implementation of [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage). - * Data is stored unencrypted in the file specified by the `--localstorage-file` CLI flag. - * Any modification of this data outside of the Web Storage API is not supported. - * Enable this API with the `--experimental-webstorage` CLI flag. - * @since v22.4.0 - */ - var localStorage: Storage; - - /** - * A browser-compatible implementation of [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage). - * Data is stored in memory, with a storage quota of 10 MB. - * Any modification of this data outside of the Web Storage API is not supported. - * Enable this API with the `--experimental-webstorage` CLI flag. - * @since v22.4.0 - */ - var sessionStorage: Storage; - // #endregion Storage - - /** - * @since v17.0.0 - * - * Creates a deep clone of an object. - */ - function structuredClone( - value: T, - transfer?: { transfer: ReadonlyArray }, - ): T; - - // #region DOMException - /** - * @since v17.0.0 - * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. - * - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException) - */ - interface DOMException extends _DOMException {} - - /** - * @since v17.0.0 - * - * The WHATWG `DOMException` class. See [DOMException](https://developer.mozilla.org/docs/Web/API/DOMException) for more details. - */ - var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T - : NodeDOMExceptionConstructor; - // #endregion DOMException - - /*----------------------------------------------* - * * - * GLOBAL INTERFACES * - * * - *-----------------------------------------------*/ - namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * 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(destination: T, options?: { end?: boolean | undefined }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): NodeJS.AsyncIterator; - } - - 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; - } - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; - /** - * @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 { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; - } - - /** An iterable iterator returned by the Node.js API. */ - // Default TReturn/TNext in v22 is `any`, for compatibility with the previously-used IterableIterator. - // TODO: In next major @types/node version, change default TReturn to undefined. - interface Iterator extends IteratorObject { - [Symbol.iterator](): NodeJS.Iterator; - } - - /** An async iterable iterator returned by the Node.js API. */ - // Default TReturn/TNext in v22 is `any`, for compatibility with the previously-used AsyncIterableIterator. - // TODO: In next major @types/node version, change default TReturn to undefined. - interface AsyncIterator extends AsyncIteratorObject { - [Symbol.asyncIterator](): NodeJS.AsyncIterator; - } - } - - interface RequestInit extends _RequestInit {} - - function fetch( - input: string | URL | globalThis.Request, - init?: RequestInit, - ): Promise; - - interface Request extends _Request {} - var Request: typeof globalThis extends { - onmessage: any; - Request: infer T; - } ? T - : typeof import("undici-types").Request; - - interface ResponseInit extends _ResponseInit {} - - interface Response extends _Response {} - var Response: typeof globalThis extends { - onmessage: any; - Response: infer T; - } ? T - : typeof import("undici-types").Response; - - interface FormData extends _FormData {} - var FormData: typeof globalThis extends { - onmessage: any; - FormData: infer T; - } ? T - : typeof import("undici-types").FormData; - - interface Headers extends _Headers {} - var Headers: typeof globalThis extends { - onmessage: any; - Headers: infer T; - } ? T - : typeof import("undici-types").Headers; - - interface MessageEvent extends _MessageEvent {} - /** - * @since v15.0.0 - */ - var MessageEvent: typeof globalThis extends { - onmessage: any; - MessageEvent: infer T; - } ? T - : typeof import("undici-types").MessageEvent; - - interface WebSocket extends _WebSocket {} - var WebSocket: typeof globalThis extends { onmessage: any; WebSocket: infer T } ? T - : typeof import("undici-types").WebSocket; - - interface EventSource extends _EventSource {} - /** - * Only available through the [--experimental-eventsource](https://nodejs.org/api/cli.html#--experimental-eventsource) flag. - * - * @since v22.3.0 - */ - var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T - : typeof import("undici-types").EventSource; -} diff --git a/node_modules/@types/node/globals.typedarray.d.ts b/node_modules/@types/node/globals.typedarray.d.ts deleted file mode 100644 index 0c7280c..0000000 --- a/node_modules/@types/node/globals.typedarray.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -export {}; // Make this a module - -declare global { - namespace NodeJS { - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = - | TypedArray - | DataView; - } -} diff --git a/node_modules/@types/node/http.d.ts b/node_modules/@types/node/http.d.ts deleted file mode 100644 index 1f4de01..0000000 --- a/node_modules/@types/node/http.d.ts +++ /dev/null @@ -1,1957 +0,0 @@ -/** - * 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. - * In particular, large, possibly chunk-encoded, messages. The interface is - * careful to never buffer entire requests or responses, so the - * user is able to stream data. - * - * HTTP message headers are represented by an object like this: - * - * ```json - * { "content-length": "123", - * "content-type": "text/plain", - * "connection": "keep-alive", - * "host": "example.com", - * "accept": "*" } - * ``` - * - * Keys are lowercased. Values are not modified. - * - * In order to support the full spectrum of possible HTTP applications, the Node.js - * HTTP API is very low-level. It deals with stream handling and message - * parsing only. It parses a message into headers and body but it does not - * parse the actual headers or the body. - * - * See `message.headers` for details on how duplicate headers are handled. - * - * The raw headers as they were received are retained in the `rawHeaders` property, which is an array of `[key, value, key2, value2, ...]`. For - * example, the previous message header object might have a `rawHeaders` list like the following: - * - * ```js - * [ 'ConTent-Length', '123456', - * 'content-LENGTH', '123', - * 'content-type', 'text/plain', - * 'CONNECTION', 'keep-alive', - * 'Host', 'example.com', - * 'accepT', '*' ] - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/http.js) - */ -declare module "http" { - import * as stream from "node:stream"; - import { URL } from "node:url"; - import { LookupOptions } from "node:dns"; - import { EventEmitter } from "node:events"; - import { LookupFunction, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net"; - // incoming headers will never contain number - interface IncomingHttpHeaders extends NodeJS.Dict { - accept?: string | undefined; - "accept-language"?: string | undefined; - "accept-patch"?: string | undefined; - "accept-ranges"?: string | undefined; - "access-control-allow-credentials"?: string | undefined; - "access-control-allow-headers"?: string | undefined; - "access-control-allow-methods"?: string | undefined; - "access-control-allow-origin"?: string | undefined; - "access-control-expose-headers"?: string | undefined; - "access-control-max-age"?: string | undefined; - "access-control-request-headers"?: string | undefined; - "access-control-request-method"?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - "alt-svc"?: string | undefined; - authorization?: string | undefined; - "cache-control"?: string | undefined; - connection?: string | undefined; - "content-disposition"?: string | undefined; - "content-encoding"?: string | undefined; - "content-language"?: string | undefined; - "content-length"?: string | undefined; - "content-location"?: string | undefined; - "content-range"?: string | undefined; - "content-type"?: string | undefined; - cookie?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - "if-match"?: string | undefined; - "if-modified-since"?: string | undefined; - "if-none-match"?: string | undefined; - "if-unmodified-since"?: string | undefined; - "last-modified"?: string | undefined; - location?: string | undefined; - origin?: string | undefined; - pragma?: string | undefined; - "proxy-authenticate"?: string | undefined; - "proxy-authorization"?: string | undefined; - "public-key-pins"?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - "retry-after"?: string | undefined; - "sec-websocket-accept"?: string | undefined; - "sec-websocket-extensions"?: string | undefined; - "sec-websocket-key"?: string | undefined; - "sec-websocket-protocol"?: string | undefined; - "sec-websocket-version"?: string | undefined; - "set-cookie"?: string[] | undefined; - "strict-transport-security"?: string | undefined; - tk?: string | undefined; - trailer?: string | undefined; - "transfer-encoding"?: string | undefined; - upgrade?: string | undefined; - "user-agent"?: string | undefined; - vary?: string | undefined; - via?: string | undefined; - warning?: string | undefined; - "www-authenticate"?: string | undefined; - } - // outgoing headers allows numbers (as they are converted internally to strings) - type OutgoingHttpHeader = number | string | string[]; - interface OutgoingHttpHeaders extends NodeJS.Dict { - accept?: string | string[] | undefined; - "accept-charset"?: string | string[] | undefined; - "accept-encoding"?: string | string[] | undefined; - "accept-language"?: string | string[] | undefined; - "accept-ranges"?: string | undefined; - "access-control-allow-credentials"?: string | undefined; - "access-control-allow-headers"?: string | undefined; - "access-control-allow-methods"?: string | undefined; - "access-control-allow-origin"?: string | undefined; - "access-control-expose-headers"?: string | undefined; - "access-control-max-age"?: string | undefined; - "access-control-request-headers"?: string | undefined; - "access-control-request-method"?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - authorization?: string | undefined; - "cache-control"?: string | undefined; - "cdn-cache-control"?: string | undefined; - connection?: string | string[] | undefined; - "content-disposition"?: string | undefined; - "content-encoding"?: string | undefined; - "content-language"?: string | undefined; - "content-length"?: string | number | undefined; - "content-location"?: string | undefined; - "content-range"?: string | undefined; - "content-security-policy"?: string | undefined; - "content-security-policy-report-only"?: string | undefined; - cookie?: string | string[] | undefined; - dav?: string | string[] | undefined; - dnt?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - "if-match"?: string | undefined; - "if-modified-since"?: string | undefined; - "if-none-match"?: string | undefined; - "if-range"?: string | undefined; - "if-unmodified-since"?: string | undefined; - "last-modified"?: string | undefined; - link?: string | string[] | undefined; - location?: string | undefined; - "max-forwards"?: string | undefined; - origin?: string | undefined; - prgama?: string | string[] | undefined; - "proxy-authenticate"?: string | string[] | undefined; - "proxy-authorization"?: string | undefined; - "public-key-pins"?: string | undefined; - "public-key-pins-report-only"?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - "referrer-policy"?: string | undefined; - refresh?: string | undefined; - "retry-after"?: string | undefined; - "sec-websocket-accept"?: string | undefined; - "sec-websocket-extensions"?: string | string[] | undefined; - "sec-websocket-key"?: string | undefined; - "sec-websocket-protocol"?: string | string[] | undefined; - "sec-websocket-version"?: string | undefined; - server?: string | undefined; - "set-cookie"?: string | string[] | undefined; - "strict-transport-security"?: string | undefined; - te?: string | undefined; - trailer?: string | undefined; - "transfer-encoding"?: string | undefined; - "user-agent"?: string | undefined; - upgrade?: string | undefined; - "upgrade-insecure-requests"?: string | undefined; - vary?: string | undefined; - via?: string | string[] | undefined; - warning?: string | undefined; - "www-authenticate"?: string | string[] | undefined; - "x-content-type-options"?: string | undefined; - "x-dns-prefetch-control"?: string | undefined; - "x-frame-options"?: string | undefined; - "x-xss-protection"?: string | undefined; - } - interface ClientRequestArgs { - _defaultAgent?: Agent | undefined; - agent?: Agent | boolean | undefined; - auth?: string | null | undefined; - createConnection?: - | (( - options: ClientRequestArgs, - oncreate: (err: Error | null, socket: stream.Duplex) => void, - ) => stream.Duplex | null | undefined) - | undefined; - defaultPort?: number | string | undefined; - family?: number | undefined; - headers?: OutgoingHttpHeaders | undefined; - hints?: LookupOptions["hints"]; - host?: string | null | undefined; - hostname?: string | null | undefined; - insecureHTTPParser?: boolean | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - lookup?: LookupFunction | undefined; - /** - * @default 16384 - */ - maxHeaderSize?: number | undefined; - method?: string | undefined; - path?: string | null | undefined; - port?: number | string | null | undefined; - protocol?: string | null | undefined; - setHost?: boolean | undefined; - signal?: AbortSignal | undefined; - socketPath?: string | undefined; - timeout?: number | undefined; - uniqueHeaders?: Array | undefined; - joinDuplicateHeaders?: boolean; - } - interface ServerOptions< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - > { - /** - * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`. - */ - IncomingMessage?: Request | undefined; - /** - * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`. - */ - ServerResponse?: Response | undefined; - /** - * Sets the timeout value in milliseconds for receiving the entire request from the client. - * @see Server.requestTimeout for more information. - * @default 300000 - * @since v18.0.0 - */ - requestTimeout?: number | undefined; - /** - * It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates. - * @default false - * @since v18.14.0 - */ - joinDuplicateHeaders?: boolean; - /** - * 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. - * @see Server.keepAliveTimeout for more information. - * @default 5000 - * @since v18.0.0 - */ - keepAliveTimeout?: number | undefined; - /** - * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests. - * @default 30000 - */ - connectionsCheckingInterval?: number | undefined; - /** - * Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`. - * This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`. - * Default: @see stream.getDefaultHighWaterMark(). - * @since v20.1.0 - */ - highWaterMark?: number | undefined; - /** - * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. - * Using the insecure parser should be avoided. - * See --insecure-http-parser for more information. - * @default false - */ - insecureHTTPParser?: boolean | undefined; - /** - * Optionally overrides the value of `--max-http-header-size` for requests received by - * this server, i.e. the maximum length of request headers in bytes. - * @default 16384 - * @since v13.3.0 - */ - maxHeaderSize?: number | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default true - * @since v16.5.0 - */ - noDelay?: 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])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @since v16.5.0 - */ - keepAliveInitialDelay?: number | undefined; - /** - * A list of response headers that should be sent only once. - * If the header's value is an array, the items will be joined using `; `. - */ - uniqueHeaders?: Array | undefined; - } - type RequestListener< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - > = (req: InstanceType, res: InstanceType & { req: InstanceType }) => void; - /** - * @since v0.1.17 - */ - class Server< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - > extends NetServer { - constructor(requestListener?: RequestListener); - constructor(options: ServerOptions, requestListener?: RequestListener); - /** - * Sets the timeout value for sockets, and emits a `'timeout'` event on - * the Server object, passing the socket as an argument, if a timeout - * occurs. - * - * If there is a `'timeout'` event listener on the Server object, then it - * will be called with the timed-out socket as an argument. - * - * By default, the Server does not timeout sockets. However, if a callback - * is assigned to the Server's `'timeout'` event, timeouts must be handled - * explicitly. - * @since v0.9.12 - * @param [msecs=0 (no timeout)] - */ - setTimeout(msecs?: number, callback?: () => void): this; - setTimeout(callback: () => void): this; - /** - * Limits maximum incoming headers count. If set to 0, no limit will be applied. - * @since v0.7.0 - */ - maxHeadersCount: number | null; - /** - * The maximum number of requests socket can handle - * before closing keep alive connection. - * - * A value of `0` will disable the limit. - * - * When the limit is reached it will set the `Connection` header value to `close`, - * but will not actually close the connection, subsequent requests sent - * after the limit is reached will get `503 Service Unavailable` as a response. - * @since v16.10.0 - */ - maxRequestsPerSocket: number | null; - /** - * The number of milliseconds of inactivity before a socket is presumed - * to have timed out. - * - * A value of `0` will disable the timeout behavior on incoming connections. - * - * The socket timeout logic is set up on connection, so changing this - * value only affects new connections to the server, not any existing connections. - * @since v0.9.12 - */ - timeout: number; - /** - * Limit the amount of time the parser will wait to receive the complete HTTP - * headers. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v11.3.0, v10.14.0 - */ - headersTimeout: number; - /** - * 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`. - * - * 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 - * 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 - * affects new connections to the server, not any existing connections. - * @since v8.0.0 - */ - keepAliveTimeout: number; - /** - * Sets the timeout value in milliseconds for receiving the entire request from - * the client. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v14.11.0 - */ - requestTimeout: number; - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request - * or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: RequestListener): this; - addListener(event: "checkExpectation", listener: RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - addListener(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - addListener(event: "request", listener: RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "clientError", err: Error, socket: stream.Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - emit(event: "dropRequest", req: InstanceType, socket: stream.Duplex): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType & { req: InstanceType }, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: RequestListener): this; - on(event: "checkExpectation", listener: RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - on(event: "connect", listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - on(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - on(event: "request", listener: RequestListener): this; - on(event: "upgrade", listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: RequestListener): this; - once(event: "checkExpectation", listener: RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - once( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - once(event: "dropRequest", listener: (req: InstanceType, socket: stream.Duplex) => void): this; - once(event: "request", listener: RequestListener): this; - once( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: RequestListener): this; - prependListener(event: "checkExpectation", listener: RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, - ): this; - prependListener(event: "request", listener: RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - prependOnceListener( - event: "dropRequest", - listener: (req: InstanceType, socket: stream.Duplex) => void, - ): this; - prependOnceListener(event: "request", listener: RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, - ): this; - } - /** - * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract outgoing message from - * the perspective of the participants of an HTTP transaction. - * @since v0.1.17 - */ - class OutgoingMessage extends stream.Writable { - readonly req: Request; - chunkedEncoding: boolean; - shouldKeepAlive: boolean; - useChunkedEncodingByDefault: boolean; - sendDate: boolean; - /** - * @deprecated Use `writableEnded` instead. - */ - finished: boolean; - /** - * Read-only. `true` if the headers were sent, otherwise `false`. - * @since v0.9.3 - */ - readonly headersSent: boolean; - /** - * Alias of `outgoingMessage.socket`. - * @since v0.3.0 - * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. - */ - readonly connection: Socket | null; - /** - * Reference to the underlying socket. Usually, users will not want to access - * this property. - * - * After calling `outgoingMessage.end()`, this property will be nulled. - * @since v0.3.0 - */ - readonly socket: Socket | null; - constructor(); - /** - * Once a socket is associated with the message and is connected, `socket.setTimeout()` will be called with `msecs` as the first parameter. - * @since v0.9.12 - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * Sets a single header value. If the header already exists in the to-be-sent - * headers, its value will be replaced. Use an array of strings to send multiple - * headers with the same name. - * @since v0.4.0 - * @param name Header name - * @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): this; - /** - * Append a single header value to the header object. - * - * If the value is an array, this is equivalent to calling this method multiple - * times. - * - * If there were no previous values for the header, this is equivalent to calling `outgoingMessage.setHeader(name, value)`. - * - * Depending of the value of `options.uniqueHeaders` when the client request or the - * server were created, this will end up in the header being sent multiple times or - * a single time with values joined using `; `. - * @since v18.3.0, v16.17.0 - * @param name Header name - * @param value Header value - */ - appendHeader(name: string, value: string | readonly string[]): this; - /** - * Gets the value of the HTTP header with the given name. If that header is not - * set, the returned value will be `undefined`. - * @since v0.4.0 - * @param name Name of header - */ - getHeader(name: string): number | string | string[] | undefined; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow - * copy is used, array values may be mutated without additional calls to - * various header-related HTTP module methods. The keys of the returned - * object are the header names and the values are the respective header - * values. All header names are lowercase. - * - * The object returned by the `outgoingMessage.getHeaders()` method does - * not prototypically inherit from the JavaScript `Object`. This means that - * typical `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, - * and others are not defined and will not work. - * - * ```js - * outgoingMessage.setHeader('Foo', 'bar'); - * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = outgoingMessage.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v7.7.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All names are lowercase. - * @since v7.7.0 - */ - getHeaderNames(): string[]; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name is case-insensitive. - * - * ```js - * const hasContentType = outgoingMessage.hasHeader('content-type'); - * ``` - * @since v7.7.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that is queued for implicit sending. - * - * ```js - * outgoingMessage.removeHeader('Content-Encoding'); - * ``` - * @since v0.4.0 - * @param name Header name - */ - removeHeader(name: string): void; - /** - * Adds HTTP trailers (headers but at the end of the message) to the message. - * - * Trailers will **only** be emitted if the message is chunked encoded. If not, - * the trailers will be silently discarded. - * - * HTTP requires the `Trailer` header to be sent to emit trailers, - * with a list of header field names in its value, e.g. - * - * ```js - * message.writeHead(200, { 'Content-Type': 'text/plain', - * 'Trailer': 'Content-MD5' }); - * message.write(fileData); - * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); - * message.end(); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.3.0 - */ - addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; - /** - * Flushes the message headers. - * - * For efficiency reason, Node.js normally buffers the message headers - * until `outgoingMessage.end()` is called or the first chunk of message data - * is written. It then tries to pack the headers and data into a single TCP - * packet. - * - * It is usually desired (it saves a TCP round-trip), but not when the first - * data is not sent until possibly much later. `outgoingMessage.flushHeaders()` bypasses the optimization and kickstarts the message. - * @since v1.6.0 - */ - flushHeaders(): void; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v0.1.17 - */ - class ServerResponse extends OutgoingMessage { - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v0.4.0 - */ - statusCode: number; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status message that will be sent to the client when - * the headers get flushed. If this is left as `undefined` then the standard - * message for the status code will be used. - * - * ```js - * response.statusMessage = 'Not found'; - * ``` - * - * After response header was sent to the client, this property indicates the - * status message which was sent out. - * @since v0.11.8 - */ - statusMessage: string; - /** - * If set to `true`, Node.js will check whether the `Content-Length` header value and the size of the body, in bytes, are equal. - * Mismatching the `Content-Length` header value will result - * in an `Error` being thrown, identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. - * @since v18.10.0, v16.18.0 - */ - strictContentLength: boolean; - constructor(req: Request); - assignSocket(socket: Socket): void; - detachSocket(socket: Socket): void; - /** - * Sends an HTTP/1.1 100 Continue message to the client, indicating that - * the request body should be sent. See the `'checkContinue'` event on `Server`. - * @since v0.3.0 - */ - writeContinue(callback?: () => void): void; - /** - * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. The optional `callback` argument will be called when - * the response message has been written. - * - * **Example** - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * 'x-trace-id': 'id for diagnostics', - * }); - * - * const earlyHintsCallback = () => console.log('early hints message sent'); - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * }, earlyHintsCallback); - * ``` - * @since v18.11.0 - * @param hints An object containing the values of headers - * @param callback Will be called when the response message has been written - */ - writeEarlyHints(hints: Record, callback?: () => void): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * Optionally one can give a human-readable `statusMessage` as the second - * argument. - * - * `headers` may be an `Array` where the keys and values are in the same list. - * It is _not_ a list of tuples. So, the even-numbered offsets are key values, - * and the odd-numbered offsets are the associated values. The array is in the same - * format as `request.rawHeaders`. - * - * Returns a reference to the `ServerResponse`, so that calls can be chained. - * - * ```js - * const body = 'hello world'; - * response - * .writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain', - * }) - * .end(body); - * ``` - * - * This method must only be called once on a message and it must - * be called before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * If this method is called and `response.setHeader()` has not been called, - * it will directly write the supplied header values onto the network channel - * without caching internally, and the `response.getHeader()` on the header - * will not yield the expected result. If progressive population of headers is - * desired with potential future retrieval and modification, use `response.setHeader()` instead. - * - * ```js - * // Returns content-type = text/plain - * const server = http.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain' }); - * res.end('ok'); - * }); - * ``` - * - * `Content-Length` is read in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js - * will check whether `Content-Length` and the length of the body which has - * been transmitted are equal or not. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a \[`Error`\]\[\] being thrown. - * @since v0.1.30 - */ - writeHead( - statusCode: number, - statusMessage?: string, - headers?: OutgoingHttpHeaders | OutgoingHttpHeader[], - ): this; - writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; - /** - * Sends a HTTP/1.1 102 Processing message to the client, indicating that - * the request body should be sent. - * @since v10.0.0 - */ - writeProcessing(): void; - } - interface InformationEvent { - statusCode: number; - statusMessage: string; - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - headers: IncomingHttpHeaders; - rawHeaders: string[]; - } - /** - * This object is created internally and returned from {@link request}. It - * represents an _in-progress_ request whose header has already been queued. The - * header is still mutable using the `setHeader(name, value)`, `getHeader(name)`, `removeHeader(name)` API. The actual header will - * be sent along with the first data chunk or when calling `request.end()`. - * - * To get the response, add a listener for `'response'` to the request object. `'response'` will be emitted from the request object when the response - * headers have been received. The `'response'` event is executed with one - * argument which is an instance of {@link IncomingMessage}. - * - * During the `'response'` event, one can add listeners to the - * response object; particularly to listen for the `'data'` event. - * - * If no `'response'` handler is added, then the response will be - * entirely discarded. However, if a `'response'` event handler is added, - * then the data from the response object **must** be consumed, either by - * calling `response.read()` whenever there is a `'readable'` event, or - * by adding a `'data'` handler, or by calling the `.resume()` method. - * Until the data is consumed, the `'end'` event will not fire. Also, until - * the data is read it will consume memory that can eventually lead to a - * 'process out of memory' error. - * - * For backward compatibility, `res` will only emit `'error'` if there is an `'error'` listener registered. - * - * Set `Content-Length` header to limit the response body size. - * If `response.strictContentLength` is set to `true`, mismatching the `Content-Length` header value will result in an `Error` being thrown, - * identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. - * - * `Content-Length` value should be in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. - * @since v0.1.17 - */ - class ClientRequest extends OutgoingMessage { - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v0.11.14 - * @deprecated Since v17.0.0, v16.12.0 - Check `destroyed` instead. - */ - aborted: boolean; - /** - * The request host. - * @since v14.5.0, v12.19.0 - */ - host: string; - /** - * The request protocol. - * @since v14.5.0, v12.19.0 - */ - protocol: string; - /** - * When sending request through a keep-alive enabled agent, the underlying socket - * might be reused. But if server closes connection at unfortunate time, client - * may run into a 'ECONNRESET' error. - * - * ```js - * import http from 'node:http'; - * - * // Server has a 5 seconds keep-alive timeout by default - * http - * .createServer((req, res) => { - * res.write('hello\n'); - * res.end(); - * }) - * .listen(3000); - * - * setInterval(() => { - * // Adapting a keep-alive agent - * http.get('http://localhost:3000', { agent }, (res) => { - * res.on('data', (data) => { - * // Do nothing - * }); - * }); - * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout - * ``` - * - * By marking a request whether it reused socket or not, we can do - * automatic error retry base on it. - * - * ```js - * import http from 'node:http'; - * const agent = new http.Agent({ keepAlive: true }); - * - * function retriableRequest() { - * const req = http - * .get('http://localhost:3000', { agent }, (res) => { - * // ... - * }) - * .on('error', (err) => { - * // Check if retry is needed - * if (req.reusedSocket && err.code === 'ECONNRESET') { - * retriableRequest(); - * } - * }); - * } - * - * retriableRequest(); - * ``` - * @since v13.0.0, v12.16.0 - */ - reusedSocket: boolean; - /** - * Limits maximum response headers count. If set to 0, no limit will be applied. - */ - maxHeadersCount: number; - constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); - /** - * The request method. - * @since v0.1.97 - */ - method: string; - /** - * The request path. - * @since v0.4.0 - */ - path: string; - /** - * Marks the request as aborting. Calling this will cause remaining data - * in the response to be dropped and the socket to be destroyed. - * @since v0.3.8 - * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. - */ - abort(): void; - onSocket(socket: Socket): void; - /** - * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. - * @since v0.5.9 - * @param timeout Milliseconds before a request times out. - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. - * @since v0.5.9 - */ - setNoDelay(noDelay?: boolean): void; - /** - * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. - * @since v0.5.9 - */ - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - /** - * Returns an array containing the unique names of the current outgoing raw - * headers. Header names are returned with their exact casing being set. - * - * ```js - * request.setHeader('Foo', 'bar'); - * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = request.getRawHeaderNames(); - * // headerNames === ['Foo', 'Set-Cookie'] - * ``` - * @since v15.13.0, v14.17.0 - */ - getRawHeaderNames(): string[]; - /** - * @deprecated - */ - addListener(event: "abort", listener: () => void): this; - addListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: "continue", listener: () => void): this; - addListener(event: "information", listener: (info: InformationEvent) => void): this; - addListener(event: "response", listener: (response: IncomingMessage) => void): this; - addListener(event: "socket", listener: (socket: Socket) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - on(event: "abort", listener: () => void): this; - on(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => 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: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - once(event: "abort", listener: () => void): this; - once(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => 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: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependListener(event: "abort", listener: () => void): this; - prependListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: "continue", listener: () => void): this; - prependListener(event: "information", listener: (info: InformationEvent) => void): this; - prependListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependListener(event: "socket", listener: (socket: Socket) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - /** - * @deprecated - */ - prependOnceListener(event: "abort", listener: () => void): this; - prependOnceListener( - event: "connect", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: "continue", listener: () => void): this; - prependOnceListener(event: "information", listener: (info: InformationEvent) => void): this; - prependOnceListener(event: "response", listener: (response: IncomingMessage) => void): this; - prependOnceListener(event: "socket", listener: (socket: Socket) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener( - event: "upgrade", - listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, - ): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to - * access response - * status, headers, and data. - * - * Different from its `socket` value which is a subclass of `stream.Duplex`, the `IncomingMessage` itself extends `stream.Readable` and is created separately to - * parse and emit the incoming HTTP headers and payload, as the underlying socket - * may be reused multiple times in case of keep-alive. - * @since v0.1.17 - */ - class IncomingMessage extends stream.Readable { - constructor(socket: Socket); - /** - * The `message.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from stream.Readable. - */ - aborted: boolean; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. - * Probably either `'1.1'` or `'1.0'`. - * - * Also `message.httpVersionMajor` is the first integer and `message.httpVersionMinor` is the second. - * @since v0.1.1 - */ - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - /** - * The `message.complete` property will be `true` if a complete HTTP message has - * been received and successfully parsed. - * - * This property is particularly useful as a means of determining if a client or - * server fully transmitted a message before a connection was terminated: - * - * ```js - * const req = http.request({ - * host: '127.0.0.1', - * port: 8080, - * method: 'POST', - * }, (res) => { - * res.resume(); - * res.on('end', () => { - * if (!res.complete) - * console.error( - * 'The connection was terminated while the message was still being sent'); - * }); - * }); - * ``` - * @since v0.3.0 - */ - complete: boolean; - /** - * Alias for `message.socket`. - * @since v0.1.90 - * @deprecated Since v16.0.0 - Use `socket`. - */ - connection: Socket; - /** - * The `net.Socket` object associated with the connection. - * - * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the - * client's authentication details. - * - * This property is guaranteed to be an instance of the `net.Socket` class, - * a subclass of `stream.Duplex`, unless the user specified a socket - * type other than `net.Socket` or internally nulled. - * @since v0.3.0 - */ - socket: Socket; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * Duplicates in raw headers are handled in the following ways, depending on the - * header name: - * - * * Duplicates of `age`, `authorization`, `content-length`, `content-type`, `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`, `last-modified`, `location`, - * `max-forwards`, `proxy-authorization`, `referer`, `retry-after`, `server`, or `user-agent` are discarded. - * To allow duplicate values of the headers listed above to be joined, - * use the option `joinDuplicateHeaders` in {@link request} and {@link createServer}. See RFC 9110 Section 5.3 for more - * information. - * * `set-cookie` is always an array. Duplicates are added to the array. - * * For duplicate `cookie` headers, the values are joined together with `; `. - * * For all other headers, the values are joined together with `, `. - * @since v0.1.5 - */ - headers: IncomingHttpHeaders; - /** - * Similar to `message.headers`, but there is no join logic and the values are - * always arrays of strings, even for headers received just once. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': ['curl/7.22.0'], - * // host: ['127.0.0.1:8000'], - * // accept: ['*'] } - * console.log(request.headersDistinct); - * ``` - * @since v18.3.0, v16.17.0 - */ - headersDistinct: NodeJS.Dict; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v0.11.6 - */ - rawHeaders: string[]; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v0.3.0 - */ - trailers: NodeJS.Dict; - /** - * Similar to `message.trailers`, but there is no join logic and the values are - * always arrays of strings, even for headers received just once. - * Only populated at the `'end'` event. - * @since v18.3.0, v16.17.0 - */ - trailersDistinct: NodeJS.Dict; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v0.11.6 - */ - rawTrailers: string[]; - /** - * Calls `message.socket.setTimeout(msecs, callback)`. - * @since v0.5.9 - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * **Only valid for request obtained from {@link Server}.** - * - * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. - * @since v0.1.1 - */ - method?: string | undefined; - /** - * **Only valid for request obtained from {@link Server}.** - * - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. Take the following request: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * To parse the URL into its parts: - * - * ```js - * new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`); - * ``` - * - * When `request.url` is `'/status?name=ryan'` and `process.env.HOST` is undefined: - * - * ```console - * $ node - * > new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`); - * URL { - * href: 'http://localhost/status?name=ryan', - * origin: 'http://localhost', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'localhost', - * hostname: 'localhost', - * port: '', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * - * Ensure that you set `process.env.HOST` to the server's host name, or consider replacing this part entirely. If using `req.headers.host`, ensure proper - * validation is used, as clients may specify a custom `Host` header. - * @since v0.1.90 - */ - url?: string | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The 3-digit HTTP response status code. E.G. `404`. - * @since v0.1.1 - */ - statusCode?: number | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. - * @since v0.11.10 - */ - statusMessage?: string | undefined; - /** - * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error` is provided, an `'error'` event is emitted on the socket and `error` is passed - * as an argument to any listeners on the event. - * @since v0.3.0 - */ - destroy(error?: Error): this; - } - interface AgentOptions extends Partial { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean | undefined; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number | undefined; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number | undefined; - /** - * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. - */ - maxTotalSockets?: number | undefined; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number | undefined; - /** - * Socket timeout in milliseconds. This will set the timeout after the socket is connected. - */ - timeout?: number | undefined; - /** - * Scheduling strategy to apply when picking the next free socket to use. - * @default `lifo` - */ - scheduling?: "fifo" | "lifo" | undefined; - } - /** - * An `Agent` is responsible for managing connection persistence - * and reuse for HTTP clients. It maintains a queue of pending requests - * for a given host and port, reusing a single socket connection for each - * until the queue is empty, at which time the socket is either destroyed - * or put into a pool where it is kept to be used again for requests to the - * same host and port. Whether it is destroyed or pooled depends on the `keepAlive` `option`. - * - * Pooled connections have TCP Keep-Alive enabled for them, but servers may - * still close idle connections, in which case they will be removed from the - * pool and a new connection will be made when a new HTTP request is made for - * that host and port. Servers may also refuse to allow multiple requests - * over the same connection, in which case the connection will have to be - * remade for every request and cannot be pooled. The `Agent` will still make - * the requests to that server, but each one will occur over a new connection. - * - * When a connection is closed by the client or the server, it is removed - * from the pool. Any unused sockets in the pool will be unrefed so as not - * to keep the Node.js process running when there are no outstanding requests. - * (see `socket.unref()`). - * - * It is good practice, to `destroy()` an `Agent` instance when it is no - * longer in use, because unused sockets consume OS resources. - * - * Sockets are removed from an agent when the socket emits either - * a `'close'` event or an `'agentRemove'` event. When intending to keep one - * HTTP request open for a long time without keeping it in the agent, something - * like the following may be done: - * - * ```js - * http.get(options, (res) => { - * // Do stuff - * }).on('socket', (socket) => { - * socket.emit('agentRemove'); - * }); - * ``` - * - * An agent may also be used for an individual request. By providing `{agent: false}` as an option to the `http.get()` or `http.request()` functions, a one-time use `Agent` with default options - * will be used - * for the client connection. - * - * `agent:false`: - * - * ```js - * http.get({ - * hostname: 'localhost', - * port: 80, - * path: '/', - * agent: false, // Create a new agent just for this one request - * }, (res) => { - * // Do stuff with response - * }); - * ``` - * - * `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v22.x/api/net.html#socketconnectoptions-connectlistener) are also supported. - * - * To configure any of them, a custom {@link Agent} instance must be created. - * - * ```js - * import http from 'node:http'; - * const keepAliveAgent = new http.Agent({ keepAlive: true }); - * options.agent = keepAliveAgent; - * http.request(options, onResponseCallback) - * ``` - * @since v0.3.4 - */ - class Agent extends EventEmitter { - /** - * By default set to 256. For agents with `keepAlive` enabled, this - * sets the maximum number of sockets that will be left open in the free - * state. - * @since v0.11.7 - */ - maxFreeSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open per origin. Origin is the returned value of `agent.getName()`. - * @since v0.3.6 - */ - maxSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open. Unlike `maxSockets`, this parameter applies across all origins. - * @since v14.5.0, v12.19.0 - */ - maxTotalSockets: number; - /** - * An object which contains arrays of sockets currently awaiting use by - * the agent when `keepAlive` is enabled. Do not modify. - * - * Sockets in the `freeSockets` list will be automatically destroyed and - * removed from the array on `'timeout'`. - * @since v0.11.4 - */ - readonly freeSockets: NodeJS.ReadOnlyDict; - /** - * An object which contains arrays of sockets currently in use by the - * agent. Do not modify. - * @since v0.3.6 - */ - readonly sockets: NodeJS.ReadOnlyDict; - /** - * An object which contains queues of requests that have not yet been assigned to - * sockets. Do not modify. - * @since v0.5.9 - */ - readonly requests: NodeJS.ReadOnlyDict; - constructor(opts?: AgentOptions); - /** - * Destroy any sockets that are currently in use by the agent. - * - * It is usually not necessary to do this. However, if using an - * agent with `keepAlive` enabled, then it is best to explicitly shut down - * the agent when it is no longer needed. Otherwise, - * sockets might stay open for quite a long time before the server - * terminates them. - * @since v0.11.4 - */ - destroy(): void; - } - const METHODS: string[]; - const STATUS_CODES: { - [errorCode: number]: string | undefined; - [errorCode: string]: string | undefined; - }; - /** - * Returns a new instance of {@link Server}. - * - * The `requestListener` is a function which is automatically - * added to the `'request'` event. - * - * ```js - * import http from 'node:http'; - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * - * ```js - * import http from 'node:http'; - * - * // Create a local server to receive data from - * const server = http.createServer(); - * - * // Listen to the request event - * server.on('request', (request, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.1.13 - */ - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - >(requestListener?: RequestListener): Server; - function createServer< - Request extends typeof IncomingMessage = typeof IncomingMessage, - Response extends typeof ServerResponse> = typeof ServerResponse, - >( - options: ServerOptions, - requestListener?: RequestListener, - ): Server; - // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, - // create interface RequestOptions would make the naming more clear to developers - interface RequestOptions extends ClientRequestArgs {} - /** - * `options` in `socket.connect()` are also supported. - * - * Node.js maintains several connections per server to make HTTP requests. - * This function allows one to transparently issue requests. - * - * `url` can be a string or a `URL` object. If `url` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * If both `url` and `options` are specified, the objects are merged, with the `options` properties taking precedence. - * - * The optional `callback` parameter will be added as a one-time listener for - * the `'response'` event. - * - * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * import http from 'node:http'; - * import { Buffer } from 'node:buffer'; - * - * const postData = JSON.stringify({ - * 'msg': 'Hello World!', - * }); - * - * const options = { - * hostname: 'www.google.com', - * port: 80, - * path: '/upload', - * method: 'POST', - * headers: { - * 'Content-Type': 'application/json', - * 'Content-Length': Buffer.byteLength(postData), - * }, - * }; - * - * const req = http.request(options, (res) => { - * console.log(`STATUS: ${res.statusCode}`); - * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - * res.setEncoding('utf8'); - * res.on('data', (chunk) => { - * console.log(`BODY: ${chunk}`); - * }); - * res.on('end', () => { - * console.log('No more data in response.'); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(`problem with request: ${e.message}`); - * }); - * - * // Write data to request body - * req.write(postData); - * req.end(); - * ``` - * - * In the example `req.end()` was called. With `http.request()` one - * must always call `req.end()` to signify the end of the request - - * even if there is no data being written to the request body. - * - * If any error is encountered during the request (be that with DNS resolution, - * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted - * on the returned request object. As with all `'error'` events, if no listeners - * are registered the error will be thrown. - * - * There are a few special headers that should be noted. - * - * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to - * the server should be persisted until the next request. - * * Sending a 'Content-Length' header will disable the default chunked encoding. - * * Sending an 'Expect' header will immediately send the request headers. - * Usually, when sending 'Expect: 100-continue', both a timeout and a listener - * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more - * information. - * * Sending an Authorization header will override using the `auth` option - * to compute basic authentication. - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('http://abc:xyz@example.com'); - * - * const req = http.request(options, (res) => { - * // ... - * }); - * ``` - * - * In a successful request, the following events will be emitted in the following - * order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * (`'data'` will not be emitted at all if the response body is empty, for - * instance, in most redirects) - * * `'end'` on the `res` object - * * `'close'` - * - * In the case of a connection error, the following events will be emitted: - * - * * `'socket'` - * * `'error'` - * * `'close'` - * - * In the case of a premature connection close before the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'` - * * `'close'` - * - * In the case of a premature connection close after the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (connection closed here) - * * `'aborted'` on the `res` object - * * `'close'` - * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'` - * * `'close'` on the `res` object - * - * If `req.destroy()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * - * If `req.destroy()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` - * - * If `req.destroy()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.destroy()` called here) - * * `'aborted'` on the `res` object - * * `'close'` - * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called - * * `'close'` on the `res` object - * - * If `req.abort()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.abort()` called here) - * * `'abort'` - * * `'close'` - * - * If `req.abort()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.abort()` called here) - * * `'abort'` - * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'` - * * `'close'` - * - * If `req.abort()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.abort()` called here) - * * `'abort'` - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * Setting the `timeout` option or using the `setTimeout()` function will - * not abort the request or do anything besides add a `'timeout'` event. - * - * Passing an `AbortSignal` and then calling `abort()` on the corresponding `AbortController` will behave the same way as calling `.destroy()` on the - * request. Specifically, the `'error'` event will be emitted with an error with - * the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'` and the `cause`, if one was provided. - * @since v0.3.6 - */ - function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: IncomingMessage) => void, - ): ClientRequest; - /** - * Since most requests are GET requests without bodies, Node.js provides this - * convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()` automatically. The callback must take care to - * consume the response - * data for reasons stated in {@link ClientRequest} section. - * - * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. - * - * JSON fetching example: - * - * ```js - * http.get('http://localhost:8000/', (res) => { - * const { statusCode } = res; - * const contentType = res.headers['content-type']; - * - * let error; - * // Any 2xx status code signals a successful response but - * // here we're only checking for 200. - * if (statusCode !== 200) { - * error = new Error('Request Failed.\n' + - * `Status Code: ${statusCode}`); - * } else if (!/^application\/json/.test(contentType)) { - * error = new Error('Invalid content-type.\n' + - * `Expected application/json but received ${contentType}`); - * } - * if (error) { - * console.error(error.message); - * // Consume response data to free up memory - * res.resume(); - * return; - * } - * - * res.setEncoding('utf8'); - * let rawData = ''; - * res.on('data', (chunk) => { rawData += chunk; }); - * res.on('end', () => { - * try { - * const parsedData = JSON.parse(rawData); - * console.log(parsedData); - * } catch (e) { - * console.error(e.message); - * } - * }); - * }).on('error', (e) => { - * console.error(`Got error: ${e.message}`); - * }); - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!', - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the method set to GET by default. - */ - function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - /** - * Performs the low-level validations on the provided `name` that are done when `res.setHeader(name, value)` is called. - * - * Passing illegal value as `name` will result in a `TypeError` being thrown, - * identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. - * - * It is not necessary to use this method before passing headers to an HTTP request - * or response. The HTTP module will automatically validate such headers. - * - * Example: - * - * ```js - * import { validateHeaderName } from 'node:http'; - * - * try { - * validateHeaderName(''); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN' - * console.error(err.message); // --> 'Header name must be a valid HTTP token [""]' - * } - * ``` - * @since v14.3.0 - * @param [label='Header name'] Label for error message. - */ - function validateHeaderName(name: string): void; - /** - * Performs the low-level validations on the provided `value` that are done when `res.setHeader(name, value)` is called. - * - * Passing illegal value as `value` will result in a `TypeError` being thrown. - * - * * Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`. - * * Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`. - * - * It is not necessary to use this method before passing headers to an HTTP request - * or response. The HTTP module will automatically validate such headers. - * - * Examples: - * - * ```js - * import { validateHeaderValue } from 'node:http'; - * - * try { - * validateHeaderValue('x-my-header', undefined); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true - * console.error(err.message); // --> 'Invalid value "undefined" for header "x-my-header"' - * } - * - * try { - * validateHeaderValue('x-my-header', 'oʊmɪɡə'); - * } catch (err) { - * console.error(err instanceof TypeError); // --> true - * console.error(err.code === 'ERR_INVALID_CHAR'); // --> true - * console.error(err.message); // --> 'Invalid character in header content ["x-my-header"]' - * } - * ``` - * @since v14.3.0 - * @param name Header name - * @param value Header value - */ - function validateHeaderValue(name: string, value: string): void; - /** - * Set the maximum number of idle HTTP parsers. - * @since v18.8.0, v16.18.0 - * @param [max=1000] - */ - function setMaxIdleHTTPParsers(max: number): void; - /** - * Global instance of `Agent` which is used as the default for all HTTP client - * requests. Diverges from a default `Agent` configuration by having `keepAlive` - * enabled and a `timeout` of 5 seconds. - * @since v0.5.9 - */ - let globalAgent: Agent; - /** - * Read-only property specifying the maximum allowed size of HTTP headers in bytes. - * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. - */ - const maxHeaderSize: number; - /** - * A browser-compatible implementation of [WebSocket](https://nodejs.org/docs/latest/api/http.html#websocket). - * @since v22.5.0 - */ - const WebSocket: import("undici-types").WebSocket; - /** - * @since v22.5.0 - */ - const CloseEvent: import("undici-types").CloseEvent; - /** - * @since v22.5.0 - */ - const MessageEvent: import("undici-types").MessageEvent; -} -declare module "node:http" { - export * from "http"; -} diff --git a/node_modules/@types/node/http2.d.ts b/node_modules/@types/node/http2.d.ts deleted file mode 100644 index 0838ae8..0000000 --- a/node_modules/@types/node/http2.d.ts +++ /dev/null @@ -1,2555 +0,0 @@ -/** - * The `node:http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. - * It can be accessed using: - * - * ```js - * import http2 from 'node:http2'; - * ``` - * @since v8.4.0 - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/http2.js) - */ -declare module "http2" { - import EventEmitter = require("node:events"); - import * as fs from "node:fs"; - import * as net from "node:net"; - import * as stream from "node:stream"; - import * as tls from "node:tls"; - import * as url from "node:url"; - import { - IncomingHttpHeaders as Http1IncomingHttpHeaders, - IncomingMessage, - OutgoingHttpHeaders, - ServerResponse, - } from "node:http"; - export { OutgoingHttpHeaders } from "node:http"; - export interface IncomingHttpStatusHeader { - ":status"?: number | undefined; - } - export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { - ":path"?: string | undefined; - ":method"?: string | undefined; - ":authority"?: string | undefined; - ":scheme"?: string | undefined; - } - // Http2Stream - export interface StreamPriorityOptions { - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - silent?: boolean | undefined; - } - export interface StreamState { - localWindowSize?: number | undefined; - state?: number | undefined; - localClose?: number | undefined; - remoteClose?: number | undefined; - sumDependencyWeight?: number | undefined; - weight?: number | undefined; - } - export interface ServerStreamResponseOptions { - endStream?: boolean | undefined; - waitForTrailers?: boolean | undefined; - } - export interface StatOptions { - offset: number; - length: number; - } - export interface ServerStreamFileResponseOptions { - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; - waitForTrailers?: boolean | undefined; - offset?: number | undefined; - length?: number | undefined; - } - export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { - onError?(err: NodeJS.ErrnoException): void; - } - export interface Http2Stream extends stream.Duplex { - /** - * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, - * the `'aborted'` event will have been emitted. - * @since v8.4.0 - */ - readonly aborted: boolean; - /** - * This property shows the number of characters currently buffered to be written. - * See `net.Socket.bufferSize` for details. - * @since v11.2.0, v10.16.0 - */ - readonly bufferSize: number; - /** - * Set to `true` if the `Http2Stream` instance has been closed. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer - * usable. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Set to `true` if the `END_STREAM` flag was set in the request or response - * HEADERS frame received, indicating that no additional data should be received - * and the readable side of the `Http2Stream` will be closed. - * @since v10.11.0 - */ - readonly endAfterHeaders: boolean; - /** - * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined` if the stream identifier has not yet been assigned. - * @since v8.4.0 - */ - readonly id?: number | undefined; - /** - * Set to `true` if the `Http2Stream` instance has not yet been assigned a - * numeric stream identifier. - * @since v9.4.0 - */ - readonly pending: boolean; - /** - * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is - * destroyed after either receiving an `RST_STREAM` frame from the connected peer, - * calling `http2stream.close()`, or `http2stream.destroy()`. Will be `undefined` if the `Http2Stream` has not been closed. - * @since v8.4.0 - */ - readonly rstCode: number; - /** - * An object containing the outbound headers sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentHeaders: OutgoingHttpHeaders; - /** - * An array of objects containing the outbound informational (additional) headers - * sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; - /** - * An object containing the outbound trailers sent for this `HttpStream`. - * @since v9.5.0 - */ - readonly sentTrailers?: OutgoingHttpHeaders | undefined; - /** - * A reference to the `Http2Session` instance that owns this `Http2Stream`. The - * value will be `undefined` after the `Http2Stream` instance is destroyed. - * @since v8.4.0 - */ - readonly session: Http2Session | undefined; - /** - * Provides miscellaneous information about the current state of the `Http2Stream`. - * - * A current state of this `Http2Stream`. - * @since v8.4.0 - */ - readonly state: StreamState; - /** - * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the - * connected HTTP/2 peer. - * @since v8.4.0 - * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. - * @param callback An optional function registered to listen for the `'close'` event. - */ - close(code?: number, callback?: () => void): void; - /** - * Updates the priority for this `Http2Stream` instance. - * @since v8.4.0 - */ - priority(options: StreamPriorityOptions): void; - /** - * ```js - * import http2 from 'node:http2'; - * const client = http2.connect('http://example.org:8000'); - * const { NGHTTP2_CANCEL } = http2.constants; - * const req = client.request({ ':path': '/' }); - * - * // Cancel the stream if there's no activity after 5 seconds - * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); - * ``` - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method - * will cause the `Http2Stream` to be immediately closed and must only be - * called after the `'wantTrailers'` event has been emitted. When sending a - * request or sending a response, the `options.waitForTrailers` option must be set - * in order to keep the `Http2Stream` open after the final `DATA` frame so that - * trailers can be sent. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond(undefined, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ xyz: 'abc' }); - * }); - * stream.end('Hello World'); - * }); - * ``` - * - * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header - * fields (e.g. `':method'`, `':path'`, etc). - * @since v10.0.0 - */ - sendTrailers(headers: OutgoingHttpHeaders): void; - addListener(event: "aborted", listener: () => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: "streamClosed", listener: (code: number) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: "wantTrailers", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted"): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: Buffer | string): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "frameError", frameType: number, errorCode: number): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: "streamClosed", code: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "wantTrailers"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: () => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: "streamClosed", listener: (code: number) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - on(event: "wantTrailers", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: () => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: "streamClosed", listener: (code: number) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - once(event: "wantTrailers", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: () => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "streamClosed", listener: (code: number) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: "wantTrailers", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: () => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "streamClosed", listener: (code: number) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: "wantTrailers", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Stream extends Http2Stream { - addListener(event: "continue", listener: () => {}): this; - addListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - addListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "continue"): boolean; - emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "continue", listener: () => {}): this; - on( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - on( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "continue", listener: () => {}): this; - once( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - once( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "continue", listener: () => {}): this; - prependListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "continue", listener: () => {}): this; - prependOnceListener( - event: "headers", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener( - event: "response", - listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ServerHttp2Stream extends Http2Stream { - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote - * client's most recent `SETTINGS` frame. Will be `true` if the remote peer - * accepts push streams, `false` otherwise. Settings are the same for every `Http2Stream` in the same `Http2Session`. - * @since v8.4.0 - */ - readonly pushAllowed: boolean; - /** - * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. - * @since v8.4.0 - */ - additionalHeaders(headers: OutgoingHttpHeaders): void; - /** - * Initiates a push stream. The callback is invoked with the new `Http2Stream` instance created for the push stream passed as the second argument, or an `Error` passed as the first argument. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { - * if (err) throw err; - * pushStream.respond({ ':status': 200 }); - * pushStream.end('some pushed data'); - * }); - * stream.end('some data'); - * }); - * ``` - * - * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass - * a `weight` value to `http2stream.priority` with the `silent` option set to `true` to enable server-side bandwidth balancing between concurrent streams. - * - * Calling `http2stream.pushStream()` from within a pushed stream is not permitted - * and will throw an error. - * @since v8.4.0 - * @param callback Callback that is called once the push stream has been initiated. - */ - pushStream( - headers: OutgoingHttpHeaders, - callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, - ): void; - pushStream( - headers: OutgoingHttpHeaders, - options?: StreamPriorityOptions, - callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void, - ): void; - /** - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.end('some data'); - * }); - * ``` - * - * Initiates a response. When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be sent. - * The `http2stream.sendTrailers()` method can then be used to send trailing header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either `http2stream.sendTrailers()` or `http2stream.close()` to close the `Http2Stream`. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * stream.end('some data'); - * }); - * ``` - * @since v8.4.0 - */ - respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; - /** - * Initiates a response whose data is read from the given file descriptor. No - * validation is performed on the given file descriptor. If an error occurs while - * attempting to read data using the file descriptor, the `Http2Stream` will be - * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * ```js - * import http2 from 'node:http2'; - * import fs from 'node:fs'; - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8', - * }; - * stream.respondWithFD(fd, headers); - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given fd. If the `statCheck` function is provided, the `http2stream.respondWithFD()` method will - * perform an `fs.fstat()` call to collect details on the provided file descriptor. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The file descriptor or `FileHandle` is not closed when the stream is closed, - * so it will need to be closed manually once it is no longer needed. - * Using the same file descriptor concurrently for multiple streams - * is not supported and may result in data loss. Re-using a file descriptor - * after a stream has finished is supported. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code _must_ call either `http2stream.sendTrailers()` - * or `http2stream.close()` to close the `Http2Stream`. - * - * ```js - * import http2 from 'node:http2'; - * import fs from 'node:fs'; - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8', - * }; - * stream.respondWithFD(fd, headers, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * @since v8.4.0 - * @param fd A readable file descriptor. - */ - respondWithFD( - fd: number | fs.promises.FileHandle, - headers?: OutgoingHttpHeaders, - options?: ServerStreamFileResponseOptions, - ): void; - /** - * Sends a regular file as the response. The `path` must specify a regular file - * or an `'error'` event will be emitted on the `Http2Stream` object. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given file: - * - * If an error occurs while attempting to read the file data, the `Http2Stream` will be closed using an - * `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. - * If the `onError` callback is defined, then it will be called. Otherwise, the stream will be destroyed. - * - * Example using a file path: - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * headers['last-modified'] = stat.mtime.toUTCString(); - * } - * - * function onError(err) { - * // stream.respond() can throw if the stream has been destroyed by - * // the other side. - * try { - * if (err.code === 'ENOENT') { - * stream.respond({ ':status': 404 }); - * } else { - * stream.respond({ ':status': 500 }); - * } - * } catch (err) { - * // Perform actual error handling. - * console.error(err); - * } - * stream.end(); - * } - * - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck, onError }); - * }); - * ``` - * - * The `options.statCheck` function may also be used to cancel the send operation - * by returning `false`. For instance, a conditional request may check the stat - * results to determine if the file has been modified to return an appropriate `304` response: - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * // Check the stat here... - * stream.respond({ ':status': 304 }); - * return false; // Cancel the send operation - * } - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck }); - * }); - * ``` - * - * The `content-length` header field will be automatically set. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The `options.onError` function may also be used to handle all the errors - * that could happen before the delivery of the file is initiated. The - * default behavior is to destroy the stream. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * }); - * ``` - * @since v8.4.0 - */ - respondWithFile( - path: string, - headers?: OutgoingHttpHeaders, - options?: ServerStreamFileResponseOptionsWithError, - ): void; - } - // Http2Session - export interface Settings { - headerTableSize?: number | undefined; - enablePush?: boolean | undefined; - initialWindowSize?: number | undefined; - maxFrameSize?: number | undefined; - maxConcurrentStreams?: number | undefined; - maxHeaderListSize?: number | undefined; - enableConnectProtocol?: boolean | undefined; - } - export interface ClientSessionRequestOptions { - endStream?: boolean | undefined; - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - waitForTrailers?: boolean | undefined; - signal?: AbortSignal | undefined; - } - export interface SessionState { - effectiveLocalWindowSize?: number | undefined; - effectiveRecvDataLength?: number | undefined; - nextStreamID?: number | undefined; - localWindowSize?: number | undefined; - lastProcStreamID?: number | undefined; - remoteWindowSize?: number | undefined; - outboundQueueSize?: number | undefined; - deflateDynamicTableSize?: number | undefined; - inflateDynamicTableSize?: number | undefined; - } - export interface Http2Session extends EventEmitter { - /** - * Value will be `undefined` if the `Http2Session` is not yet connected to a - * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or - * will return the value of the connected `TLSSocket`'s own `alpnProtocol` property. - * @since v9.4.0 - */ - readonly alpnProtocol?: string | undefined; - /** - * Will be `true` if this `Http2Session` instance has been closed, otherwise `false`. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Will be `true` if this `Http2Session` instance is still connecting, will be set - * to `false` before emitting `connect` event and/or calling the `http2.connect` callback. - * @since v10.0.0 - */ - readonly connecting: boolean; - /** - * Will be `true` if this `Http2Session` instance has been destroyed and must no - * longer be used, otherwise `false`. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Value is `undefined` if the `Http2Session` session socket has not yet been - * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, - * and `false` if the `Http2Session` is connected to any other kind of socket - * or stream. - * @since v9.4.0 - */ - readonly encrypted?: boolean | undefined; - /** - * A prototype-less object describing the current local settings of this `Http2Session`. - * The local settings are local to _this_`Http2Session` instance. - * @since v8.4.0 - */ - readonly localSettings: Settings; - /** - * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property - * will return an `Array` of origins for which the `Http2Session` may be - * considered authoritative. - * - * The `originSet` property is only available when using a secure TLS connection. - * @since v9.4.0 - */ - readonly originSet?: string[] | undefined; - /** - * Indicates whether the `Http2Session` is currently waiting for acknowledgment of - * a sent `SETTINGS` frame. Will be `true` after calling the `http2session.settings()` method. - * Will be `false` once all sent `SETTINGS` frames have been acknowledged. - * @since v8.4.0 - */ - readonly pendingSettingsAck: boolean; - /** - * A prototype-less object describing the current remote settings of this`Http2Session`. - * The remote settings are set by the _connected_ HTTP/2 peer. - * @since v8.4.0 - */ - readonly remoteSettings: Settings; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * limits available methods to ones safe to use with HTTP/2. - * - * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw - * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. - * - * `setTimeout` method will be called on this `Http2Session`. - * - * All other interactions will be routed directly to the socket. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * Provides miscellaneous information about the current state of the`Http2Session`. - * - * An object describing the current status of this `Http2Session`. - * @since v8.4.0 - */ - readonly state: SessionState; - /** - * The `http2session.type` will be equal to `http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a - * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a - * client. - * @since v8.4.0 - */ - readonly type: number; - /** - * Gracefully closes the `Http2Session`, allowing any existing streams to - * complete on their own and preventing new `Http2Stream` instances from being - * created. Once closed, `http2session.destroy()`_might_ be called if there - * are no open `Http2Stream` instances. - * - * If specified, the `callback` function is registered as a handler for the`'close'` event. - * @since v9.4.0 - */ - close(callback?: () => void): void; - /** - * Immediately terminates the `Http2Session` and the associated `net.Socket` or `tls.TLSSocket`. - * - * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error` is not undefined, an `'error'` event will be emitted immediately before the `'close'` event. - * - * If there are any remaining open `Http2Streams` associated with the `Http2Session`, those will also be destroyed. - * @since v8.4.0 - * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. - * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. - */ - destroy(error?: Error, code?: number): void; - /** - * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. - * @since v9.4.0 - * @param code An HTTP/2 error code - * @param lastStreamID The numeric ID of the last processed `Http2Stream` - * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. - */ - goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; - /** - * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must - * be provided. The method will return `true` if the `PING` was sent, `false` otherwise. - * - * The maximum number of outstanding (unacknowledged) pings is determined by the `maxOutstandingPings` configuration option. The default maximum is 10. - * - * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView` containing 8 bytes of data that will be transmitted with the `PING` and - * returned with the ping acknowledgment. - * - * The callback will be invoked with three arguments: an error argument that will - * be `null` if the `PING` was successfully acknowledged, a `duration` argument - * that reports the number of milliseconds elapsed since the ping was sent and the - * acknowledgment was received, and a `Buffer` containing the 8-byte `PING` payload. - * - * ```js - * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { - * if (!err) { - * console.log(`Ping acknowledged in ${duration} milliseconds`); - * console.log(`With payload '${payload.toString()}'`); - * } - * }); - * ``` - * - * If the `payload` argument is not specified, the default payload will be the - * 64-bit timestamp (little endian) marking the start of the `PING` duration. - * @since v8.9.3 - * @param payload Optional ping payload. - */ - ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - ping( - payload: NodeJS.ArrayBufferView, - callback: (err: Error | null, duration: number, payload: Buffer) => void, - ): boolean; - /** - * Calls `ref()` on this `Http2Session` instance's underlying `net.Socket`. - * @since v9.4.0 - */ - ref(): void; - /** - * Sets the local endpoint's window size. - * The `windowSize` is the total window size to set, not - * the delta. - * - * ```js - * import http2 from 'node:http2'; - * - * const server = http2.createServer(); - * const expectedWindowSize = 2 ** 20; - * server.on('connect', (session) => { - * - * // Set local window size to be 2 ** 20 - * session.setLocalWindowSize(expectedWindowSize); - * }); - * ``` - * @since v15.3.0, v14.18.0 - */ - setLocalWindowSize(windowSize: number): void; - /** - * Used to set a callback function that is called when there is no activity on - * the `Http2Session` after `msecs` milliseconds. The given `callback` is - * registered as a listener on the `'timeout'` event. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Updates the current local settings for this `Http2Session` and sends a new `SETTINGS` frame to the connected HTTP/2 peer. - * - * Once called, the `http2session.pendingSettingsAck` property will be `true` while the session is waiting for the remote peer to acknowledge the new - * settings. - * - * The new settings will not become effective until the `SETTINGS` acknowledgment - * is received and the `'localSettings'` event is emitted. It is possible to send - * multiple `SETTINGS` frames while acknowledgment is still pending. - * @since v8.4.0 - * @param callback Callback that is called once the session is connected or right away if the session is already connected. - */ - settings( - settings: Settings, - callback?: (err: Error | null, settings: Settings, duration: number) => void, - ): void; - /** - * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - unref(): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - addListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - addListener(event: "localSettings", listener: (settings: Settings) => void): this; - addListener(event: "ping", listener: () => void): this; - addListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean; - emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData?: Buffer): boolean; - emit(event: "localSettings", settings: Settings): boolean; - emit(event: "ping"): boolean; - emit(event: "remoteSettings", settings: Settings): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this; - on(event: "localSettings", listener: (settings: Settings) => void): this; - on(event: "ping", listener: () => void): this; - on(event: "remoteSettings", listener: (settings: Settings) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void): this; - once(event: "localSettings", listener: (settings: Settings) => void): this; - once(event: "ping", listener: () => void): this; - once(event: "remoteSettings", listener: (settings: Settings) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - prependListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependListener(event: "ping", listener: () => void): this; - prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "frameError", - listener: (frameType: number, errorCode: number, streamID: number) => void, - ): this; - prependOnceListener( - event: "goaway", - listener: (errorCode: number, lastStreamID: number, opaqueData?: Buffer) => void, - ): this; - prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "ping", listener: () => void): this; - prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Session extends Http2Session { - /** - * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()` creates and returns an `Http2Stream` instance that can be used to send an - * HTTP/2 request to the connected server. - * - * When a `ClientHttp2Session` is first created, the socket may not yet be - * connected. if `clienthttp2session.request()` is called during this time, the - * actual request will be deferred until the socket is ready to go. - * If the `session` is closed before the actual request be executed, an `ERR_HTTP2_GOAWAY_SESSION` is thrown. - * - * This method is only available if `http2session.type` is equal to `http2.constants.NGHTTP2_SESSION_CLIENT`. - * - * ```js - * import http2 from 'node:http2'; - * const clientSession = http2.connect('https://localhost:1234'); - * const { - * HTTP2_HEADER_PATH, - * HTTP2_HEADER_STATUS, - * } = http2.constants; - * - * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); - * req.on('response', (headers) => { - * console.log(headers[HTTP2_HEADER_STATUS]); - * req.on('data', (chunk) => { // .. }); - * req.on('end', () => { // .. }); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * is emitted immediately after queuing the last chunk of payload data to be sent. - * The `http2stream.sendTrailers()` method can then be called to send trailing - * headers to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * When `options.signal` is set with an `AbortSignal` and then `abort` on the - * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. - * - * The `:method` and `:path` pseudo-headers are not specified within `headers`, - * they respectively default to: - * - * * `:method` \= `'GET'` - * * `:path` \= `/` - * @since v8.4.0 - */ - request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; - addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - addListener(event: "origin", listener: (origins: string[]) => void): this; - addListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - addListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; - emit(event: "origin", origins: readonly string[]): boolean; - emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit( - event: "stream", - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - on(event: "origin", listener: (origins: string[]) => void): this; - on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - once(event: "origin", listener: (origins: string[]) => void): this; - once( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - once( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependListener(event: "origin", listener: (origins: string[]) => void): this; - prependListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependOnceListener(event: "origin", listener: (origins: string[]) => void): this; - prependOnceListener( - event: "connect", - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): this; - prependOnceListener( - event: "stream", - listener: ( - stream: ClientHttp2Stream, - headers: IncomingHttpHeaders & IncomingHttpStatusHeader, - flags: number, - ) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface AlternativeServiceOptions { - origin: number | string | url.URL; - } - export interface ServerHttp2Session< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends Http2Session { - readonly server: - | Http2Server - | Http2SecureServer; - /** - * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. - * - * ```js - * import http2 from 'node:http2'; - * - * const server = http2.createServer(); - * server.on('session', (session) => { - * // Set altsvc for origin https://example.org:80 - * session.altsvc('h2=":8000"', 'https://example.org:80'); - * }); - * - * server.on('stream', (stream) => { - * // Set altsvc for a specific stream - * stream.session.altsvc('h2=":8000"', stream.id); - * }); - * ``` - * - * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate - * service is associated with the origin of the given `Http2Stream`. - * - * The `alt` and origin string _must_ contain only ASCII bytes and are - * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given - * domain. - * - * When a string is passed for the `originOrStream` argument, it will be parsed as - * a URL and the origin will be derived. For instance, the origin for the - * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * @since v9.4.0 - * @param alt A description of the alternative service configuration as defined by `RFC 7838`. - * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the - * `http2stream.id` property. - */ - altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; - /** - * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client - * to advertise the set of origins for which the server is capable of providing - * authoritative responses. - * - * ```js - * import http2 from 'node:http2'; - * const options = getSecureOptionsSomehow(); - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * server.on('session', (session) => { - * session.origin('https://example.com', 'https://example.org'); - * }); - * ``` - * - * When a string is passed as an `origin`, it will be parsed as a URL and the - * origin will be derived. For instance, the origin for the HTTP URL `'https://example.org/foo/bar'` is the ASCII string` 'https://example.org'`. An error will be thrown if either the given - * string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as - * an `origin`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * - * Alternatively, the `origins` option may be used when creating a new HTTP/2 - * server using the `http2.createSecureServer()` method: - * - * ```js - * import http2 from 'node:http2'; - * const options = getSecureOptionsSomehow(); - * options.origins = ['https://example.com', 'https://example.org']; - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * ``` - * @since v10.12.0 - * @param origins One or more URL Strings passed as separate arguments. - */ - origin( - ...origins: Array< - | string - | url.URL - | { - origin: string; - } - > - ): void; - addListener( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit( - event: "connect", - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "connect", - listener: ( - session: ServerHttp2Session, - socket: net.Socket | tls.TLSSocket, - ) => void, - ): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - // Http2Server - export interface SessionOptions { - maxDeflateDynamicTableSize?: number | undefined; - maxSessionMemory?: number | undefined; - maxHeaderListPairs?: number | undefined; - maxOutstandingPings?: number | undefined; - maxSendHeaderBlockLength?: number | undefined; - paddingStrategy?: number | undefined; - peerMaxConcurrentStreams?: number | undefined; - settings?: Settings | undefined; - remoteCustomSettings?: number[] | undefined; - /** - * Specifies a timeout in milliseconds that - * a server should wait when an [`'unknownProtocol'`][] is emitted. If the - * socket has not been destroyed by that time the server will destroy it. - * @default 100000 - */ - unknownProtocolTimeout?: number | undefined; - selectPadding?(frameLen: number, maxFrameLen: number): number; - } - export interface ClientSessionOptions extends SessionOptions { - maxReservedRemoteStreams?: number | undefined; - createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; - protocol?: "http:" | "https:" | undefined; - } - export interface ServerSessionOptions< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends SessionOptions { - Http1IncomingMessage?: Http1Request | undefined; - Http1ServerResponse?: Http1Response | undefined; - Http2ServerRequest?: Http2Request | undefined; - Http2ServerResponse?: Http2Response | undefined; - } - export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} - export interface SecureServerSessionOptions< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends ServerSessionOptions, tls.TlsOptions {} - export interface ServerOptions< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends ServerSessionOptions {} - export interface SecureServerOptions< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends SecureServerSessionOptions { - allowHTTP1?: boolean | undefined; - origins?: string[] | undefined; - } - interface HTTP2ServerCommon { - setTimeout(msec?: number, callback?: () => void): this; - /** - * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. - * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. - */ - updateSettings(settings: Settings): void; - } - export interface Http2Server< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends net.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit( - event: "checkContinue", - request: InstanceType, - response: InstanceType, - ): boolean; - emit(event: "request", request: InstanceType, response: InstanceType): boolean; - emit( - event: "session", - session: ServerHttp2Session, - ): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependOnceListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependOnceListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface Http2SecureServer< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - > extends tls.Server, HTTP2ServerCommon { - addListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - addListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit( - event: "checkContinue", - request: InstanceType, - response: InstanceType, - ): boolean; - emit(event: "request", request: InstanceType, response: InstanceType): boolean; - emit( - event: "session", - session: ServerHttp2Session, - ): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - on( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - on(event: "timeout", listener: () => void): this; - on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - once( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - once(event: "timeout", listener: () => void): this; - once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener( - event: "checkContinue", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependOnceListener( - event: "request", - listener: (request: InstanceType, response: InstanceType) => void, - ): this; - prependOnceListener( - event: "session", - listener: (session: ServerHttp2Session) => void, - ): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener( - event: "stream", - listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void, - ): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, - * headers, and - * data. - * @since v8.4.0 - */ - export class Http2ServerRequest extends stream.Readable { - constructor( - stream: ServerHttp2Stream, - headers: IncomingHttpHeaders, - options: stream.ReadableOptions, - rawHeaders: readonly string[], - ); - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - */ - readonly aborted: boolean; - /** - * The request authority pseudo header field. Because HTTP/2 allows requests - * to set either `:authority` or `host`, this value is derived from `req.headers[':authority']` if present. Otherwise, it is derived from `req.headers['host']`. - * @since v8.4.0 - */ - readonly authority: string; - /** - * See `request.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * The `request.complete` property will be `true` if the request has - * been completed, aborted, or destroyed. - * @since v12.10.0 - */ - readonly complete: boolean; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * See `HTTP/2 Headers Object`. - * - * In HTTP/2, the request path, host name, protocol, and method are represented as - * special headers prefixed with the `:` character (e.g. `':path'`). These special - * headers will be included in the `request.headers` object. Care must be taken not - * to inadvertently modify these special headers or errors may occur. For instance, - * removing all headers from the request will cause errors to occur: - * - * ```js - * removeAllHeaders(request.headers); - * assert(request.url); // Fails because the :path header has been removed - * ``` - * @since v8.4.0 - */ - readonly headers: IncomingHttpHeaders; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. Returns `'2.0'`. - * - * Also `message.httpVersionMajor` is the first integer and `message.httpVersionMinor` is the second. - * @since v8.4.0 - */ - readonly httpVersion: string; - readonly httpVersionMinor: number; - readonly httpVersionMajor: number; - /** - * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. - * @since v8.4.0 - */ - readonly method: string; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v8.4.0 - */ - readonly rawHeaders: string[]; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly rawTrailers: string[]; - /** - * The request scheme pseudo header field indicating the scheme - * portion of the target URL. - * @since v8.4.0 - */ - readonly scheme: string; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `request.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on `request.stream`. - * - * `setTimeout` method will be called on `request.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. With TLS support, - * use `request.socket.getPeerCertificate()` to obtain the client's - * authentication details. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the request. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly trailers: IncomingHttpHeaders; - /** - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. If the request is: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * Then `request.url` will be: - * - * ```js - * '/status?name=ryan' - * ``` - * - * To parse the url into its parts, `new URL()` can be used: - * - * ```console - * $ node - * > new URL('/status?name=ryan', 'http://example.com') - * URL { - * href: 'http://example.com/status?name=ryan', - * origin: 'http://example.com', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'example.com', - * hostname: 'example.com', - * port: '', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v8.4.0 - */ - url: string; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream`s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - read(size?: number): Buffer | string | null; - addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "aborted", hadError: boolean, code: number): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: Buffer | string): boolean; - emit(event: "end"): boolean; - emit(event: "readable"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v8.4.0 - */ - export class Http2ServerResponse extends stream.Writable { - constructor(stream: ServerHttp2Stream); - /** - * See `response.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * Append a single header value to the header object. - * - * If the value is an array, this is equivalent to calling this method multiple times. - * - * If there were no previous values for the header, this is equivalent to calling {@link setHeader}. - * - * Attempting to set a header field name or value that contains invalid characters will result in a - * [TypeError](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-typeerror) being thrown. - * - * ```js - * // Returns headers including "set-cookie: a" and "set-cookie: b" - * const server = http2.createServer((req, res) => { - * res.setHeader('set-cookie', 'a'); - * res.appendHeader('set-cookie', 'b'); - * res.writeHead(200); - * res.end('ok'); - * }); - * ``` - * @since v20.12.0 - */ - appendHeader(name: string, value: string | string[]): void; - /** - * Boolean value that indicates whether the response has completed. Starts - * as `false`. After `response.end()` executes, the value will be `true`. - * @since v8.4.0 - * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. - */ - readonly finished: boolean; - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * A reference to the original HTTP2 `request` object. - * @since v15.7.0 - */ - readonly req: Request; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `response.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on `response.stream`. - * - * `setTimeout` method will be called on `response.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. - * - * ```js - * import http2 from 'node:http2'; - * const server = http2.createServer((req, res) => { - * const ip = req.socket.remoteAddress; - * const port = req.socket.remotePort; - * res.end(`Your IP address is ${ip} and your source port is ${port}.`); - * }).listen(3000); - * ``` - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the response. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * When true, the Date header will be automatically generated and sent in - * the response if it is not already present in the headers. Defaults to true. - * - * This should only be disabled for testing; HTTP requires the Date header - * in responses. - * @since v8.4.0 - */ - sendDate: boolean; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v8.4.0 - */ - statusCode: number; - /** - * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns - * an empty string. - * @since v8.4.0 - */ - statusMessage: ""; - /** - * This method adds HTTP trailing headers (a header but at the end of the - * message) to the response. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - addTrailers(trailers: OutgoingHttpHeaders): void; - /** - * This method signals to the server that all of the response headers and body - * have been sent; that server should consider this message complete. - * The method, `response.end()`, MUST be called on each response. - * - * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. - * - * If `callback` is specified, it will be called when the response stream - * is finished. - * @since v8.4.0 - */ - end(callback?: () => void): this; - end(data: string | Uint8Array, callback?: () => void): this; - end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this; - /** - * Reads out a header that has already been queued but not sent to the client. - * The name is case-insensitive. - * - * ```js - * const contentType = response.getHeader('content-type'); - * ``` - * @since v8.4.0 - */ - getHeader(name: string): string; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All header names are lowercase. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = response.getHeaderNames(); - * // headerNames === ['foo', 'set-cookie'] - * ``` - * @since v8.4.0 - */ - getHeaderNames(): string[]; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow copy - * is used, array values may be mutated without additional calls to various - * header-related http module methods. The keys of the returned object are the - * header names and the values are the respective header values. All header names - * are lowercase. - * - * The object returned by the `response.getHeaders()` method _does not_ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = response.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v8.4.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name matching is case-insensitive. - * - * ```js - * const hasContentType = response.hasHeader('content-type'); - * ``` - * @since v8.4.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that has been queued for implicit sending. - * - * ```js - * response.removeHeader('Content-Encoding'); - * ``` - * @since v8.4.0 - */ - removeHeader(name: string): void; - /** - * Sets a single header value for implicit headers. If this header already exists - * in the to-be-sent headers, its value will be replaced. Use an array of strings - * here to send multiple headers with the same name. - * - * ```js - * response.setHeader('Content-Type', 'text/html; charset=utf-8'); - * ``` - * - * or - * - * ```js - * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * - * When headers have been set with `response.setHeader()`, 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 = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * @since v8.4.0 - */ - setHeader(name: string, value: number | string | readonly string[]): void; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'` events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * If this method is called and `response.writeHead()` has not been called, - * it will switch to implicit header mode and flush the implicit headers. - * - * This sends a chunk of the response body. This method may - * be called multiple times to provide successive parts of the body. - * - * In the `node:http` module, the response body is omitted when the - * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. - * - * `chunk` can be a string or a buffer. If `chunk` is a string, - * the second parameter specifies how to encode it into a byte stream. - * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk - * of data is flushed. - * - * This is the raw HTTP body and has nothing to do with higher-level multi-part - * body encodings that may be used. - * - * The first time `response.write()` is called, it will send the buffered - * header information and the first chunk of the body to the client. The second - * time `response.write()` is called, Node.js assumes data will be streamed, - * and sends the new data separately. That is, the response is buffered up to the - * first chunk of the body. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. - * @since v8.4.0 - */ - write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; - write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; - /** - * Sends a status `100 Continue` to the client, indicating that the request body - * should be sent. See the `'checkContinue'` event on `Http2Server` and `Http2SecureServer`. - * @since v8.4.0 - */ - writeContinue(): void; - /** - * Sends a status `103 Early Hints` to the client with a Link header, - * indicating that the user agent can preload/preconnect the linked resources. - * The `hints` is an object containing the values of headers to be sent with - * early hints message. - * - * **Example** - * - * ```js - * const earlyHintsLink = '; rel=preload; as=style'; - * response.writeEarlyHints({ - * 'link': earlyHintsLink, - * }); - * - * const earlyHintsLinks = [ - * '; rel=preload; as=style', - * '; rel=preload; as=script', - * ]; - * response.writeEarlyHints({ - * 'link': earlyHintsLinks, - * }); - * ``` - * @since v18.11.0 - */ - writeEarlyHints(hints: Record): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * - * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. - * - * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be - * passed as the second argument. However, because the `statusMessage` has no - * meaning within HTTP/2, the argument will have no effect and a process warning - * will be emitted. - * - * ```js - * const body = 'hello world'; - * response.writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain; charset=utf-8', - * }); - * ``` - * - * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a - * given encoding. On outbound messages, Node.js does not check if Content-Length - * and the length of the body being transmitted are equal or not. However, when - * receiving messages, Node.js will automatically reject messages when the `Content-Length` does not match the actual payload size. - * - * This method may be called at most one time on a message before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, 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 = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; - writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; - /** - * Call `http2stream.pushStream()` with the given headers, and wrap the - * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback - * parameter if successful. When `Http2ServerRequest` is closed, the callback is - * called with an error `ERR_HTTP2_INVALID_STREAM`. - * @since v8.4.0 - * @param headers An object describing the headers - * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of - * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method - */ - createPushResponse( - headers: OutgoingHttpHeaders, - callback: (err: Error | null, res: Http2ServerResponse) => void, - ): void; - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export namespace constants { - const NGHTTP2_SESSION_SERVER: number; - const NGHTTP2_SESSION_CLIENT: number; - const NGHTTP2_STREAM_STATE_IDLE: number; - const NGHTTP2_STREAM_STATE_OPEN: number; - const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; - const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; - const NGHTTP2_STREAM_STATE_CLOSED: number; - const NGHTTP2_NO_ERROR: number; - const NGHTTP2_PROTOCOL_ERROR: number; - const NGHTTP2_INTERNAL_ERROR: number; - const NGHTTP2_FLOW_CONTROL_ERROR: number; - const NGHTTP2_SETTINGS_TIMEOUT: number; - const NGHTTP2_STREAM_CLOSED: number; - const NGHTTP2_FRAME_SIZE_ERROR: number; - const NGHTTP2_REFUSED_STREAM: number; - const NGHTTP2_CANCEL: number; - const NGHTTP2_COMPRESSION_ERROR: number; - const NGHTTP2_CONNECT_ERROR: number; - const NGHTTP2_ENHANCE_YOUR_CALM: number; - const NGHTTP2_INADEQUATE_SECURITY: number; - const NGHTTP2_HTTP_1_1_REQUIRED: number; - const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; - const NGHTTP2_FLAG_NONE: number; - const NGHTTP2_FLAG_END_STREAM: number; - const NGHTTP2_FLAG_END_HEADERS: number; - const NGHTTP2_FLAG_ACK: number; - const NGHTTP2_FLAG_PADDED: number; - const NGHTTP2_FLAG_PRIORITY: number; - const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; - const DEFAULT_SETTINGS_ENABLE_PUSH: number; - const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; - const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; - const MAX_MAX_FRAME_SIZE: number; - const MIN_MAX_FRAME_SIZE: number; - const MAX_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_DEFAULT_WEIGHT: number; - const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; - const NGHTTP2_SETTINGS_ENABLE_PUSH: number; - const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; - const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; - const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; - const PADDING_STRATEGY_NONE: number; - const PADDING_STRATEGY_MAX: number; - const PADDING_STRATEGY_CALLBACK: number; - const HTTP2_HEADER_STATUS: string; - const HTTP2_HEADER_METHOD: string; - const HTTP2_HEADER_AUTHORITY: string; - const HTTP2_HEADER_SCHEME: string; - const HTTP2_HEADER_PATH: string; - const HTTP2_HEADER_ACCEPT_CHARSET: string; - const HTTP2_HEADER_ACCEPT_ENCODING: string; - const HTTP2_HEADER_ACCEPT_LANGUAGE: string; - const HTTP2_HEADER_ACCEPT_RANGES: string; - const HTTP2_HEADER_ACCEPT: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; - const HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS: string; - const HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS: string; - const HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD: string; - const HTTP2_HEADER_AGE: string; - const HTTP2_HEADER_ALLOW: string; - const HTTP2_HEADER_AUTHORIZATION: string; - const HTTP2_HEADER_CACHE_CONTROL: string; - const HTTP2_HEADER_CONNECTION: string; - const HTTP2_HEADER_CONTENT_DISPOSITION: string; - const HTTP2_HEADER_CONTENT_ENCODING: string; - const HTTP2_HEADER_CONTENT_LANGUAGE: string; - const HTTP2_HEADER_CONTENT_LENGTH: string; - const HTTP2_HEADER_CONTENT_LOCATION: string; - const HTTP2_HEADER_CONTENT_MD5: string; - const HTTP2_HEADER_CONTENT_RANGE: string; - const HTTP2_HEADER_CONTENT_TYPE: string; - const HTTP2_HEADER_COOKIE: string; - const HTTP2_HEADER_DATE: string; - const HTTP2_HEADER_ETAG: string; - const HTTP2_HEADER_EXPECT: string; - const HTTP2_HEADER_EXPIRES: string; - const HTTP2_HEADER_FROM: string; - const HTTP2_HEADER_HOST: string; - const HTTP2_HEADER_IF_MATCH: string; - const HTTP2_HEADER_IF_MODIFIED_SINCE: string; - const HTTP2_HEADER_IF_NONE_MATCH: string; - const HTTP2_HEADER_IF_RANGE: string; - const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; - const HTTP2_HEADER_LAST_MODIFIED: string; - const HTTP2_HEADER_LINK: string; - const HTTP2_HEADER_LOCATION: string; - const HTTP2_HEADER_MAX_FORWARDS: string; - const HTTP2_HEADER_PREFER: string; - const HTTP2_HEADER_PROXY_AUTHENTICATE: string; - const HTTP2_HEADER_PROXY_AUTHORIZATION: string; - const HTTP2_HEADER_RANGE: string; - const HTTP2_HEADER_REFERER: string; - const HTTP2_HEADER_REFRESH: string; - const HTTP2_HEADER_RETRY_AFTER: string; - const HTTP2_HEADER_SERVER: string; - const HTTP2_HEADER_SET_COOKIE: string; - const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; - const HTTP2_HEADER_TRANSFER_ENCODING: string; - const HTTP2_HEADER_TE: string; - const HTTP2_HEADER_UPGRADE: string; - const HTTP2_HEADER_USER_AGENT: string; - const HTTP2_HEADER_VARY: string; - const HTTP2_HEADER_VIA: string; - const HTTP2_HEADER_WWW_AUTHENTICATE: string; - const HTTP2_HEADER_HTTP2_SETTINGS: string; - const HTTP2_HEADER_KEEP_ALIVE: string; - const HTTP2_HEADER_PROXY_CONNECTION: string; - const HTTP2_METHOD_ACL: string; - const HTTP2_METHOD_BASELINE_CONTROL: string; - const HTTP2_METHOD_BIND: string; - const HTTP2_METHOD_CHECKIN: string; - const HTTP2_METHOD_CHECKOUT: string; - const HTTP2_METHOD_CONNECT: string; - const HTTP2_METHOD_COPY: string; - const HTTP2_METHOD_DELETE: string; - const HTTP2_METHOD_GET: string; - const HTTP2_METHOD_HEAD: string; - const HTTP2_METHOD_LABEL: string; - const HTTP2_METHOD_LINK: string; - const HTTP2_METHOD_LOCK: string; - const HTTP2_METHOD_MERGE: string; - const HTTP2_METHOD_MKACTIVITY: string; - const HTTP2_METHOD_MKCALENDAR: string; - const HTTP2_METHOD_MKCOL: string; - const HTTP2_METHOD_MKREDIRECTREF: string; - const HTTP2_METHOD_MKWORKSPACE: string; - const HTTP2_METHOD_MOVE: string; - const HTTP2_METHOD_OPTIONS: string; - const HTTP2_METHOD_ORDERPATCH: string; - const HTTP2_METHOD_PATCH: string; - const HTTP2_METHOD_POST: string; - const HTTP2_METHOD_PRI: string; - const HTTP2_METHOD_PROPFIND: string; - const HTTP2_METHOD_PROPPATCH: string; - const HTTP2_METHOD_PUT: string; - const HTTP2_METHOD_REBIND: string; - const HTTP2_METHOD_REPORT: string; - const HTTP2_METHOD_SEARCH: string; - const HTTP2_METHOD_TRACE: string; - const HTTP2_METHOD_UNBIND: string; - const HTTP2_METHOD_UNCHECKOUT: string; - const HTTP2_METHOD_UNLINK: string; - const HTTP2_METHOD_UNLOCK: string; - const HTTP2_METHOD_UPDATE: string; - const HTTP2_METHOD_UPDATEREDIRECTREF: string; - const HTTP2_METHOD_VERSION_CONTROL: string; - const HTTP_STATUS_CONTINUE: number; - const HTTP_STATUS_SWITCHING_PROTOCOLS: number; - const HTTP_STATUS_PROCESSING: number; - const HTTP_STATUS_OK: number; - const HTTP_STATUS_CREATED: number; - const HTTP_STATUS_ACCEPTED: number; - const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; - const HTTP_STATUS_NO_CONTENT: number; - const HTTP_STATUS_RESET_CONTENT: number; - const HTTP_STATUS_PARTIAL_CONTENT: number; - const HTTP_STATUS_MULTI_STATUS: number; - const HTTP_STATUS_ALREADY_REPORTED: number; - const HTTP_STATUS_IM_USED: number; - const HTTP_STATUS_MULTIPLE_CHOICES: number; - const HTTP_STATUS_MOVED_PERMANENTLY: number; - const HTTP_STATUS_FOUND: number; - const HTTP_STATUS_SEE_OTHER: number; - const HTTP_STATUS_NOT_MODIFIED: number; - const HTTP_STATUS_USE_PROXY: number; - const HTTP_STATUS_TEMPORARY_REDIRECT: number; - const HTTP_STATUS_PERMANENT_REDIRECT: number; - const HTTP_STATUS_BAD_REQUEST: number; - const HTTP_STATUS_UNAUTHORIZED: number; - const HTTP_STATUS_PAYMENT_REQUIRED: number; - const HTTP_STATUS_FORBIDDEN: number; - const HTTP_STATUS_NOT_FOUND: number; - const HTTP_STATUS_METHOD_NOT_ALLOWED: number; - const HTTP_STATUS_NOT_ACCEPTABLE: number; - const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; - const HTTP_STATUS_REQUEST_TIMEOUT: number; - const HTTP_STATUS_CONFLICT: number; - const HTTP_STATUS_GONE: number; - const HTTP_STATUS_LENGTH_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_FAILED: number; - const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; - const HTTP_STATUS_URI_TOO_LONG: number; - const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; - const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; - const HTTP_STATUS_EXPECTATION_FAILED: number; - const HTTP_STATUS_TEAPOT: number; - const HTTP_STATUS_MISDIRECTED_REQUEST: number; - const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; - const HTTP_STATUS_LOCKED: number; - const HTTP_STATUS_FAILED_DEPENDENCY: number; - const HTTP_STATUS_UNORDERED_COLLECTION: number; - const HTTP_STATUS_UPGRADE_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_REQUIRED: number; - const HTTP_STATUS_TOO_MANY_REQUESTS: number; - const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; - const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; - const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; - const HTTP_STATUS_NOT_IMPLEMENTED: number; - const HTTP_STATUS_BAD_GATEWAY: number; - const HTTP_STATUS_SERVICE_UNAVAILABLE: number; - const HTTP_STATUS_GATEWAY_TIMEOUT: number; - const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; - const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; - const HTTP_STATUS_INSUFFICIENT_STORAGE: number; - const HTTP_STATUS_LOOP_DETECTED: number; - const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; - const HTTP_STATUS_NOT_EXTENDED: number; - const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; - } - /** - * This symbol can be set as a property on the HTTP/2 headers object with - * an array value in order to provide a list of headers considered sensitive. - */ - export const sensitiveHeaders: symbol; - /** - * Returns an object containing the default settings for an `Http2Session` instance. This method returns a new object instance every time it is called - * so instances returned may be safely modified for use. - * @since v8.4.0 - */ - export function getDefaultSettings(): Settings; - /** - * Returns a `Buffer` instance containing serialized representation of the given - * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended - * for use with the `HTTP2-Settings` header field. - * - * ```js - * import http2 from 'node:http2'; - * - * const packed = http2.getPackedSettings({ enablePush: false }); - * - * console.log(packed.toString('base64')); - * // Prints: AAIAAAAA - * ``` - * @since v8.4.0 - */ - export function getPackedSettings(settings: Settings): Buffer; - /** - * Returns a `HTTP/2 Settings Object` containing the deserialized settings from - * the given `Buffer` as generated by `http2.getPackedSettings()`. - * @since v8.4.0 - * @param buf The packed settings. - */ - export function getUnpackedSettings(buf: Uint8Array): Settings; - /** - * Returns a `net.Server` instance that creates and manages `Http2Session` instances. - * - * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when - * communicating - * with browser clients. - * - * ```js - * import http2 from 'node:http2'; - * - * // Create an unencrypted HTTP/2 server. - * // Since there are no browsers known that support - * // unencrypted HTTP/2, the use of `http2.createSecureServer()` - * // is necessary when communicating with browser clients. - * const server = http2.createServer(); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200, - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(8000); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createServer( - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2Server; - export function createServer< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - >( - options: ServerOptions, - onRequestHandler?: (request: InstanceType, response: InstanceType) => void, - ): Http2Server; - /** - * Returns a `tls.Server` instance that creates and manages `Http2Session` instances. - * - * ```js - * import http2 from 'node:http2'; - * import fs from 'node:fs'; - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * }; - * - * // Create a secure HTTP/2 server - * const server = http2.createSecureServer(options); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200, - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(8443); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createSecureServer( - onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void, - ): Http2SecureServer; - export function createSecureServer< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - >( - options: SecureServerOptions, - onRequestHandler?: (request: InstanceType, response: InstanceType) => void, - ): Http2SecureServer; - /** - * Returns a `ClientHttp2Session` instance. - * - * ```js - * import http2 from 'node:http2'; - * const client = http2.connect('https://localhost:1234'); - * - * // Use the client - * - * client.close(); - * ``` - * @since v8.4.0 - * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port - * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. - * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. - */ - export function connect( - authority: string | url.URL, - listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): ClientHttp2Session; - export function connect( - authority: string | url.URL, - options?: ClientSessionOptions | SecureClientSessionOptions, - listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, - ): ClientHttp2Session; - /** - * Create an HTTP/2 server session from an existing socket. - * @param socket A Duplex Stream - * @param options Any `{@link createServer}` options can be provided. - * @since v20.12.0 - */ - export function performServerHandshake< - Http1Request extends typeof IncomingMessage = typeof IncomingMessage, - Http1Response extends typeof ServerResponse> = typeof ServerResponse, - Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, - Http2Response extends typeof Http2ServerResponse> = typeof Http2ServerResponse, - >( - socket: stream.Duplex, - options?: ServerOptions, - ): ServerHttp2Session; -} -declare module "node:http2" { - export * from "http2"; -} diff --git a/node_modules/@types/node/https.d.ts b/node_modules/@types/node/https.d.ts deleted file mode 100644 index 7112b8d..0000000 --- a/node_modules/@types/node/https.d.ts +++ /dev/null @@ -1,544 +0,0 @@ -/** - * 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/v22.x/lib/https.js) - */ -declare module "https" { - import { Duplex } from "node:stream"; - import * as tls from "node:tls"; - import * as http from "node:http"; - import { URL } from "node:url"; - type ServerOptions< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; - type RequestOptions = - & http.RequestOptions - & tls.SecureContextOptions - & { - checkServerIdentity?: typeof tls.checkServerIdentity | 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; - } - /** - * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. - * @since v0.4.5 - */ - class Agent extends http.Agent { - constructor(options?: AgentOptions); - options: AgentOptions; - } - interface Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - > extends http.Server {} - /** - * See `http.Server` for more information. - * @since v0.3.4 - */ - class Server< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - > extends tls.Server { - constructor(requestListener?: http.RequestListener); - constructor( - options: ServerOptions, - requestListener?: http.RequestListener, - ); - /** - * Closes all connections connected to this server. - * @since v18.2.0 - */ - closeAllConnections(): void; - /** - * Closes all connections connected to this server which are not sending a request or waiting for a response. - * @since v18.2.0 - */ - closeIdleConnections(): void; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - addListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Duplex) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "checkContinue", listener: http.RequestListener): this; - addListener(event: "checkExpectation", listener: http.RequestListener): this; - addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - addListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - addListener(event: "request", listener: http.RequestListener): this; - addListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - emit(event: string, ...args: any[]): boolean; - emit(event: "keylog", line: Buffer, tlsSocket: tls.TLSSocket): boolean; - emit( - event: "newSession", - sessionId: Buffer, - sessionData: Buffer, - callback: (err: Error, resp: Buffer) => void, - ): boolean; - emit( - event: "OCSPRequest", - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => 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; - emit(event: "connection", socket: Duplex): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit( - event: "checkContinue", - req: InstanceType, - res: InstanceType, - ): boolean; - emit( - event: "checkExpectation", - req: InstanceType, - res: InstanceType, - ): boolean; - emit(event: "clientError", err: Error, socket: Duplex): boolean; - emit(event: "connect", req: InstanceType, socket: Duplex, head: Buffer): boolean; - emit( - event: "request", - req: InstanceType, - res: InstanceType, - ): boolean; - emit(event: "upgrade", req: InstanceType, socket: Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - on( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - on( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Duplex) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "checkContinue", listener: http.RequestListener): this; - on(event: "checkExpectation", listener: http.RequestListener): this; - on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - on(event: "connect", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - on(event: "request", listener: http.RequestListener): this; - on(event: "upgrade", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - once( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - once( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Duplex) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "checkContinue", listener: http.RequestListener): this; - once(event: "checkExpectation", listener: http.RequestListener): this; - once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - once(event: "connect", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - once(event: "request", listener: http.RequestListener): this; - once(event: "upgrade", listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Duplex) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "checkContinue", listener: http.RequestListener): this; - prependListener(event: "checkExpectation", listener: http.RequestListener): this; - prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependListener(event: "request", listener: http.RequestListener): this; - prependListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, - ): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Duplex) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "checkContinue", listener: http.RequestListener): this; - prependOnceListener(event: "checkExpectation", listener: http.RequestListener): this; - prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this; - prependOnceListener( - event: "connect", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - prependOnceListener(event: "request", listener: http.RequestListener): this; - prependOnceListener( - event: "upgrade", - listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, - ): this; - } - /** - * ```js - * // curl -k https://localhost:8000/ - * import https from 'node:https'; - * import fs from 'node:fs'; - * - * const options = { - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * - * Or - * - * ```js - * import https from 'node:https'; - * import fs from 'node:fs'; - * - * const options = { - * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), - * passphrase: 'sample', - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * @since v0.3.4 - * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. - * @param requestListener A listener to be added to the `'request'` event. - */ - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - >(requestListener?: http.RequestListener): Server; - function createServer< - Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, - Response extends typeof http.ServerResponse> = typeof http.ServerResponse, - >( - options: ServerOptions, - requestListener?: http.RequestListener, - ): Server; - /** - * Makes a request to a secure web server. - * - * The following additional `options` from `tls.connect()` are also accepted: `ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`, `honorCipherOrder`, `key`, `passphrase`, - * `pfx`, `rejectUnauthorized`, `secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`, `highWaterMark`. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * import https from 'node:https'; - * - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * }; - * - * const req = https.request(options, (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(e); - * }); - * req.end(); - * ``` - * - * Example using options from `tls.connect()`: - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * }; - * options.agent = new https.Agent(options); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Alternatively, opt out of connection pooling by not using an `Agent`. - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * agent: false, - * }; - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('https://abc:xyz@example.com'); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): - * - * ```js - * 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'); - * } - * const options = { - * hostname: 'github.com', - * port: 443, - * path: '/', - * method: 'GET', - * checkServerIdentity: function(host, cert) { - * // Make sure the certificate is issued to the host we are connected to - * const err = tls.checkServerIdentity(host, cert); - * if (err) { - * return err; - * } - * - * // Pin the public key, similar to HPKP pin-sha256 pinning - * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; - * if (sha256(cert.pubkey) !== pubkey256) { - * const msg = 'Certificate verification error: ' + - * `The public key of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // Pin the exact certificate, rather than the pub key - * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + - * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; - * if (cert.fingerprint256 !== cert256) { - * const msg = 'Certificate verification error: ' + - * `The certificate of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // This loop is informational only. - * // Print the certificate and public key fingerprints of all certs in the - * // chain. Its common to pin the public key of the issuer on the public - * // internet, while pinning the public key of the service in sensitive - * // environments. - * do { - * console.log('Subject Common Name:', cert.subject.CN); - * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); - * - * hash = crypto.createHash('sha256'); - * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); - * - * lastprint256 = cert.fingerprint256; - * cert = cert.issuerCertificate; - * } while (cert.fingerprint256 !== lastprint256); - * - * }, - * }; - * - * options.agent = new https.Agent(options); - * const req = https.request(options, (res) => { - * console.log('All OK. Server matched our pinned cert or public key'); - * console.log('statusCode:', res.statusCode); - * // Print the HPKP values - * console.log('headers:', res.headers['public-key-pins']); - * - * res.on('data', (d) => {}); - * }); - * - * req.on('error', (e) => { - * console.error(e.message); - * }); - * req.end(); - * ``` - * - * Outputs for example: - * - * ```text - * Subject Common Name: github.com - * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 - * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= - * Subject Common Name: DigiCert SHA2 Extended Validation Server CA - * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A - * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= - * Subject Common Name: DigiCert High Assurance EV Root CA - * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF - * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= - * All OK. Server matched our pinned cert or public key - * statusCode: 200 - * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; - * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; - * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains - * ``` - * @since v0.3.6 - * @param options Accepts all `options` from `request`, with some differences in default values: - */ - function request( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function request( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - /** - * Like `http.get()` but for HTTPS. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * 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 - * import https from 'node:https'; - * - * https.get('https://encrypted.google.com/', (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * - * }).on('error', (e) => { - * console.error(e); - * }); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. - */ - function get( - options: RequestOptions | string | URL, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - function get( - url: string | URL, - options: RequestOptions, - callback?: (res: http.IncomingMessage) => void, - ): http.ClientRequest; - let globalAgent: Agent; -} -declare module "node:https" { - export * from "https"; -} diff --git a/node_modules/@types/node/index.d.ts b/node_modules/@types/node/index.d.ts deleted file mode 100644 index e99dc83..0000000 --- a/node_modules/@types/node/index.d.ts +++ /dev/null @@ -1,92 +0,0 @@ -/** - * License for programmatically and manually incorporated - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc - * - * Copyright Node.js contributors. All rights reserved. - * 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: - * - * 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. - */ - -// NOTE: These definitions support Node.js and TypeScript 5.7+. - -// Reference required TypeScript libs: -/// - -// TypeScript backwards-compatibility definitions: -/// - -// Definitions specific to TypeScript 5.7+: -/// -/// - -// Definitions for Node.js modules that are not specific to any version of TypeScript: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// diff --git a/node_modules/@types/node/inspector.d.ts b/node_modules/@types/node/inspector.d.ts deleted file mode 100644 index 32d9ba4..0000000 --- a/node_modules/@types/node/inspector.d.ts +++ /dev/null @@ -1,3966 +0,0 @@ -// These definitions are automatically generated by the generate-inspector script. -// Do not edit this file directly. -// See scripts/generate-inspector/README.md for information on how to update the protocol definitions. -// Changes to the module itself should be added to the generator template (scripts/generate-inspector/inspector.d.ts.template). - -/** - * The `node:inspector` module provides an API for interacting with the V8 - * inspector. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/inspector.js) - */ -declare module 'inspector' { - import EventEmitter = require('node:events'); - - interface InspectorNotification { - method: string; - params: T; - } - - namespace Schema { - /** - * Description of the protocol domain. - */ - interface Domain { - /** - * Domain name. - */ - name: string; - /** - * Domain version. - */ - version: string; - } - interface GetDomainsReturnType { - /** - * List of supported domains. - */ - domains: Domain[]; - } - } - namespace Runtime { - /** - * Unique script identifier. - */ - type ScriptId = string; - /** - * Unique object identifier. - */ - type RemoteObjectId = string; - /** - * Primitive value which cannot be JSON-stringified. - */ - type UnserializableValue = string; - /** - * Mirror object referencing original JavaScript object. - */ - interface RemoteObject { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * Object class (constructor) name. Specified for object type values only. - */ - className?: string | undefined; - /** - * Remote object value in case of primitive values or JSON values (if it was requested). - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified does not have value, but gets this property. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * Unique object identifier (for non-primitive values). - */ - objectId?: RemoteObjectId | undefined; - /** - * Preview containing abbreviated property values. Specified for object type values only. - * @experimental - */ - preview?: ObjectPreview | undefined; - /** - * @experimental - */ - customPreview?: CustomPreview | undefined; - } - /** - * @experimental - */ - interface CustomPreview { - header: string; - hasBody: boolean; - formatterObjectId: RemoteObjectId; - bindRemoteObjectFunctionId: RemoteObjectId; - configObjectId?: RemoteObjectId | undefined; - } - /** - * Object containing abbreviated remote object value. - * @experimental - */ - interface ObjectPreview { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * True iff some of the properties or entries of the original object did not fit. - */ - overflow: boolean; - /** - * List of the properties. - */ - properties: PropertyPreview[]; - /** - * List of the entries. Specified for map and set subtype values only. - */ - entries?: EntryPreview[] | undefined; - } - /** - * @experimental - */ - interface PropertyPreview { - /** - * Property name. - */ - name: string; - /** - * Object type. Accessor means that the property itself is an accessor property. - */ - type: string; - /** - * User-friendly property value string. - */ - value?: string | undefined; - /** - * Nested value preview. - */ - valuePreview?: ObjectPreview | undefined; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - } - /** - * @experimental - */ - interface EntryPreview { - /** - * Preview of the key. Specified for map-like collection entries. - */ - key?: ObjectPreview | undefined; - /** - * Preview of the value. - */ - value: ObjectPreview; - } - /** - * Object property descriptor. - */ - interface PropertyDescriptor { - /** - * Property name or symbol description. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - /** - * True if the value associated with the property may be changed (data descriptors only). - */ - writable?: boolean | undefined; - /** - * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). - */ - get?: RemoteObject | undefined; - /** - * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). - */ - set?: RemoteObject | undefined; - /** - * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. - */ - configurable: boolean; - /** - * True if this property shows up during enumeration of the properties on the corresponding object. - */ - enumerable: boolean; - /** - * True if the result was thrown during the evaluation. - */ - wasThrown?: boolean | undefined; - /** - * True if the property is owned for the object. - */ - isOwn?: boolean | undefined; - /** - * Property symbol object, if the property is of the symbol type. - */ - symbol?: RemoteObject | undefined; - } - /** - * Object internal property descriptor. This property isn't normally visible in JavaScript code. - */ - interface InternalPropertyDescriptor { - /** - * Conventional property name. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - } - /** - * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. - */ - interface CallArgument { - /** - * Primitive value or serializable javascript object. - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * Remote object handle. - */ - objectId?: RemoteObjectId | undefined; - } - /** - * Id of an execution context. - */ - type ExecutionContextId = number; - /** - * Description of an isolated world. - */ - interface ExecutionContextDescription { - /** - * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. - */ - id: ExecutionContextId; - /** - * Execution context origin. - */ - origin: string; - /** - * Human readable name describing given context. - */ - name: string; - /** - * Embedder-specific auxiliary data. - */ - auxData?: {} | undefined; - } - /** - * Detailed information about exception (or error) that was thrown during script compilation or execution. - */ - interface ExceptionDetails { - /** - * Exception id. - */ - exceptionId: number; - /** - * Exception text, which should be used together with exception object when available. - */ - text: string; - /** - * Line number of the exception location (0-based). - */ - lineNumber: number; - /** - * Column number of the exception location (0-based). - */ - columnNumber: number; - /** - * Script ID of the exception location. - */ - scriptId?: ScriptId | undefined; - /** - * URL of the exception location, to be used when the script was not reported. - */ - url?: string | undefined; - /** - * JavaScript stack trace if available. - */ - stackTrace?: StackTrace | undefined; - /** - * Exception object if available. - */ - exception?: RemoteObject | undefined; - /** - * Identifier of the context where exception happened. - */ - executionContextId?: ExecutionContextId | undefined; - } - /** - * Number of milliseconds since epoch. - */ - type Timestamp = number; - /** - * Stack entry for runtime errors and assertions. - */ - interface CallFrame { - /** - * JavaScript function name. - */ - functionName: string; - /** - * JavaScript script id. - */ - scriptId: ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * JavaScript script line number (0-based). - */ - lineNumber: number; - /** - * JavaScript script column number (0-based). - */ - columnNumber: number; - } - /** - * Call frames for assertions or error messages. - */ - interface StackTrace { - /** - * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. - */ - description?: string | undefined; - /** - * JavaScript function name. - */ - callFrames: CallFrame[]; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - */ - parent?: StackTrace | undefined; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - * @experimental - */ - parentId?: StackTraceId | undefined; - } - /** - * Unique identifier of current debugger. - * @experimental - */ - type UniqueDebuggerId = string; - /** - * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. - * @experimental - */ - interface StackTraceId { - id: string; - debuggerId?: UniqueDebuggerId | undefined; - } - interface EvaluateParameterType { - /** - * Expression to evaluate. - */ - expression: string; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - contextId?: ExecutionContextId | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface AwaitPromiseParameterType { - /** - * Identifier of the promise. - */ - promiseObjectId: RemoteObjectId; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - } - interface CallFunctionOnParameterType { - /** - * Declaration of the function to call. - */ - functionDeclaration: string; - /** - * Identifier of the object to call function on. Either objectId or executionContextId should be specified. - */ - objectId?: RemoteObjectId | undefined; - /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target object. - */ - arguments?: CallArgument[] | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - /** - * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. - */ - objectGroup?: string | undefined; - } - interface GetPropertiesParameterType { - /** - * Identifier of the object to return properties for. - */ - objectId: RemoteObjectId; - /** - * If true, returns properties belonging only to the element itself, not to its prototype chain. - */ - ownProperties?: boolean | undefined; - /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. - * @experimental - */ - accessorPropertiesOnly?: boolean | undefined; - /** - * Whether preview should be generated for the results. - * @experimental - */ - generatePreview?: boolean | undefined; - } - interface ReleaseObjectParameterType { - /** - * Identifier of the object to release. - */ - objectId: RemoteObjectId; - } - interface ReleaseObjectGroupParameterType { - /** - * Symbolic object group name. - */ - objectGroup: string; - } - interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; - } - interface CompileScriptParameterType { - /** - * Expression to compile. - */ - expression: string; - /** - * Source url to be set for the script. - */ - sourceURL: string; - /** - * Specifies whether the compiled script should be persisted. - */ - persistScript: boolean; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface RunScriptParameterType { - /** - * Id of the script to run. - */ - scriptId: ScriptId; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface QueryObjectsParameterType { - /** - * Identifier of the prototype to return objects for. - */ - prototypeObjectId: RemoteObjectId; - } - interface GlobalLexicalScopeNamesParameterType { - /** - * Specifies in which execution context to lookup global scope variables. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface EvaluateReturnType { - /** - * Evaluation result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface AwaitPromiseReturnType { - /** - * Promise result. Will contain rejected value if promise was rejected. - */ - result: RemoteObject; - /** - * Exception details if stack strace is available. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CallFunctionOnReturnType { - /** - * Call result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface GetPropertiesReturnType { - /** - * Object properties. - */ - result: PropertyDescriptor[]; - /** - * Internal object properties (only of the element itself). - */ - internalProperties?: InternalPropertyDescriptor[] | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CompileScriptReturnType { - /** - * Id of the script. - */ - scriptId?: ScriptId | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface RunScriptReturnType { - /** - * Run result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface QueryObjectsReturnType { - /** - * Array with objects. - */ - objects: RemoteObject; - } - interface GlobalLexicalScopeNamesReturnType { - names: string[]; - } - interface ExecutionContextCreatedEventDataType { - /** - * A newly created execution context. - */ - context: ExecutionContextDescription; - } - interface ExecutionContextDestroyedEventDataType { - /** - * Id of the destroyed context - */ - executionContextId: ExecutionContextId; - } - interface ExceptionThrownEventDataType { - /** - * Timestamp of the exception. - */ - timestamp: Timestamp; - exceptionDetails: ExceptionDetails; - } - interface ExceptionRevokedEventDataType { - /** - * Reason describing why exception was revoked. - */ - reason: string; - /** - * The id of revoked exception, as reported in exceptionThrown. - */ - exceptionId: number; - } - interface ConsoleAPICalledEventDataType { - /** - * Type of the call. - */ - type: string; - /** - * Call arguments. - */ - args: RemoteObject[]; - /** - * Identifier of the context where the call was made. - */ - executionContextId: ExecutionContextId; - /** - * Call timestamp. - */ - timestamp: Timestamp; - /** - * Stack trace captured when the call was made. - */ - stackTrace?: StackTrace | undefined; - /** - * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. - * @experimental - */ - context?: string | undefined; - } - interface InspectRequestedEventDataType { - object: RemoteObject; - hints: {}; - } - } - namespace Debugger { - /** - * Breakpoint identifier. - */ - type BreakpointId = string; - /** - * Call frame identifier. - */ - type CallFrameId = string; - /** - * Location in the source code. - */ - interface Location { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - } - /** - * Location in the source code. - * @experimental - */ - interface ScriptPosition { - lineNumber: number; - columnNumber: number; - } - /** - * JavaScript call frame. Array of call frames form the call stack. - */ - interface CallFrame { - /** - * Call frame identifier. This identifier is only valid while the virtual machine is paused. - */ - callFrameId: CallFrameId; - /** - * Name of the JavaScript function called on this call frame. - */ - functionName: string; - /** - * Location in the source code. - */ - functionLocation?: Location | undefined; - /** - * Location in the source code. - */ - location: Location; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Scope chain for this call frame. - */ - scopeChain: Scope[]; - /** - * this object for this call frame. - */ - this: Runtime.RemoteObject; - /** - * The value being returned, if the function is at return point. - */ - returnValue?: Runtime.RemoteObject | undefined; - } - /** - * Scope description. - */ - interface Scope { - /** - * Scope type. - */ - type: string; - /** - * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. - */ - object: Runtime.RemoteObject; - name?: string | undefined; - /** - * Location in the source code where scope starts - */ - startLocation?: Location | undefined; - /** - * Location in the source code where scope ends - */ - endLocation?: Location | undefined; - } - /** - * Search match for resource. - */ - interface SearchMatch { - /** - * Line number in resource content. - */ - lineNumber: number; - /** - * Line with match content. - */ - lineContent: string; - } - interface BreakLocation { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - type?: string | undefined; - } - interface SetBreakpointsActiveParameterType { - /** - * New value for breakpoints active state. - */ - active: boolean; - } - interface SetSkipAllPausesParameterType { - /** - * New value for skip pauses state. - */ - skip: boolean; - } - interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; - /** - * URL of the resources to set breakpoint on. - */ - url?: string | undefined; - /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - */ - urlRegex?: string | undefined; - /** - * Script hash of the resources to set breakpoint on. - */ - scriptHash?: string | undefined; - /** - * Offset in the line to set breakpoint at. - */ - columnNumber?: number | undefined; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface SetBreakpointParameterType { - /** - * Location to set breakpoint in. - */ - location: Location; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface RemoveBreakpointParameterType { - breakpointId: BreakpointId; - } - interface GetPossibleBreakpointsParameterType { - /** - * Start of range to search possible breakpoint locations in. - */ - start: Location; - /** - * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. - */ - end?: Location | undefined; - /** - * Only consider locations which are in the same (non-nested) function as start. - */ - restrictToFunction?: boolean | undefined; - } - interface ContinueToLocationParameterType { - /** - * Location to continue to. - */ - location: Location; - targetCallFrames?: string | undefined; - } - interface PauseOnAsyncCallParameterType { - /** - * Debugger will pause when async call with given stack trace is started. - */ - parentStackTraceId: Runtime.StackTraceId; - } - interface StepIntoParameterType { - /** - * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. - * @experimental - */ - breakOnAsyncCall?: boolean | undefined; - } - interface GetStackTraceParameterType { - stackTraceId: Runtime.StackTraceId; - } - interface SearchInContentParameterType { - /** - * Id of the script to search in. - */ - scriptId: Runtime.ScriptId; - /** - * String to search for. - */ - query: string; - /** - * If true, search is case sensitive. - */ - caseSensitive?: boolean | undefined; - /** - * If true, treats string parameter as regex. - */ - isRegex?: boolean | undefined; - } - interface SetScriptSourceParameterType { - /** - * Id of the script to edit. - */ - scriptId: Runtime.ScriptId; - /** - * New content of the script. - */ - scriptSource: string; - /** - * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. - */ - dryRun?: boolean | undefined; - } - interface RestartFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - } - interface GetScriptSourceParameterType { - /** - * Id of the script to get source for. - */ - scriptId: Runtime.ScriptId; - } - interface SetPauseOnExceptionsParameterType { - /** - * Pause on exceptions mode. - */ - state: string; - } - interface EvaluateOnCallFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - /** - * Expression to evaluate. - */ - expression: string; - /** - * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). - */ - objectGroup?: string | undefined; - /** - * Specifies whether command line API should be available to the evaluated expression, defaults to false. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - */ - throwOnSideEffect?: boolean | undefined; - } - interface SetVariableValueParameterType { - /** - * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. - */ - scopeNumber: number; - /** - * Variable name. - */ - variableName: string; - /** - * New variable value. - */ - newValue: Runtime.CallArgument; - /** - * Id of callframe that holds variable. - */ - callFrameId: CallFrameId; - } - interface SetReturnValueParameterType { - /** - * New return value. - */ - newValue: Runtime.CallArgument; - } - interface SetAsyncCallStackDepthParameterType { - /** - * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). - */ - maxDepth: number; - } - interface SetBlackboxPatternsParameterType { - /** - * Array of regexps that will be used to check script url for blackbox state. - */ - patterns: string[]; - } - interface SetBlackboxedRangesParameterType { - /** - * Id of the script. - */ - scriptId: Runtime.ScriptId; - positions: ScriptPosition[]; - } - interface EnableReturnType { - /** - * Unique identifier of the debugger. - * @experimental - */ - debuggerId: Runtime.UniqueDebuggerId; - } - interface SetBreakpointByUrlReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * List of the locations this breakpoint resolved into upon addition. - */ - locations: Location[]; - } - interface SetBreakpointReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * Location this breakpoint resolved into. - */ - actualLocation: Location; - } - interface GetPossibleBreakpointsReturnType { - /** - * List of the possible breakpoint locations. - */ - locations: BreakLocation[]; - } - interface GetStackTraceReturnType { - stackTrace: Runtime.StackTrace; - } - interface SearchInContentReturnType { - /** - * List of search matches. - */ - result: SearchMatch[]; - } - interface SetScriptSourceReturnType { - /** - * New stack trace in case editing has happened while VM was stopped. - */ - callFrames?: CallFrame[] | undefined; - /** - * Whether current call stack was modified after applying the changes. - */ - stackChanged?: boolean | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Exception details if any. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface RestartFrameReturnType { - /** - * New stack trace. - */ - callFrames: CallFrame[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - } - interface GetScriptSourceReturnType { - /** - * Script source. - */ - scriptSource: string; - } - interface EvaluateOnCallFrameReturnType { - /** - * Object wrapper for the evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface ScriptParsedEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * True, if this script is generated as a result of the live edit operation. - * @experimental - */ - isLiveEdit?: boolean | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface ScriptFailedToParseEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface BreakpointResolvedEventDataType { - /** - * Breakpoint unique identifier. - */ - breakpointId: BreakpointId; - /** - * Actual breakpoint location. - */ - location: Location; - } - interface PausedEventDataType { - /** - * Call stack the virtual machine stopped on. - */ - callFrames: CallFrame[]; - /** - * Pause reason. - */ - reason: string; - /** - * Object containing break-specific auxiliary properties. - */ - data?: {} | undefined; - /** - * Hit breakpoints IDs - */ - hitBreakpoints?: string[] | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. - * @experimental - */ - asyncCallStackTraceId?: Runtime.StackTraceId | undefined; - } - } - namespace Console { - /** - * Console message. - */ - interface ConsoleMessage { - /** - * Message source. - */ - source: string; - /** - * Message severity. - */ - level: string; - /** - * Message text. - */ - text: string; - /** - * URL of the message origin. - */ - url?: string | undefined; - /** - * Line number in the resource that generated this message (1-based). - */ - line?: number | undefined; - /** - * Column number in the resource that generated this message (1-based). - */ - column?: number | undefined; - } - interface MessageAddedEventDataType { - /** - * Console message that has been added. - */ - message: ConsoleMessage; - } - } - namespace Profiler { - /** - * Profile node. Holds callsite information, execution statistics and child nodes. - */ - interface ProfileNode { - /** - * Unique id of the node. - */ - id: number; - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Number of samples where this node was on top of the call stack. - */ - hitCount?: number | undefined; - /** - * Child node ids. - */ - children?: number[] | undefined; - /** - * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. - */ - deoptReason?: string | undefined; - /** - * An array of source position ticks. - */ - positionTicks?: PositionTickInfo[] | undefined; - } - /** - * Profile. - */ - interface Profile { - /** - * The list of profile nodes. First item is the root node. - */ - nodes: ProfileNode[]; - /** - * Profiling start timestamp in microseconds. - */ - startTime: number; - /** - * Profiling end timestamp in microseconds. - */ - endTime: number; - /** - * Ids of samples top nodes. - */ - samples?: number[] | undefined; - /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. - */ - timeDeltas?: number[] | undefined; - } - /** - * Specifies a number of samples attributed to a certain source position. - */ - interface PositionTickInfo { - /** - * Source line number (1-based). - */ - line: number; - /** - * Number of samples attributed to the source line. - */ - ticks: number; - } - /** - * Coverage data for a source range. - */ - interface CoverageRange { - /** - * JavaScript script source offset for the range start. - */ - startOffset: number; - /** - * JavaScript script source offset for the range end. - */ - endOffset: number; - /** - * Collected execution count of the source range. - */ - count: number; - } - /** - * Coverage data for a JavaScript function. - */ - interface FunctionCoverage { - /** - * JavaScript function name. - */ - functionName: string; - /** - * Source ranges inside the function with coverage data. - */ - ranges: CoverageRange[]; - /** - * Whether coverage data for this function has block granularity. - */ - isBlockCoverage: boolean; - } - /** - * Coverage data for a JavaScript script. - */ - interface ScriptCoverage { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Functions contained in the script that has coverage data. - */ - functions: FunctionCoverage[]; - } - interface SetSamplingIntervalParameterType { - /** - * New sampling interval in microseconds. - */ - interval: number; - } - interface StartPreciseCoverageParameterType { - /** - * Collect accurate call counts beyond simple 'covered' or 'not covered'. - */ - callCount?: boolean | undefined; - /** - * Collect block-based coverage. - */ - detailed?: boolean | undefined; - } - interface StopReturnType { - /** - * Recorded profile. - */ - profile: Profile; - } - interface TakePreciseCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface GetBestEffortCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface ConsoleProfileStartedEventDataType { - id: string; - /** - * Location of console.profile(). - */ - location: Debugger.Location; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profile; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - } - namespace HeapProfiler { - /** - * Heap snapshot object id. - */ - type HeapSnapshotObjectId = string; - /** - * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. - */ - interface SamplingHeapProfileNode { - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Allocations size in bytes for the node excluding children. - */ - selfSize: number; - /** - * Child nodes. - */ - children: SamplingHeapProfileNode[]; - } - /** - * Profile. - */ - interface SamplingHeapProfile { - head: SamplingHeapProfileNode; - } - interface StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean | undefined; - } - interface StopTrackingHeapObjectsParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. - */ - reportProgress?: boolean | undefined; - } - interface TakeHeapSnapshotParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. - */ - reportProgress?: boolean | undefined; - } - interface GetObjectByHeapObjectIdParameterType { - objectId: HeapSnapshotObjectId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - } - interface AddInspectedHeapObjectParameterType { - /** - * Heap snapshot object id to be accessible by means of $x command line API. - */ - heapObjectId: HeapSnapshotObjectId; - } - interface GetHeapObjectIdParameterType { - /** - * Identifier of the object to get heap object id for. - */ - objectId: Runtime.RemoteObjectId; - } - interface StartSamplingParameterType { - /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. - */ - samplingInterval?: number | undefined; - } - interface GetObjectByHeapObjectIdReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - } - interface GetHeapObjectIdReturnType { - /** - * Id of the heap snapshot object corresponding to the passed remote object id. - */ - heapSnapshotObjectId: HeapSnapshotObjectId; - } - interface StopSamplingReturnType { - /** - * Recorded sampling heap profile. - */ - profile: SamplingHeapProfile; - } - interface GetSamplingProfileReturnType { - /** - * Return the sampling profile being collected. - */ - profile: SamplingHeapProfile; - } - interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean | undefined; - } - interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; - } - interface HeapStatsUpdateEventDataType { - /** - * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. - */ - statsUpdate: number[]; - } - } - namespace NodeTracing { - interface TraceConfig { - /** - * Controls how the trace buffer stores data. - */ - recordMode?: string | undefined; - /** - * Included category filters. - */ - includedCategories: string[]; - } - interface StartParameterType { - traceConfig: TraceConfig; - } - interface GetCategoriesReturnType { - /** - * A list of supported tracing categories. - */ - categories: string[]; - } - interface DataCollectedEventDataType { - value: Array<{}>; - } - } - namespace NodeWorker { - type WorkerID = string; - /** - * Unique identifier of attached debugging session. - */ - type SessionID = string; - interface WorkerInfo { - workerId: WorkerID; - type: string; - title: string; - url: string; - } - interface SendMessageToWorkerParameterType { - message: string; - /** - * Identifier of the session. - */ - sessionId: SessionID; - } - interface EnableParameterType { - /** - * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` - * message to run them. - */ - waitForDebuggerOnStart: boolean; - } - interface DetachParameterType { - sessionId: SessionID; - } - interface AttachedToWorkerEventDataType { - /** - * Identifier assigned to the session used to send/receive messages. - */ - sessionId: SessionID; - workerInfo: WorkerInfo; - waitingForDebugger: boolean; - } - interface DetachedFromWorkerEventDataType { - /** - * Detached session identifier. - */ - sessionId: SessionID; - } - interface ReceivedMessageFromWorkerEventDataType { - /** - * Identifier of a session which sends a message. - */ - sessionId: SessionID; - message: string; - } - } - namespace Network { - /** - * Resource type as it was perceived by the rendering engine. - */ - type ResourceType = string; - /** - * Unique request identifier. - */ - type RequestId = string; - /** - * UTC time in seconds, counted from January 1, 1970. - */ - type TimeSinceEpoch = number; - /** - * Monotonically increasing time in seconds since an arbitrary point in the past. - */ - type MonotonicTime = number; - /** - * HTTP request data. - */ - interface Request { - url: string; - method: string; - headers: Headers; - } - /** - * HTTP response data. - */ - interface Response { - url: string; - status: number; - statusText: string; - headers: Headers; - } - /** - * Request / response headers as keys / values of JSON object. - */ - interface Headers { - } - interface RequestWillBeSentEventDataType { - /** - * Request identifier. - */ - requestId: RequestId; - /** - * Request data. - */ - request: Request; - /** - * Timestamp. - */ - timestamp: MonotonicTime; - /** - * Timestamp. - */ - wallTime: TimeSinceEpoch; - } - interface ResponseReceivedEventDataType { - /** - * Request identifier. - */ - requestId: RequestId; - /** - * Timestamp. - */ - timestamp: MonotonicTime; - /** - * Resource type. - */ - type: ResourceType; - /** - * Response data. - */ - response: Response; - } - interface LoadingFailedEventDataType { - /** - * Request identifier. - */ - requestId: RequestId; - /** - * Timestamp. - */ - timestamp: MonotonicTime; - /** - * Resource type. - */ - type: ResourceType; - /** - * Error message. - */ - errorText: string; - } - interface LoadingFinishedEventDataType { - /** - * Request identifier. - */ - requestId: RequestId; - /** - * Timestamp. - */ - timestamp: MonotonicTime; - } - } - namespace NodeRuntime { - interface NotifyWhenWaitingForDisconnectParameterType { - enabled: boolean; - } - } - - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - */ - class Session extends EventEmitter { - /** - * Create a new instance of the inspector.Session class. - * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. - */ - constructor(); - - /** - * Connects a session to the inspector back-end. - */ - connect(): void; - - /** - * Connects a session to the inspector back-end. - * An exception will be thrown if this API was not called on a Worker thread. - * @since v12.11.0 - */ - connectToMainThread(): void; - - /** - * Immediately close the session. All pending message callbacks will be called with an error. - * `session.connect()` will need to be called to be able to send messages again. - * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. - */ - disconnect(): void; - - /** - * Posts a message to the inspector back-end. `callback` will be notified when - * a response is received. `callback` is a function that accepts two optional - * arguments: error and message-specific result. - * - * ```js - * session.post('Runtime.evaluate', { expression: '2 + 2' }, - * (error, { result }) => console.log(result)); - * // Output: { type: 'number', value: 4, description: '4' } - * ``` - * - * The latest version of the V8 inspector protocol is published on the - * [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). - * - * Node.js inspector supports all the Chrome DevTools Protocol domains declared - * by V8. Chrome DevTools Protocol domain provides an interface for interacting - * with one of the runtime agents used to inspect the application state and listen - * to the run-time events. - */ - post(method: string, callback?: (err: Error | null, params?: object) => void): void; - post(method: string, params?: object, callback?: (err: Error | null, params?: object) => void): void; - /** - * Returns supported domains. - */ - post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; - /** - * Evaluates expression on global object. - */ - post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - /** - * Add handler to promise with given promise object id. - */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - /** - * Returns properties of a given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - /** - * Releases remote object with given id. - */ - post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void; - /** - * Releases all remote objects that belong to a given group. - */ - post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void; - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void; - /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. - */ - post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; - /** - * Disables reporting of execution contexts creation. - */ - post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; - /** - * Discards collected exceptions and console API calls. - */ - post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void; - /** - * Compiles expression. - */ - post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - /** - * Runs script with given id in a given context. - */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - /** - * Returns all let, const and class variables from global scope. - */ - post( - method: 'Runtime.globalLexicalScopeNames', - params?: Runtime.GlobalLexicalScopeNamesParameterType, - callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void - ): void; - post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; - /** - * Disables debugger for given page. - */ - post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void; - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void; - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - /** - * Removes JavaScript breakpoint. - */ - post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void; - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. - */ - post( - method: 'Debugger.getPossibleBreakpoints', - params?: Debugger.GetPossibleBreakpointsParameterType, - callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void - ): void; - post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - /** - * Continues execution until specific location is reached. - */ - post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; - /** - * Steps over the statement. - */ - post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; - /** - * Steps into the function call. - */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; - /** - * Steps out of the function call. - */ - post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; - /** - * Stops on the next JavaScript statement. - */ - post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; - /** - * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; - /** - * Resumes JavaScript execution. - */ - post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; - /** - * Returns stack trace with given stackTraceId. - * @experimental - */ - post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - /** - * Searches for given string in script content. - */ - post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - /** - * Edits JavaScript source live. - */ - post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - /** - * Restarts particular call frame from the beginning. - */ - post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - /** - * Returns source for the script with given id. - */ - post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void; - /** - * Evaluates expression on a given call frame. - */ - post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void; - /** - * Changes return value in top frame. Available only at return break position. - * @experimental - */ - post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void; - /** - * Enables or disables async call stacks tracking. - */ - post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void; - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void; - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: 'Console.enable', callback?: (err: Error | null) => void): void; - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: 'Console.disable', callback?: (err: Error | null) => void): void; - /** - * Does nothing. - */ - post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.start', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - */ - post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - */ - post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - */ - post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - */ - post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; - post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void; - post( - method: 'HeapProfiler.getObjectByHeapObjectId', - params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, - callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void - ): void; - post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; - post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; - /** - * Gets supported tracing categories. - */ - post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; - /** - * Start trace events collection. - */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; - /** - * Stop trace events collection. Remaining collected events will be sent as a sequence of - * dataCollected events followed by tracingComplete event. - */ - post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; - /** - * Sends protocol message over session with given id. - */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; - /** - * Instructs the inspector to attach to running workers. Will also attach to new workers - * as they start - */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; - /** - * Detaches from all running workers and disables attaching to new workers as they are started. - */ - post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; - /** - * Detached from the worker with given sessionId. - */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; - /** - * Disables network tracking, prevents network events from being sent to the client. - */ - post(method: 'Network.disable', callback?: (err: Error | null) => void): void; - /** - * Enables network tracking, network events will now be delivered to the client. - */ - post(method: 'Network.enable', callback?: (err: Error | null) => void): void; - /** - * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.enable', callback?: (err: Error | null) => void): void; - /** - * Disable NodeRuntime events - */ - post(method: 'NodeRuntime.disable', callback?: (err: Error | null) => void): void; - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void; - - addListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - addListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - addListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextsCleared'): boolean; - emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; - emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; - emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; - emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; - emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; - emit(event: 'Debugger.paused', message: InspectorNotification): boolean; - emit(event: 'Debugger.resumed'): boolean; - emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.resetProfiles'): boolean; - emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.tracingComplete'): boolean; - emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; - emit(event: 'Network.requestWillBeSent', message: InspectorNotification): boolean; - emit(event: 'Network.responseReceived', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFailed', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFinished', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - emit(event: 'NodeRuntime.waitingForDebugger'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - on(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - on(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - on(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - once(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - once(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - once(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - prependListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - prependOnceListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - } - - /** - * Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically after node has - * started. - * - * If wait is `true`, will block until a client has connected to the inspect port - * and flow control has been passed to the debugger client. - * - * See the [security warning](https://nodejs.org/docs/latest-v22.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure) - * regarding the `host` parameter usage. - * @param port Port to listen on for inspector connections. Defaults to what was specified on the CLI. - * @param host Host to listen on for inspector connections. Defaults to what was specified on the CLI. - * @param wait Block until a client has connected. Defaults to what was specified on the CLI. - * @returns Disposable that calls `inspector.close()`. - */ - function open(port?: number, host?: string, wait?: boolean): Disposable; - - /** - * Deactivate the inspector. Blocks until there are no active connections. - */ - function close(): void; - - /** - * Return the URL of the active inspector, or `undefined` if there is none. - * - * ```console - * $ node --inspect -p 'inspector.url()' - * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * For help, see: https://nodejs.org/en/docs/inspector - * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * - * $ node --inspect=localhost:3000 -p 'inspector.url()' - * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * For help, see: https://nodejs.org/en/docs/inspector - * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * - * $ node -p 'inspector.url()' - * undefined - * ``` - */ - function url(): string | undefined; - - /** - * Blocks until a client (existing or connected later) has sent `Runtime.runIfWaitingForDebugger` command. - * - * An exception will be thrown if there is no active inspector. - * @since v12.7.0 - */ - function waitForDebugger(): void; - - // These methods are exposed by the V8 inspector console API (inspector/v8-console.h). - // The method signatures differ from those of the Node.js console, and are deliberately - // typed permissively. - interface InspectorConsole { - debug(...data: any[]): void; - error(...data: any[]): void; - info(...data: any[]): void; - log(...data: any[]): void; - warn(...data: any[]): void; - dir(...data: any[]): void; - dirxml(...data: any[]): void; - table(...data: any[]): void; - trace(...data: any[]): void; - group(...data: any[]): void; - groupCollapsed(...data: any[]): void; - groupEnd(...data: any[]): void; - clear(...data: any[]): void; - count(label?: any): void; - countReset(label?: any): void; - assert(value?: any, ...data: any[]): void; - profile(label?: any): void; - profileEnd(label?: any): void; - time(label?: any): void; - timeLog(label?: any): void; - timeStamp(label?: any): void; - } - - /** - * An object to send messages to the remote inspector console. - * @since v11.0.0 - */ - const console: InspectorConsole; - - // DevTools protocol event broadcast methods - namespace Network { - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that - * the application is about to send an HTTP request. - * @since v22.6.0 - * @experimental - */ - function requestWillBeSent(params: RequestWillBeSentEventDataType): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.responseReceived` event to connected frontends. This event indicates that - * HTTP response is available. - * @since v22.6.0 - * @experimental - */ - function responseReceived(params: ResponseReceivedEventDataType): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.loadingFinished` event to connected frontends. This event indicates that - * HTTP request has finished loading. - * @since v22.6.0 - * @experimental - */ - function loadingFinished(params: LoadingFinishedEventDataType): void; - /** - * This feature is only available with the `--experimental-network-inspection` flag enabled. - * - * Broadcasts the `Network.loadingFailed` event to connected frontends. This event indicates that - * HTTP request has failed to load. - * @since v22.7.0 - * @experimental - */ - function loadingFailed(params: LoadingFailedEventDataType): void; - } -} - -/** - * The `node:inspector` module provides an API for interacting with the V8 - * inspector. - */ -declare module 'node:inspector' { - export * from 'inspector'; -} - -/** - * The `node:inspector/promises` module provides an API for interacting with the V8 - * inspector. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/inspector/promises.js) - * @since v19.0.0 - */ -declare module 'inspector/promises' { - import EventEmitter = require('node:events'); - import { - open, - close, - url, - waitForDebugger, - console, - InspectorNotification, - Schema, - Runtime, - Debugger, - Console, - Profiler, - HeapProfiler, - NodeTracing, - NodeWorker, - Network, - NodeRuntime, - } from 'inspector'; - - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - * @since v19.0.0 - */ - class Session extends EventEmitter { - /** - * Create a new instance of the `inspector.Session` class. - * The inspector session needs to be connected through `session.connect()` before the messages can be dispatched to the inspector backend. - */ - constructor(); - - /** - * Connects a session to the inspector back-end. - */ - connect(): void; - - /** - * Connects a session to the inspector back-end. - * An exception will be thrown if this API was not called on a Worker thread. - */ - connectToMainThread(): void; - - /** - * Immediately close the session. All pending message callbacks will be called with an error. - * `session.connect()` will need to be called to be able to send messages again. - * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. - */ - disconnect(): void; - - /** - * Posts a message to the inspector back-end. - * - * ```js - * import { Session } from 'node:inspector/promises'; - * try { - * const session = new Session(); - * session.connect(); - * const result = await session.post('Runtime.evaluate', { expression: '2 + 2' }); - * console.log(result); - * } catch (error) { - * console.error(error); - * } - * // Output: { result: { type: 'number', value: 4, description: '4' } } - * ``` - * - * The latest version of the V8 inspector protocol is published on the - * [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). - * - * Node.js inspector supports all the Chrome DevTools Protocol domains declared - * by V8. Chrome DevTools Protocol domain provides an interface for interacting - * with one of the runtime agents used to inspect the application state and listen - * to the run-time events. - */ - post(method: string, params?: object): Promise; - /** - * Returns supported domains. - */ - post(method: 'Schema.getDomains'): Promise; - /** - * Evaluates expression on global object. - */ - post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType): Promise; - /** - * Add handler to promise with given promise object id. - */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType): Promise; - /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType): Promise; - /** - * Returns properties of a given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType): Promise; - /** - * Releases remote object with given id. - */ - post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType): Promise; - /** - * Releases all remote objects that belong to a given group. - */ - post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType): Promise; - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: 'Runtime.runIfWaitingForDebugger'): Promise; - /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. - */ - post(method: 'Runtime.enable'): Promise; - /** - * Disables reporting of execution contexts creation. - */ - post(method: 'Runtime.disable'): Promise; - /** - * Discards collected exceptions and console API calls. - */ - post(method: 'Runtime.discardConsoleEntries'): Promise; - /** - * @experimental - */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType): Promise; - /** - * Compiles expression. - */ - post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType): Promise; - /** - * Runs script with given id in a given context. - */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType): Promise; - post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType): Promise; - /** - * Returns all let, const and class variables from global scope. - */ - post(method: 'Runtime.globalLexicalScopeNames', params?: Runtime.GlobalLexicalScopeNamesParameterType): Promise; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: 'Debugger.enable'): Promise; - /** - * Disables debugger for given page. - */ - post(method: 'Debugger.disable'): Promise; - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType): Promise; - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType): Promise; - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType): Promise; - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType): Promise; - /** - * Removes JavaScript breakpoint. - */ - post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType): Promise; - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. - */ - post(method: 'Debugger.getPossibleBreakpoints', params?: Debugger.GetPossibleBreakpointsParameterType): Promise; - /** - * Continues execution until specific location is reached. - */ - post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType): Promise; - /** - * @experimental - */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType): Promise; - /** - * Steps over the statement. - */ - post(method: 'Debugger.stepOver'): Promise; - /** - * Steps into the function call. - */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType): Promise; - /** - * Steps out of the function call. - */ - post(method: 'Debugger.stepOut'): Promise; - /** - * Stops on the next JavaScript statement. - */ - post(method: 'Debugger.pause'): Promise; - /** - * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: 'Debugger.scheduleStepIntoAsync'): Promise; - /** - * Resumes JavaScript execution. - */ - post(method: 'Debugger.resume'): Promise; - /** - * Returns stack trace with given stackTraceId. - * @experimental - */ - post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType): Promise; - /** - * Searches for given string in script content. - */ - post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType): Promise; - /** - * Edits JavaScript source live. - */ - post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType): Promise; - /** - * Restarts particular call frame from the beginning. - */ - post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType): Promise; - /** - * Returns source for the script with given id. - */ - post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType): Promise; - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType): Promise; - /** - * Evaluates expression on a given call frame. - */ - post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType): Promise; - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType): Promise; - /** - * Changes return value in top frame. Available only at return break position. - * @experimental - */ - post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType): Promise; - /** - * Enables or disables async call stacks tracking. - */ - post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType): Promise; - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType): Promise; - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType): Promise; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: 'Console.enable'): Promise; - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: 'Console.disable'): Promise; - /** - * Does nothing. - */ - post(method: 'Console.clearMessages'): Promise; - post(method: 'Profiler.enable'): Promise; - post(method: 'Profiler.disable'): Promise; - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType): Promise; - post(method: 'Profiler.start'): Promise; - post(method: 'Profiler.stop'): Promise; - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - */ - post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType): Promise; - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - */ - post(method: 'Profiler.stopPreciseCoverage'): Promise; - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - */ - post(method: 'Profiler.takePreciseCoverage'): Promise; - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - */ - post(method: 'Profiler.getBestEffortCoverage'): Promise; - post(method: 'HeapProfiler.enable'): Promise; - post(method: 'HeapProfiler.disable'): Promise; - post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType): Promise; - post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType): Promise; - post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType): Promise; - post(method: 'HeapProfiler.collectGarbage'): Promise; - post(method: 'HeapProfiler.getObjectByHeapObjectId', params?: HeapProfiler.GetObjectByHeapObjectIdParameterType): Promise; - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType): Promise; - post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType): Promise; - post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType): Promise; - post(method: 'HeapProfiler.stopSampling'): Promise; - post(method: 'HeapProfiler.getSamplingProfile'): Promise; - /** - * Gets supported tracing categories. - */ - post(method: 'NodeTracing.getCategories'): Promise; - /** - * Start trace events collection. - */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType): Promise; - /** - * Stop trace events collection. Remaining collected events will be sent as a sequence of - * dataCollected events followed by tracingComplete event. - */ - post(method: 'NodeTracing.stop'): Promise; - /** - * Sends protocol message over session with given id. - */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType): Promise; - /** - * Instructs the inspector to attach to running workers. Will also attach to new workers - * as they start - */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType): Promise; - /** - * Detaches from all running workers and disables attaching to new workers as they are started. - */ - post(method: 'NodeWorker.disable'): Promise; - /** - * Detached from the worker with given sessionId. - */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType): Promise; - /** - * Disables network tracking, prevents network events from being sent to the client. - */ - post(method: 'Network.disable'): Promise; - /** - * Enables network tracking, network events will now be delivered to the client. - */ - post(method: 'Network.enable'): Promise; - /** - * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.enable'): Promise; - /** - * Disable NodeRuntime events - */ - post(method: 'NodeRuntime.disable'): Promise; - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType): Promise; - - addListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - addListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - addListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextsCleared'): boolean; - emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; - emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; - emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; - emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; - emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; - emit(event: 'Debugger.paused', message: InspectorNotification): boolean; - emit(event: 'Debugger.resumed'): boolean; - emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.resetProfiles'): boolean; - emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.tracingComplete'): boolean; - emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; - emit(event: 'Network.requestWillBeSent', message: InspectorNotification): boolean; - emit(event: 'Network.responseReceived', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFailed', message: InspectorNotification): boolean; - emit(event: 'Network.loadingFinished', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - emit(event: 'NodeRuntime.waitingForDebugger'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - on(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - on(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - on(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - on(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - once(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - once(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - once(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - once(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - prependListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification) => void): this; - /** - * Issued when new execution context is created. - */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Fired when page is about to send HTTP request. - */ - prependOnceListener(event: 'Network.requestWillBeSent', listener: (message: InspectorNotification) => void): this; - /** - * Fired when HTTP response is available. - */ - prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - /** - * This event is fired when the runtime is waiting for the debugger. For - * example, when inspector.waitingForDebugger is called - */ - prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this; - } - - export { - Session, - open, - close, - url, - waitForDebugger, - console, - InspectorNotification, - Schema, - Runtime, - Debugger, - Console, - Profiler, - HeapProfiler, - NodeTracing, - NodeWorker, - Network, - NodeRuntime, - }; -} - -/** - * The `node:inspector/promises` module provides an API for interacting with the V8 - * inspector. - * @since v19.0.0 - */ -declare module 'node:inspector/promises' { - export * from 'inspector/promises'; -} diff --git a/node_modules/@types/node/module.d.ts b/node_modules/@types/node/module.d.ts deleted file mode 100644 index 4f38659..0000000 --- a/node_modules/@types/node/module.d.ts +++ /dev/null @@ -1,301 +0,0 @@ -/** - * @since v0.3.7 - * @experimental - */ -declare module "module" { - import { URL } from "node:url"; - import { MessagePort } from "node:worker_threads"; - namespace Module { - /** - * The `module.syncBuiltinESMExports()` method updates all the live bindings for - * builtin `ES Modules` to match the properties of the `CommonJS` exports. It - * does not add or remove exported names from the `ES Modules`. - * - * ```js - * import fs from 'node:fs'; - * import assert from 'node:assert'; - * import { syncBuiltinESMExports } from 'node:module'; - * - * fs.readFile = newAPI; - * - * delete fs.readFileSync; - * - * function newAPI() { - * // ... - * } - * - * fs.newAPI = newAPI; - * - * syncBuiltinESMExports(); - * - * import('node:fs').then((esmFS) => { - * // It syncs the existing readFile property with the new value - * assert.strictEqual(esmFS.readFile, newAPI); - * // readFileSync has been deleted from the required fs - * assert.strictEqual('readFileSync' in fs, false); - * // syncBuiltinESMExports() does not remove readFileSync from esmFS - * assert.strictEqual('readFileSync' in esmFS, true); - * // syncBuiltinESMExports() does not add names - * assert.strictEqual(esmFS.newAPI, undefined); - * }); - * ``` - * @since v12.12.0 - */ - function syncBuiltinESMExports(): void; - /** - * `path` is the resolved path for the file for which a corresponding source map - * should be fetched. - * @since v13.7.0, v12.17.0 - * @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise. - */ - function findSourceMap(path: string, error?: Error): SourceMap; - interface SourceMapPayload { - file: string; - version: number; - sources: string[]; - sourcesContent: string[]; - names: string[]; - mappings: string; - sourceRoot: string; - } - interface SourceMapping { - generatedLine: number; - generatedColumn: number; - originalSource: string; - originalLine: number; - originalColumn: number; - } - interface SourceOrigin { - /** - * The name of the range in the source map, if one was provided - */ - name?: string; - /** - * The file name of the original source, as reported in the SourceMap - */ - fileName: string; - /** - * The 1-indexed lineNumber of the corresponding call site in the original source - */ - lineNumber: number; - /** - * The 1-indexed columnNumber of the corresponding call site in the original source - */ - columnNumber: number; - } - /** - * @since v13.7.0, v12.17.0 - */ - class SourceMap { - /** - * Getter for the payload used to construct the `SourceMap` instance. - */ - readonly payload: SourceMapPayload; - constructor(payload: SourceMapPayload); - /** - * Given a line offset and column offset in the generated source - * file, returns an object representing the SourceMap range in the - * original file if found, or an empty object if not. - * - * The object returned contains the following keys: - * - * The returned value represents the raw range as it appears in the - * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and - * column numbers as they appear in Error messages and CallSite - * objects. - * - * To get the corresponding 1-indexed line and column numbers from a - * lineNumber and columnNumber as they are reported by Error stacks - * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)` - * @param lineOffset The zero-indexed line number offset in the generated source - * @param columnOffset The zero-indexed column number offset in the generated source - */ - findEntry(lineOffset: number, columnOffset: number): SourceMapping; - /** - * Given a 1-indexed `lineNumber` and `columnNumber` from a call site in the generated source, - * find the corresponding call site location in the original source. - * - * If the `lineNumber` and `columnNumber` provided are not found in any source map, - * then an empty object is returned. - * @param lineNumber The 1-indexed line number of the call site in the generated source - * @param columnNumber The 1-indexed column number of the call site in the generated source - */ - findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {}; - } - interface ImportAttributes extends NodeJS.Dict { - type?: string | undefined; - } - type ModuleFormat = "builtin" | "commonjs" | "json" | "module" | "wasm"; - type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray; - interface GlobalPreloadContext { - port: MessagePort; - } - /** - * @deprecated This hook will be removed in a future version. - * Use `initialize` instead. When a loader has an `initialize` export, `globalPreload` will be ignored. - * - * Sometimes it might be necessary to run some code inside of the same global scope that the application runs in. - * This hook allows the return of a string that is run as a sloppy-mode script on startup. - * - * @param context Information to assist the preload code - * @return Code to run before application startup - */ - type GlobalPreloadHook = (context: GlobalPreloadContext) => string; - /** - * The `initialize` hook provides a way to define a custom function that runs in the hooks thread - * when the hooks module is initialized. Initialization happens when the hooks module is registered via `register`. - * - * This hook can receive data from a `register` invocation, including ports and other transferrable objects. - * The return value of `initialize` can be a `Promise`, in which case it will be awaited before the main application thread execution resumes. - */ - type InitializeHook = (data: Data) => void | Promise; - interface ResolveHookContext { - /** - * Export conditions of the relevant `package.json` - */ - conditions: string[]; - /** - * An object whose key-value pairs represent the assertions for the module to import - */ - importAttributes: ImportAttributes; - /** - * The module importing this one, or undefined if this is the Node.js entry point - */ - parentURL: string | undefined; - } - interface ResolveFnOutput { - /** - * A hint to the load hook (it might be ignored) - */ - format?: ModuleFormat | null | undefined; - /** - * The import attributes to use when caching the module (optional; if excluded the input will be used) - */ - importAttributes?: ImportAttributes | undefined; - /** - * A signal that this hook intends to terminate the chain of `resolve` hooks. - * @default false - */ - shortCircuit?: boolean | undefined; - /** - * The absolute URL to which this input resolves - */ - url: string; - } - /** - * The `resolve` hook chain is responsible for resolving file URL for a given module specifier and parent URL, and optionally its format (such as `'module'`) as a hint to the `load` hook. - * If a format is specified, the load hook is ultimately responsible for providing the final `format` value (and it is free to ignore the hint provided by `resolve`); - * if `resolve` provides a format, a custom `load` hook is required even if only to pass the value to the Node.js default `load` hook. - * - * @param specifier The specified URL path of the module to be resolved - * @param context - * @param nextResolve The subsequent `resolve` hook in the chain, or the Node.js default `resolve` hook after the last user-supplied resolve hook - */ - type ResolveHook = ( - specifier: string, - context: ResolveHookContext, - nextResolve: ( - specifier: string, - context?: ResolveHookContext, - ) => ResolveFnOutput | Promise, - ) => ResolveFnOutput | Promise; - interface LoadHookContext { - /** - * Export conditions of the relevant `package.json` - */ - conditions: string[]; - /** - * The format optionally supplied by the `resolve` hook chain - */ - format: ModuleFormat; - /** - * An object whose key-value pairs represent the assertions for the module to import - */ - importAttributes: ImportAttributes; - } - interface LoadFnOutput { - format: ModuleFormat; - /** - * A signal that this hook intends to terminate the chain of `resolve` hooks. - * @default false - */ - shortCircuit?: boolean | undefined; - /** - * The source for Node.js to evaluate - */ - source?: ModuleSource; - } - /** - * The `load` hook provides a way to define a custom method of determining how a URL should be interpreted, retrieved, and parsed. - * It is also in charge of validating the import assertion. - * - * @param url The URL/path of the module to be loaded - * @param context Metadata about the module - * @param nextLoad The subsequent `load` hook in the chain, or the Node.js default `load` hook after the last user-supplied `load` hook - */ - type LoadHook = ( - url: string, - context: LoadHookContext, - nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise, - ) => LoadFnOutput | Promise; - } - interface RegisterOptions { - parentURL: string | URL; - data?: Data | undefined; - transferList?: any[] | undefined; - } - interface Module extends NodeModule {} - class Module { - static runMain(): void; - static wrap(code: string): string; - static createRequire(path: string | URL): NodeRequire; - static builtinModules: string[]; - static isBuiltin(moduleName: string): boolean; - static Module: typeof Module; - static register( - specifier: string | URL, - parentURL?: string | URL, - options?: RegisterOptions, - ): void; - static register(specifier: string | URL, options?: RegisterOptions): void; - constructor(id: string, parent?: Module); - } - global { - interface ImportMeta { - /** - * The directory name of the current module. This is the same as the `path.dirname()` of the `import.meta.filename`. - * **Caveat:** only present on `file:` modules. - */ - dirname: string; - /** - * The full absolute path and filename of the current module, with symlinks resolved. - * This is the same as the `url.fileURLToPath()` of the `import.meta.url`. - * **Caveat:** only local modules support this property. Modules not using the `file:` protocol will not provide it. - */ - filename: string; - /** - * The absolute `file:` URL of the module. - */ - url: string; - /** - * Provides a module-relative resolution function scoped to each module, returning - * the URL string. - * - * Second `parent` parameter is only used when the `--experimental-import-meta-resolve` - * command flag enabled. - * - * @since v20.6.0 - * - * @param specifier The module specifier to resolve relative to `parent`. - * @param parent The absolute parent module URL to resolve from. - * @returns The absolute (`file:`) URL string for the resolved module. - */ - resolve(specifier: string, parent?: string | URL | undefined): string; - } - } - export = Module; -} -declare module "node:module" { - import module = require("module"); - export = module; -} diff --git a/node_modules/@types/node/net.d.ts b/node_modules/@types/node/net.d.ts deleted file mode 100644 index d113e21..0000000 --- a/node_modules/@types/node/net.d.ts +++ /dev/null @@ -1,1001 +0,0 @@ -/** - * > Stability: 2 - Stable - * - * The `node:net` module provides an asynchronous network API for creating stream-based - * TCP or `IPC` servers ({@link createServer}) and clients - * ({@link createConnection}). - * - * It can be accessed using: - * - * ```js - * import net from 'node:net'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/net.js) - */ -declare module "net" { - import * as stream from "node:stream"; - import { Abortable, EventEmitter } from "node:events"; - import * as dns from "node:dns"; - type LookupFunction = ( - hostname: string, - options: dns.LookupOptions, - callback: (err: NodeJS.ErrnoException | null, address: string | dns.LookupAddress[], family?: number) => void, - ) => void; - interface AddressInfo { - address: string; - family: string; - port: number; - } - interface SocketConstructorOpts { - fd?: number | undefined; - allowHalfOpen?: boolean | undefined; - onread?: OnReadOpts | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - signal?: AbortSignal; - } - 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. - */ - callback(bytesWritten: number, buffer: Uint8Array): boolean; - } - // TODO: remove empty ConnectOpts placeholder at next major @types/node version. - /** @deprecated */ - interface ConnectOpts {} - interface TcpSocketConnectOpts { - port: number; - host?: string | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - hints?: number | undefined; - family?: number | undefined; - lookup?: LookupFunction | undefined; - noDelay?: boolean | undefined; - keepAlive?: boolean | undefined; - keepAliveInitialDelay?: number | undefined; - /** - * @since v18.13.0 - */ - autoSelectFamily?: boolean | undefined; - /** - * @since v18.13.0 - */ - autoSelectFamilyAttemptTimeout?: number | undefined; - } - interface IpcSocketConnectOpts { - path: string; - } - type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; - type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed"; - /** - * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint - * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also - * an `EventEmitter`. - * - * A `net.Socket` can be created by the user and used directly to interact with - * a server. For example, it is returned by {@link createConnection}, - * so the user can use it to talk to the server. - * - * It can also be created by Node.js and passed to the user when a connection - * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use - * it to interact with the client. - * @since v0.3.4 - */ - class Socket extends stream.Duplex { - constructor(options?: SocketConstructorOpts); - /** - * Destroys the socket after all data is written. If the `finish` event was already emitted the socket is destroyed immediately. - * If the socket is still writable it implicitly calls `socket.end()`. - * @since v0.3.4 - */ - destroySoon(): void; - /** - * Sends data on the socket. The second parameter specifies the encoding in the - * case of a string. It defaults to UTF8 encoding. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. - * - * The optional `callback` parameter will be executed when the data is finally - * written out, which may not be immediately. - * - * See `Writable` stream `write()` method for more - * information. - * @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; - /** - * Initiate a connection on a given socket. - * - * Possible signatures: - * - * * `socket.connect(options[, connectListener])` - * * `socket.connect(path[, connectListener])` for `IPC` connections. - * * `socket.connect(port[, host][, connectListener])` for TCP connections. - * * Returns: `net.Socket` The socket itself. - * - * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, - * instead of a `'connect'` event, an `'error'` event will be emitted with - * the error passed to the `'error'` listener. - * The last parameter `connectListener`, if supplied, will be added as a listener - * for the `'connect'` event **once**. - * - * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined - * behavior. - */ - connect(options: SocketConnectOpts, connectionListener?: () => void): this; - connect(port: number, host: string, connectionListener?: () => void): this; - connect(port: number, connectionListener?: () => void): this; - connect(path: string, connectionListener?: () => void): this; - /** - * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. - * @since v0.1.90 - * @return The socket itself. - */ - setEncoding(encoding?: BufferEncoding): this; - /** - * Pauses the reading of data. That is, `'data'` events will not be emitted. - * Useful to throttle back an upload. - * @return The socket itself. - */ - pause(): this; - /** - * Close the TCP connection by sending an RST packet and destroy the stream. - * If this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected. - * Otherwise, it will call `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. - * If this is not a TCP socket (for example, a pipe), calling this method will immediately throw an `ERR_INVALID_HANDLE_TYPE` Error. - * @since v18.3.0, v16.17.0 - */ - resetAndDestroy(): this; - /** - * Resumes reading after a call to `socket.pause()`. - * @return The socket itself. - */ - resume(): this; - /** - * Sets the socket to timeout after `timeout` milliseconds of inactivity on - * the socket. By default `net.Socket` do not have a timeout. - * - * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to - * end the connection. - * - * ```js - * socket.setTimeout(3000); - * socket.on('timeout', () => { - * console.log('socket timeout'); - * socket.end(); - * }); - * ``` - * - * If `timeout` is 0, then the existing idle timeout is disabled. - * - * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. - * @since v0.1.90 - * @return The socket itself. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Enable/disable the use of Nagle's algorithm. - * - * When a TCP connection is created, it will have Nagle's algorithm enabled. - * - * Nagle's algorithm delays data before it is sent via the network. It attempts - * to optimize throughput at the expense of latency. - * - * Passing `true` for `noDelay` or not passing an argument will disable Nagle's - * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's - * algorithm. - * @since v0.1.90 - * @param [noDelay=true] - * @return The socket itself. - */ - setNoDelay(noDelay?: boolean): this; - /** - * Enable/disable keep-alive functionality, and optionally set the initial - * delay before the first keepalive probe is sent on an idle socket. - * - * Set `initialDelay` (in milliseconds) to set the delay between the last - * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default - * (or previous) setting. - * - * Enabling the keep-alive functionality will set the following socket options: - * - * * `SO_KEEPALIVE=1` - * * `TCP_KEEPIDLE=initialDelay` - * * `TCP_KEEPCNT=10` - * * `TCP_KEEPINTVL=1` - * @since v0.1.92 - * @param [enable=false] - * @param [initialDelay=0] - * @return The socket itself. - */ - setKeepAlive(enable?: boolean, initialDelay?: number): this; - /** - * Returns the bound `address`, the address `family` name and `port` of the - * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` - * @since v0.1.90 - */ - address(): AddressInfo | {}; - /** - * Calling `unref()` on a socket will allow the program to exit if this is the only - * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - unref(): this; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior). - * If the socket is `ref`ed calling `ref` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - ref(): this; - /** - * This property is only present if the family autoselection algorithm is enabled in `socket.connect(options)` - * and it is an array of the addresses that have been attempted. - * - * Each address is a string in the form of `$IP:$PORT`. - * If the connection was successful, then the last address is the one that the socket is currently connected to. - * @since v19.4.0 - */ - readonly autoSelectFamilyAttemptedAddresses: string[]; - /** - * This property shows the number of characters buffered for writing. The buffer - * may contain strings whose length after encoding is not yet known. So this number - * is only an approximation of the number of bytes in the buffer. - * - * `net.Socket` has the property that `socket.write()` always works. This is to - * help users get up and running quickly. The computer cannot always keep up - * with the amount of data that is written to a socket. The network connection - * simply might be too slow. Node.js will internally queue up the data written to a - * socket and send it out over the wire when it is possible. - * - * The consequence of this internal buffering is that memory may grow. - * Users who experience large or growing `bufferSize` should attempt to - * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. - * @since v0.3.8 - * @deprecated Since v14.6.0 - Use `writableLength` instead. - */ - readonly bufferSize: number; - /** - * The amount of received bytes. - * @since v0.5.3 - */ - readonly bytesRead: number; - /** - * The amount of bytes sent. - * @since v0.5.3 - */ - readonly bytesWritten: number; - /** - * If `true`, `socket.connect(options[, connectListener])` was - * called and has not yet finished. It will stay `true` until the socket becomes - * connected, then it is set to `false` and the `'connect'` event is emitted. Note - * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. - * @since v6.1.0 - */ - readonly connecting: boolean; - /** - * This is `true` if the socket is not connected yet, either because `.connect()`has not yet been called or because it is still in the process of connecting - * (see `socket.connecting`). - * @since v11.2.0, v10.16.0 - */ - readonly pending: boolean; - /** - * See `writable.destroyed` for further details. - */ - readonly destroyed: boolean; - /** - * The string representation of the local IP address the remote client is - * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client - * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. - * @since v0.9.6 - */ - readonly localAddress?: string; - /** - * The numeric representation of the local port. For example, `80` or `21`. - * @since v0.9.6 - */ - readonly localPort?: number; - /** - * The string representation of the local IP family. `'IPv4'` or `'IPv6'`. - * @since v18.8.0, v16.18.0 - */ - readonly localFamily?: string; - /** - * This property represents the state of the connection as a string. - * - * * If the stream is connecting `socket.readyState` is `opening`. - * * If the stream is readable and writable, it is `open`. - * * If the stream is readable and not writable, it is `readOnly`. - * * If the stream is not readable and writable, it is `writeOnly`. - * @since v0.5.0 - */ - readonly readyState: SocketReadyState; - /** - * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - 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; - /** - * 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; - /** - * 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; - /** - * Half-closes the socket. i.e., it sends a FIN packet. It is possible the - * server will still send some data. - * - * See `writable.end()` for further details. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - * @param callback Optional callback for when the socket is finished. - * @return The socket itself. - */ - end(callback?: () => void): this; - end(buffer: Uint8Array | string, callback?: () => void): this; - end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. connectionAttempt - * 4. connectionAttemptFailed - * 5. connectionAttemptTimeout - * 6. data - * 7. drain - * 8. end - * 9. error - * 10. lookup - * 11. ready - * 12. timeout - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (hadError: boolean) => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - addListener( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number) => void, - ): this; - addListener( - event: "connectionAttemptTimeout", - listener: (ip: string, port: number, family: number) => void, - ): this; - addListener(event: "data", listener: (data: Buffer) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "timeout", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - 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: "connectionAttemptTimeout", ip: string, port: number, family: number): boolean; - emit(event: "data", data: Buffer): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; - emit(event: "ready"): boolean; - emit(event: "timeout"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - 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: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this; - on(event: "data", listener: (data: Buffer) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - on(event: "ready", listener: () => void): this; - on(event: "timeout", listener: () => void): this; - 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: "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: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - once(event: "ready", listener: () => void): this; - once(event: "timeout", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (hadError: boolean) => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this; - prependListener( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependListener( - event: "connectionAttemptTimeout", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependListener(event: "data", listener: (data: Buffer) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: (hadError: boolean) => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener( - event: "connectionAttempt", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependOnceListener( - event: "connectionAttemptFailed", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependOnceListener( - event: "connectionAttemptTimeout", - listener: (ip: string, port: number, family: number) => void, - ): this; - prependOnceListener(event: "data", listener: (data: Buffer) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener( - event: "lookup", - listener: (err: Error, address: string, family: string | number, host: string) => void, - ): this; - prependOnceListener(event: "ready", listener: () => void): this; - 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; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - } - interface ServerOpts { - /** - * Indicates whether half-opened TCP connections are allowed. - * @default false - */ - allowHalfOpen?: boolean | undefined; - /** - * Indicates whether the socket should be paused on incoming connections. - * @default false - */ - pauseOnConnect?: boolean | undefined; - /** - * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. - * @default false - * @since v16.5.0 - */ - noDelay?: 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])`. - * @default false - * @since v16.5.0 - */ - keepAlive?: boolean | undefined; - /** - * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. - * @default 0 - * @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-v22.x/api/stream.html#streamgetdefaulthighwatermarkobjectmode). - * @since v18.17.0, v20.1.0 - */ - highWaterMark?: number | undefined; - } - interface DropArgument { - localAddress?: string; - localPort?: number; - localFamily?: string; - remoteAddress?: string; - remotePort?: number; - remoteFamily?: string; - } - /** - * This class is used to create a TCP or `IPC` server. - * @since v0.1.90 - */ - class Server extends EventEmitter { - constructor(connectionListener?: (socket: Socket) => void); - constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); - /** - * Start a server listening for connections. A `net.Server` can be a TCP or - * an `IPC` server depending on what it listens to. - * - * Possible signatures: - * - * * `server.listen(handle[, backlog][, callback])` - * * `server.listen(options[, callback])` - * * `server.listen(path[, backlog][, callback])` for `IPC` servers - * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers - * - * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` - * event. - * - * All `listen()` methods can take a `backlog` parameter to specify the maximum - * length of the queue of pending connections. The actual length will be determined - * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn` on Linux. The default value of this parameter is 511 (not 512). - * - * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for - * details). - * - * The `server.listen()` method can be called again if and only if there was an - * error during the first `server.listen()` call or `server.close()` has been - * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. - * - * One of the most common errors raised when listening is `EADDRINUSE`. - * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry - * after a certain amount of time: - * - * ```js - * server.on('error', (e) => { - * if (e.code === 'EADDRINUSE') { - * console.error('Address in use, retrying...'); - * setTimeout(() => { - * server.close(); - * server.listen(PORT, HOST); - * }, 1000); - * } - * }); - * ``` - */ - listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, hostname?: string, listeningListener?: () => void): this; - listen(port?: number, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, listeningListener?: () => void): this; - listen(path: string, backlog?: number, listeningListener?: () => void): this; - listen(path: string, listeningListener?: () => void): this; - listen(options: ListenOptions, listeningListener?: () => void): this; - listen(handle: any, backlog?: number, listeningListener?: () => void): this; - listen(handle: any, listeningListener?: () => void): this; - /** - * Stops the server from accepting new connections and keeps existing - * connections. This function is asynchronous, the server is finally closed - * when all connections are ended and the server emits a `'close'` event. - * The optional `callback` will be called once the `'close'` event occurs. Unlike - * that event, it will be called with an `Error` as its only argument if the server - * was not open when it was closed. - * @since v0.1.90 - * @param callback Called when the server is closed. - */ - close(callback?: (err?: Error) => void): this; - /** - * Returns the bound `address`, the address `family` name, and `port` of the server - * as reported by the operating system if listening on an IP socket - * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. - * - * For a server listening on a pipe or Unix domain socket, the name is returned - * as a string. - * - * ```js - * const server = net.createServer((socket) => { - * socket.end('goodbye\n'); - * }).on('error', (err) => { - * // Handle errors here. - * throw err; - * }); - * - * // Grab an arbitrary unused port. - * server.listen(() => { - * console.log('opened server on', server.address()); - * }); - * ``` - * - * `server.address()` returns `null` before the `'listening'` event has been - * emitted or after calling `server.close()`. - * @since v0.1.90 - */ - address(): AddressInfo | string | null; - /** - * Asynchronously get the number of concurrent connections on the server. Works - * when sockets were sent to forks. - * - * Callback should take two arguments `err` and `count`. - * @since v0.9.7 - */ - getConnections(cb: (error: Error | null, count: number) => void): void; - /** - * 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. - * @since v0.9.1 - */ - ref(): this; - /** - * Calling `unref()` on a server will allow the program to exit if this is the only - * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - */ - unref(): this; - /** - * Set this property to reject connections when the server's connection count gets - * high. - * - * It is not recommended to use this option once a socket has been sent to a child - * with `child_process.fork()`. - * @since v0.2.0 - */ - maxConnections: number; - connections: number; - /** - * Indicates whether or not the server is listening for connections. - * @since v5.7.0 - */ - readonly listening: boolean; - /** - * events.EventEmitter - * 1. close - * 2. connection - * 3. error - * 4. listening - * 5. drop - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "drop", listener: (data?: DropArgument) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "drop", data?: DropArgument): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "drop", listener: (data?: DropArgument) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "drop", listener: (data?: DropArgument) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "drop", listener: (data?: DropArgument) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "drop", listener: (data?: DropArgument) => void): this; - /** - * Calls {@link Server.close()} and returns a promise that fulfills when the server has closed. - * @since v20.5.0 - */ - [Symbol.asyncDispose](): Promise; - } - type IPVersion = "ipv4" | "ipv6"; - /** - * The `BlockList` object can be used with some network APIs to specify rules for - * disabling inbound or outbound access to specific IP addresses, IP ranges, or - * IP subnets. - * @since v15.0.0, v14.18.0 - */ - class BlockList { - /** - * Adds a rule to block the given IP address. - * @since v15.0.0, v14.18.0 - * @param address An IPv4 or IPv6 address. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addAddress(address: string, type?: IPVersion): void; - addAddress(address: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). - * @since v15.0.0, v14.18.0 - * @param start The starting IPv4 or IPv6 address in the range. - * @param end The ending IPv4 or IPv6 address in the range. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addRange(start: string, end: string, type?: IPVersion): void; - addRange(start: SocketAddress, end: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses specified as a subnet mask. - * @since v15.0.0, v14.18.0 - * @param net The network IPv4 or IPv6 address. - * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addSubnet(net: SocketAddress, prefix: number): void; - addSubnet(net: string, prefix: number, type?: IPVersion): void; - /** - * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. - * - * ```js - * const blockList = new net.BlockList(); - * blockList.addAddress('123.123.123.123'); - * blockList.addRange('10.0.0.1', '10.0.0.10'); - * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); - * - * console.log(blockList.check('123.123.123.123')); // Prints: true - * console.log(blockList.check('10.0.0.3')); // Prints: true - * console.log(blockList.check('222.111.111.222')); // Prints: false - * - * // IPv6 notation for IPv4 addresses works: - * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true - * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true - * ``` - * @since v15.0.0, v14.18.0 - * @param address The IP address to check - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - check(address: SocketAddress): boolean; - check(address: string, type?: IPVersion): boolean; - /** - * The list of rules added to the blocklist. - * @since v15.0.0, v14.18.0 - */ - rules: readonly string[]; - } - interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; - /** - * Creates a new TCP or `IPC` server. - * - * If `allowHalfOpen` is set to `true`, when the other end of the socket - * signals the end of transmission, the server will only send back the end of - * transmission when `socket.end()` is explicitly called. For example, in the - * context of TCP, when a FIN packed is received, a FIN packed is sent - * back only when `socket.end()` is explicitly called. Until then the - * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. - * - * If `pauseOnConnect` is set to `true`, then the socket associated with each - * incoming connection will be paused, and no data will be read from its handle. - * This allows connections to be passed between processes without any data being - * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. - * - * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. - * - * Here is an example of a TCP echo server which listens for connections - * on port 8124: - * - * ```js - * import net from 'node:net'; - * const server = net.createServer((c) => { - * // 'connection' listener. - * console.log('client connected'); - * c.on('end', () => { - * console.log('client disconnected'); - * }); - * c.write('hello\r\n'); - * c.pipe(c); - * }); - * server.on('error', (err) => { - * throw err; - * }); - * server.listen(8124, () => { - * console.log('server bound'); - * }); - * ``` - * - * Test this by using `telnet`: - * - * ```bash - * telnet localhost 8124 - * ``` - * - * To listen on the socket `/tmp/echo.sock`: - * - * ```js - * server.listen('/tmp/echo.sock', () => { - * console.log('server bound'); - * }); - * ``` - * - * Use `nc` to connect to a Unix domain socket server: - * - * ```bash - * nc -U /tmp/echo.sock - * ``` - * @since v0.5.0 - * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. - */ - function createServer(connectionListener?: (socket: Socket) => void): Server; - function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; - /** - * Aliases to {@link createConnection}. - * - * Possible signatures: - * - * * {@link connect} - * * {@link connect} for `IPC` connections. - * * {@link connect} for TCP connections. - */ - function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; - function connect(port: number, host?: string, connectionListener?: () => void): Socket; - function connect(path: string, connectionListener?: () => void): Socket; - /** - * A factory function, which creates a new {@link Socket}, - * immediately initiates connection with `socket.connect()`, - * then returns the `net.Socket` that starts the connection. - * - * When the connection is established, a `'connect'` event will be emitted - * on the returned socket. The last parameter `connectListener`, if supplied, - * will be added as a listener for the `'connect'` event **once**. - * - * Possible signatures: - * - * * {@link createConnection} - * * {@link createConnection} for `IPC` connections. - * * {@link createConnection} for TCP connections. - * - * The {@link connect} function is an alias to this function. - */ - function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; - function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; - function createConnection(path: string, connectionListener?: () => void): Socket; - /** - * Gets the current default value of the `autoSelectFamily` option of `socket.connect(options)`. - * The initial default value is `true`, unless the command line option`--no-network-family-autoselection` is provided. - * @since v19.4.0 - */ - function getDefaultAutoSelectFamily(): boolean; - /** - * Sets the default value of the `autoSelectFamily` option of `socket.connect(options)`. - * @since v19.4.0 - */ - function setDefaultAutoSelectFamily(value: boolean): void; - /** - * Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * The initial default value is `250` or the value specified via the command line option `--network-family-autoselection-attempt-timeout`. - * @returns The current default value of the `autoSelectFamilyAttemptTimeout` option. - * @since v19.8.0, v18.8.0 - */ - function getDefaultAutoSelectFamilyAttemptTimeout(): number; - /** - * Sets the default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`. - * @param value The new default value, which must be a positive number. If the number is less than `10`, the value `10` is used instead. The initial default value is `250` or the value specified via the command line - * option `--network-family-autoselection-attempt-timeout`. - * @since v19.8.0, v18.8.0 - */ - function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void; - /** - * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4 - * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`. - * - * ```js - * net.isIP('::1'); // returns 6 - * net.isIP('127.0.0.1'); // returns 4 - * net.isIP('127.000.000.001'); // returns 0 - * net.isIP('127.0.0.1/24'); // returns 0 - * net.isIP('fhqwhgads'); // returns 0 - * ``` - * @since v0.3.0 - */ - function isIP(input: string): number; - /** - * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no - * leading zeroes. Otherwise, returns `false`. - * - * ```js - * net.isIPv4('127.0.0.1'); // returns true - * net.isIPv4('127.000.000.001'); // returns false - * net.isIPv4('127.0.0.1/24'); // returns false - * net.isIPv4('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv4(input: string): boolean; - /** - * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`. - * - * ```js - * net.isIPv6('::1'); // returns true - * net.isIPv6('fhqwhgads'); // returns false - * ``` - * @since v0.3.0 - */ - function isIPv6(input: string): boolean; - interface SocketAddressInitOptions { - /** - * The network address as either an IPv4 or IPv6 string. - * @default 127.0.0.1 - */ - address?: string | undefined; - /** - * @default `'ipv4'` - */ - family?: IPVersion | undefined; - /** - * An IPv6 flow-label used only if `family` is `'ipv6'`. - * @default 0 - */ - flowlabel?: number | undefined; - /** - * An IP port. - * @default 0 - */ - port?: number | undefined; - } - /** - * @since v15.14.0, v14.18.0 - */ - class SocketAddress { - constructor(options: SocketAddressInitOptions); - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly address: string; - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0, v14.18.0 - */ - readonly family: IPVersion; - /** - * @since v15.14.0, v14.18.0 - */ - readonly port: number; - /** - * @since v15.14.0, v14.18.0 - */ - readonly flowlabel: number; - } -} -declare module "node:net" { - export * from "net"; -} diff --git a/node_modules/@types/node/os.d.ts b/node_modules/@types/node/os.d.ts deleted file mode 100644 index 7f30535..0000000 --- a/node_modules/@types/node/os.d.ts +++ /dev/null @@ -1,495 +0,0 @@ -/** - * The `node:os` module provides operating system-related utility methods and - * properties. It can be accessed using: - * - * ```js - * import os from 'node:os'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/os.js) - */ -declare module "os" { - interface CpuInfo { - model: string; - speed: number; - times: { - /** The number of milliseconds the CPU has spent in user mode. */ - user: number; - /** The number of milliseconds the CPU has spent in nice mode. */ - nice: number; - /** The number of milliseconds the CPU has spent in sys mode. */ - sys: number; - /** The number of milliseconds the CPU has spent in idle mode. */ - idle: number; - /** The number of milliseconds the CPU has spent in irq mode. */ - irq: number; - }; - } - interface NetworkInterfaceBase { - address: string; - netmask: string; - mac: string; - internal: boolean; - cidr: string | null; - } - interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { - family: "IPv4"; - scopeid?: undefined; - } - interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { - family: "IPv6"; - scopeid: number; - } - interface UserInfo { - username: T; - uid: number; - gid: number; - shell: T | null; - homedir: T; - } - type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; - /** - * Returns the host name of the operating system as a string. - * @since v0.3.3 - */ - function hostname(): string; - /** - * Returns an array containing the 1, 5, and 15 minute load averages. - * - * The load average is a measure of system activity calculated by the operating - * system and expressed as a fractional number. - * - * The load average is a Unix-specific concept. On Windows, the return value is - * always `[0, 0, 0]`. - * @since v0.3.3 - */ - function loadavg(): number[]; - /** - * Returns the system uptime in number of seconds. - * @since v0.3.3 - */ - function uptime(): number; - /** - * Returns the amount of free system memory in bytes as an integer. - * @since v0.3.3 - */ - function freemem(): number; - /** - * Returns the total amount of system memory in bytes as an integer. - * @since v0.3.3 - */ - function totalmem(): number; - /** - * Returns an array of objects containing information about each logical CPU core. - * The array will be empty if no CPU information is available, such as if the `/proc` file system is unavailable. - * - * The properties included on each object include: - * - * ```js - * [ - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 252020, - * nice: 0, - * sys: 30340, - * idle: 1070356870, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 306960, - * nice: 0, - * sys: 26980, - * idle: 1071569080, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 248450, - * nice: 0, - * sys: 21750, - * idle: 1070919370, - * irq: 0, - * }, - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 256880, - * nice: 0, - * sys: 19430, - * idle: 1070905480, - * irq: 20, - * }, - * }, - * ] - * ``` - * - * `nice` values are POSIX-only. On Windows, the `nice` values of all processors - * are always 0. - * - * `os.cpus().length` should not be used to calculate the amount of parallelism - * available to an application. Use {@link availableParallelism} for this purpose. - * @since v0.3.3 - */ - function cpus(): CpuInfo[]; - /** - * Returns an estimate of the default amount of parallelism a program should use. - * Always returns a value greater than zero. - * - * This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism). - * @since v19.4.0, v18.14.0 - */ - function availableParallelism(): number; - /** - * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it - * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. - * - * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information - * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. - * @since v0.3.3 - */ - function type(): string; - /** - * Returns the operating system as a string. - * - * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See - * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v0.3.3 - */ - function release(): string; - /** - * Returns an object containing network interfaces that have been assigned a - * network address. - * - * Each key on the returned object identifies a network interface. The associated - * value is an array of objects that each describe an assigned network address. - * - * The properties available on the assigned network address object include: - * - * ```js - * { - * lo: [ - * { - * address: '127.0.0.1', - * netmask: '255.0.0.0', - * family: 'IPv4', - * mac: '00:00:00:00:00:00', - * internal: true, - * cidr: '127.0.0.1/8' - * }, - * { - * address: '::1', - * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - * family: 'IPv6', - * mac: '00:00:00:00:00:00', - * scopeid: 0, - * internal: true, - * cidr: '::1/128' - * } - * ], - * eth0: [ - * { - * address: '192.168.1.108', - * netmask: '255.255.255.0', - * family: 'IPv4', - * mac: '01:02:03:0a:0b:0c', - * internal: false, - * cidr: '192.168.1.108/24' - * }, - * { - * address: 'fe80::a00:27ff:fe4e:66a1', - * netmask: 'ffff:ffff:ffff:ffff::', - * family: 'IPv6', - * mac: '01:02:03:0a:0b:0c', - * scopeid: 1, - * internal: false, - * cidr: 'fe80::a00:27ff:fe4e:66a1/64' - * } - * ] - * } - * ``` - * @since v0.6.0 - */ - function networkInterfaces(): NodeJS.Dict; - /** - * Returns the string path of the current user's home directory. - * - * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it - * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. - * - * On Windows, it uses the `USERPROFILE` environment variable if defined. - * Otherwise it uses the path to the profile directory of the current user. - * @since v2.3.0 - */ - function homedir(): string; - /** - * Returns information about the currently effective user. On POSIX platforms, - * this is typically a subset of the password file. The returned object includes - * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and `gid` fields are `-1`, and `shell` is `null`. - * - * The value of `homedir` returned by `os.userInfo()` is provided by the operating - * system. This differs from the result of `os.homedir()`, which queries - * environment variables for the home directory before falling back to the - * operating system response. - * - * Throws a [`SystemError`](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-systemerror) if a user has no `username` or `homedir`. - * @since v6.0.0 - */ - function userInfo(options: { encoding: "buffer" }): UserInfo; - function userInfo(options?: { encoding: BufferEncoding }): UserInfo; - type SignalConstants = { - [key in NodeJS.Signals]: number; - }; - namespace constants { - const UV_UDP_REUSEADDR: number; - namespace signals {} - const signals: SignalConstants; - namespace errno { - const E2BIG: number; - const EACCES: number; - const EADDRINUSE: number; - const EADDRNOTAVAIL: number; - const EAFNOSUPPORT: number; - const EAGAIN: number; - const EALREADY: number; - const EBADF: number; - const EBADMSG: number; - const EBUSY: number; - const ECANCELED: number; - const ECHILD: number; - const ECONNABORTED: number; - const ECONNREFUSED: number; - const ECONNRESET: number; - const EDEADLK: number; - const EDESTADDRREQ: number; - const EDOM: number; - const EDQUOT: number; - const EEXIST: number; - const EFAULT: number; - const EFBIG: number; - const EHOSTUNREACH: number; - const EIDRM: number; - const EILSEQ: number; - const EINPROGRESS: number; - const EINTR: number; - const EINVAL: number; - const EIO: number; - const EISCONN: number; - const EISDIR: number; - const ELOOP: number; - const EMFILE: number; - const EMLINK: number; - const EMSGSIZE: number; - const EMULTIHOP: number; - const ENAMETOOLONG: number; - const ENETDOWN: number; - const ENETRESET: number; - const ENETUNREACH: number; - const ENFILE: number; - const ENOBUFS: number; - const ENODATA: number; - const ENODEV: number; - const ENOENT: number; - const ENOEXEC: number; - const ENOLCK: number; - const ENOLINK: number; - const ENOMEM: number; - const ENOMSG: number; - const ENOPROTOOPT: number; - const ENOSPC: number; - const ENOSR: number; - const ENOSTR: number; - const ENOSYS: number; - const ENOTCONN: number; - const ENOTDIR: number; - const ENOTEMPTY: number; - const ENOTSOCK: number; - const ENOTSUP: number; - const ENOTTY: number; - const ENXIO: number; - const EOPNOTSUPP: number; - const EOVERFLOW: number; - const EPERM: number; - const EPIPE: number; - const EPROTO: number; - const EPROTONOSUPPORT: number; - const EPROTOTYPE: number; - const ERANGE: number; - const EROFS: number; - const ESPIPE: number; - const ESRCH: number; - const ESTALE: number; - const ETIME: number; - const ETIMEDOUT: number; - const ETXTBSY: number; - const EWOULDBLOCK: number; - const EXDEV: number; - const WSAEINTR: number; - const WSAEBADF: number; - const WSAEACCES: number; - const WSAEFAULT: number; - const WSAEINVAL: number; - const WSAEMFILE: number; - const WSAEWOULDBLOCK: number; - const WSAEINPROGRESS: number; - const WSAEALREADY: number; - const WSAENOTSOCK: number; - const WSAEDESTADDRREQ: number; - const WSAEMSGSIZE: number; - const WSAEPROTOTYPE: number; - const WSAENOPROTOOPT: number; - const WSAEPROTONOSUPPORT: number; - const WSAESOCKTNOSUPPORT: number; - const WSAEOPNOTSUPP: number; - const WSAEPFNOSUPPORT: number; - const WSAEAFNOSUPPORT: number; - const WSAEADDRINUSE: number; - const WSAEADDRNOTAVAIL: number; - const WSAENETDOWN: number; - const WSAENETUNREACH: number; - const WSAENETRESET: number; - const WSAECONNABORTED: number; - const WSAECONNRESET: number; - const WSAENOBUFS: number; - const WSAEISCONN: number; - const WSAENOTCONN: number; - const WSAESHUTDOWN: number; - const WSAETOOMANYREFS: number; - const WSAETIMEDOUT: number; - const WSAECONNREFUSED: number; - const WSAELOOP: number; - const WSAENAMETOOLONG: number; - const WSAEHOSTDOWN: number; - const WSAEHOSTUNREACH: number; - const WSAENOTEMPTY: number; - const WSAEPROCLIM: number; - const WSAEUSERS: number; - const WSAEDQUOT: number; - const WSAESTALE: number; - const WSAEREMOTE: number; - const WSASYSNOTREADY: number; - const WSAVERNOTSUPPORTED: number; - const WSANOTINITIALISED: number; - const WSAEDISCON: number; - const WSAENOMORE: number; - const WSAECANCELLED: number; - const WSAEINVALIDPROCTABLE: number; - const WSAEINVALIDPROVIDER: number; - const WSAEPROVIDERFAILEDINIT: number; - const WSASYSCALLFAILURE: number; - const WSASERVICE_NOT_FOUND: number; - const WSATYPE_NOT_FOUND: number; - const WSA_E_NO_MORE: number; - const WSA_E_CANCELLED: number; - const WSAEREFUSED: number; - } - namespace dlopen { - const RTLD_LAZY: number; - const RTLD_NOW: number; - const RTLD_GLOBAL: number; - const RTLD_LOCAL: number; - const RTLD_DEEPBIND: number; - } - namespace priority { - const PRIORITY_LOW: number; - const PRIORITY_BELOW_NORMAL: number; - const PRIORITY_NORMAL: number; - const PRIORITY_ABOVE_NORMAL: number; - const PRIORITY_HIGH: number; - const PRIORITY_HIGHEST: number; - } - } - const devNull: string; - /** - * The operating system-specific end-of-line marker. - * * `\n` on POSIX - * * `\r\n` on Windows - */ - 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'`. - * - * The return value is equivalent to [process.arch](https://nodejs.org/docs/latest-v22.x/api/process.html#processarch). - * @since v0.5.0 - */ - function arch(): string; - /** - * Returns a string identifying the kernel version. - * - * On POSIX systems, the operating system release 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. - * @since v13.11.0, v12.17.0 - */ - function version(): string; - /** - * Returns a string identifying the operating system platform for which - * the Node.js binary was compiled. The value is set at compile time. - * Possible values are `'aix'`, `'darwin'`, `'freebsd'`, `'linux'`, `'openbsd'`, `'sunos'`, and `'win32'`. - * - * The return value is equivalent to `process.platform`. - * - * The value `'android'` may also be returned if Node.js is built on the Android - * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.5.0 - */ - 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`. - * - * 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. - * @since v18.9.0, v16.18.0 - */ - function machine(): string; - /** - * Returns the operating system's default directory for temporary files as a - * string. - * @since v0.9.9 - */ - function tmpdir(): string; - /** - * Returns a string identifying the endianness of the CPU for which the Node.js - * binary was compiled. - * - * Possible values are `'BE'` for big endian and `'LE'` for little endian. - * @since v0.9.4 - */ - function endianness(): "BE" | "LE"; - /** - * Returns the scheduling priority for the process specified by `pid`. If `pid` is - * not provided or is `0`, the priority of the current process is returned. - * @since v10.10.0 - * @param [pid=0] The process ID to retrieve scheduling priority for. - */ - function getPriority(pid?: number): number; - /** - * Attempts to set the scheduling priority for the process specified by `pid`. If `pid` is not provided or is `0`, the process ID of the current process is used. - * - * The `priority` input must be an integer between `-20` (high priority) and `19` (low priority). Due to differences between Unix priority levels and Windows - * priority classes, `priority` is mapped to one of six priority constants in `os.constants.priority`. When retrieving a process priority level, this range - * mapping may cause the return value to be slightly different on Windows. To avoid - * confusion, set `priority` to one of the priority constants. - * - * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user - * privileges. Otherwise the set priority will be silently reduced to `PRIORITY_HIGH`. - * @since v10.10.0 - * @param [pid=0] The process ID to set scheduling priority for. - * @param priority The scheduling priority to assign to the process. - */ - function setPriority(priority: number): void; - function setPriority(pid: number, priority: number): void; -} -declare module "node:os" { - export * from "os"; -} diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json deleted file mode 100644 index 098e853..0000000 --- a/node_modules/@types/node/package.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "name": "@types/node", - "version": "22.7.7", - "description": "TypeScript definitions for node", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", - "license": "MIT", - "contributors": [ - { - "name": "Microsoft TypeScript", - "githubUsername": "Microsoft", - "url": "https://github.com/Microsoft" - }, - { - "name": "Alberto Schiabel", - "githubUsername": "jkomyno", - "url": "https://github.com/jkomyno" - }, - { - "name": "Alvis HT Tang", - "githubUsername": "alvis", - "url": "https://github.com/alvis" - }, - { - "name": "Andrew Makarov", - "githubUsername": "r3nya", - "url": "https://github.com/r3nya" - }, - { - "name": "Benjamin Toueg", - "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", - "url": "https://github.com/mohsen1" - }, - { - "name": "Nikita Galkin", - "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", - "url": "https://github.com/chyzwar" - }, - { - "name": "Trivikram Kamat", - "githubUsername": "trivikr", - "url": "https://github.com/trivikr" - }, - { - "name": "Junxiao Shi", - "githubUsername": "yoursunny", - "url": "https://github.com/yoursunny" - }, - { - "name": "Ilia Baryshnikov", - "githubUsername": "qwelias", - "url": "https://github.com/qwelias" - }, - { - "name": "ExE Boss", - "githubUsername": "ExE-Boss", - "url": "https://github.com/ExE-Boss" - }, - { - "name": "Piotr Błażejewicz", - "githubUsername": "peterblazejewicz", - "url": "https://github.com/peterblazejewicz" - }, - { - "name": "Anna Henningsen", - "githubUsername": "addaleax", - "url": "https://github.com/addaleax" - }, - { - "name": "Victor Perin", - "githubUsername": "victorperin", - "url": "https://github.com/victorperin" - }, - { - "name": "Yongsheng Zhang", - "githubUsername": "ZYSzys", - "url": "https://github.com/ZYSzys" - }, - { - "name": "NodeJS Contributors", - "githubUsername": "NodeJS", - "url": "https://github.com/NodeJS" - }, - { - "name": "Linus Unnebäck", - "githubUsername": "LinusU", - "url": "https://github.com/LinusU" - }, - { - "name": "wafuwafu13", - "githubUsername": "wafuwafu13", - "url": "https://github.com/wafuwafu13" - }, - { - "name": "Matteo Collina", - "githubUsername": "mcollina", - "url": "https://github.com/mcollina" - }, - { - "name": "Dmitry Semigradsky", - "githubUsername": "Semigradsky", - "url": "https://github.com/Semigradsky" - } - ], - "main": "", - "types": "index.d.ts", - "typesVersions": { - "<=5.6": { - "*": [ - "ts5.6/*" - ] - } - }, - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/node" - }, - "scripts": {}, - "dependencies": { - "undici-types": "~6.19.2" - }, - "typesPublisherContentHash": "fa31e6c2802baba25cea51cc9964246c953fcbf22ed95a34bb888cea10a202c4", - "typeScriptVersion": "4.8" -} \ No newline at end of file diff --git a/node_modules/@types/node/path.d.ts b/node_modules/@types/node/path.d.ts deleted file mode 100644 index 25bfc80..0000000 --- a/node_modules/@types/node/path.d.ts +++ /dev/null @@ -1,200 +0,0 @@ -declare module "path/posix" { - import path = require("path"); - export = path; -} -declare module "path/win32" { - import path = require("path"); - export = path; -} -/** - * The `node:path` module provides utilities for working with file and directory - * paths. It can be accessed using: - * - * ```js - * import path from 'node:path'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/path.js) - */ -declare module "path" { - namespace path { - /** - * A parsed path object generated by path.parse() or consumed by path.format(). - */ - interface ParsedPath { - /** - * The root of the path such as '/' or 'c:\' - */ - root: string; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir: string; - /** - * The file name including extension (if any) such as 'index.html' - */ - base: string; - /** - * The file extension (if any) such as '.html' - */ - ext: string; - /** - * The file name without extension (if any) such as 'index' - */ - name: string; - } - interface FormatInputPathObject { - /** - * The root of the path such as '/' or 'c:\' - */ - root?: string | undefined; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir?: string | undefined; - /** - * The file name including extension (if any) such as 'index.html' - */ - base?: string | undefined; - /** - * The file extension (if any) such as '.html' - */ - ext?: string | undefined; - /** - * The file name without extension (if any) such as 'index' - */ - name?: string | undefined; - } - interface PlatformPath { - /** - * Normalize a string path, reducing '..' and '.' parts. - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. - * - * @param path string path to normalize. - * @throws {TypeError} if `path` is not a string. - */ - normalize(path: string): string; - /** - * Join all arguments together and normalize the resulting path. - * - * @param paths paths to join. - * @throws {TypeError} if any of the path segments is not a string. - */ - join(...paths: string[]): string; - /** - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. - * - * Starting from leftmost {from} parameter, resolves {to} to an absolute path. - * - * If {to} isn't already absolute, {from} arguments are prepended in right to left order, - * until an absolute path is found. If after using all {from} paths still no absolute path is found, - * the current working directory is used as well. The resulting path is normalized, - * and trailing slashes are removed unless the path gets resolved to the root directory. - * - * @param paths A sequence of paths or path segments. - * @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. - * - * If the given {path} is a zero-length string, `false` will be returned. - * - * @param path path to test. - * @throws {TypeError} if `path` is not a string. - */ - isAbsolute(path: string): boolean; - /** - * Solve the relative path from {from} to {to} based on the current working directory. - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. - * - * @throws {TypeError} if either `from` or `to` is not a string. - */ - relative(from: string, to: string): string; - /** - * Return the directory name of a path. Similar to the Unix dirname command. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - dirname(path: string): string; - /** - * Return the last portion of a path. Similar to the Unix basename command. - * Often used to extract the file name from a fully qualified path. - * - * @param path the path to evaluate. - * @param suffix optionally, an extension to remove from the result. - * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. - */ - basename(path: string, suffix?: string): string; - /** - * Return the extension of the path, from the last '.' to end of string in the last portion of the path. - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. - * - * @param path the path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - extname(path: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - readonly sep: "\\" | "/"; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - readonly delimiter: ";" | ":"; - /** - * Returns an object from a path string - the opposite of format(). - * - * @param path path to evaluate. - * @throws {TypeError} if `path` is not a string. - */ - parse(path: string): ParsedPath; - /** - * Returns a path string from an object - the opposite of parse(). - * - * @param pathObject path to evaluate. - */ - format(pathObject: FormatInputPathObject): string; - /** - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. - * If path is not a string, path will be returned without modifications. - * This method is meaningful only on Windows system. - * On POSIX systems, the method is non-operational and always returns path without modifications. - */ - toNamespacedPath(path: string): string; - /** - * Posix specific pathing. - * Same as parent object on posix. - */ - readonly posix: PlatformPath; - /** - * Windows specific pathing. - * Same as parent object on windows - */ - readonly win32: PlatformPath; - } - } - const path: path.PlatformPath; - export = path; -} -declare module "node:path" { - import path = require("path"); - export = path; -} -declare module "node:path/posix" { - import path = require("path/posix"); - export = path; -} -declare module "node:path/win32" { - import path = require("path/win32"); - export = path; -} diff --git a/node_modules/@types/node/perf_hooks.d.ts b/node_modules/@types/node/perf_hooks.d.ts deleted file mode 100644 index bffdd3e..0000000 --- a/node_modules/@types/node/perf_hooks.d.ts +++ /dev/null @@ -1,941 +0,0 @@ -/** - * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for - * Node.js-specific performance measurements. - * - * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): - * - * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) - * * [Performance Timeline](https://w3c.github.io/performance-timeline/) - * * [User Timing](https://www.w3.org/TR/user-timing/) - * * [Resource Timing](https://www.w3.org/TR/resource-timing-2/) - * - * ```js - * import { PerformanceObserver, performance } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((items) => { - * console.log(items.getEntries()[0].duration); - * performance.clearMarks(); - * }); - * obs.observe({ type: 'measure' }); - * performance.measure('Start to Now'); - * - * performance.mark('A'); - * doSomeLongRunningProcess(() => { - * performance.measure('A to Now', 'A'); - * - * performance.mark('B'); - * performance.measure('A to B', 'A', 'B'); - * }); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/perf_hooks.js) - */ -declare module "perf_hooks" { - import { AsyncResource } from "node:async_hooks"; - 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; - /** - * 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; - } - /** - * The constructor of this class is not exposed to users directly. - * @since v8.5.0 - */ - class PerformanceEntry { - protected constructor(); - /** - * The total number of milliseconds elapsed for this entry. This value will not - * be meaningful for all Performance Entry types. - * @since v8.5.0 - */ - readonly duration: number; - /** - * The name of the performance entry. - * @since v8.5.0 - */ - readonly name: string; - /** - * The high resolution millisecond timestamp marking the starting time of the - * Performance Entry. - * @since v8.5.0 - */ - readonly startTime: number; - /** - * The type of the performance entry. It may be one of: - * - * * `'node'` (Node.js only) - * * `'mark'` (available on the Web) - * * `'measure'` (available on the Web) - * * `'gc'` (Node.js only) - * * `'function'` (Node.js only) - * * `'http2'` (Node.js only) - * * `'http'` (Node.js only) - * @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; - } - /** - * Exposes marks created via the `Performance.mark()` method. - * @since v18.2.0, v16.17.0 - */ - class PerformanceMark extends PerformanceEntry { - readonly duration: 0; - readonly entryType: "mark"; - } - /** - * Exposes measures created via the `Performance.measure()` method. - * - * The constructor of this class is not exposed to users directly. - * @since v18.2.0, v16.17.0 - */ - class PerformanceMeasure extends PerformanceEntry { - readonly entryType: "measure"; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Provides timing details for Node.js itself. The constructor of this class - * is not exposed to users. - * @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 - * has the value of -1. - * @since v8.5.0 - */ - readonly bootstrapComplete: number; - /** - * The high resolution millisecond timestamp at which the Node.js environment was - * initialized. - * @since v8.5.0 - */ - readonly environment: number; - /** - * The high resolution millisecond timestamp of the amount of time the event loop - * has been idle within the event loop's event provider (e.g. `epoll_wait`). This - * does not take CPU usage into consideration. If the event loop has not yet - * started (e.g., in the first tick of the main script), the property has the - * value of 0. - * @since v14.10.0, v12.19.0 - */ - readonly idleTime: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * exited. If the event loop has not yet exited, the property has the value of -1\. - * It can only have a value of not -1 in a handler of the `'exit'` event. - * @since v8.5.0 - */ - readonly loopExit: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * started. If the event loop has not yet started (e.g., in the first tick of the - * main script), the property has the value of -1. - * @since v8.5.0 - */ - readonly loopStart: number; - /** - * The high resolution millisecond timestamp at which the Node.js process was initialized. - * @since v8.5.0 - */ - readonly nodeStart: number; - /** - * The high resolution millisecond timestamp at which the V8 platform was - * initialized. - * @since v8.5.0 - */ - readonly v8Start: number; - } - interface EventLoopUtilization { - idle: number; - active: number; - utilization: number; - } - /** - * @param utilization1 The result of a previous call to `eventLoopUtilization()`. - * @param utilization2 The result of a previous call to `eventLoopUtilization()` prior to `utilization1`. - */ - type EventLoopUtilityFunction = ( - utilization1?: EventLoopUtilization, - utilization2?: EventLoopUtilization, - ) => EventLoopUtilization; - interface MarkOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * An optional timestamp to be used as the mark time. - * @default `performance.now()` - */ - startTime?: number | undefined; - } - interface MeasureOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * Duration between start and end times. - */ - duration?: number | undefined; - /** - * Timestamp to be used as the end time, or a string identifying a previously recorded mark. - */ - end?: number | string | undefined; - /** - * Timestamp to be used as the start time, or a string identifying a previously recorded mark. - */ - start?: number | string | undefined; - } - interface TimerifyOptions { - /** - * A histogram object created using `perf_hooks.createHistogram()` that will record runtime - * durations in nanoseconds. - */ - histogram?: RecordableHistogram | undefined; - } - interface Performance { - /** - * If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline. - * If `name` is provided, removes only the named mark. - * @since v8.5.0 - */ - clearMarks(name?: string): void; - /** - * If `name` is not provided, removes all `PerformanceMeasure` objects from the Performance Timeline. - * If `name` is provided, removes only the named measure. - * @since v16.7.0 - */ - clearMeasures(name?: string): void; - /** - * If `name` is not provided, removes all `PerformanceResourceTiming` objects from the Resource Timeline. - * If `name` is provided, removes only the named resource. - * @since v18.2.0, v16.17.0 - */ - clearResourceTimings(name?: string): void; - /** - * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. - * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). - * No other CPU idle time is taken into consideration. - */ - eventLoopUtilization: EventLoopUtilityFunction; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. - * If you are only interested in performance entries of certain types or that have certain names, see - * `performance.getEntriesByType()` and `performance.getEntriesByName()`. - * @since v16.7.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. - * @param name - * @param type - * @since v16.7.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` - * whose `performanceEntry.entryType` is equal to `type`. - * @param type - * @since v16.7.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - /** - * Creates a new `PerformanceMark` entry in the Performance Timeline. - * A `PerformanceMark` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'mark'`, - * and whose `performanceEntry.duration` is always `0`. - * Performance marks are used to mark specific significant moments in the Performance Timeline. - * - * The created `PerformanceMark` entry is put in the global Performance Timeline and can be queried with - * `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is - * performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearMarks`. - * @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', - * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. - * - * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify - * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, - * then startMark is set to timeOrigin by default. - * - * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp - * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. - * @param name - * @param startMark - * @param endMark - * @return The PerformanceMeasure entry that was created - */ - measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; - measure(name: string, options: MeasureOptions): PerformanceMeasure; - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * An instance of the `PerformanceNodeTiming` class that provides performance metrics for specific Node.js operational milestones. - * @since v8.5.0 - */ - readonly nodeTiming: PerformanceNodeTiming; - /** - * Returns the current high resolution millisecond timestamp, where 0 represents the start of the current `node` process. - * @since v8.5.0 - */ - now(): number; - /** - * Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects. - * - * By default the max buffer size is set to 250. - * @since v18.8.0 - */ - setResourceTimingBufferSize(maxSize: number): void; - /** - * The [`timeOrigin`](https://w3c.github.io/hr-time/#dom-performance-timeorigin) specifies the high resolution millisecond timestamp - * at which the current `node` process began, measured in Unix time. - * @since v8.5.0 - */ - readonly timeOrigin: number; - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Wraps a function within a new function that measures the running time of the wrapped function. - * A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * function someFunction() { - * console.log('hello world'); - * } - * - * const wrapped = performance.timerify(someFunction); - * - * const obs = new PerformanceObserver((list) => { - * console.log(list.getEntries()[0].duration); - * - * performance.clearMarks(); - * performance.clearMeasures(); - * obs.disconnect(); - * }); - * obs.observe({ entryTypes: ['function'] }); - * - * // A performance timeline entry will be created - * wrapped(); - * ``` - * - * If the wrapped function returns a promise, a finally handler will be attached to the promise and the duration will be reported - * once the finally handler is invoked. - * @param fn - */ - timerify any>(fn: T, options?: TimerifyOptions): T; - /** - * An object which is JSON representation of the performance object. It is similar to - * [`window.performance.toJSON`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON) in browsers. - * @since v16.1.0 - */ - toJSON(): any; - } - class PerformanceObserverEntryList { - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime`. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntries()); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 81.465639, - * * duration: 0, - * * detail: null - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 81.860064, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is - * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByName('meow')); - * - * * [ - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 98.545991, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('nope')); // [] - * - * console.log(perfObserverList.getEntriesByName('test', 'mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 63.518931, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ entryTypes: ['mark', 'measure'] }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`. - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByType('mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 55.897834, - * * duration: 0, - * * detail: null - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 56.350146, - * * duration: 0, - * * detail: null - * * } - * * ] - * - * performance.clearMarks(); - * performance.clearMeasures(); - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - } - type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - /** - * @since v8.5.0 - */ - class PerformanceObserver extends AsyncResource { - constructor(callback: PerformanceObserverCallback); - /** - * Disconnects the `PerformanceObserver` instance from all notifications. - * @since v8.5.0 - */ - disconnect(): void; - /** - * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes` or `options.type`: - * - * ```js - * import { - * performance, - * PerformanceObserver, - * } from 'node:perf_hooks'; - * - * const obs = new PerformanceObserver((list, observer) => { - * // Called once asynchronously. `list` contains three items. - * }); - * obs.observe({ type: 'mark' }); - * - * for (let n = 0; n < 3; n++) - * performance.mark(`test${n}`); - * ``` - * @since v8.5.0 - */ - observe( - options: - | { - entryTypes: readonly EntryType[]; - buffered?: boolean | undefined; - } - | { - type: EntryType; - buffered?: boolean | undefined; - }, - ): void; - } - /** - * Provides detailed network timing data regarding the loading of an application's resources. - * - * The constructor of this class is not exposed to users directly. - * @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` - * request. If the resource is not intercepted by a worker the property will always return 0. - * @since v18.2.0, v16.17.0 - */ - readonly workerStart: number; - /** - * The high resolution millisecond timestamp that represents the start time of the fetch which - * initiates the redirect. - * @since v18.2.0, v16.17.0 - */ - readonly redirectStart: number; - /** - * The high resolution millisecond timestamp that will be created immediately after receiving - * the last byte of the response of the last redirect. - * @since v18.2.0, v16.17.0 - */ - readonly redirectEnd: number; - /** - * The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource. - * @since v18.2.0, v16.17.0 - */ - readonly fetchStart: number; - /** - * The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup - * for the resource. - * @since v18.2.0, v16.17.0 - */ - readonly domainLookupStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately after the Node.js finished - * the domain name lookup for the resource. - * @since v18.2.0, v16.17.0 - */ - readonly domainLookupEnd: number; - /** - * The high resolution millisecond timestamp representing the time immediately before Node.js starts to - * establish the connection to the server to retrieve the resource. - * @since v18.2.0, v16.17.0 - */ - readonly connectStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately after Node.js finishes - * establishing the connection to the server to retrieve the resource. - * @since v18.2.0, v16.17.0 - */ - readonly connectEnd: number; - /** - * The high resolution millisecond timestamp representing the time immediately before Node.js starts the - * handshake process to secure the current connection. - * @since v18.2.0, v16.17.0 - */ - readonly secureConnectionStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately before Node.js receives the - * first byte of the response from the server. - * @since v18.2.0, v16.17.0 - */ - readonly requestStart: number; - /** - * The high resolution millisecond timestamp representing the time immediately after Node.js receives the - * last byte of the resource or immediately before the transport connection is closed, whichever comes first. - * @since v18.2.0, v16.17.0 - */ - readonly responseEnd: number; - /** - * A number representing the size (in octets) of the fetched resource. The size includes the response header - * fields plus the response payload body. - * @since v18.2.0, v16.17.0 - */ - readonly transferSize: number; - /** - * A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before - * removing any applied content-codings. - * @since v18.2.0, v16.17.0 - */ - readonly encodedBodySize: number; - /** - * A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after - * removing any applied content-codings. - * @since v18.2.0, v16.17.0 - */ - readonly decodedBodySize: number; - /** - * Returns a `object` that is the JSON representation of the `PerformanceResourceTiming` object - * @since v18.2.0, v16.17.0 - */ - toJSON(): any; - } - namespace constants { - const NODE_PERFORMANCE_GC_MAJOR: number; - const NODE_PERFORMANCE_GC_MINOR: number; - const NODE_PERFORMANCE_GC_INCREMENTAL: number; - const NODE_PERFORMANCE_GC_WEAKCB: number; - const NODE_PERFORMANCE_GC_FLAGS_NO: number; - const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; - const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; - const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; - const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; - } - const performance: Performance; - interface EventLoopMonitorOptions { - /** - * The sampling rate in milliseconds. - * Must be greater than zero. - * @default 10 - */ - resolution?: number | undefined; - } - interface Histogram { - /** - * The number of samples recorded by the histogram. - * @since v17.4.0, v16.14.0 - */ - readonly count: number; - /** - * The number of samples recorded by the histogram. - * v17.4.0, v16.14.0 - */ - readonly countBigInt: bigint; - /** - * The number of times the event loop delay exceeded the maximum 1 hour event - * loop delay threshold. - * @since v11.10.0 - */ - readonly exceeds: number; - /** - * The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold. - * @since v17.4.0, v16.14.0 - */ - readonly exceedsBigInt: bigint; - /** - * The maximum recorded event loop delay. - * @since v11.10.0 - */ - readonly max: number; - /** - * The maximum recorded event loop delay. - * v17.4.0, v16.14.0 - */ - readonly maxBigInt: number; - /** - * The mean of the recorded event loop delays. - * @since v11.10.0 - */ - readonly mean: number; - /** - * The minimum recorded event loop delay. - * @since v11.10.0 - */ - readonly min: number; - /** - * The minimum recorded event loop delay. - * v17.4.0, v16.14.0 - */ - readonly minBigInt: bigint; - /** - * Returns the value at the given percentile. - * @since v11.10.0 - * @param percentile A percentile value in the range (0, 100]. - */ - percentile(percentile: number): number; - /** - * Returns the value at the given percentile. - * @since v17.4.0, v16.14.0 - * @param percentile A percentile value in the range (0, 100]. - */ - percentileBigInt(percentile: number): bigint; - /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v11.10.0 - */ - readonly percentiles: Map; - /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v17.4.0, v16.14.0 - */ - readonly percentilesBigInt: Map; - /** - * Resets the collected histogram data. - * @since v11.10.0 - */ - reset(): void; - /** - * The standard deviation of the recorded event loop delays. - * @since v11.10.0 - */ - readonly stddev: number; - } - interface IntervalHistogram extends Histogram { - /** - * Enables the update interval timer. Returns `true` if the timer was - * started, `false` if it was already started. - * @since v11.10.0 - */ - enable(): boolean; - /** - * Disables the update interval timer. Returns `true` if the timer was - * stopped, `false` if it was already stopped. - * @since v11.10.0 - */ - disable(): boolean; - } - interface RecordableHistogram extends Histogram { - /** - * @since v15.9.0, v14.18.0 - * @param val The amount to record in the histogram. - */ - record(val: number | bigint): void; - /** - * Calculates the amount of time (in nanoseconds) that has passed since the - * previous call to `recordDelta()` and records that amount in the histogram. - * @since v15.9.0, v14.18.0 - */ - recordDelta(): void; - /** - * Adds the values from `other` to this histogram. - * @since v17.4.0, v16.14.0 - */ - add(other: RecordableHistogram): void; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Creates an `IntervalHistogram` object that samples and reports the event loop - * delay over time. The delays will be reported in nanoseconds. - * - * Using a timer to detect approximate event loop delay works because the - * execution of timers is tied specifically to the lifecycle of the libuv - * event loop. That is, a delay in the loop will cause a delay in the execution - * of the timer, and those delays are specifically what this API is intended to - * detect. - * - * ```js - * import { monitorEventLoopDelay } from 'node:perf_hooks'; - * const h = monitorEventLoopDelay({ resolution: 20 }); - * h.enable(); - * // Do something. - * h.disable(); - * console.log(h.min); - * console.log(h.max); - * console.log(h.mean); - * console.log(h.stddev); - * console.log(h.percentiles); - * console.log(h.percentile(50)); - * console.log(h.percentile(99)); - * ``` - * @since v11.10.0 - */ - function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; - interface CreateHistogramOptions { - /** - * The minimum recordable value. Must be an integer value greater than 0. - * @default 1 - */ - min?: number | bigint | undefined; - /** - * The maximum recordable value. Must be an integer value greater than min. - * @default Number.MAX_SAFE_INTEGER - */ - max?: number | bigint | undefined; - /** - * The number of accuracy digits. Must be a number between 1 and 5. - * @default 3 - */ - figures?: number | undefined; - } - /** - * Returns a `RecordableHistogram`. - * @since v15.9.0, v14.18.0 - */ - function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; - import { - performance as _performance, - PerformanceEntry as _PerformanceEntry, - PerformanceMark as _PerformanceMark, - PerformanceMeasure as _PerformanceMeasure, - PerformanceObserver as _PerformanceObserver, - PerformanceObserverEntryList as _PerformanceObserverEntryList, - PerformanceResourceTiming as _PerformanceResourceTiming, - } from "perf_hooks"; - global { - /** - * `PerformanceEntry` is a global reference for `import { PerformanceEntry } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceentry - * @since v19.0.0 - */ - var PerformanceEntry: typeof globalThis extends { - onmessage: any; - PerformanceEntry: infer T; - } ? T - : typeof _PerformanceEntry; - /** - * `PerformanceMark` is a global reference for `import { PerformanceMark } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performancemark - * @since v19.0.0 - */ - var PerformanceMark: typeof globalThis extends { - onmessage: any; - PerformanceMark: infer T; - } ? T - : typeof _PerformanceMark; - /** - * `PerformanceMeasure` is a global reference for `import { PerformanceMeasure } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performancemeasure - * @since v19.0.0 - */ - var PerformanceMeasure: typeof globalThis extends { - onmessage: any; - PerformanceMeasure: infer T; - } ? T - : typeof _PerformanceMeasure; - /** - * `PerformanceObserver` is a global reference for `import { PerformanceObserver } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceobserver - * @since v19.0.0 - */ - var PerformanceObserver: typeof globalThis extends { - onmessage: any; - PerformanceObserver: infer T; - } ? T - : typeof _PerformanceObserver; - /** - * `PerformanceObserverEntryList` is a global reference for `import { PerformanceObserverEntryList } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceobserverentrylist - * @since v19.0.0 - */ - var PerformanceObserverEntryList: typeof globalThis extends { - onmessage: any; - PerformanceObserverEntryList: infer T; - } ? T - : typeof _PerformanceObserverEntryList; - /** - * `PerformanceResourceTiming` is a global reference for `import { PerformanceResourceTiming } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceresourcetiming - * @since v19.0.0 - */ - var PerformanceResourceTiming: typeof globalThis extends { - onmessage: any; - PerformanceResourceTiming: infer T; - } ? T - : typeof _PerformanceResourceTiming; - /** - * `performance` is a global reference for `import { performance } from 'node:perf_hooks'` - * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performance - * @since v16.0.0 - */ - var performance: typeof globalThis extends { - onmessage: any; - performance: infer T; - } ? T - : typeof _performance; - } -} -declare module "node:perf_hooks" { - export * from "perf_hooks"; -} diff --git a/node_modules/@types/node/process.d.ts b/node_modules/@types/node/process.d.ts deleted file mode 100644 index e7fd20b..0000000 --- a/node_modules/@types/node/process.d.ts +++ /dev/null @@ -1,1912 +0,0 @@ -declare module "process" { - 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 { - // this namespace merge is here because these are specifically used - // as the type for process.stdin, process.stdout, and process.stderr. - // they can't live in tty.d.ts because we need to disambiguate the imported name. - interface ReadStream extends tty.ReadStream {} - interface WriteStream extends tty.WriteStream {} - interface MemoryUsageFn { - /** - * The `process.memoryUsage()` method iterate over each page to gather informations about memory - * usage which can be slow depending on the program memory allocations. - */ - (): MemoryUsage; - /** - * method returns an integer representing the Resident Set Size (RSS) in bytes. - */ - rss(): number; - } - interface MemoryUsage { - /** - * Resident Set Size, is the amount of space occupied in the main memory device (that is a subset of the total allocated memory) for the - * process, including all C++ and JavaScript objects and code. - */ - rss: number; - /** - * Refers to V8's memory usage. - */ - heapTotal: number; - /** - * Refers to V8's memory usage. - */ - heapUsed: number; - external: number; - /** - * Refers to memory allocated for `ArrayBuffer`s and `SharedArrayBuffer`s, including all Node.js Buffers. This is also included - * in the external value. When Node.js is used as an embedded library, this value may be `0` because allocations for `ArrayBuffer`s - * may not be tracked in that case. - */ - arrayBuffers: number; - } - interface CpuUsage { - user: number; - system: number; - } - interface ProcessRelease { - name: string; - sourceUrl?: string | undefined; - headersUrl?: string | undefined; - libUrl?: string | undefined; - lts?: string | undefined; - } - interface ProcessVersions extends Dict { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - modules: string; - openssl: string; - } - type Platform = - | "aix" - | "android" - | "darwin" - | "freebsd" - | "haiku" - | "linux" - | "openbsd" - | "sunos" - | "win32" - | "cygwin" - | "netbsd"; - type Architecture = - | "arm" - | "arm64" - | "ia32" - | "loong64" - | "mips" - | "mipsel" - | "ppc" - | "ppc64" - | "riscv64" - | "s390" - | "s390x" - | "x64"; - type Signals = - | "SIGABRT" - | "SIGALRM" - | "SIGBUS" - | "SIGCHLD" - | "SIGCONT" - | "SIGFPE" - | "SIGHUP" - | "SIGILL" - | "SIGINT" - | "SIGIO" - | "SIGIOT" - | "SIGKILL" - | "SIGPIPE" - | "SIGPOLL" - | "SIGPROF" - | "SIGPWR" - | "SIGQUIT" - | "SIGSEGV" - | "SIGSTKFLT" - | "SIGSTOP" - | "SIGSYS" - | "SIGTERM" - | "SIGTRAP" - | "SIGTSTP" - | "SIGTTIN" - | "SIGTTOU" - | "SIGUNUSED" - | "SIGURG" - | "SIGUSR1" - | "SIGUSR2" - | "SIGVTALRM" - | "SIGWINCH" - | "SIGXCPU" - | "SIGXFSZ" - | "SIGBREAK" - | "SIGLOST" - | "SIGINFO"; - type UncaughtExceptionOrigin = "uncaughtException" | "unhandledRejection"; - type MultipleResolveType = "resolve" | "reject"; - type BeforeExitListener = (code: number) => void; - type DisconnectListener = () => void; - type ExitListener = (code: number) => void; - type RejectionHandledListener = (promise: Promise) => void; - type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; - /** - * Most of the time the unhandledRejection will be an Error, but this should not be relied upon - * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error. - */ - type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void; - type WarningListener = (warning: Error) => void; - type MessageListener = (message: unknown, sendHandle: unknown) => void; - type SignalsListener = (signal: Signals) => void; - type MultipleResolveListener = ( - type: MultipleResolveType, - promise: Promise, - value: unknown, - ) => void; - type WorkerListener = (worker: Worker) => void; - interface Socket extends ReadWriteStream { - isTTY?: true | undefined; - } - // Alias for compatibility - interface ProcessEnv extends Dict { - /** - * Can be used to change the default timezone at runtime - */ - TZ?: string; - } - interface 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`. - * - * 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. - * ```js - * import { hrtime } from 'node:process'; - * - * const start = hrtime.bigint(); - * // 191051479007711n - * - * setTimeout(() => { - * const end = hrtime.bigint(); - * // 191052633396993n - * - * console.log(`Benchmark took ${end - start} nanoseconds`); - * // Benchmark took 1154389282 nanoseconds - * }, 1000); - * ``` - */ - bigint(): bigint; - } - interface ProcessPermission { - /** - * Verifies that the process is able to access the given scope and reference. - * If no reference is provided, a global scope is assumed, for instance, `process.permission.has('fs.read')` - * will check if the process has ALL file system read permissions. - * - * The reference has a meaning based on the provided scope. For example, the reference when the scope is File System means files and folders. - * - * The available scopes are: - * - * * `fs` - All File System - * * `fs.read` - File System read operations - * * `fs.write` - File System write operations - * * `child` - Child process spawning operations - * * `worker` - Worker thread spawning operation - * - * ```js - * // Check if the process has permission to read the README file - * process.permission.has('fs.read', './README.md'); - * // Check if the process has read permission operations - * process.permission.has('fs.read'); - * ``` - * @since v20.0.0 - */ - 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. - */ - directory: string; - /** - * 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 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): object; - /** - * If true, a diagnostic report is generated on fatal errors, - * such as out of memory errors or failed C++ assertions. - * @default false - */ - reportOnFatalError: boolean; - /** - * If true, a diagnostic report is generated when the process - * receives the signal specified by process.report.signal. - * @default false - */ - reportOnSignal: boolean; - /** - * If true, a diagnostic report is generated on uncaught exception. - * @default false - */ - reportOnUncaughtException: boolean; - /** - * The signal used to trigger the creation of a diagnostic report. - * @default 'SIGUSR2' - */ - signal: Signals; - /** - * 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. - * - * 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 err A custom error used for reporting the JavaScript stack. - * @return Filename of the generated report. - */ - writeReport(fileName?: string, err?: Error): string; - writeReport(err?: Error): string; - } - interface ResourceUsage { - fsRead: number; - fsWrite: number; - involuntaryContextSwitches: number; - ipcReceived: number; - ipcSent: number; - majorPageFault: number; - maxRSS: number; - minorPageFault: number; - sharedMemorySize: number; - signalsCount: number; - swappedOut: number; - systemCPUTime: number; - unsharedDataSize: number; - unsharedStackSize: number; - userCPUTime: number; - voluntaryContextSwitches: number; - } - interface EmitWarningOptions { - /** - * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. - * - * @default 'Warning' - */ - type?: string | undefined; - /** - * A unique identifier for the warning instance being emitted. - */ - code?: string | undefined; - /** - * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. - * - * @default process.emitWarning - */ - ctor?: Function | undefined; - /** - * Additional text to include with the error. - */ - detail?: string | undefined; - } - interface ProcessConfig { - readonly target_defaults: { - readonly cflags: any[]; - readonly default_configuration: string; - readonly defines: string[]; - readonly include_dirs: string[]; - readonly libraries: string[]; - }; - readonly variables: { - readonly clang: number; - readonly host_arch: string; - readonly node_install_npm: boolean; - readonly node_install_waf: boolean; - readonly node_prefix: string; - readonly node_shared_openssl: boolean; - readonly node_shared_v8: boolean; - readonly node_shared_zlib: boolean; - readonly node_use_dtrace: boolean; - readonly node_use_etw: boolean; - readonly node_use_openssl: boolean; - readonly target_arch: string; - readonly v8_no_strict_aliasing: number; - readonly v8_use_snapshot: boolean; - readonly visibility: string; - }; - } - interface Process extends EventEmitter { - /** - * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is - * a `Writable` stream. - * - * For example, to copy `process.stdin` to `process.stdout`: - * - * ```js - * import { stdin, stdout } from 'node:process'; - * - * stdin.pipe(stdout); - * ``` - * - * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stdout: WriteStream & { - fd: 1; - }; - /** - * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is - * a `Writable` stream. - * - * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stderr: WriteStream & { - fd: 2; - }; - /** - * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is - * a `Readable` stream. - * - * For details of how to read from `stdin` see `readable.read()`. - * - * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that - * is compatible with scripts written for Node.js prior to v0.10\. - * For more information see `Stream compatibility`. - * - * In "old" streams mode the `stdin` stream is paused by default, so one - * must call `process.stdin.resume()` to read from it. Note also that calling `process.stdin.resume()` itself would switch stream to "old" mode. - */ - stdin: ReadStream & { - fd: 0; - }; - /** - * The `process.argv` property returns an array containing the command-line - * arguments passed when the Node.js process was launched. The first element will - * be {@link execPath}. See `process.argv0` if access to the original value - * of `argv[0]` is needed. The second element will be the path to the JavaScript - * file being executed. The remaining elements will be any additional command-line - * arguments. - * - * For example, assuming the following script for `process-args.js`: - * - * ```js - * import { argv } from 'node:process'; - * - * // print process.argv - * argv.forEach((val, index) => { - * console.log(`${index}: ${val}`); - * }); - * ``` - * - * Launching the Node.js process as: - * - * ```bash - * node process-args.js one two=three four - * ``` - * - * Would generate the output: - * - * ```text - * 0: /usr/local/bin/node - * 1: /Users/mjr/work/node/process-args.js - * 2: one - * 3: two=three - * 4: four - * ``` - * @since v0.1.27 - */ - argv: string[]; - /** - * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. - * - * ```console - * $ bash -c 'exec -a customArgv0 ./node' - * > process.argv[0] - * '/Volumes/code/external/node/out/Release/node' - * > process.argv0 - * 'customArgv0' - * ``` - * @since v6.4.0 - */ - argv0: string; - /** - * The `process.execArgv` property returns the set of Node.js-specific command-line - * options passed when the Node.js process was launched. These options do not - * appear in the array returned by the {@link argv} property, and do not - * include the Node.js executable, the name of the script, or any options following - * the script name. These options are useful in order to spawn child processes with - * the same execution environment as the parent. - * - * ```bash - * node --icu-data-dir=./foo --require ./bar.js script.js --version - * ``` - * - * Results in `process.execArgv`: - * - * ```js - * ["--icu-data-dir=./foo", "--require", "./bar.js"] - * ``` - * - * And `process.argv`: - * - * ```js - * ['/usr/local/bin/node', 'script.js', '--version'] - * ``` - * - * Refer to `Worker constructor` for the detailed behavior of worker - * threads with this property. - * @since v0.7.7 - */ - execArgv: string[]; - /** - * The `process.execPath` property returns the absolute pathname of the executable - * that started the Node.js process. Symbolic links, if any, are resolved. - * - * ```js - * '/usr/local/bin/node' - * ``` - * @since v0.1.100 - */ - execPath: string; - /** - * The `process.abort()` method causes the Node.js process to exit immediately and - * generate a core file. - * - * This feature is not available in `Worker` threads. - * @since v0.7.0 - */ - abort(): never; - /** - * The `process.chdir()` method changes the current working directory of the - * Node.js process or throws an exception if doing so fails (for instance, if - * the specified `directory` does not exist). - * - * ```js - * import { chdir, cwd } from 'node:process'; - * - * console.log(`Starting directory: ${cwd()}`); - * try { - * chdir('/tmp'); - * console.log(`New directory: ${cwd()}`); - * } catch (err) { - * console.error(`chdir: ${err}`); - * } - * ``` - * - * This feature is not available in `Worker` threads. - * @since v0.1.17 - */ - chdir(directory: string): void; - /** - * The `process.cwd()` method returns the current working directory of the Node.js - * process. - * - * ```js - * import { cwd } from 'node:process'; - * - * console.log(`Current directory: ${cwd()}`); - * ``` - * @since v0.1.8 - */ - cwd(): string; - /** - * The port used by the Node.js debugger when enabled. - * - * ```js - * import process from 'node:process'; - * - * process.debugPort = 5858; - * ``` - * @since v0.7.2 - */ - debugPort: number; - /** - * The `process.dlopen()` method allows dynamically loading shared objects. It is primarily used by `require()` to load C++ Addons, and - * 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-v22.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 - * are then accessible via `module.exports`. - * - * The example below shows how to load a C++ Addon, named `local.node`, that exports a `foo` function. All the symbols are loaded before the call returns, by passing the `RTLD_NOW` constant. - * In this example the constant is assumed to be available. - * - * ```js - * import { dlopen } from 'node:process'; - * import { constants } from 'node:os'; - * import { fileURLToPath } from 'node:url'; - * - * const module = { exports: {} }; - * dlopen(module, fileURLToPath(new URL('local.node', import.meta.url)), - * constants.dlopen.RTLD_NOW); - * module.exports.foo(); - * ``` - */ - dlopen(module: object, filename: string, flags?: number): void; - /** - * The `process.emitWarning()` method can be used to emit custom or application - * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. - * - * ```js - * import { emitWarning } from 'node:process'; - * - * // Emit a warning using a string. - * emitWarning('Something happened!'); - * // Emits: (node: 56338) Warning: Something happened! - * ``` - * - * ```js - * import { emitWarning } from 'node:process'; - * - * // Emit a warning using a string and a type. - * emitWarning('Something Happened!', 'CustomWarning'); - * // Emits: (node:56338) CustomWarning: Something Happened! - * ``` - * - * ```js - * import { emitWarning } from 'node:process'; - * - * emitWarning('Something happened!', 'CustomWarning', 'WARN001'); - * // Emits: (node:56338) [WARN001] CustomWarning: Something happened! - * ```js - * - * In each of the previous examples, an `Error` object is generated internally by `process.emitWarning()` and passed through to the `'warning'` handler. - * - * ```js - * import process from 'node:process'; - * - * process.on('warning', (warning) => { - * console.warn(warning.name); // 'Warning' - * console.warn(warning.message); // 'Something happened!' - * console.warn(warning.code); // 'MY_WARNING' - * console.warn(warning.stack); // Stack trace - * console.warn(warning.detail); // 'This is some additional information' - * }); - * ``` - * - * If `warning` is passed as an `Error` object, it will be passed through to the `'warning'` event handler - * unmodified (and the optional `type`, `code` and `ctor` arguments will be ignored): - * - * ```js - * import { emitWarning } from 'node:process'; - * - * // Emit a warning using an Error object. - * const myWarning = new Error('Something happened!'); - * // Use the Error name property to specify the type name - * myWarning.name = 'CustomWarning'; - * myWarning.code = 'WARN001'; - * - * emitWarning(myWarning); - * // Emits: (node:56338) [WARN001] CustomWarning: Something happened! - * ``` - * - * A `TypeError` is thrown if `warning` is anything other than a string or `Error` object. - * - * While process warnings use `Error` objects, the process warning mechanism is not a replacement for normal error handling mechanisms. - * - * The following additional handling is implemented if the warning `type` is `'DeprecationWarning'`: - * * If the `--throw-deprecation` command-line flag is used, the deprecation warning is thrown as an exception rather than being emitted as an event. - * * If the `--no-deprecation` command-line flag is used, the deprecation warning is suppressed. - * * If the `--trace-deprecation` command-line flag is used, the deprecation warning is printed to `stderr` along with the full stack trace. - * @since v8.0.0 - * @param warning The warning to emit. - */ - emitWarning(warning: string | Error, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; - emitWarning(warning: string | Error, options?: EmitWarningOptions): void; - /** - * The `process.env` property returns an object containing the user environment. - * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). - * - * An example of this object looks like: - * - * ```js - * { - * TERM: 'xterm-256color', - * SHELL: '/usr/local/bin/bash', - * USER: 'maciej', - * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - * PWD: '/Users/maciej', - * EDITOR: 'vim', - * SHLVL: '1', - * HOME: '/Users/maciej', - * LOGNAME: 'maciej', - * _: '/usr/local/bin/node' - * } - * ``` - * - * It is possible to modify this object, but such modifications will not be - * reflected outside the Node.js process, or (unless explicitly requested) - * to other `Worker` threads. - * In other words, the following example would not work: - * - * ```bash - * node -e 'process.env.foo = "bar"' && echo $foo - * ``` - * - * While the following will: - * - * ```js - * import { env } from 'node:process'; - * - * env.foo = 'bar'; - * console.log(env.foo); - * ``` - * - * Assigning a property on `process.env` will implicitly convert the value - * to a string. **This behavior is deprecated.** Future versions of Node.js may - * throw an error when the value is not a string, number, or boolean. - * - * ```js - * import { env } from 'node:process'; - * - * env.test = null; - * console.log(env.test); - * // => 'null' - * env.test = undefined; - * console.log(env.test); - * // => 'undefined' - * ``` - * - * Use `delete` to delete a property from `process.env`. - * - * ```js - * import { env } from 'node:process'; - * - * env.TEST = 1; - * delete env.TEST; - * console.log(env.TEST); - * // => undefined - * ``` - * - * On Windows operating systems, environment variables are case-insensitive. - * - * ```js - * import { env } from 'node:process'; - * - * env.TEST = 1; - * console.log(env.test); - * // => 1 - * ``` - * - * Unless explicitly specified when creating a `Worker` instance, - * each `Worker` thread has its own copy of `process.env`, based on its - * parent thread's `process.env`, or whatever was specified as the `env` option - * to the `Worker` constructor. Changes to `process.env` will not be visible - * across `Worker` threads, and only the main thread can make changes that - * are visible to the operating system or to native add-ons. On Windows, a copy of `process.env` on a `Worker` instance operates in a case-sensitive manner - * unlike the main thread. - * @since v0.1.27 - */ - env: ProcessEnv; - /** - * The `process.exit()` method instructs Node.js to terminate the process - * synchronously with an exit status of `code`. If `code` is omitted, exit uses - * either the 'success' code `0` or the value of `process.exitCode` if it has been - * set. Node.js will not terminate until all the `'exit'` event listeners are - * called. - * - * To exit with a 'failure' code: - * - * ```js - * import { exit } from 'node:process'; - * - * exit(1); - * ``` - * - * The shell that executed Node.js should see the exit code as `1`. - * - * Calling `process.exit()` will force the process to exit as quickly as possible - * even if there are still asynchronous operations pending that have not yet - * completed fully, including I/O operations to `process.stdout` and `process.stderr`. - * - * In most situations, it is not actually necessary to call `process.exit()` explicitly. The Node.js process will exit on its own _if there is no additional_ - * _work pending_ in the event loop. The `process.exitCode` property can be set to - * tell the process which exit code to use when the process exits gracefully. - * - * For instance, the following example illustrates a _misuse_ of the `process.exit()` method that could lead to data printed to stdout being - * truncated and lost: - * - * ```js - * import { exit } from 'node:process'; - * - * // This is an example of what *not* to do: - * if (someConditionNotMet()) { - * printUsageToStdout(); - * exit(1); - * } - * ``` - * - * The reason this is problematic is because writes to `process.stdout` in Node.js - * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js - * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. - * - * Rather than calling `process.exit()` directly, the code _should_ set the `process.exitCode` and allow the process to exit naturally by avoiding - * scheduling any additional work for the event loop: - * - * ```js - * import process from 'node:process'; - * - * // How to properly set the exit code while letting - * // the process exit gracefully. - * if (someConditionNotMet()) { - * printUsageToStdout(); - * process.exitCode = 1; - * } - * ``` - * - * If it is necessary to terminate the Node.js process due to an error condition, - * throwing an _uncaught_ error and allowing the process to terminate accordingly - * is safer than calling `process.exit()`. - * - * In `Worker` threads, this function stops the current thread rather - * than the current 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; - /** - * A number which will be the process exit code, when the process either - * exits gracefully, or is exited via {@link exit} without specifying - * a code. - * - * Specifying a code to {@link exit} will override any - * previous setting of `process.exitCode`. - * @default undefined - * @since v0.11.8 - */ - exitCode?: number | string | number | 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(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(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. - * - * ```js - * import { getActiveResourcesInfo } from 'node:process'; - * import { setTimeout } from 'node:timers'; - - * console.log('Before:', getActiveResourcesInfo()); - * setTimeout(() => {}, 1000); - * console.log('After:', getActiveResourcesInfo()); - * // Prints: - * // Before: [ 'TTYWrap', 'TTYWrap', 'TTYWrap' ] - * // After: [ 'TTYWrap', 'TTYWrap', 'TTYWrap', 'Timeout' ] - * ``` - * @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: 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).) - * - * ```js - * import process from 'node:process'; - * - * if (process.getgid) { - * console.log(`Current gid: ${process.getgid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.31 - */ - getgid?: () => number; - /** - * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a - * numeric ID or a group name - * string. If a group name is specified, this method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'node:process'; - * - * if (process.getgid && process.setgid) { - * console.log(`Current gid: ${process.getgid()}`); - * try { - * process.setgid(501); - * console.log(`New gid: ${process.getgid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.31 - * @param id The group name or ID - */ - setgid?: (id: number | string) => void; - /** - * The `process.getuid()` method returns the numeric user identity of the process. - * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) - * - * ```js - * import process from 'node:process'; - * - * if (process.getuid) { - * console.log(`Current uid: ${process.getuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.28 - */ - getuid?: () => number; - /** - * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a - * numeric ID or a username string. - * If a username is specified, the method blocks while resolving the associated - * numeric ID. - * - * ```js - * import process from 'node:process'; - * - * if (process.getuid && process.setuid) { - * console.log(`Current uid: ${process.getuid()}`); - * try { - * process.setuid(501); - * console.log(`New uid: ${process.getuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.28 - */ - setuid?: (id: number | string) => void; - /** - * The `process.geteuid()` method returns the numerical effective user identity of - * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) - * - * ```js - * import process from 'node:process'; - * - * if (process.geteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - geteuid?: () => number; - /** - * The `process.seteuid()` method sets the effective user identity of the process. - * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username - * string. If a username is specified, the method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'node:process'; - * - * if (process.geteuid && process.seteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * try { - * process.seteuid(501); - * console.log(`New uid: ${process.geteuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A user name or ID - */ - seteuid?: (id: number | string) => void; - /** - * The `process.getegid()` method returns the numerical effective group identity - * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) - * - * ```js - * import process from 'node:process'; - * - * if (process.getegid) { - * console.log(`Current gid: ${process.getegid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - getegid?: () => number; - /** - * The `process.setegid()` method sets the effective group identity of the process. - * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group - * name string. If a group name is specified, this method blocks while resolving - * the associated a numeric ID. - * - * ```js - * import process from 'node:process'; - * - * if (process.getegid && process.setegid) { - * console.log(`Current gid: ${process.getegid()}`); - * try { - * process.setegid(501); - * console.log(`New gid: ${process.getegid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A group name or ID - */ - setegid?: (id: number | string) => void; - /** - * The `process.getgroups()` method returns an array with the supplementary group - * IDs. POSIX leaves it unspecified if the effective group ID is included but - * Node.js ensures it always is. - * - * ```js - * import process from 'node:process'; - * - * if (process.getgroups) { - * console.log(process.getgroups()); // [ 16, 21, 297 ] - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.9.4 - */ - getgroups?: () => number[]; - /** - * The `process.setgroups()` method sets the supplementary group IDs for the - * Node.js process. This is a privileged operation that requires the Node.js - * process to have `root` or the `CAP_SETGID` capability. - * - * The `groups` array can contain numeric group IDs, group names, or both. - * - * ```js - * import process from 'node:process'; - * - * if (process.getgroups && process.setgroups) { - * try { - * process.setgroups([501]); - * console.log(process.getgroups()); // new groups - * } catch (err) { - * console.log(`Failed to set groups: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.9.4 - */ - setgroups?: (groups: ReadonlyArray) => void; - /** - * The `process.setUncaughtExceptionCaptureCallback()` function sets a function - * that will be invoked when an uncaught exception occurs, which will receive the - * exception value itself as its first argument. - * - * If such a function is set, the `'uncaughtException'` event will - * not be emitted. If `--abort-on-uncaught-exception` was passed from the - * command line or set through `v8.setFlagsFromString()`, the process will - * not abort. Actions configured to take place on exceptions such as report - * generations will be affected too - * - * To unset the capture function, `process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this - * method with a non-`null` argument while another capture function is set will - * throw an error. - * - * Using this function is mutually exclusive with using the deprecated `domain` built-in module. - * @since v9.3.0 - */ - setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; - /** - * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. - * @since v9.3.0 - */ - hasUncaughtExceptionCaptureCallback(): boolean; - /** - * The `process.sourceMapsEnabled` property returns whether the [Source Map v3](https://sourcemaps.info/spec.html) support for stack traces is enabled. - * @since v20.7.0 - * @experimental - */ - readonly sourceMapsEnabled: boolean; - /** - * This function enables or disables the [Source Map v3](https://sourcemaps.info/spec.html) support for - * stack traces. - * - * It provides same features as launching Node.js process with commandline options `--enable-source-maps`. - * - * Only source maps in JavaScript files that are loaded after source maps has been - * enabled will be parsed and loaded. - * @since v16.6.0, v14.18.0 - * @experimental - */ - setSourceMapsEnabled(value: boolean): void; - /** - * The `process.version` property contains the Node.js version string. - * - * ```js - * import { version } from 'node:process'; - * - * console.log(`Version: ${version}`); - * // Version: v14.8.0 - * ``` - * - * To get the version string without the prepended _v_, use`process.versions.node`. - * @since v0.1.3 - */ - readonly version: string; - /** - * The `process.versions` property returns an object listing the version strings of - * Node.js and its dependencies. `process.versions.modules` indicates the current - * ABI version, which is increased whenever a C++ API changes. Node.js will refuse - * to load modules that were compiled against a different module ABI version. - * - * ```js - * import { versions } from 'node:process'; - * - * console.log(versions); - * ``` - * - * Will generate an object similar to: - * - * ```console - * { node: '20.2.0', - * acorn: '8.8.2', - * ada: '2.4.0', - * ares: '1.19.0', - * base64: '0.5.0', - * brotli: '1.0.9', - * cjs_module_lexer: '1.2.2', - * cldr: '43.0', - * icu: '73.1', - * llhttp: '8.1.0', - * modules: '115', - * napi: '8', - * nghttp2: '1.52.0', - * nghttp3: '0.7.0', - * ngtcp2: '0.8.1', - * openssl: '3.0.8+quic', - * simdutf: '3.2.9', - * tz: '2023c', - * undici: '5.22.0', - * unicode: '15.0', - * uv: '1.44.2', - * uvwasi: '0.0.16', - * v8: '11.3.244.8-node.9', - * zlib: '1.2.13' } - * ``` - * @since v0.2.0 - */ - readonly versions: ProcessVersions; - /** - * The `process.config` property returns a frozen `Object` containing the - * JavaScript representation of the configure options used to compile the current - * Node.js executable. This is the same as the `config.gypi` file that was produced - * when running the `./configure` script. - * - * An example of the possible output looks like: - * - * ```js - * { - * target_defaults: - * { cflags: [], - * default_configuration: 'Release', - * defines: [], - * include_dirs: [], - * libraries: [] }, - * variables: - * { - * host_arch: 'x64', - * napi_build_version: 5, - * node_install_npm: 'true', - * node_prefix: '', - * node_shared_cares: 'false', - * node_shared_http_parser: 'false', - * node_shared_libuv: 'false', - * node_shared_zlib: 'false', - * node_use_openssl: 'true', - * node_shared_openssl: 'false', - * strict_aliasing: 'true', - * target_arch: 'x64', - * v8_use_snapshot: 1 - * } - * } - * ``` - * @since v0.7.7 - */ - readonly config: ProcessConfig; - /** - * The `process.kill()` method sends the `signal` to the process identified by`pid`. - * - * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. - * - * This method will throw an error if the target `pid` does not exist. As a special - * case, a signal of `0` can be used to test for the existence of a process. - * Windows platforms will throw an error if the `pid` is used to kill a process - * group. - * - * Even though the name of this function is `process.kill()`, it is really just a - * signal sender, like the `kill` system call. The signal sent may do something - * other than kill the target process. - * - * ```js - * import process, { kill } from 'node:process'; - * - * process.on('SIGHUP', () => { - * console.log('Got SIGHUP signal.'); - * }); - * - * setTimeout(() => { - * console.log('Exiting.'); - * process.exit(0); - * }, 100); - * - * kill(process.pid, 'SIGHUP'); - * ``` - * - * When `SIGUSR1` is received by a Node.js process, Node.js will start the - * debugger. See `Signal Events`. - * @since v0.0.6 - * @param pid A process ID - * @param [signal='SIGTERM'] The signal to send, either as a string or number. - */ - kill(pid: number, signal?: string | number): true; - /** - * Loads the environment configuration from a `.env` file into `process.env`. If - * the file is not found, error will be thrown. - * - * To load a specific .env file by specifying its path, use the following code: - * - * ```js - * import { loadEnvFile } from 'node:process'; - * - * loadEnvFile('./development.env') - * ``` - * @since v20.12.0 - * @param path The path to the .env file - */ - loadEnvFile(path?: string | URL | Buffer): void; - /** - * The `process.pid` property returns the PID of the process. - * - * ```js - * import { pid } from 'node:process'; - * - * console.log(`This process is pid ${pid}`); - * ``` - * @since v0.1.15 - */ - readonly pid: number; - /** - * The `process.ppid` property returns the PID of the parent of the - * current process. - * - * ```js - * import { ppid } from 'node:process'; - * - * console.log(`The parent process is pid ${ppid}`); - * ``` - * @since v9.2.0, v8.10.0, v6.13.0 - */ - readonly ppid: number; - /** - * 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 - * the current value of `ps`. - * - * When a new value is assigned, different platforms will impose different maximum - * length restrictions on the title. Usually such restrictions are quite limited. - * For instance, on Linux and macOS, `process.title` is limited to the size of the - * binary name plus the length of the command-line arguments because setting the `process.title` overwrites the `argv` memory of the process. Node.js v0.8 - * allowed for longer process title strings by also overwriting the `environ` memory but that was potentially insecure and confusing in some (rather obscure) - * cases. - * - * Assigning a value to `process.title` might not result in an accurate label - * within process manager applications such as macOS Activity Monitor or Windows - * Services Manager. - * @since v0.1.104 - */ - 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'`. - * - * ```js - * import { arch } from 'node:process'; - * - * console.log(`This processor architecture is ${arch}`); - * ``` - * @since v0.5.0 - */ - readonly arch: Architecture; - /** - * The `process.platform` property returns a string identifying the operating - * system platform for which the Node.js binary was compiled. - * - * Currently possible values are: - * - * * `'aix'` - * * `'darwin'` - * * `'freebsd'` - * * `'linux'` - * * `'openbsd'` - * * `'sunos'` - * * `'win32'` - * - * ```js - * import { platform } from 'node:process'; - * - * console.log(`This platform is ${platform}`); - * ``` - * - * The value `'android'` may also be returned if the Node.js is built on the - * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.1.16 - */ - readonly platform: Platform; - /** - * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at - * runtime, `require.main` may still refer to the original main module in - * modules that were required before the change occurred. Generally, it's - * safe to assume that the two refer to the same module. - * - * As with `require.main`, `process.mainModule` will be `undefined` if there - * is no entry script. - * @since v0.1.17 - * @deprecated Since v14.0.0 - Use `main` instead. - */ - mainModule?: Module | undefined; - memoryUsage: MemoryUsageFn; - /** - * Gets the amount of memory available to the process (in bytes) based on - * limits imposed by the OS. If there is no such constraint, or the constraint - * is unknown, `0` is returned. - * - * 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-v22.x/api/process.html#processavailablememory) for more information. - * @experimental - * @since v20.13.0 - */ - availableMemory(): number; - /** - * The `process.cpuUsage()` method returns the user and system CPU time usage of - * the current process, in an object with properties `user` and `system`, whose - * values are microsecond values (millionth of a second). These values measure time - * spent in user and system code respectively, and may end up being greater than - * actual elapsed time if multiple CPU cores are performing work for this process. - * - * The result of a previous call to `process.cpuUsage()` can be passed as the - * argument to the function, to get a diff reading. - * - * ```js - * import { cpuUsage } from 'node:process'; - * - * const startUsage = cpuUsage(); - * // { user: 38579, system: 6986 } - * - * // spin the CPU for 500 milliseconds - * const now = Date.now(); - * while (Date.now() - now < 500); - * - * console.log(cpuUsage(startUsage)); - * // { user: 514883, system: 11226 } - * ``` - * @since v6.1.0 - * @param previousValue A previous return value from calling `process.cpuUsage()` - */ - cpuUsage(previousValue?: CpuUsage): CpuUsage; - /** - * `process.nextTick()` adds `callback` to the "next tick queue". This queue is - * fully drained after the current operation on the JavaScript stack runs to - * completion and before the event loop is allowed to continue. It's possible to - * create an infinite loop if one were to recursively call `process.nextTick()`. - * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. - * - * ```js - * import { nextTick } from 'node:process'; - * - * console.log('start'); - * nextTick(() => { - * console.log('nextTick callback'); - * }); - * console.log('scheduled'); - * // Output: - * // start - * // scheduled - * // nextTick callback - * ``` - * - * This is important when developing APIs in order to give users the opportunity - * to assign event handlers _after_ an object has been constructed but before any - * I/O has occurred: - * - * ```js - * import { nextTick } from 'node:process'; - * - * function MyThing(options) { - * this.setupOptions(options); - * - * nextTick(() => { - * this.startDoingStuff(); - * }); - * } - * - * const thing = new MyThing(); - * thing.getReadyForStuff(); - * - * // thing.startDoingStuff() gets called now, not before. - * ``` - * - * It is very important for APIs to be either 100% synchronous or 100% - * asynchronous. Consider this example: - * - * ```js - * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! - * function maybeSync(arg, cb) { - * if (arg) { - * cb(); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * - * This API is hazardous because in the following case: - * - * ```js - * const maybeTrue = Math.random() > 0.5; - * - * maybeSync(maybeTrue, () => { - * foo(); - * }); - * - * bar(); - * ``` - * - * It is not clear whether `foo()` or `bar()` will be called first. - * - * The following approach is much better: - * - * ```js - * import { nextTick } from 'node:process'; - * - * function definitelyAsync(arg, cb) { - * if (arg) { - * nextTick(cb); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * @since v0.1.26 - * @param args Additional arguments to pass when invoking the `callback` - */ - nextTick(callback: Function, ...args: any[]): void; - /** - * This API is available through the [--experimental-permission](https://nodejs.org/api/cli.html#--experimental-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). - * @since v20.0.0 - */ - permission: ProcessPermission; - /** - * The `process.release` property returns an `Object` containing metadata related - * to the current release, including URLs for the source tarball and headers-only - * tarball. - * - * `process.release` contains the following properties: - * - * ```js - * { - * name: 'node', - * lts: 'Hydrogen', - * sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz', - * headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz', - * libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib' - * } - * ``` - * - * In custom builds from non-release versions of the source tree, only the `name` property may be present. The additional properties should not be - * relied upon to exist. - * @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; - }; - /** - * `process.umask()` returns the Node.js process's file mode creation mask. Child - * processes inherit the mask from the parent process. - * @since v0.1.19 - * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential - * security vulnerability. There is no safe, cross-platform alternative API. - */ - umask(): number; - /** - * Can only be set if not in worker thread. - */ - umask(mask: string | number): number; - /** - * The `process.uptime()` method returns the number of seconds the current Node.js - * process has been running. - * - * The return value includes fractions of a second. Use `Math.floor()` to get whole - * seconds. - * @since v0.5.0 - */ - uptime(): number; - hrtime: HRTime; - /** - * If the Node.js process was spawned with an IPC channel, the process.channel property is a reference to the IPC channel. - * 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; - }; - /** - * 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. - * - * If Node.js was not spawned with an IPC channel, `process.send` will be `undefined`. - * - * The message goes through serialization and parsing. The resulting message might - * not be the same as what is originally sent. - * @since v0.5.9 - * @param options used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send?( - message: any, - sendHandle?: any, - options?: { - keepOpen?: boolean | undefined; - }, - callback?: (error: Error | null) => void, - ): boolean; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the - * IPC channel to the parent process, allowing the child process to exit gracefully - * once there are no other connections keeping it alive. - * - * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. - * - * If the Node.js process was not spawned with an IPC channel, `process.disconnect()` will be `undefined`. - * @since v0.7.2 - */ - disconnect(): void; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return `true` so long as the IPC - * channel is connected and will return `false` after `process.disconnect()` is called. - * - * Once `process.connected` is `false`, it is no longer possible to send messages - * over the IPC channel using `process.send()`. - * @since v0.7.2 - */ - connected: boolean; - /** - * The `process.allowedNodeEnvironmentFlags` property is a special, - * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. - * - * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides `Set.prototype.has` to recognize several different possible flag - * representations. `process.allowedNodeEnvironmentFlags.has()` will - * return `true` in the following cases: - * - * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g., `inspect-brk` for `--inspect-brk`, or `r` for `-r`. - * * Flags passed through to V8 (as listed in `--v8-options`) may replace - * one or more _non-leading_ dashes for an underscore, or vice-versa; - * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, - * etc. - * * Flags may contain one or more equals (`=`) characters; all - * characters after and including the first equals will be ignored; - * e.g., `--stack-trace-limit=100`. - * * Flags _must_ be allowable within `NODE_OPTIONS`. - * - * When iterating over `process.allowedNodeEnvironmentFlags`, flags will - * appear only _once_; each will begin with one or more dashes. Flags - * passed through to V8 will contain underscores instead of non-leading - * dashes: - * - * ```js - * import { allowedNodeEnvironmentFlags } from 'node:process'; - * - * allowedNodeEnvironmentFlags.forEach((flag) => { - * // -r - * // --inspect-brk - * // --abort_on_uncaught_exception - * // ... - * }); - * ``` - * - * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail - * silently. - * - * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will - * contain what _would have_ been allowable. - * @since v10.10.0 - */ - allowedNodeEnvironmentFlags: ReadonlySet; - /** - * `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-v22.x/api/report.html). - * @since v11.8.0 - */ - report: ProcessReport; - /** - * ```js - * import { resourceUsage } from 'node:process'; - * - * console.log(resourceUsage()); - * /* - * Will output: - * { - * userCPUTime: 82872, - * systemCPUTime: 4143, - * maxRSS: 33164, - * sharedMemorySize: 0, - * unsharedDataSize: 0, - * unsharedStackSize: 0, - * minorPageFault: 2469, - * majorPageFault: 0, - * swappedOut: 0, - * fsRead: 0, - * fsWrite: 8, - * ipcSent: 0, - * ipcReceived: 0, - * signalsCount: 0, - * voluntaryContextSwitches: 79, - * involuntaryContextSwitches: 1 - * } - * - * ``` - * @since v12.6.0 - * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. - */ - resourceUsage(): ResourceUsage; - /** - * The initial value of `process.throwDeprecation` indicates whether the `--throw-deprecation` flag is set on the current Node.js process. `process.throwDeprecation` - * is mutable, so whether or not deprecation warnings result in errors may be altered at runtime. See the documentation for the 'warning' event and the emitWarning() - * method for more information. - * - * ```bash - * $ node --throw-deprecation -p "process.throwDeprecation" - * true - * $ node -p "process.throwDeprecation" - * undefined - * $ node - * > process.emitWarning('test', 'DeprecationWarning'); - * undefined - * > (node:26598) DeprecationWarning: test - * > process.throwDeprecation = true; - * true - * > process.emitWarning('test', 'DeprecationWarning'); - * Thrown: - * [DeprecationWarning: test] { name: 'DeprecationWarning' } - * ``` - * @since v0.9.12 - */ - throwDeprecation: boolean; - /** - * The `process.traceDeprecation` property indicates whether the `--trace-deprecation` flag is set on the current Node.js process. See the - * documentation for the `'warning' event` and the `emitWarning() method` for more information about this - * flag's behavior. - * @since v0.8.0 - */ - traceDeprecation: boolean; - /* EventEmitter */ - addListener(event: "beforeExit", listener: BeforeExitListener): this; - addListener(event: "disconnect", listener: DisconnectListener): this; - addListener(event: "exit", listener: ExitListener): this; - addListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - addListener(event: "warning", listener: WarningListener): this; - addListener(event: "message", listener: MessageListener): this; - addListener(event: Signals, listener: SignalsListener): this; - addListener(event: "multipleResolves", listener: MultipleResolveListener): this; - addListener(event: "worker", listener: WorkerListener): this; - emit(event: "beforeExit", code: number): boolean; - emit(event: "disconnect"): boolean; - emit(event: "exit", code: number): boolean; - emit(event: "rejectionHandled", promise: Promise): boolean; - emit(event: "uncaughtException", error: Error): boolean; - emit(event: "uncaughtExceptionMonitor", error: Error): boolean; - emit(event: "unhandledRejection", reason: unknown, promise: Promise): boolean; - emit(event: "warning", warning: Error): boolean; - emit(event: "message", message: unknown, sendHandle: unknown): this; - emit(event: Signals, signal?: Signals): boolean; - emit( - event: "multipleResolves", - type: MultipleResolveType, - promise: Promise, - value: unknown, - ): this; - emit(event: "worker", listener: WorkerListener): this; - on(event: "beforeExit", listener: BeforeExitListener): this; - on(event: "disconnect", listener: DisconnectListener): this; - on(event: "exit", listener: ExitListener): this; - on(event: "rejectionHandled", listener: RejectionHandledListener): this; - on(event: "uncaughtException", listener: UncaughtExceptionListener): this; - on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - on(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - on(event: "warning", listener: WarningListener): this; - on(event: "message", listener: MessageListener): this; - on(event: Signals, listener: SignalsListener): this; - on(event: "multipleResolves", listener: MultipleResolveListener): this; - on(event: "worker", listener: WorkerListener): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "beforeExit", listener: BeforeExitListener): this; - once(event: "disconnect", listener: DisconnectListener): this; - once(event: "exit", listener: ExitListener): this; - once(event: "rejectionHandled", listener: RejectionHandledListener): this; - once(event: "uncaughtException", listener: UncaughtExceptionListener): this; - once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - once(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - once(event: "warning", listener: WarningListener): this; - once(event: "message", listener: MessageListener): this; - once(event: Signals, listener: SignalsListener): this; - once(event: "multipleResolves", listener: MultipleResolveListener): this; - once(event: "worker", listener: WorkerListener): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "beforeExit", listener: BeforeExitListener): this; - prependListener(event: "disconnect", listener: DisconnectListener): this; - prependListener(event: "exit", listener: ExitListener): this; - prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependListener(event: "warning", listener: WarningListener): this; - prependListener(event: "message", listener: MessageListener): this; - prependListener(event: Signals, listener: SignalsListener): this; - prependListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependListener(event: "worker", listener: WorkerListener): this; - prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this; - prependOnceListener(event: "disconnect", listener: DisconnectListener): this; - prependOnceListener(event: "exit", listener: ExitListener): this; - prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependOnceListener(event: "warning", listener: WarningListener): this; - prependOnceListener(event: "message", listener: MessageListener): this; - prependOnceListener(event: Signals, listener: SignalsListener): this; - prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this; - prependOnceListener(event: "worker", listener: WorkerListener): this; - listeners(event: "beforeExit"): BeforeExitListener[]; - listeners(event: "disconnect"): DisconnectListener[]; - listeners(event: "exit"): ExitListener[]; - listeners(event: "rejectionHandled"): RejectionHandledListener[]; - listeners(event: "uncaughtException"): UncaughtExceptionListener[]; - listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[]; - listeners(event: "unhandledRejection"): UnhandledRejectionListener[]; - listeners(event: "warning"): WarningListener[]; - listeners(event: "message"): MessageListener[]; - listeners(event: Signals): SignalsListener[]; - listeners(event: "multipleResolves"): MultipleResolveListener[]; - listeners(event: "worker"): WorkerListener[]; - } - } - } - export = process; -} -declare module "node:process" { - import process = require("process"); - export = process; -} diff --git a/node_modules/@types/node/punycode.d.ts b/node_modules/@types/node/punycode.d.ts deleted file mode 100644 index 655c47b..0000000 --- a/node_modules/@types/node/punycode.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * **The version of the punycode module bundled in Node.js is being deprecated. **In a future major version of Node.js this module will be removed. Users - * currently depending on the `punycode` module should switch to using the - * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL - * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. - * - * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It - * can be accessed using: - * - * ```js - * import punycode from 'node:punycode'; - * ``` - * - * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is - * primarily intended for use in Internationalized Domain Names. Because host - * names in URLs are limited to ASCII characters only, Domain Names that contain - * non-ASCII characters must be converted into ASCII using the Punycode scheme. - * For instance, the Japanese character that translates into the English word, `'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent - * to `'example.com'`) is represented by Punycode as the ASCII string `'xn--fsq.com'`. - * - * The `punycode` module provides a simple implementation of the Punycode standard. - * - * The `punycode` module is a third-party dependency used by Node.js and - * 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/v22.x/lib/punycode.js) - */ -declare module "punycode" { - /** - * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only - * characters to the equivalent string of Unicode codepoints. - * - * ```js - * punycode.decode('maana-pta'); // 'mañana' - * punycode.decode('--dqo34k'); // '☃-⌘' - * ``` - * @since v0.5.1 - */ - function decode(string: string): string; - /** - * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. - * - * ```js - * punycode.encode('mañana'); // 'maana-pta' - * punycode.encode('☃-⌘'); // '--dqo34k' - * ``` - * @since v0.5.1 - */ - function encode(string: string): string; - /** - * The `punycode.toUnicode()` method converts a string representing a domain name - * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be - * converted. - * - * ```js - * // decode domain names - * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' - * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' - * punycode.toUnicode('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toUnicode(domain: string): string; - /** - * The `punycode.toASCII()` method converts a Unicode string representing an - * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the - * domain name will be converted. Calling `punycode.toASCII()` on a string that - * already only contains ASCII characters will have no effect. - * - * ```js - * // encode domain names - * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' - * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' - * punycode.toASCII('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toASCII(domain: string): string; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const ucs2: ucs2; - interface ucs2 { - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - decode(string: string): number[]; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - encode(codePoints: readonly number[]): string; - } - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const version: string; -} -declare module "node:punycode" { - export * from "punycode"; -} diff --git a/node_modules/@types/node/querystring.d.ts b/node_modules/@types/node/querystring.d.ts deleted file mode 100644 index 4d6dac1..0000000 --- a/node_modules/@types/node/querystring.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -/** - * The `node:querystring` module provides utilities for parsing and formatting URL - * query strings. It can be accessed using: - * - * ```js - * 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/v22.x/lib/querystring.js) - */ -declare module "querystring" { - interface StringifyOptions { - /** - * The function to use when converting URL-unsafe characters to percent-encoding in the query string. - * @default `querystring.escape()` - */ - encodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParseOptions { - /** - * Specifies the maximum number of keys to parse. Specify `0` to remove key counting limitations. - * @default 1000 - */ - maxKeys?: number | undefined; - /** - * The function to use when decoding percent-encoded characters in the query string. - * @default `querystring.unescape()` - */ - decodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParsedUrlQuery extends NodeJS.Dict {} - interface ParsedUrlQueryInput extends - NodeJS.Dict< - | string - | number - | boolean - | readonly string[] - | readonly number[] - | readonly boolean[] - | null - > - {} - /** - * The `querystring.stringify()` method produces a URL query string from a - * given `obj` by iterating through the object's "own properties". - * - * It serializes the following types of values passed in `obj`: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | - * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to - * empty strings. - * - * ```js - * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); - * // Returns 'foo=bar&baz=qux&baz=quux&corge=' - * - * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); - * // Returns 'foo:bar;baz:qux' - * ``` - * - * By default, characters requiring percent-encoding within the query string will - * be encoded as UTF-8\. If an alternative encoding is required, then an alternative `encodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkEncodeURIComponent function already exists, - * - * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, - * { encodeURIComponent: gbkEncodeURIComponent }); - * ``` - * @since v0.1.25 - * @param obj The object to serialize into a URL query string - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; - /** - * The `querystring.parse()` method parses a URL query string (`str`) into a - * collection of key and value pairs. - * - * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: - * - * ```json - * { - * "foo": "bar", - * "abc": ["xyz", "123"] - * } - * ``` - * - * The object returned by the `querystring.parse()` method _does not_ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * By default, percent-encoded characters within the query string will be assumed - * to use UTF-8 encoding. If an alternative character encoding is used, then an - * alternative `decodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkDecodeURIComponent function already exists... - * - * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, - * { decodeURIComponent: gbkDecodeURIComponent }); - * ``` - * @since v0.1.25 - * @param str The URL query string to parse - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] The substring used to delimit keys and values in the query string. - */ - function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; - /** - * The querystring.encode() function is an alias for querystring.stringify(). - */ - const encode: typeof stringify; - /** - * The querystring.decode() function is an alias for querystring.parse(). - */ - const decode: typeof parse; - /** - * The `querystring.escape()` method performs URL percent-encoding on the given `str` in a manner that is optimized for the specific requirements of URL - * query strings. - * - * The `querystring.escape()` method is used by `querystring.stringify()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement percent-encoding implementation if - * necessary by assigning `querystring.escape` to an alternative function. - * @since v0.1.25 - */ - function escape(str: string): string; - /** - * The `querystring.unescape()` method performs decoding of URL percent-encoded - * characters on the given `str`. - * - * The `querystring.unescape()` method is used by `querystring.parse()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement decoding implementation if - * necessary by assigning `querystring.unescape` to an alternative function. - * - * By default, the `querystring.unescape()` method will attempt to use the - * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, - * a safer equivalent that does not throw on malformed URLs will be used. - * @since v0.1.25 - */ - function unescape(str: string): string; -} -declare module "node:querystring" { - export * from "querystring"; -} diff --git a/node_modules/@types/node/readline.d.ts b/node_modules/@types/node/readline.d.ts deleted file mode 100644 index b706a87..0000000 --- a/node_modules/@types/node/readline.d.ts +++ /dev/null @@ -1,540 +0,0 @@ -/** - * The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-v22.x/api/stream.html#readable-streams) stream - * (such as [`process.stdin`](https://nodejs.org/docs/latest-v22.x/api/process.html#processstdin)) one line at a time. - * - * To use the promise-based APIs: - * - * ```js - * import * as readline from 'node:readline/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as readline from 'node:readline'; - * ``` - * - * The following simple example illustrates the basic use of the `node:readline` module. - * - * ```js - * import * as readline from 'node:readline/promises'; - * import { stdin as input, stdout as output } from 'node:process'; - * - * const rl = readline.createInterface({ input, output }); - * - * const answer = await rl.question('What do you think of Node.js? '); - * - * console.log(`Thank you for your valuable feedback: ${answer}`); - * - * rl.close(); - * ``` - * - * 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/v22.x/lib/readline.js) - */ -declare module "readline" { - import { Abortable, EventEmitter } from "node:events"; - import * as promises from "node:readline/promises"; - export { promises }; - export interface Key { - sequence?: string | undefined; - name?: string | undefined; - ctrl?: boolean | undefined; - meta?: boolean | undefined; - shift?: boolean | undefined; - } - /** - * 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-v22.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v22.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 { - readonly terminal: boolean; - /** - * The current input data being processed by node. - * - * This can be used when collecting input from a TTY stream to retrieve the - * current value that has been processed thus far, prior to the `line` event - * being emitted. Once the `line` event has been emitted, this property will - * be an empty string. - * - * Be aware that modifying the value during the instance runtime may have - * unintended consequences if `rl.cursor` is not also controlled. - * - * **If not using a TTY stream for input, use the `'line'` event.** - * - * One possible use case would be as follows: - * - * ```js - * const values = ['lorem ipsum', 'dolor sit amet']; - * const rl = readline.createInterface(process.stdin); - * const showResults = debounce(() => { - * console.log( - * '\n', - * values.filter((val) => val.startsWith(rl.line)).join(' '), - * ); - * }, 300); - * process.stdin.on('keypress', (c, k) => { - * showResults(); - * }); - * ``` - * @since v0.1.98 - */ - readonly line: string; - /** - * The cursor position relative to `rl.line`. - * - * This will track where the current cursor lands in the input string, when - * reading input from a TTY stream. The position of cursor determines the - * portion of the input string that will be modified as input is processed, - * as well as the column where the terminal caret will be rendered. - * @since v0.1.98 - */ - readonly cursor: number; - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/readline.html#class-interfaceconstructor - */ - protected constructor( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ); - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/readline.html#class-interfaceconstructor - */ - protected constructor(options: ReadLineOptions); - /** - * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. - * @since v15.3.0, v14.17.0 - * @return the current prompt string - */ - getPrompt(): string; - /** - * The `rl.setPrompt()` method sets the prompt that will be written to `output` whenever `rl.prompt()` is called. - * @since v0.1.98 - */ - setPrompt(prompt: string): void; - /** - * The `rl.prompt()` method writes the `Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new - * location at which to provide input. - * - * When called, `rl.prompt()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or `undefined` the prompt is not written. - * @since v0.1.98 - * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. - */ - prompt(preserveCursor?: boolean): void; - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written. - * - * The `callback` function passed to `rl.question()` does not follow the typical - * pattern of accepting an `Error` object or `null` as the first argument. - * The `callback` is called with the provided answer as the only argument. - * - * An error will be thrown if calling `rl.question()` after `rl.close()`. - * - * Example usage: - * - * ```js - * rl.question('What is your favorite food? ', (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * ``` - * - * Using an `AbortController` to cancel a question. - * - * ```js - * const ac = new AbortController(); - * const signal = ac.signal; - * - * rl.question('What is your favorite food? ', { signal }, (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * setTimeout(() => ac.abort(), 10000); - * ``` - * @since v0.3.3 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @param callback A callback function that is invoked with the user's input in response to the `query`. - */ - question(query: string, callback: (answer: string) => void): void; - question(query: string, options: Abortable, callback: (answer: string) => void): void; - /** - * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed - * later if necessary. - * - * Calling `rl.pause()` does not immediately pause other events (including `'line'`) from being emitted by the `Interface` instance. - * @since v0.3.4 - */ - pause(): this; - /** - * The `rl.resume()` method resumes the `input` stream if it has been paused. - * @since v0.3.4 - */ - resume(): this; - /** - * The `rl.close()` method closes the `Interface` instance and - * relinquishes control over the `input` and `output` streams. When called, - * the `'close'` event will be emitted. - * - * Calling `rl.close()` does not immediately stop other events (including `'line'`) - * from being emitted by the `Interface` instance. - * @since v0.1.98 - */ - close(): 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 - * a `TTY` text terminal. See `TTY keybindings` for a list of key - * combinations. - * - * If `key` is specified, `data` is ignored. - * - * When called, `rl.write()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or `undefined` the `data` and `key` are not written. - * - * ```js - * rl.write('Delete this!'); - * // Simulate Ctrl+U to delete the line written previously - * rl.write(null, { ctrl: true, name: 'u' }); - * ``` - * - * The `rl.write()` method will write the data to the `readline` `Interface`'s `input` _as if it were provided by the user_. - * @since v0.1.98 - */ - write(data: string | Buffer, key?: Key): void; - write(data: undefined | null | string | Buffer, key: Key): void; - /** - * Returns the real position of the cursor in relation to the input - * prompt + string. Long input (wrapping) strings, as well as multiple - * line prompts are included in the calculations. - * @since v13.5.0, v12.16.0 - */ - getCursorPos(): CursorPos; - /** - * events.EventEmitter - * 1. close - * 2. line - * 3. pause - * 4. resume - * 5. SIGCONT - * 6. SIGINT - * 7. SIGTSTP - * 8. history - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "history", listener: (history: string[]) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "history", history: string[]): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "history", listener: (history: string[]) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "history", listener: (history: string[]) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "history", listener: (history: string[]) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "history", listener: (history: string[]) => void): this; - [Symbol.asyncIterator](): NodeJS.AsyncIterator; - } - export type ReadLine = Interface; // type forwarded for backwards compatibility - export type Completer = (line: string) => CompleterResult; - export type AsyncCompleter = ( - line: string, - callback: (err?: null | Error, result?: CompleterResult) => void, - ) => void; - export type CompleterResult = [string[], string]; - export interface ReadLineOptions { - input: NodeJS.ReadableStream; - output?: NodeJS.WritableStream | undefined; - completer?: Completer | AsyncCompleter | undefined; - 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. - * @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. - * @default false - */ - removeHistoryDuplicates?: boolean | undefined; - escapeCodeTimeout?: number | undefined; - tabSize?: number | undefined; - } - /** - * The `readline.createInterface()` method creates a new `readline.Interface` instance. - * - * ```js - * import readline from 'node:readline'; - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * }); - * ``` - * - * Once the `readline.Interface` instance is created, the most common case is to - * listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * - * When creating a `readline.Interface` using `stdin` as input, the program - * will not terminate until it receives an [EOF character](https://en.wikipedia.org/wiki/End-of-file#EOF_character). To exit without - * waiting for user input, call `process.stdin.unref()`. - * @since v0.1.98 - */ - export function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ): Interface; - export function createInterface(options: ReadLineOptions): Interface; - /** - * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. - * - * Optionally, `interface` specifies a `readline.Interface` instance for which - * autocompletion is disabled when copy-pasted input is detected. - * - * If the `stream` is a `TTY`, then it must be in raw mode. - * - * This is automatically called by any readline instance on its `input` if the `input` is a terminal. Closing the `readline` instance does not stop - * the `input` from emitting `'keypress'` events. - * - * ```js - * readline.emitKeypressEvents(process.stdin); - * if (process.stdin.isTTY) - * process.stdin.setRawMode(true); - * ``` - * - * ## Example: Tiny CLI - * - * The following example illustrates the use of `readline.Interface` class to - * implement a small command-line interface: - * - * ```js - * import readline from 'node:readline'; - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * prompt: 'OHAI> ', - * }); - * - * rl.prompt(); - * - * rl.on('line', (line) => { - * switch (line.trim()) { - * case 'hello': - * console.log('world!'); - * break; - * default: - * console.log(`Say what? I might have heard '${line.trim()}'`); - * break; - * } - * rl.prompt(); - * }).on('close', () => { - * console.log('Have a great day!'); - * process.exit(0); - * }); - * ``` - * - * ## Example: Read file stream line-by-Line - * - * A common use case for `readline` is to consume an input file one line at a - * time. The easiest way to do so is leveraging the `fs.ReadStream` API as - * well as a `for await...of` loop: - * - * ```js - * import fs from 'node:fs'; - * import readline from 'node:readline'; - * - * async function processLineByLine() { - * const fileStream = fs.createReadStream('input.txt'); - * - * const rl = readline.createInterface({ - * input: fileStream, - * crlfDelay: Infinity, - * }); - * // Note: we use the crlfDelay option to recognize all instances of CR LF - * // ('\r\n') in input.txt as a single line break. - * - * for await (const line of rl) { - * // Each line in input.txt will be successively available here as `line`. - * console.log(`Line from file: ${line}`); - * } - * } - * - * processLineByLine(); - * ``` - * - * Alternatively, one could use the `'line'` event: - * - * ```js - * import fs from 'node:fs'; - * import readline from 'node:readline'; - * - * const rl = readline.createInterface({ - * input: fs.createReadStream('sample.txt'), - * crlfDelay: Infinity, - * }); - * - * rl.on('line', (line) => { - * console.log(`Line from file: ${line}`); - * }); - * ``` - * - * 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 - * import { once } from 'node:events'; - * import { createReadStream } from 'node:fs'; - * import { createInterface } from 'node:readline'; - * - * (async function processLineByLine() { - * try { - * const rl = createInterface({ - * input: createReadStream('big-file.txt'), - * crlfDelay: Infinity, - * }); - * - * rl.on('line', (line) => { - * // Process the line. - * }); - * - * await once(rl, 'close'); - * - * console.log('File processed.'); - * } catch (err) { - * console.error(err); - * } - * })(); - * ``` - * @since v0.7.7 - */ - export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; - export type Direction = -1 | 0 | 1; - export interface CursorPos { - rows: number; - cols: number; - } - /** - * The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v22.x/api/tty.html) stream - * in a specified direction identified by `dir`. - * @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`. - */ - export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; - /** - * The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v22.x/api/tty.html) stream from - * the current position of the cursor down. - * @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`. - */ - 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-v22.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`. - */ - 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-v22.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`. - */ - export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; -} -declare module "node:readline" { - export * from "readline"; -} diff --git a/node_modules/@types/node/readline/promises.d.ts b/node_modules/@types/node/readline/promises.d.ts deleted file mode 100644 index 4d43106..0000000 --- a/node_modules/@types/node/readline/promises.d.ts +++ /dev/null @@ -1,150 +0,0 @@ -/** - * @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"; - /** - * 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. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v17.0.0 - */ - class Interface extends _Interface { - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written. - * - * If the question is called after `rl.close()`, it returns a rejected promise. - * - * Example usage: - * - * ```js - * const answer = await rl.question('What is your favorite food? '); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * - * Using an `AbortSignal` to cancel a question. - * - * ```js - * const signal = AbortSignal.timeout(10_000); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * const answer = await rl.question('What is your favorite food? ', { signal }); - * console.log(`Oh, so your favorite food is ${answer}`); - * ``` - * @since v17.0.0 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @return A promise that is fulfilled with the user's input in response to the `query`. - */ - question(query: string): Promise; - question(query: string, options: Abortable): Promise; - } - /** - * @since v17.0.0 - */ - class Readline { - /** - * @param stream A TTY stream. - */ - constructor( - stream: NodeJS.WritableStream, - options?: { - autoCommit?: boolean; - }, - ); - /** - * The `rl.clearLine()` method adds to the internal list of pending action an - * action that clears current line of the associated `stream` in a specified - * direction identified by `dir`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - * @since v17.0.0 - * @return this - */ - clearLine(dir: Direction): this; - /** - * The `rl.clearScreenDown()` method adds to the internal list of pending action an - * action that clears the associated stream from the current position of the - * cursor down. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - * @since v17.0.0 - * @return this - */ - clearScreenDown(): this; - /** - * The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions. - * @since v17.0.0 - */ - commit(): Promise; - /** - * The `rl.cursorTo()` method adds to the internal list of pending action an action - * that moves cursor to the specified position in the associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - * @since v17.0.0 - * @return this - */ - cursorTo(x: number, y?: number): this; - /** - * The `rl.moveCursor()` method adds to the internal list of pending action an - * action that moves the cursor _relative_ to its current position in the - * associated `stream`. - * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. - * @since v17.0.0 - * @return this - */ - moveCursor(dx: number, dy: number): this; - /** - * The `rl.rollback` methods clears the internal list of pending actions without - * sending it to the associated `stream`. - * @since v17.0.0 - * @return this - */ - rollback(): this; - } - /** - * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance. - * - * ```js - * import readlinePromises from 'node:readline/promises'; - * const rl = readlinePromises.createInterface({ - * input: process.stdin, - * output: process.stdout, - * }); - * ``` - * - * Once the `readlinePromises.Interface` instance is created, the most common case - * is to listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * @since v17.0.0 - */ - function createInterface( - input: NodeJS.ReadableStream, - output?: NodeJS.WritableStream, - completer?: Completer | AsyncCompleter, - terminal?: boolean, - ): Interface; - function createInterface(options: ReadLineOptions): Interface; -} -declare module "node:readline/promises" { - export * from "readline/promises"; -} diff --git a/node_modules/@types/node/repl.d.ts b/node_modules/@types/node/repl.d.ts deleted file mode 100644 index 5ff046a..0000000 --- a/node_modules/@types/node/repl.d.ts +++ /dev/null @@ -1,430 +0,0 @@ -/** - * The `node:repl` module provides a Read-Eval-Print-Loop (REPL) implementation - * that is available both as a standalone program or includible in other - * applications. It can be accessed using: - * - * ```js - * import repl from 'node:repl'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/repl.js) - */ -declare module "repl" { - import { AsyncCompleter, Completer, Interface } from "node:readline"; - import { Context } from "node:vm"; - import { InspectOptions } from "node:util"; - interface ReplOptions { - /** - * The input prompt to display. - * @default "> " - */ - prompt?: string | undefined; - /** - * The `Readable` stream from which REPL input will be read. - * @default process.stdin - */ - input?: NodeJS.ReadableStream | undefined; - /** - * The `Writable` stream to which REPL output will be written. - * @default process.stdout - */ - output?: NodeJS.WritableStream | undefined; - /** - * If `true`, specifies that the output should be treated as a TTY terminal, and have - * ANSI/VT100 escape codes written to it. - * Default: checking the value of the `isTTY` property on the output stream upon - * instantiation. - */ - 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 - * error with `repl.Recoverable` to indicate the input was incomplete and prompt for - * additional lines. - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_default_evaluation - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_custom_evaluation_functions - */ - eval?: REPLEval | undefined; - /** - * Defines if the repl prints output previews or not. - * @default `true` Always `false` in case `terminal` is falsy. - */ - preview?: boolean | undefined; - /** - * If `true`, specifies that the default `writer` function should include ANSI color - * styling to REPL output. If a custom `writer` function is provided then this has no - * effect. - * @default the REPL instance's `terminal` value - */ - useColors?: boolean | undefined; - /** - * If `true`, specifies that the default evaluation function will use the JavaScript - * `global` as the context as opposed to creating a new separate context for the REPL - * instance. The node CLI REPL sets this value to `true`. - * @default false - */ - useGlobal?: boolean | undefined; - /** - * If `true`, specifies that the default writer will not output the return value of a - * command if it evaluates to `undefined`. - * @default false - */ - ignoreUndefined?: boolean | undefined; - /** - * 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-v22.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-v22.x/docs/api/readline.html#readline_use_of_the_completer_function - */ - completer?: Completer | AsyncCompleter | undefined; - /** - * A flag that specifies whether the default evaluator executes all JavaScript commands in - * strict mode or default (sloppy) mode. - * Accepted values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; - /** - * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is - * pressed. This cannot be used together with a custom `eval` function. - * @default false - */ - breakEvalOnSigint?: boolean | undefined; - } - type REPLEval = ( - this: REPLServer, - evalCmd: string, - context: Context, - file: string, - cb: (err: Error | null, result: any) => void, - ) => void; - type REPLWriter = (this: REPLServer, obj: any) => string; - /** - * This is the default "writer" value, if none is passed in the REPL options, - * and it can be overridden by custom print functions. - */ - const writer: REPLWriter & { - options: InspectOptions; - }; - type REPLCommandAction = (this: REPLServer, text: string) => void; - interface REPLCommand { - /** - * Help text to be displayed when `.help` is entered. - */ - help?: string | undefined; - /** - * The function to execute, optionally accepting a single string argument. - */ - action: REPLCommandAction; - } - /** - * Instances of `repl.REPLServer` are created using the {@link start} method - * or directly using the JavaScript `new` keyword. - * - * ```js - * import repl from 'node:repl'; - * - * const options = { useColors: true }; - * - * const firstInstance = repl.start(options); - * const secondInstance = new repl.REPLServer(options); - * ``` - * @since v0.1.91 - */ - class REPLServer extends Interface { - /** - * The `vm.Context` provided to the `eval` function to be used for JavaScript - * evaluation. - */ - readonly context: Context; - /** - * @deprecated since v14.3.0 - Use `input` instead. - */ - readonly inputStream: NodeJS.ReadableStream; - /** - * @deprecated since v14.3.0 - Use `output` instead. - */ - readonly outputStream: NodeJS.WritableStream; - /** - * The `Readable` stream from which REPL input will be read. - */ - readonly input: NodeJS.ReadableStream; - /** - * The `Writable` stream to which REPL output will be written. - */ - readonly output: NodeJS.WritableStream; - /** - * The commands registered via `replServer.defineCommand()`. - */ - readonly commands: NodeJS.ReadOnlyDict; - /** - * A value indicating whether the REPL is currently in "editor mode". - * - * @see https://nodejs.org/dist/latest-v22.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-v22.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-v22.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-v22.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-v22.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly lastError: any; - /** - * Specified in the REPL options, this is the function to be used when evaluating each - * given line of input. If not specified in the REPL options, this is an async wrapper - * for the JavaScript `eval()` function. - */ - readonly eval: REPLEval; - /** - * Specified in the REPL options, this is a value indicating whether the default - * `writer` function should include ANSI color styling to REPL output. - */ - readonly useColors: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `eval` - * function will use the JavaScript `global` as the context as opposed to creating a new - * separate context for the REPL instance. - */ - readonly useGlobal: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `writer` - * function should output the result of a command if it evaluates to `undefined`. - */ - readonly ignoreUndefined: boolean; - /** - * Specified in the REPL options, this is the function to invoke to format the output of - * each command before writing to `outputStream`. If not specified in the REPL options, - * this will be a wrapper for `util.inspect`. - */ - readonly writer: REPLWriter; - /** - * Specified in the REPL options, this is the function to use for custom Tab auto-completion. - */ - readonly completer: Completer | AsyncCompleter; - /** - * Specified in the REPL options, this is a flag that specifies whether the default `eval` - * function should execute all JavaScript commands in strict mode or default (sloppy) mode. - * Possible values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; - /** - * NOTE: According to the documentation: - * - * > Instances of `repl.REPLServer` are created using the `repl.start()` method and - * > _should not_ be created directly using the JavaScript `new` keyword. - * - * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_class_replserver - */ - private constructor(); - /** - * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands - * to the REPL instance. Such commands are invoked by typing a `.` followed by the `keyword`. The `cmd` is either a `Function` or an `Object` with the following - * properties: - * - * The following example shows two new commands added to the REPL instance: - * - * ```js - * import repl from 'node:repl'; - * - * const replServer = repl.start({ prompt: '> ' }); - * replServer.defineCommand('sayhello', { - * help: 'Say hello', - * action(name) { - * this.clearBufferedCommand(); - * console.log(`Hello, ${name}!`); - * this.displayPrompt(); - * }, - * }); - * replServer.defineCommand('saybye', function saybye() { - * console.log('Goodbye!'); - * this.close(); - * }); - * ``` - * - * The new commands can then be used from within the REPL instance: - * - * ```console - * > .sayhello Node.js User - * Hello, Node.js User! - * > .saybye - * Goodbye! - * ``` - * @since v0.3.0 - * @param keyword The command keyword (_without_ a leading `.` character). - * @param cmd The function to invoke when the command is processed. - */ - defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; - /** - * 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 - * 'prompt'. - * - * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. - * - * The `replServer.displayPrompt` method is primarily intended to be called from - * within the action function for commands registered using the `replServer.defineCommand()` method. - * @since v0.1.91 - */ - displayPrompt(preserveCursor?: boolean): void; - /** - * The `replServer.clearBufferedCommand()` method clears any command that has been - * buffered but not yet executed. This method is primarily intended to be - * called from within the action function for commands registered using the `replServer.defineCommand()` method. - * @since v9.0.0 - */ - clearBufferedCommand(): void; - /** - * Initializes a history log file for the REPL instance. When executing the - * Node.js binary and using the command-line REPL, a history file is initialized - * by default. However, this is not the case when creating a REPL - * programmatically. Use this method to initialize a history log file when working - * with REPL instances programmatically. - * @since v11.10.0 - * @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; - /** - * events.EventEmitter - * 1. close - inherited from `readline.Interface` - * 2. line - inherited from `readline.Interface` - * 3. pause - inherited from `readline.Interface` - * 4. resume - inherited from `readline.Interface` - * 5. SIGCONT - inherited from `readline.Interface` - * 6. SIGINT - inherited from `readline.Interface` - * 7. SIGTSTP - inherited from `readline.Interface` - * 8. exit - * 9. reset - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "exit", listener: () => void): this; - addListener(event: "reset", listener: (context: Context) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "exit"): boolean; - emit(event: "reset", context: Context): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "exit", listener: () => void): this; - on(event: "reset", listener: (context: Context) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "exit", listener: () => void): this; - once(event: "reset", listener: (context: Context) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "exit", listener: () => void): this; - prependListener(event: "reset", listener: (context: Context) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "exit", listener: () => void): this; - prependOnceListener(event: "reset", listener: (context: Context) => void): this; - } - /** - * A flag passed in the REPL options. Evaluates expressions in sloppy mode. - */ - const REPL_MODE_SLOPPY: unique symbol; - /** - * A flag passed in the REPL options. Evaluates expressions in strict mode. - * This is equivalent to prefacing every repl statement with `'use strict'`. - */ - const REPL_MODE_STRICT: unique symbol; - /** - * The `repl.start()` method creates and starts a {@link REPLServer} instance. - * - * If `options` is a string, then it specifies the input prompt: - * - * ```js - * import repl from 'node:repl'; - * - * // a Unix style prompt - * repl.start('$ '); - * ``` - * @since v0.1.91 - */ - function start(options?: string | ReplOptions): REPLServer; - /** - * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. - * - * @see https://nodejs.org/dist/latest-v22.x/docs/api/repl.html#repl_recoverable_errors - */ - class Recoverable extends SyntaxError { - err: Error; - constructor(err: Error); - } -} -declare module "node:repl" { - export * from "repl"; -} diff --git a/node_modules/@types/node/sea.d.ts b/node_modules/@types/node/sea.d.ts deleted file mode 100644 index 0bedc62..0000000 --- a/node_modules/@types/node/sea.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -/** - * This feature allows the distribution of a Node.js application conveniently to a - * system that does not have Node.js installed. - * - * Node.js supports the creation of [single executable applications](https://github.com/nodejs/single-executable) by allowing - * the injection of a blob prepared by Node.js, which can contain a bundled script, - * into the `node` binary. During start up, the program checks if anything has been - * injected. If the blob is found, it executes the script in the blob. Otherwise - * Node.js operates as it normally does. - * - * The single executable application feature currently only supports running a - * single embedded script using the `CommonJS` module system. - * - * Users can create a single executable application from their bundled script - * with the `node` binary itself and any tool which can inject resources into the - * binary. - * - * Here are the steps for creating a single executable application using one such - * tool, [postject](https://github.com/nodejs/postject): - * - * 1. Create a JavaScript file: - * ```bash - * echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js - * ``` - * 2. Create a configuration file building a blob that can be injected into the - * single executable application (see `Generating single executable preparation blobs` for details): - * ```bash - * echo '{ "main": "hello.js", "output": "sea-prep.blob" }' > sea-config.json - * ``` - * 3. Generate the blob to be injected: - * ```bash - * node --experimental-sea-config sea-config.json - * ``` - * 4. Create a copy of the `node` executable and name it according to your needs: - * * On systems other than Windows: - * ```bash - * cp $(command -v node) hello - * ``` - * * On Windows: - * ```text - * node -e "require('fs').copyFileSync(process.execPath, 'hello.exe')" - * ``` - * The `.exe` extension is necessary. - * 5. Remove the signature of the binary (macOS and Windows only): - * * On macOS: - * ```bash - * codesign --remove-signature hello - * ``` - * * On Windows (optional): - * [signtool](https://learn.microsoft.com/en-us/windows/win32/seccrypto/signtool) can be used from the installed [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/). - * If this step is - * skipped, ignore any signature-related warning from postject. - * ```powershell - * signtool remove /s hello.exe - * ``` - * 6. Inject the blob into the copied binary by running `postject` with - * the following options: - * * `hello` / `hello.exe` \- The name of the copy of the `node` executable - * created in step 4. - * * `NODE_SEA_BLOB` \- The name of the resource / note / section in the binary - * where the contents of the blob will be stored. - * * `sea-prep.blob` \- The name of the blob created in step 1. - * * `--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2` \- The [fuse](https://www.electronjs.org/docs/latest/tutorial/fuses) used by the Node.js project to detect if a file has been - * injected. - * * `--macho-segment-name NODE_SEA` (only needed on macOS) - The name of the - * segment in the binary where the contents of the blob will be - * stored. - * To summarize, here is the required command for each platform: - * * On Linux: - * ```bash - * npx postject hello NODE_SEA_BLOB sea-prep.blob \ - * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 - * ``` - * * On Windows - PowerShell: - * ```powershell - * npx postject hello.exe NODE_SEA_BLOB sea-prep.blob ` - * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 - * ``` - * * On Windows - Command Prompt: - * ```text - * npx postject hello.exe NODE_SEA_BLOB sea-prep.blob ^ - * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 - * ``` - * * On macOS: - * ```bash - * npx postject hello NODE_SEA_BLOB sea-prep.blob \ - * --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \ - * --macho-segment-name NODE_SEA - * ``` - * 7. Sign the binary (macOS and Windows only): - * * On macOS: - * ```bash - * codesign --sign - hello - * ``` - * * On Windows (optional): - * A certificate needs to be present for this to work. However, the unsigned - * binary would still be runnable. - * ```powershell - * signtool sign /fd SHA256 hello.exe - * ``` - * 8. Run the binary: - * * On systems other than Windows - * ```console - * $ ./hello world - * Hello, world! - * ``` - * * On Windows - * ```console - * $ .\hello.exe world - * Hello, world! - * ``` - * @since v19.7.0, v18.16.0 - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v22.x/src/node_sea.cc) - */ -declare module "node:sea" { - type AssetKey = string; - /** - * @since v20.12.0 - * @return Whether this script is running inside a single-executable application. - */ - function isSea(): boolean; - /** - * This method can be used to retrieve the assets configured to be bundled into the - * single-executable application at build time. - * An error is thrown when no matching asset can be found. - * @since v20.12.0 - */ - function getAsset(key: AssetKey): ArrayBuffer; - function getAsset(key: AssetKey, encoding: string): string; - /** - * Similar to `sea.getAsset()`, but returns the result in a [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob). - * An error is thrown when no matching asset can be found. - * @since v20.12.0 - */ - function getAssetAsBlob(key: AssetKey, options?: { - type: string; - }): Blob; - /** - * This method can be used to retrieve the assets configured to be bundled into the - * single-executable application at build time. - * An error is thrown when no matching asset can be found. - * - * Unlike `sea.getRawAsset()` or `sea.getAssetAsBlob()`, this method does not - * return a copy. Instead, it returns the raw asset bundled inside the executable. - * - * For now, users should avoid writing to the returned array buffer. If the - * injected section is not marked as writable or not aligned properly, - * writes to the returned array buffer is likely to result in a crash. - * @since v20.12.0 - */ - function getRawAsset(key: AssetKey): string | ArrayBuffer; -} diff --git a/node_modules/@types/node/sqlite.d.ts b/node_modules/@types/node/sqlite.d.ts deleted file mode 100644 index 9fa7bab..0000000 --- a/node_modules/@types/node/sqlite.d.ts +++ /dev/null @@ -1,213 +0,0 @@ -/** - * The `node:sqlite` module facilitates working with SQLite databases. - * To access it: - * - * ```js - * import sqlite from 'node:sqlite'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import sqlite from 'node:sqlite'; - * ``` - * - * The following example shows the basic usage of the `node:sqlite` module to open - * an in-memory database, write data to the database, and then read the data back. - * - * ```js - * import { DatabaseSync } from 'node:sqlite'; - * const database = new DatabaseSync(':memory:'); - * - * // Execute SQL statements from strings. - * database.exec(` - * CREATE TABLE data( - * key INTEGER PRIMARY KEY, - * value TEXT - * ) STRICT - * `); - * // Create a prepared statement to insert data into the database. - * const insert = database.prepare('INSERT INTO data (key, value) VALUES (?, ?)'); - * // Execute the prepared statement with bound values. - * insert.run(1, 'hello'); - * insert.run(2, 'world'); - * // Create a prepared statement to read data from the database. - * const query = database.prepare('SELECT * FROM data ORDER BY key'); - * // Execute the prepared statement and log the result set. - * console.log(query.all()); - * // Prints: [ { key: 1, value: 'hello' }, { key: 2, value: 'world' } ] - * ``` - * @since v22.5.0 - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/sqlite.js) - */ -declare module "node:sqlite" { - interface DatabaseSyncOptions { - /** - * If `true`, the database is opened by the constructor. - * When this value is `false`, the database must be opened via the `open()` method. - */ - open?: boolean | undefined; - } - /** - * This class represents a single [connection](https://www.sqlite.org/c3ref/sqlite3.html) to a SQLite database. All APIs - * exposed by this class execute synchronously. - * @since v22.5.0 - */ - class DatabaseSync { - /** - * Constructs a new `DatabaseSync` instance. - * @param location The location of the database. - * A SQLite database can be stored in a file or completely [in memory](https://www.sqlite.org/inmemorydb.html). - * To use a file-backed database, the location should be a file path. - * To use an in-memory database, the location should be the special name `':memory:'`. - * @param options Configuration options for the database connection. - */ - constructor(location: string, options?: DatabaseSyncOptions); - /** - * Closes the database connection. An exception is thrown if the database is not - * open. This method is a wrapper around [`sqlite3_close_v2()`](https://www.sqlite.org/c3ref/close.html). - * @since v22.5.0 - */ - close(): void; - /** - * This method allows one or more SQL statements to be executed without returning - * any results. This method is useful when executing SQL statements read from a - * file. This method is a wrapper around [`sqlite3_exec()`](https://www.sqlite.org/c3ref/exec.html). - * @since v22.5.0 - * @param sql A SQL string to execute. - */ - exec(sql: string): void; - /** - * Opens the database specified in the `location` argument of the `DatabaseSync`constructor. This method should only be used when the database is not opened via - * the constructor. An exception is thrown if the database is already open. - * @since v22.5.0 - */ - open(): void; - /** - * Compiles a SQL statement into a [prepared statement](https://www.sqlite.org/c3ref/stmt.html). This method is a wrapper - * around [`sqlite3_prepare_v2()`](https://www.sqlite.org/c3ref/prepare.html). - * @since v22.5.0 - * @param sql A SQL string to compile to a prepared statement. - * @return The prepared statement. - */ - prepare(sql: string): StatementSync; - } - type SupportedValueType = null | number | bigint | string | Uint8Array; - interface StatementResultingChanges { - /** - * The number of rows modified, inserted, or deleted by the most recently completed `INSERT`, `UPDATE`, or `DELETE` statement. - * This field is either a number or a `BigInt` depending on the prepared statement's configuration. - * This property is the result of [`sqlite3_changes64()`](https://www.sqlite.org/c3ref/changes.html). - */ - changes: number | bigint; - /** - * The most recently inserted rowid. - * This field is either a number or a `BigInt` depending on the prepared statement's configuration. - * This property is the result of [`sqlite3_last_insert_rowid()`](https://www.sqlite.org/c3ref/last_insert_rowid.html). - */ - lastInsertRowid: number | bigint; - } - /** - * This class represents a single [prepared statement](https://www.sqlite.org/c3ref/stmt.html). This class cannot be - * instantiated via its constructor. Instead, instances are created via the`database.prepare()` method. All APIs exposed by this class execute - * synchronously. - * - * A prepared statement is an efficient binary representation of the SQL used to - * create it. Prepared statements are parameterizable, and can be invoked multiple - * times with different bound values. Parameters also offer protection against [SQL injection](https://en.wikipedia.org/wiki/SQL_injection) attacks. For these reasons, prepared statements are - * preferred - * over hand-crafted SQL strings when handling user input. - * @since v22.5.0 - */ - class StatementSync { - private constructor(); - /** - * This method executes a prepared statement and returns all results as an array of - * objects. If the prepared statement does not return any results, this method - * returns an empty array. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using - * the values in `namedParameters` and `anonymousParameters`. - * @since v22.5.0 - * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping. - * @param anonymousParameters Zero or more values to bind to anonymous parameters. - * @return An array of objects. Each object corresponds to a row returned by executing the prepared statement. The keys and values of each object correspond to the column names and values of - * the row. - */ - all(...anonymousParameters: SupportedValueType[]): unknown[]; - all( - namedParameters: Record, - ...anonymousParameters: SupportedValueType[] - ): unknown[]; - /** - * This method returns the source SQL of the prepared statement with parameter - * placeholders replaced by values. This method is a wrapper around [`sqlite3_expanded_sql()`](https://www.sqlite.org/c3ref/expanded_sql.html). - * @since v22.5.0 - * @return The source SQL expanded to include parameter values. - */ - expandedSQL(): string; - /** - * This method executes a prepared statement and returns the first result as an - * object. If the prepared statement does not return any results, this method - * returns `undefined`. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using the - * values in `namedParameters` and `anonymousParameters`. - * @since v22.5.0 - * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping. - * @param anonymousParameters Zero or more values to bind to anonymous parameters. - * @return An object corresponding to the first row returned by executing the prepared statement. The keys and values of the object correspond to the column names and values of the row. If no - * rows were returned from the database then this method returns `undefined`. - */ - get(...anonymousParameters: SupportedValueType[]): unknown; - get(namedParameters: Record, ...anonymousParameters: SupportedValueType[]): unknown; - /** - * This method executes a prepared statement and returns an object summarizing the - * resulting changes. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using the - * values in `namedParameters` and `anonymousParameters`. - * @since v22.5.0 - * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping. - * @param anonymousParameters Zero or more values to bind to anonymous parameters. - */ - run(...anonymousParameters: SupportedValueType[]): StatementResultingChanges; - run( - namedParameters: Record, - ...anonymousParameters: SupportedValueType[] - ): StatementResultingChanges; - /** - * The names of SQLite parameters begin with a prefix character. By default,`node:sqlite` requires that this prefix character is present when binding - * parameters. However, with the exception of dollar sign character, these - * prefix characters also require extra quoting when used in object keys. - * - * To improve ergonomics, this method can be used to also allow bare named - * parameters, which do not require the prefix character in JavaScript code. There - * are several caveats to be aware of when enabling bare named parameters: - * - * * The prefix character is still required in SQL. - * * The prefix character is still allowed in JavaScript. In fact, prefixed names - * will have slightly better binding performance. - * * Using ambiguous named parameters, such as `$k` and `@k`, in the same prepared - * statement will result in an exception as it cannot be determined how to bind - * a bare name. - * @since v22.5.0 - * @param enabled Enables or disables support for binding named parameters without the prefix character. - */ - setAllowBareNamedParameters(enabled: boolean): void; - /** - * When reading from the database, SQLite `INTEGER`s are mapped to JavaScript - * numbers by default. However, SQLite `INTEGER`s can store values larger than - * JavaScript numbers are capable of representing. In such cases, this method can - * be used to read `INTEGER` data using JavaScript `BigInt`s. This method has no - * impact on database write operations where numbers and `BigInt`s are both - * supported at all times. - * @since v22.5.0 - * @param enabled Enables or disables the use of `BigInt`s when reading `INTEGER` fields from the database. - */ - setReadBigInts(enabled: boolean): void; - /** - * This method returns the source SQL of the prepared statement. This method is a - * wrapper around [`sqlite3_sql()`](https://www.sqlite.org/c3ref/expanded_sql.html). - * @since v22.5.0 - * @return The source SQL used to create this prepared statement. - */ - sourceSQL(): string; - } -} diff --git a/node_modules/@types/node/stream.d.ts b/node_modules/@types/node/stream.d.ts deleted file mode 100644 index 916bfcb..0000000 --- a/node_modules/@types/node/stream.d.ts +++ /dev/null @@ -1,1726 +0,0 @@ -/** - * A stream is an abstract interface for working with streaming data in Node.js. - * The `node:stream` module provides an API for implementing the stream interface. - * - * There are many stream objects provided by Node.js. For instance, a [request to an HTTP server](https://nodejs.org/docs/latest-v22.x/api/http.html#class-httpincomingmessage) - * and [`process.stdout`](https://nodejs.org/docs/latest-v22.x/api/process.html#processstdout) are both stream instances. - * - * Streams can be readable, writable, or both. All streams are instances of [`EventEmitter`](https://nodejs.org/docs/latest-v22.x/api/events.html#class-eventemitter). - * - * To access the `node:stream` module: - * - * ```js - * import stream from 'node:stream'; - * ``` - * - * The `node:stream` module is useful for creating new types of stream instances. - * It is usually not necessary to use the `node:stream` module to consume streams. - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/stream.js) - */ -declare module "stream" { - import { Abortable, EventEmitter } from "node:events"; - import { Blob as NodeBlob } from "node:buffer"; - import * as streamPromises from "node:stream/promises"; - import * as streamConsumers from "node:stream/consumers"; - import * as streamWeb from "node:stream/web"; - - type ComposeFnParam = (source: any) => void; - - class internal extends EventEmitter { - pipe( - destination: T, - options?: { - end?: boolean | undefined; - }, - ): T; - compose( - stream: T | ComposeFnParam | Iterable | AsyncIterable, - options?: { signal: AbortSignal }, - ): T; - } - import Stream = internal.Stream; - import Readable = internal.Readable; - import ReadableOptions = internal.ReadableOptions; - interface ArrayOptions { - /** - * The maximum concurrent invocations of `fn` to call on the stream at once. - * @default 1 - */ - concurrency?: number; - /** Allows destroying the stream if the signal is aborted. */ - signal?: AbortSignal; - } - class ReadableBase extends Stream implements NodeJS.ReadableStream { - /** - * A utility method for creating Readable Streams out of iterators. - * @since v12.3.0, v10.17.0 - * @param iterable Object implementing the `Symbol.asyncIterator` or `Symbol.iterator` iterable protocol. Emits an 'error' event if a null value is passed. - * @param options Options provided to `new stream.Readable([options])`. By default, `Readable.from()` will set `options.objectMode` to `true`, unless this is explicitly opted out by setting `options.objectMode` to `false`. - */ - static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; - /** - * Returns whether the stream has been read from or cancelled. - * @since v16.8.0 - */ - static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; - /** - * Returns whether the stream was destroyed or errored before emitting `'end'`. - * @since v16.8.0 - * @experimental - */ - readonly readableAborted: boolean; - /** - * Is `true` if it is safe to call {@link read}, which means - * the stream has not been destroyed or emitted `'error'` or `'end'`. - * @since v11.4.0 - */ - readable: boolean; - /** - * Returns whether `'data'` has been emitted. - * @since v16.7.0, v14.18.0 - * @experimental - */ - readonly readableDidRead: boolean; - /** - * Getter for the property `encoding` of a given `Readable` stream. The `encoding` property can be set using the {@link setEncoding} method. - * @since v12.7.0 - */ - readonly readableEncoding: BufferEncoding | null; - /** - * Becomes `true` when [`'end'`](https://nodejs.org/docs/latest-v22.x/api/stream.html#event-end) event is emitted. - * @since v12.9.0 - */ - readonly readableEnded: boolean; - /** - * This property reflects the current state of a `Readable` stream as described - * in the [Three states](https://nodejs.org/docs/latest-v22.x/api/stream.html#three-states) section. - * @since v9.4.0 - */ - readonly readableFlowing: boolean | null; - /** - * Returns the value of `highWaterMark` passed when creating this `Readable`. - * @since v9.3.0 - */ - readonly readableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be read. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly readableLength: number; - /** - * Getter for the property `objectMode` of a given `Readable` stream. - * @since v12.3.0 - */ - readonly readableObjectMode: boolean; - /** - * Is `true` after `readable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is `true` after `'close'` has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - constructor(opts?: ReadableOptions); - _construct?(callback: (error?: Error | null) => void): void; - _read(size: number): void; - /** - * The `readable.read()` method reads data out of the internal buffer and - * returns it. If no data is available to be read, `null` is returned. By default, - * the data is returned as a `Buffer` object unless an encoding has been - * specified using the `readable.setEncoding()` method or the stream is operating - * in object mode. - * - * The optional `size` argument specifies a specific number of bytes to read. If - * `size` bytes are not available to be read, `null` will be returned _unless_ the - * stream has ended, in which case all of the data remaining in the internal buffer - * will be returned. - * - * If the `size` argument is not specified, all of the data contained in the - * internal buffer will be returned. - * - * The `size` argument must be less than or equal to 1 GiB. - * - * The `readable.read()` method should only be called on `Readable` streams - * operating in paused mode. In flowing mode, `readable.read()` is called - * automatically until the internal buffer is fully drained. - * - * ```js - * const readable = getReadableStreamSomehow(); - * - * // 'readable' may be triggered multiple times as data is buffered in - * readable.on('readable', () => { - * let chunk; - * console.log('Stream is readable (new data received in buffer)'); - * // Use a loop to make sure we read all currently available data - * while (null !== (chunk = readable.read())) { - * console.log(`Read ${chunk.length} bytes of data...`); - * } - * }); - * - * // 'end' will be triggered once when there is no more data available - * readable.on('end', () => { - * console.log('Reached end of stream.'); - * }); - * ``` - * - * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks - * are not concatenated. A `while` loop is necessary to consume all data - * currently in the buffer. When reading a large file `.read()` may return `null`, - * having consumed all buffered content so far, but there is still more data to - * come not yet buffered. In this case a new `'readable'` event will be emitted - * when there is more data in the buffer. Finally the `'end'` event will be - * emitted when there is no more data to come. - * - * Therefore to read a file's whole contents from a `readable`, it is necessary - * to collect chunks across multiple `'readable'` events: - * - * ```js - * const chunks = []; - * - * readable.on('readable', () => { - * let chunk; - * while (null !== (chunk = readable.read())) { - * chunks.push(chunk); - * } - * }); - * - * readable.on('end', () => { - * const content = chunks.join(''); - * }); - * ``` - * - * A `Readable` stream in object mode will always return a single item from - * a call to `readable.read(size)`, regardless of the value of the `size` argument. - * - * If the `readable.read()` method returns a chunk of data, a `'data'` event will - * also be emitted. - * - * Calling {@link read} after the `'end'` event has - * been emitted will return `null`. No runtime error will be raised. - * @since v0.9.4 - * @param size Optional argument to specify how much data to read. - */ - read(size?: number): any; - /** - * The `readable.setEncoding()` method sets the character encoding for - * data read from the `Readable` stream. - * - * By default, no encoding is assigned and stream data will be returned as `Buffer` objects. Setting an encoding causes the stream data - * to be returned as strings of the specified encoding rather than as `Buffer` objects. For instance, calling `readable.setEncoding('utf8')` will cause the - * output data to be interpreted as UTF-8 data, and passed as strings. Calling `readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal - * string format. - * - * The `Readable` stream will properly handle multi-byte characters delivered - * through the stream that would otherwise become improperly decoded if simply - * pulled from the stream as `Buffer` objects. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.setEncoding('utf8'); - * readable.on('data', (chunk) => { - * assert.equal(typeof chunk, 'string'); - * console.log('Got %d characters of string data:', chunk.length); - * }); - * ``` - * @since v0.9.4 - * @param encoding The encoding to use. - */ - setEncoding(encoding: BufferEncoding): this; - /** - * The `readable.pause()` method will cause a stream in flowing mode to stop - * emitting `'data'` events, switching out of flowing mode. Any data that - * becomes available will remain in the internal buffer. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.on('data', (chunk) => { - * console.log(`Received ${chunk.length} bytes of data.`); - * readable.pause(); - * console.log('There will be no additional data for 1 second.'); - * setTimeout(() => { - * console.log('Now data will start flowing again.'); - * readable.resume(); - * }, 1000); - * }); - * ``` - * - * The `readable.pause()` method has no effect if there is a `'readable'` event listener. - * @since v0.9.4 - */ - pause(): this; - /** - * The `readable.resume()` method causes an explicitly paused `Readable` stream to - * resume emitting `'data'` events, switching the stream into flowing mode. - * - * The `readable.resume()` method can be used to fully consume the data from a - * stream without actually processing any of that data: - * - * ```js - * getReadableStreamSomehow() - * .resume() - * .on('end', () => { - * console.log('Reached the end, but did not read anything.'); - * }); - * ``` - * - * The `readable.resume()` method has no effect if there is a `'readable'` event listener. - * @since v0.9.4 - */ - resume(): this; - /** - * The `readable.isPaused()` method returns the current operating state of the `Readable`. - * This is used primarily by the mechanism that underlies the `readable.pipe()` method. - * In most typical cases, there will be no reason to use this method directly. - * - * ```js - * const readable = new stream.Readable(); - * - * readable.isPaused(); // === false - * readable.pause(); - * readable.isPaused(); // === true - * readable.resume(); - * readable.isPaused(); // === false - * ``` - * @since v0.11.14 - */ - isPaused(): boolean; - /** - * The `readable.unpipe()` method detaches a `Writable` stream previously attached - * using the {@link pipe} method. - * - * If the `destination` is not specified, then _all_ pipes are detached. - * - * If the `destination` is specified, but no pipe is set up for it, then - * the method does nothing. - * - * ```js - * import fs from 'node:fs'; - * const readable = getReadableStreamSomehow(); - * const writable = fs.createWriteStream('file.txt'); - * // All the data from readable goes into 'file.txt', - * // but only for the first second. - * readable.pipe(writable); - * setTimeout(() => { - * console.log('Stop writing to file.txt.'); - * readable.unpipe(writable); - * console.log('Manually close the file stream.'); - * writable.end(); - * }, 1000); - * ``` - * @since v0.9.4 - * @param destination Optional specific stream to unpipe - */ - unpipe(destination?: NodeJS.WritableStream): this; - /** - * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the - * same as `readable.push(null)`, after which no more data can be written. The EOF - * signal is put at the end of the buffer and any buffered data will still be - * flushed. - * - * The `readable.unshift()` method pushes a chunk of data back into the internal - * buffer. This is useful in certain situations where a stream is being consumed by - * code that needs to "un-consume" some amount of data that it has optimistically - * pulled out of the source, so that the data can be passed on to some other party. - * - * The `stream.unshift(chunk)` method cannot be called after the `'end'` event - * has been emitted or a runtime error will be thrown. - * - * Developers using `stream.unshift()` often should consider switching to - * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. - * - * ```js - * // Pull off a header delimited by \n\n. - * // Use unshift() if we get too much. - * // Call the callback with (error, header, stream). - * import { StringDecoder } from 'node:string_decoder'; - * function parseHeader(stream, callback) { - * stream.on('error', callback); - * stream.on('readable', onReadable); - * const decoder = new StringDecoder('utf8'); - * let header = ''; - * function onReadable() { - * let chunk; - * while (null !== (chunk = stream.read())) { - * const str = decoder.write(chunk); - * if (str.includes('\n\n')) { - * // Found the header boundary. - * const split = str.split(/\n\n/); - * header += split.shift(); - * const remaining = split.join('\n\n'); - * const buf = Buffer.from(remaining, 'utf8'); - * stream.removeListener('error', callback); - * // Remove the 'readable' listener before unshifting. - * stream.removeListener('readable', onReadable); - * if (buf.length) - * stream.unshift(buf); - * // Now the body of the message can be read from the stream. - * callback(null, header, stream); - * return; - * } - * // Still reading the header. - * header += str; - * } - * } - * } - * ``` - * - * Unlike {@link push}, `stream.unshift(chunk)` will not - * end the reading process by resetting the internal reading state of the stream. - * This can cause unexpected results if `readable.unshift()` is called during a - * read (i.e. from within a {@link _read} implementation on a - * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, - * however it is best to simply avoid calling `readable.unshift()` while in the - * process of performing a read. - * @since v0.9.11 - * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must - * be a {string}, {Buffer}, {TypedArray}, {DataView} or `null`. For object mode streams, `chunk` may be any JavaScript value. - * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. - */ - unshift(chunk: any, encoding?: BufferEncoding): void; - /** - * Prior to Node.js 0.10, streams did not implement the entire `node:stream` module API as it is currently defined. (See `Compatibility` for more - * information.) - * - * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the `readable.wrap()` method can be used to create a `Readable` - * stream that uses - * the old stream as its data source. - * - * It will rarely be necessary to use `readable.wrap()` but the method has been - * provided as a convenience for interacting with older Node.js applications and - * libraries. - * - * ```js - * import { OldReader } from './old-api-module.js'; - * import { Readable } from 'node:stream'; - * const oreader = new OldReader(); - * const myReader = new Readable().wrap(oreader); - * - * myReader.on('readable', () => { - * myReader.read(); // etc. - * }); - * ``` - * @since v0.9.4 - * @param stream An "old style" readable stream - */ - wrap(stream: NodeJS.ReadableStream): this; - push(chunk: any, encoding?: BufferEncoding): boolean; - /** - * The iterator created by this method gives users the option to cancel the destruction - * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`, - * or if the iterator should destroy the stream if the stream emitted an error during iteration. - * @since v16.3.0 - * @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator, - * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream. - * **Default: `true`**. - */ - iterator(options?: { destroyOnReturn?: boolean }): NodeJS.AsyncIterator; - /** - * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream. - * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream. - * @since v17.4.0, v16.14.0 - * @param fn a function to map over every chunk in the stream. Async or not. - * @returns a stream mapped with the function *fn*. - */ - map(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; - /** - * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called - * and if it returns a truthy value, the chunk will be passed to the result stream. - * If the *fn* function returns a promise - that promise will be `await`ed. - * @since v17.4.0, v16.14.0 - * @param fn a function to filter chunks from the stream. Async or not. - * @returns a stream filtered with the predicate *fn*. - */ - filter( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Readable; - /** - * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called. - * If the *fn* function returns a promise - that promise will be `await`ed. - * - * This method is different from `for await...of` loops in that it can optionally process chunks concurrently. - * In addition, a `forEach` iteration can only be stopped by having passed a `signal` option - * and aborting the related AbortController while `for await...of` can be stopped with `break` or `return`. - * In either case the stream will be destroyed. - * - * This method is different from listening to the `'data'` event in that it uses the `readable` event - * in the underlying machinary and can limit the number of concurrent *fn* calls. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise for when the stream has finished. - */ - forEach( - fn: (data: any, options?: Pick) => void | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method allows easily obtaining the contents of a stream. - * - * As this method reads the entire stream into memory, it negates the benefits of streams. It's intended - * for interoperability and convenience, not as the primary way to consume streams. - * @since v17.5.0 - * @returns a promise containing an array with the contents of the stream. - */ - toArray(options?: Pick): Promise; - /** - * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream - * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk - * `await`ed return value is truthy, the stream is destroyed and the promise is fulfilled with `true`. - * If none of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `false`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks. - */ - some( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream - * to find a chunk with a truthy value for *fn*. Once an *fn* call's awaited return value is truthy, - * the stream is destroyed and the promise is fulfilled with value for which *fn* returned a truthy value. - * If all of the *fn* calls on the chunks return a falsy value, the promise is fulfilled with `undefined`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to the first chunk for which *fn* evaluated with a truthy value, - * or `undefined` if no element was found. - */ - find( - fn: (data: any, options?: Pick) => data is T, - options?: ArrayOptions, - ): Promise; - find( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream - * to check if all awaited return values are truthy value for *fn*. Once an *fn* call on a chunk - * `await`ed return value is falsy, the stream is destroyed and the promise is fulfilled with `false`. - * If all of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `true`. - * @since v17.5.0 - * @param fn a function to call on each chunk of the stream. Async or not. - * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks. - */ - every( - fn: (data: any, options?: Pick) => boolean | Promise, - options?: ArrayOptions, - ): Promise; - /** - * This method returns a new stream by applying the given callback to each chunk of the stream - * and then flattening the result. - * - * It is possible to return a stream or another iterable or async iterable from *fn* and the result streams - * will be merged (flattened) into the returned stream. - * @since v17.5.0 - * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator. - * @returns a stream flat-mapped with the function *fn*. - */ - flatMap(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; - /** - * This method returns a new stream with the first *limit* chunks dropped from the start. - * @since v17.5.0 - * @param limit the number of chunks to drop from the readable. - * @returns a stream with *limit* chunks dropped from the start. - */ - drop(limit: number, options?: Pick): Readable; - /** - * This method returns a new stream with the first *limit* chunks. - * @since v17.5.0 - * @param limit the number of chunks to take from the readable. - * @returns a stream with *limit* chunks taken. - */ - take(limit: number, options?: Pick): Readable; - /** - * This method returns a new stream with chunks of the underlying stream paired with a counter - * in the form `[index, chunk]`. The first index value is `0` and it increases by 1 for each chunk produced. - * @since v17.5.0 - * @returns a stream of indexed pairs. - */ - asIndexedPairs(options?: Pick): Readable; - /** - * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation - * on the previous element. It returns a promise for the final value of the reduction. - * - * If no *initial* value is supplied the first chunk of the stream is used as the initial value. - * If the stream is empty, the promise is rejected with a `TypeError` with the `ERR_INVALID_ARGS` code property. - * - * The reducer function iterates the stream element-by-element which means that there is no *concurrency* parameter - * or parallelism. To perform a reduce concurrently, you can extract the async function to `readable.map` method. - * @since v17.5.0 - * @param fn a reducer function to call over every chunk in the stream. Async or not. - * @param initial the initial value to use in the reduction. - * @returns a promise for the final value of the reduction. - */ - reduce( - fn: (previous: any, data: any, options?: Pick) => T, - initial?: undefined, - options?: Pick, - ): Promise; - reduce( - fn: (previous: T, data: any, options?: Pick) => T, - initial: T, - options?: Pick, - ): Promise; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` event (unless `emitClose` is set to `false`). After this call, the readable - * stream will release any internal resources and subsequent calls to `push()` will be ignored. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, but instead implement `readable._destroy()`. - * @since v8.0.0 - * @param error Error which will be passed as payload in `'error'` event - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. end - * 4. error - * 5. pause - * 6. readable - * 7. resume - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "pause"): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - [Symbol.asyncIterator](): NodeJS.AsyncIterator; - /** - * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished. - * @since v20.4.0 - */ - [Symbol.asyncDispose](): Promise; - } - import WritableOptions = internal.WritableOptions; - class WritableBase extends Stream implements NodeJS.WritableStream { - /** - * Is `true` if it is safe to call `writable.write()`, which means - * the stream has not been destroyed, errored, or ended. - * @since v11.4.0 - */ - readonly writable: boolean; - /** - * Is `true` after `writable.end()` has been called. This property - * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. - * @since v12.9.0 - */ - readonly writableEnded: boolean; - /** - * Is set to `true` immediately before the `'finish'` event is emitted. - * @since v12.6.0 - */ - readonly writableFinished: boolean; - /** - * Return the value of `highWaterMark` passed when creating this `Writable`. - * @since v9.3.0 - */ - readonly writableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be written. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly writableLength: number; - /** - * Getter for the property `objectMode` of a given `Writable` stream. - * @since v12.3.0 - */ - readonly writableObjectMode: boolean; - /** - * Number of times `writable.uncork()` needs to be - * called in order to fully uncork the stream. - * @since v13.2.0, v12.16.0 - */ - readonly writableCorked: number; - /** - * Is `true` after `writable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - /** - * Is `true` after `'close'` has been emitted. - * @since v18.0.0 - */ - readonly closed: boolean; - /** - * Returns error if the stream has been destroyed with an error. - * @since v18.0.0 - */ - readonly errored: Error | null; - /** - * Is `true` if the stream's buffer has been full and stream will emit `'drain'`. - * @since v15.2.0, v14.17.0 - */ - readonly writableNeedDrain: boolean; - constructor(opts?: WritableOptions); - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - _construct?(callback: (error?: Error | null) => void): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - /** - * The `writable.write()` method writes some data to the stream, and calls the - * supplied `callback` once the data has been fully handled. If an error - * occurs, the `callback` will be called with the error as its - * first argument. The `callback` is called asynchronously and before `'error'` is - * emitted. - * - * The return value is `true` if the internal buffer is less than the `highWaterMark` configured when the stream was created after admitting `chunk`. - * If `false` is returned, further attempts to write data to the stream should - * stop until the `'drain'` event is emitted. - * - * While a stream is not draining, calls to `write()` will buffer `chunk`, and - * return false. Once all currently buffered chunks are drained (accepted for - * delivery by the operating system), the `'drain'` event will be emitted. - * Once `write()` returns false, do not write more chunks - * until the `'drain'` event is emitted. While calling `write()` on a stream that - * is not draining is allowed, Node.js will buffer all written chunks until - * maximum memory usage occurs, at which point it will abort unconditionally. - * Even before it aborts, high memory usage will cause poor garbage collector - * performance and high RSS (which is not typically released back to the system, - * even after the memory is no longer required). Since TCP sockets may never - * drain if the remote peer does not read the data, writing a socket that is - * not draining may lead to a remotely exploitable vulnerability. - * - * Writing data while the stream is not draining is particularly - * problematic for a `Transform`, because the `Transform` streams are paused - * by default until they are piped or a `'data'` or `'readable'` event handler - * is added. - * - * If the data to be written can be generated or fetched on demand, it is - * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is - * possible to respect backpressure and avoid memory issues using the `'drain'` event: - * - * ```js - * function write(data, cb) { - * if (!stream.write(data)) { - * stream.once('drain', cb); - * } else { - * process.nextTick(cb); - * } - * } - * - * // Wait for cb to be called before doing any other write. - * write('hello', () => { - * console.log('Write completed, do more writes now.'); - * }); - * ``` - * - * A `Writable` stream in object mode will always ignore the `encoding` argument. - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, - * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`. - * @param [encoding='utf8'] The encoding, if `chunk` is a string. - * @param callback Callback for when this chunk of data is flushed. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; - /** - * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. - * @since v0.11.15 - * @param encoding The new default encoding - */ - setDefaultEncoding(encoding: BufferEncoding): this; - /** - * Calling the `writable.end()` method signals that no more data will be written - * to the `Writable`. The optional `chunk` and `encoding` arguments allow one - * final additional chunk of data to be written immediately before closing the - * stream. - * - * Calling the {@link write} method after calling {@link end} will raise an error. - * - * ```js - * // Write 'hello, ' and then end with 'world!'. - * import fs from 'node:fs'; - * const file = fs.createWriteStream('example.txt'); - * file.write('hello, '); - * file.end('world!'); - * // Writing more now is not allowed! - * ``` - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, - * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`. - * @param encoding The encoding if `chunk` is a string - * @param callback Callback for when the stream is finished. - */ - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; - /** - * The `writable.cork()` method forces all written data to be buffered in memory. - * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. - * - * The primary intent of `writable.cork()` is to accommodate a situation in which - * several small chunks are written to the stream in rapid succession. Instead of - * immediately forwarding them to the underlying destination, `writable.cork()` buffers all the chunks until `writable.uncork()` is called, which will pass them - * all to `writable._writev()`, if present. This prevents a head-of-line blocking - * situation where data is being buffered while waiting for the first small chunk - * to be processed. However, use of `writable.cork()` without implementing `writable._writev()` may have an adverse effect on throughput. - * - * See also: `writable.uncork()`, `writable._writev()`. - * @since v0.11.2 - */ - cork(): void; - /** - * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. - * - * When using `writable.cork()` and `writable.uncork()` to manage the buffering - * of writes to a stream, defer calls to `writable.uncork()` using `process.nextTick()`. Doing so allows batching of all `writable.write()` calls that occur within a given Node.js event - * loop phase. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.write('data '); - * process.nextTick(() => stream.uncork()); - * ``` - * - * If the `writable.cork()` method is called multiple times on a stream, the - * same number of calls to `writable.uncork()` must be called to flush the buffered - * data. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.cork(); - * stream.write('data '); - * process.nextTick(() => { - * stream.uncork(); - * // The data will not be flushed until uncork() is called a second time. - * stream.uncork(); - * }); - * ``` - * - * See also: `writable.cork()`. - * @since v0.11.2 - */ - uncork(): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` event (unless `emitClose` is set to `false`). After this call, the writable - * stream has ended and subsequent calls to `write()` or `end()` will result in - * an `ERR_STREAM_DESTROYED` error. - * This is a destructive and immediate way to destroy a stream. Previous calls to `write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. - * Use `end()` instead of destroy if data should flush before close, or wait for - * the `'drain'` event before destroying the stream. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, - * but instead implement `writable._destroy()`. - * @since v8.0.0 - * @param error Optional, an error to emit with `'error'` event. - */ - destroy(error?: Error): this; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. drain - * 3. error - * 4. finish - * 5. pipe - * 6. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - namespace internal { - class Stream extends internal { - constructor(opts?: ReadableOptions); - } - interface StreamOptions extends Abortable { - emitClose?: boolean | undefined; - highWaterMark?: number | undefined; - objectMode?: boolean | undefined; - construct?(this: T, callback: (error?: Error | null) => void): void; - destroy?(this: T, error: Error | null, callback: (error?: Error | null) => void): void; - autoDestroy?: boolean | undefined; - } - interface ReadableOptions extends StreamOptions { - encoding?: BufferEncoding | undefined; - read?(this: Readable, size: number): void; - } - /** - * @since v0.9.4 - */ - class Readable extends ReadableBase { - /** - * A utility method for creating a `Readable` from a web `ReadableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - readableStream: streamWeb.ReadableStream, - options?: Pick, - ): Readable; - /** - * A utility method for creating a web `ReadableStream` from a `Readable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamReadable: Readable): streamWeb.ReadableStream; - } - interface WritableOptions extends StreamOptions { - decodeStrings?: boolean | undefined; - defaultEncoding?: BufferEncoding | undefined; - write?( - this: Writable, - chunk: any, - encoding: BufferEncoding, - callback: (error?: Error | null) => void, - ): void; - writev?( - this: Writable, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Writable, callback: (error?: Error | null) => void): void; - } - /** - * @since v0.9.4 - */ - class Writable extends WritableBase { - /** - * A utility method for creating a `Writable` from a web `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - writableStream: streamWeb.WritableStream, - options?: Pick, - ): Writable; - /** - * A utility method for creating a web `WritableStream` from a `Writable`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamWritable: Writable): streamWeb.WritableStream; - } - interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean | undefined; - readableObjectMode?: boolean | undefined; - writableObjectMode?: boolean | undefined; - readableHighWaterMark?: number | undefined; - writableHighWaterMark?: number | undefined; - writableCorked?: number | undefined; - construct?(this: Duplex, callback: (error?: Error | null) => void): void; - read?(this: Duplex, size: number): void; - write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Duplex, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Duplex, callback: (error?: Error | null) => void): void; - destroy?(this: Duplex, error: Error | null, callback: (error?: Error | null) => void): void; - } - /** - * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Duplex` streams include: - * - * * `TCP sockets` - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Duplex extends ReadableBase implements WritableBase { - readonly writable: boolean; - readonly writableEnded: boolean; - readonly writableFinished: boolean; - readonly writableHighWaterMark: number; - readonly writableLength: number; - readonly writableObjectMode: boolean; - readonly writableCorked: number; - readonly writableNeedDrain: boolean; - readonly closed: boolean; - readonly errored: Error | null; - /** - * If `false` then the stream will automatically end the writable side when the - * readable side ends. Set initially by the `allowHalfOpen` constructor option, - * which defaults to `true`. - * - * This can be changed manually to change the half-open behavior of an existing - * `Duplex` stream instance, but must be changed before the `'end'` event is emitted. - * @since v0.9.4 - */ - allowHalfOpen: boolean; - constructor(opts?: DuplexOptions); - /** - * A utility method for creating duplex streams. - * - * - `Stream` converts writable stream into writable `Duplex` and readable stream - * to `Duplex`. - * - `Blob` converts into readable `Duplex`. - * - `string` converts into readable `Duplex`. - * - `ArrayBuffer` converts into readable `Duplex`. - * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. - * - `AsyncGeneratorFunction` converts into a readable/writable transform - * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield - * `null`. - * - `AsyncFunction` converts into a writable `Duplex`. Must return - * either `null` or `undefined` - * - `Object ({ writable, readable })` converts `readable` and - * `writable` into `Stream` and then combines them into `Duplex` where the - * `Duplex` will write to the `writable` and read from the `readable`. - * - `Promise` converts into readable `Duplex`. Value `null` is ignored. - * - * @since v16.8.0 - */ - static from( - src: - | Stream - | NodeBlob - | ArrayBuffer - | string - | Iterable - | AsyncIterable - | AsyncGeneratorFunction - | Promise - | Object, - ): Duplex; - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; - setDefaultEncoding(encoding: BufferEncoding): this; - end(cb?: () => void): this; - end(chunk: any, cb?: () => void): this; - end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this; - cork(): void; - uncork(): void; - /** - * A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`. - * @since v17.0.0 - * @experimental - */ - static toWeb(streamDuplex: Duplex): { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }; - /** - * A utility method for creating a `Duplex` from a web `ReadableStream` and `WritableStream`. - * @since v17.0.0 - * @experimental - */ - static fromWeb( - duplexStream: { - readable: streamWeb.ReadableStream; - writable: streamWeb.WritableStream; - }, - options?: Pick< - DuplexOptions, - "allowHalfOpen" | "decodeStrings" | "encoding" | "highWaterMark" | "objectMode" | "signal" - >, - ): Duplex; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. drain - * 4. end - * 5. error - * 6. finish - * 7. pause - * 8. pipe - * 9. readable - * 10. resume - * 11. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pause"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pause", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pause", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * The utility function `duplexPair` returns an Array with two items, - * each being a `Duplex` stream connected to the other side: - * - * ```js - * const [ sideA, sideB ] = duplexPair(); - * ``` - * - * Whatever is written to one stream is made readable on the other. It provides - * behavior analogous to a network connection, where the data written by the client - * becomes readable by the server, and vice-versa. - * - * The Duplex streams are symmetrical; one or the other may be used without any - * difference in behavior. - * @param options A value to pass to both {@link Duplex} constructors, - * to set options such as buffering. - * @since v22.6.0 - */ - function duplexPair(options?: DuplexOptions): [Duplex, Duplex]; - type TransformCallback = (error?: Error | null, data?: any) => void; - interface TransformOptions extends DuplexOptions { - construct?(this: Transform, callback: (error?: Error | null) => void): void; - read?(this: Transform, size: number): void; - write?( - this: Transform, - chunk: any, - encoding: BufferEncoding, - callback: (error?: Error | null) => void, - ): void; - writev?( - this: Transform, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void, - ): void; - final?(this: Transform, callback: (error?: Error | null) => void): void; - destroy?(this: Transform, error: Error | null, callback: (error?: Error | null) => void): void; - transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - flush?(this: Transform, callback: TransformCallback): void; - } - /** - * Transform streams are `Duplex` streams where the output is in some way - * related to the input. Like all `Duplex` streams, `Transform` streams - * implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Transform` streams include: - * - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Transform extends Duplex { - constructor(opts?: TransformOptions); - _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - _flush(callback: TransformCallback): void; - } - /** - * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is - * primarily for examples and testing, but there are some use cases where `stream.PassThrough` is useful as a building block for novel sorts of streams. - */ - class PassThrough extends Transform {} - /** - * A stream to attach a signal to. - * - * Attaches an AbortSignal to a readable or writeable stream. This lets code - * control stream destruction using an `AbortController`. - * - * Calling `abort` on the `AbortController` corresponding to the passed `AbortSignal` will behave the same way as calling `.destroy(new AbortError())` on the - * stream, and `controller.error(new AbortError())` for webstreams. - * - * ```js - * import fs from 'node:fs'; - * - * const controller = new AbortController(); - * const read = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')), - * ); - * // Later, abort the operation closing the stream - * controller.abort(); - * ``` - * - * Or using an `AbortSignal` with a readable stream as an async iterable: - * - * ```js - * const controller = new AbortController(); - * setTimeout(() => controller.abort(), 10_000); // set a timeout - * const stream = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')), - * ); - * (async () => { - * try { - * for await (const chunk of stream) { - * await process(chunk); - * } - * } catch (e) { - * if (e.name === 'AbortError') { - * // The operation was cancelled - * } else { - * throw e; - * } - * } - * })(); - * ``` - * - * Or using an `AbortSignal` with a ReadableStream: - * - * ```js - * const controller = new AbortController(); - * const rs = new ReadableStream({ - * start(controller) { - * controller.enqueue('hello'); - * controller.enqueue('world'); - * controller.close(); - * }, - * }); - * - * addAbortSignal(controller.signal, rs); - * - * finished(rs, (err) => { - * if (err) { - * if (err.name === 'AbortError') { - * // The operation was cancelled - * } - * } - * }); - * - * const reader = rs.getReader(); - * - * reader.read().then(({ value, done }) => { - * console.log(value); // hello - * console.log(done); // false - * controller.abort(); - * }); - * ``` - * @since v15.4.0 - * @param signal A signal representing possible cancellation - * @param stream A stream to attach a signal to. - */ - function addAbortSignal(signal: AbortSignal, stream: T): T; - /** - * Returns the default highWaterMark used by streams. - * Defaults to `65536` (64 KiB), or `16` for `objectMode`. - * @since v19.9.0 - */ - function getDefaultHighWaterMark(objectMode: boolean): number; - /** - * Sets the default highWaterMark used by streams. - * @since v19.9.0 - * @param value highWaterMark value - */ - function setDefaultHighWaterMark(objectMode: boolean, value: number): void; - interface FinishedOptions extends Abortable { - error?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - } - /** - * A readable and/or writable stream/webstream. - * - * A function to get notified when a stream is no longer readable, writable - * or has experienced an error or a premature close event. - * - * ```js - * import { finished } from 'node:stream'; - * import fs from 'node:fs'; - * - * const rs = fs.createReadStream('archive.tar'); - * - * finished(rs, (err) => { - * if (err) { - * console.error('Stream failed.', err); - * } else { - * console.log('Stream is done reading.'); - * } - * }); - * - * rs.resume(); // Drain the stream. - * ``` - * - * Especially useful in error handling scenarios where a stream is destroyed - * prematurely (like an aborted HTTP request), and will not emit `'end'` or `'finish'`. - * - * The `finished` API provides [`promise version`](https://nodejs.org/docs/latest-v22.x/api/stream.html#streamfinishedstream-options). - * - * `stream.finished()` leaves dangling event listeners (in particular `'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been - * invoked. The reason for this is so that unexpected `'error'` events (due to - * incorrect stream implementations) do not cause unexpected crashes. - * If this is unwanted behavior then the returned cleanup function needs to be - * invoked in the callback: - * - * ```js - * const cleanup = finished(rs, (err) => { - * cleanup(); - * // ... - * }); - * ``` - * @since v10.0.0 - * @param stream A readable and/or writable stream. - * @param callback A callback function that takes an optional error argument. - * @returns A cleanup function which removes all registered listeners. - */ - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options: FinishedOptions, - callback: (err?: NodeJS.ErrnoException | null) => void, - ): () => void; - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - callback: (err?: NodeJS.ErrnoException | null) => void, - ): () => void; - namespace finished { - function __promisify__( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options?: FinishedOptions, - ): Promise; - } - type PipelineSourceFunction = () => Iterable | AsyncIterable; - type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; - type PipelineTransform, U> = - | NodeJS.ReadWriteStream - | (( - source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable - : S, - ) => AsyncIterable); - type PipelineTransformSource = PipelineSource | PipelineTransform; - type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; - type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; - type PipelineDestination, P> = S extends - PipelineTransformSource ? - | NodeJS.WritableStream - | PipelineDestinationIterableFunction - | PipelineDestinationPromiseFunction - : never; - type PipelineCallback> = S extends - PipelineDestinationPromiseFunction ? (err: NodeJS.ErrnoException | null, value: P) => void - : (err: NodeJS.ErrnoException | null) => void; - type PipelinePromise> = S extends - PipelineDestinationPromiseFunction ? Promise

: Promise; - interface PipelineOptions { - signal?: AbortSignal | undefined; - end?: boolean | undefined; - } - /** - * A module method to pipe between streams and generators forwarding errors and - * properly cleaning up and provide a callback when the pipeline is complete. - * - * ```js - * import { pipeline } from 'node:stream'; - * import fs from 'node:fs'; - * import zlib from 'node:zlib'; - * - * // Use the pipeline API to easily pipe a series of streams - * // together and get notified when the pipeline is fully done. - * - * // A pipeline to gzip a potentially huge tar file efficiently: - * - * pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * (err) => { - * if (err) { - * console.error('Pipeline failed.', err); - * } else { - * console.log('Pipeline succeeded.'); - * } - * }, - * ); - * ``` - * - * The `pipeline` API provides a [`promise version`](https://nodejs.org/docs/latest-v22.x/api/stream.html#streampipelinesource-transforms-destination-options). - * - * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: - * - * * `Readable` streams which have emitted `'end'` or `'close'`. - * * `Writable` streams which have emitted `'finish'` or `'close'`. - * - * `stream.pipeline()` leaves dangling event listeners on the streams - * after the `callback` has been invoked. In the case of reuse of streams after - * failure, this can cause event listener leaks and swallowed errors. If the last - * stream is readable, dangling event listeners will be removed so that the last - * stream can be consumed later. - * - * `stream.pipeline()` closes all the streams when an error is raised. - * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior - * once it would destroy the socket without sending the expected response. - * See the example below: - * - * ```js - * import fs from 'node:fs'; - * import http from 'node:http'; - * import { pipeline } from 'node:stream'; - * - * const server = http.createServer((req, res) => { - * const fileStream = fs.createReadStream('./fileNotExist.txt'); - * pipeline(fileStream, res, (err) => { - * if (err) { - * console.log(err); // No such file - * // this message can't be sent once `pipeline` already destroyed the socket - * return res.end('error!!!'); - * } - * }); - * }); - * ``` - * @since v10.0.0 - * @param callback Called when the pipeline is fully done. - */ - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - callback: PipelineCallback, - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline( - streams: ReadonlyArray, - callback: (err: NodeJS.ErrnoException | null) => void, - ): NodeJS.WritableStream; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array< - NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void) - > - ): NodeJS.WritableStream; - namespace pipeline { - function __promisify__, B extends PipelineDestination>( - source: A, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function __promisify__( - streams: ReadonlyArray, - options?: PipelineOptions, - ): Promise; - function __promisify__( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; - } - interface Pipe { - close(): void; - hasRef(): boolean; - ref(): void; - unref(): void; - } - /** - * Returns whether the stream has encountered an error. - * @since v17.3.0, v16.14.0 - * @experimental - */ - function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean; - /** - * Returns whether the stream is readable. - * @since v17.4.0, v16.14.0 - * @experimental - */ - function isReadable(stream: Readable | NodeJS.ReadableStream): boolean; - const promises: typeof streamPromises; - const consumers: typeof streamConsumers; - } - export = internal; -} -declare module "node:stream" { - import stream = require("stream"); - export = stream; -} diff --git a/node_modules/@types/node/stream/consumers.d.ts b/node_modules/@types/node/stream/consumers.d.ts deleted file mode 100644 index 5ad9cba..0000000 --- a/node_modules/@types/node/stream/consumers.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare module "stream/consumers" { - import { Blob as NodeBlob } from "node:buffer"; - import { Readable } from "node:stream"; - function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; - function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable): Promise; -} -declare module "node:stream/consumers" { - export * from "stream/consumers"; -} diff --git a/node_modules/@types/node/stream/promises.d.ts b/node_modules/@types/node/stream/promises.d.ts deleted file mode 100644 index 6eac5b7..0000000 --- a/node_modules/@types/node/stream/promises.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -declare module "stream/promises" { - import { - FinishedOptions, - PipelineDestination, - PipelineOptions, - PipelinePromise, - PipelineSource, - PipelineTransform, - } from "node:stream"; - function finished( - stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, - options?: FinishedOptions, - ): Promise; - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination, - >( - source: A, - transform1: T1, - transform2: T2, - transform3: T3, - transform4: T4, - destination: B, - options?: PipelineOptions, - ): PipelinePromise; - function pipeline( - streams: ReadonlyArray, - options?: PipelineOptions, - ): Promise; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; -} -declare module "node:stream/promises" { - export * from "stream/promises"; -} diff --git a/node_modules/@types/node/stream/web.d.ts b/node_modules/@types/node/stream/web.d.ts deleted file mode 100644 index 5da8a98..0000000 --- a/node_modules/@types/node/stream/web.d.ts +++ /dev/null @@ -1,609 +0,0 @@ -type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ByteLengthQueuingStrategy; -type _CompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {} - : import("stream/web").CompressionStream; -type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").CountQueuingStrategy; -type _DecompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {} - : import("stream/web").DecompressionStream; -type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableByteStreamController; -type _ReadableStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStream; -type _ReadableStreamBYOBReader = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamBYOBReader; -type _ReadableStreamBYOBRequest = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamBYOBRequest; -type _ReadableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamDefaultController; -type _ReadableStreamDefaultReader = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").ReadableStreamDefaultReader; -type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TextDecoderStream; -type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TextEncoderStream; -type _TransformStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TransformStream; -type _TransformStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").TransformStreamDefaultController; -type _WritableStream = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").WritableStream; -type _WritableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").WritableStreamDefaultController; -type _WritableStreamDefaultWriter = typeof globalThis extends { onmessage: any } ? {} - : import("stream/web").WritableStreamDefaultWriter; - -declare module "stream/web" { - // stub module, pending copy&paste from .d.ts or manual impl - // copy from lib.dom.d.ts - interface ReadableWritablePair { - readable: ReadableStream; - /** - * Provides a convenient, chainable way of piping this readable stream - * through a transform stream (or any other { writable, readable } - * pair). It simply pipes the stream into the writable side of the - * supplied pair, and returns the readable side for further use. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - */ - writable: WritableStream; - } - interface StreamPipeOptions { - preventAbort?: boolean; - preventCancel?: boolean; - /** - * Pipes this readable stream to a given writable stream destination. - * The way in which the piping process behaves under various error - * conditions can be customized with a number of passed options. It - * returns a promise that fulfills when the piping process completes - * successfully, or rejects if any errors were encountered. - * - * Piping a stream will lock it for the duration of the pipe, preventing - * any other consumer from acquiring a reader. - * - * Errors and closures of the source and destination streams propagate - * as follows: - * - * An error in this source readable stream will abort destination, - * unless preventAbort is truthy. The returned promise will be rejected - * with the source's error, or with any error that occurs during - * aborting the destination. - * - * An error in destination will cancel this source readable stream, - * unless preventCancel is truthy. The returned promise will be rejected - * with the destination's error, or with any error that occurs during - * canceling the source. - * - * When this source readable stream closes, destination will be closed, - * unless preventClose is truthy. The returned promise will be fulfilled - * once this process completes, unless an error is encountered while - * closing the destination, in which case it will be rejected with that - * error. - * - * If destination starts out closed or closing, this source readable - * stream will be canceled, unless preventCancel is true. The returned - * promise will be rejected with an error indicating piping to a closed - * stream failed, or with any error that occurs during canceling the - * source. - * - * The signal option can be set to an AbortSignal to allow aborting an - * ongoing pipe operation via the corresponding AbortController. In this - * case, this source readable stream will be canceled, and destination - * aborted, unless the respective options preventCancel or preventAbort - * are set. - */ - preventClose?: boolean; - signal?: AbortSignal; - } - interface ReadableStreamGenericReader { - readonly closed: Promise; - cancel(reason?: any): Promise; - } - type ReadableStreamController = ReadableStreamDefaultController; - interface ReadableStreamReadValueResult { - done: false; - value: T; - } - interface ReadableStreamReadDoneResult { - done: true; - value?: T; - } - type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; - interface ReadableByteStreamControllerCallback { - (controller: ReadableByteStreamController): void | PromiseLike; - } - interface UnderlyingSinkAbortCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSinkCloseCallback { - (): void | PromiseLike; - } - interface UnderlyingSinkStartCallback { - (controller: WritableStreamDefaultController): any; - } - interface UnderlyingSinkWriteCallback { - (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; - } - interface UnderlyingSourceCancelCallback { - (reason?: any): void | PromiseLike; - } - interface UnderlyingSourcePullCallback { - (controller: ReadableStreamController): void | PromiseLike; - } - interface UnderlyingSourceStartCallback { - (controller: ReadableStreamController): any; - } - interface TransformerFlushCallback { - (controller: TransformStreamDefaultController): void | PromiseLike; - } - interface TransformerStartCallback { - (controller: TransformStreamDefaultController): any; - } - interface TransformerTransformCallback { - (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; - } - interface UnderlyingByteSource { - autoAllocateChunkSize?: number; - cancel?: ReadableStreamErrorCallback; - pull?: ReadableByteStreamControllerCallback; - start?: ReadableByteStreamControllerCallback; - type: "bytes"; - } - interface UnderlyingSource { - cancel?: UnderlyingSourceCancelCallback; - pull?: UnderlyingSourcePullCallback; - start?: UnderlyingSourceStartCallback; - type?: undefined; - } - interface UnderlyingSink { - abort?: UnderlyingSinkAbortCallback; - close?: UnderlyingSinkCloseCallback; - start?: UnderlyingSinkStartCallback; - type?: undefined; - write?: UnderlyingSinkWriteCallback; - } - interface ReadableStreamErrorCallback { - (reason: any): void | PromiseLike; - } - interface ReadableStreamAsyncIterator extends NodeJS.AsyncIterator { - [Symbol.asyncIterator](): ReadableStreamAsyncIterator; - } - /** This Streams API interface represents a readable stream of byte data. */ - interface ReadableStream { - readonly locked: boolean; - cancel(reason?: any): Promise; - getReader(options: { mode: "byob" }): ReadableStreamBYOBReader; - getReader(): ReadableStreamDefaultReader; - getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader; - pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; - pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; - tee(): [ReadableStream, ReadableStream]; - values(options?: { preventCancel?: boolean }): ReadableStreamAsyncIterator; - [Symbol.asyncIterator](): ReadableStreamAsyncIterator; - } - const ReadableStream: { - prototype: ReadableStream; - from(iterable: Iterable | AsyncIterable): ReadableStream; - new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; - new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; - }; - 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 = ReadableStreamDefaultReader | ReadableStreamBYOBReader; - interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { - read(): Promise>; - releaseLock(): void; - } - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */ - interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */ - read(view: T): Promise>; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */ - releaseLock(): void; - } - const ReadableStreamDefaultReader: { - prototype: ReadableStreamDefaultReader; - new(stream: ReadableStream): ReadableStreamDefaultReader; - }; - 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; - close(): void; - enqueue(chunk: ArrayBufferView): void; - error(error?: any): void; - } - const ReadableByteStreamController: { - prototype: ReadableByteStreamController; - new(): ReadableByteStreamController; - }; - interface ReadableStreamDefaultController { - readonly desiredSize: number | null; - close(): void; - enqueue(chunk?: R): void; - error(e?: any): void; - } - const ReadableStreamDefaultController: { - prototype: ReadableStreamDefaultController; - new(): ReadableStreamDefaultController; - }; - interface Transformer { - flush?: TransformerFlushCallback; - readableType?: undefined; - start?: TransformerStartCallback; - transform?: TransformerTransformCallback; - writableType?: undefined; - } - interface TransformStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const TransformStream: { - prototype: TransformStream; - new( - transformer?: Transformer, - writableStrategy?: QueuingStrategy, - readableStrategy?: QueuingStrategy, - ): TransformStream; - }; - interface TransformStreamDefaultController { - readonly desiredSize: number | null; - enqueue(chunk?: O): void; - error(reason?: any): void; - terminate(): void; - } - const TransformStreamDefaultController: { - prototype: TransformStreamDefaultController; - new(): TransformStreamDefaultController; - }; - /** - * This Streams API interface provides a standard abstraction for writing - * streaming data to a destination, known as a sink. This object comes with - * built-in back pressure and queuing. - */ - interface WritableStream { - readonly locked: boolean; - abort(reason?: any): Promise; - close(): Promise; - getWriter(): WritableStreamDefaultWriter; - } - const WritableStream: { - prototype: WritableStream; - new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; - }; - /** - * This Streams API interface is the object returned by - * WritableStream.getWriter() and once created locks the < writer to the - * WritableStream ensuring that no other streams can write to the underlying - * sink. - */ - interface WritableStreamDefaultWriter { - readonly closed: Promise; - readonly desiredSize: number | null; - readonly ready: Promise; - abort(reason?: any): Promise; - close(): Promise; - releaseLock(): void; - write(chunk?: W): Promise; - } - const WritableStreamDefaultWriter: { - prototype: WritableStreamDefaultWriter; - new(stream: WritableStream): WritableStreamDefaultWriter; - }; - /** - * This Streams API interface represents a controller allowing control of a - * WritableStream's state. When constructing a WritableStream, the - * underlying sink is given a corresponding WritableStreamDefaultController - * instance to manipulate. - */ - interface WritableStreamDefaultController { - error(e?: any): void; - } - const WritableStreamDefaultController: { - prototype: WritableStreamDefaultController; - new(): WritableStreamDefaultController; - }; - interface QueuingStrategy { - highWaterMark?: number; - size?: QueuingStrategySize; - } - interface QueuingStrategySize { - (chunk?: T): number; - } - interface QueuingStrategyInit { - /** - * Creates a new ByteLengthQueuingStrategy with the provided high water - * mark. - * - * Note that the provided high water mark will not be validated ahead of - * time. Instead, if it is negative, NaN, or not a number, the resulting - * ByteLengthQueuingStrategy will cause the corresponding stream - * constructor to throw. - */ - highWaterMark: number; - } - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface ByteLengthQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const ByteLengthQueuingStrategy: { - prototype: ByteLengthQueuingStrategy; - new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; - }; - /** - * This Streams API interface provides a built-in byte length queuing - * strategy that can be used when constructing streams. - */ - interface CountQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; - } - const CountQueuingStrategy: { - prototype: CountQueuingStrategy; - new(init: QueuingStrategyInit): CountQueuingStrategy; - }; - interface TextEncoderStream { - /** Returns "utf-8". */ - readonly encoding: "utf-8"; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextEncoderStream: { - prototype: TextEncoderStream; - new(): TextEncoderStream; - }; - interface TextDecoderOptions { - fatal?: boolean; - ignoreBOM?: boolean; - } - type BufferSource = ArrayBufferView | ArrayBuffer; - interface TextDecoderStream { - /** Returns encoding's name, lower cased. */ - readonly encoding: string; - /** Returns `true` if error mode is "fatal", and `false` otherwise. */ - readonly fatal: boolean; - /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ - readonly ignoreBOM: boolean; - readonly readable: ReadableStream; - readonly writable: WritableStream; - readonly [Symbol.toStringTag]: string; - } - const TextDecoderStream: { - prototype: TextDecoderStream; - new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream; - }; - interface CompressionStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - const CompressionStream: { - prototype: CompressionStream; - new(format: "deflate" | "deflate-raw" | "gzip"): CompressionStream; - }; - interface DecompressionStream { - readonly writable: WritableStream; - readonly readable: ReadableStream; - } - const DecompressionStream: { - prototype: DecompressionStream; - new(format: "deflate" | "deflate-raw" | "gzip"): DecompressionStream; - }; - - 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 CompressionStream extends _CompressionStream {} - /** - * `CompressionStream` class is a global reference for `import { CompressionStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-compressionstream - * @since v18.0.0 - */ - var CompressionStream: typeof globalThis extends { - onmessage: any; - // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit. - // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts - ReportingObserver: any; - CompressionStream: infer T; - } ? T - // TS 4.8, 4.9, 5.0 - : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? { - prototype: T; - new(format: "deflate" | "deflate-raw" | "gzip"): T; - } - : typeof import("stream/web").CompressionStream; - - 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 DecompressionStream extends _DecompressionStream {} - /** - * `DecompressionStream` class is a global reference for `import { DecompressionStream } from 'node:stream/web'`. - * https://nodejs.org/api/globals.html#class-decompressionstream - * @since v18.0.0 - */ - var DecompressionStream: typeof globalThis extends { - onmessage: any; - // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit. - // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts - ReportingObserver: any; - DecompressionStream: infer T extends object; - } ? T - // TS 4.8, 4.9, 5.0 - : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? { - prototype: T; - new(format: "deflate" | "deflate-raw" | "gzip"): T; - } - : typeof import("stream/web").DecompressionStream; - - 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 extends _ReadableStream {} - /** - * `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 extends _ReadableStreamDefaultController {} - /** - * `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 extends _ReadableStreamDefaultReader {} - /** - * `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 extends _TransformStream {} - /** - * `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 extends _TransformStreamDefaultController {} - /** - * `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 extends _WritableStream {} - /** - * `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 extends _WritableStreamDefaultWriter {} - /** - * `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; - } -} -declare module "node:stream/web" { - export * from "stream/web"; -} diff --git a/node_modules/@types/node/string_decoder.d.ts b/node_modules/@types/node/string_decoder.d.ts deleted file mode 100644 index 350aace..0000000 --- a/node_modules/@types/node/string_decoder.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * The `node:string_decoder` module provides an API for decoding `Buffer` objects - * into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 - * characters. It can be accessed using: - * - * ```js - * import { StringDecoder } from 'node:string_decoder'; - * ``` - * - * The following example shows the basic use of the `StringDecoder` class. - * - * ```js - * import { StringDecoder } from 'node:string_decoder'; - * const decoder = new StringDecoder('utf8'); - * - * const cent = Buffer.from([0xC2, 0xA2]); - * console.log(decoder.write(cent)); // Prints: ¢ - * - * const euro = Buffer.from([0xE2, 0x82, 0xAC]); - * console.log(decoder.write(euro)); // Prints: € - * ``` - * - * When a `Buffer` instance is written to the `StringDecoder` instance, an - * internal buffer is used to ensure that the decoded string does not contain - * any incomplete multibyte characters. These are held in the buffer until the - * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. - * - * In the following example, the three UTF-8 encoded bytes of the European Euro - * symbol (`€`) are written over three separate operations: - * - * ```js - * 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/v22.x/lib/string_decoder.js) - */ -declare module "string_decoder" { - class StringDecoder { - constructor(encoding?: BufferEncoding); - /** - * Returns a decoded string, ensuring that any incomplete multibyte characters at - * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the - * returned string and stored in an internal buffer for the next call to `stringDecoder.write()` or `stringDecoder.end()`. - * @since v0.1.99 - * @param buffer The bytes to decode. - */ - write(buffer: string | Buffer | 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 - * substitution characters appropriate for the character encoding. - * - * If the `buffer` argument is provided, one final call to `stringDecoder.write()` is performed before returning the remaining input. - * After `end()` is called, the `stringDecoder` object can be reused for new input. - * @since v0.9.3 - * @param buffer The bytes to decode. - */ - end(buffer?: string | Buffer | NodeJS.ArrayBufferView): string; - } -} -declare module "node:string_decoder" { - export * from "string_decoder"; -} diff --git a/node_modules/@types/node/test.d.ts b/node_modules/@types/node/test.d.ts deleted file mode 100644 index 42ff08e..0000000 --- a/node_modules/@types/node/test.d.ts +++ /dev/null @@ -1,2098 +0,0 @@ -/** - * The `node:test` module facilitates the creation of JavaScript tests. - * To access it: - * - * ```js - * import test from 'node:test'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import test from 'node:test'; - * ``` - * - * Tests created via the `test` module consist of a single function that is - * processed in one of three ways: - * - * 1. A synchronous function that is considered failing if it throws an exception, - * and is considered passing otherwise. - * 2. A function that returns a `Promise` that is considered failing if the `Promise` rejects, and is considered passing if the `Promise` fulfills. - * 3. A function that receives a callback function. If the callback receives any - * truthy value as its first argument, the test is considered failing. If a - * falsy value is passed as the first argument to the callback, the test is - * considered passing. If the test function receives a callback function and - * also returns a `Promise`, the test will fail. - * - * The following example illustrates how tests are written using the `test` module. - * - * ```js - * test('synchronous passing test', (t) => { - * // This test passes because it does not throw an exception. - * assert.strictEqual(1, 1); - * }); - * - * test('synchronous failing test', (t) => { - * // This test fails because it throws an exception. - * assert.strictEqual(1, 2); - * }); - * - * test('asynchronous passing test', async (t) => { - * // This test passes because the Promise returned by the async - * // function is settled and not rejected. - * assert.strictEqual(1, 1); - * }); - * - * test('asynchronous failing test', async (t) => { - * // This test fails because the Promise returned by the async - * // function is rejected. - * assert.strictEqual(1, 2); - * }); - * - * test('failing test using Promises', (t) => { - * // Promises can be used directly as well. - * return new Promise((resolve, reject) => { - * setImmediate(() => { - * reject(new Error('this will cause the test to fail')); - * }); - * }); - * }); - * - * test('callback passing test', (t, done) => { - * // done() is the callback function. When the setImmediate() runs, it invokes - * // done() with no arguments. - * setImmediate(done); - * }); - * - * test('callback failing test', (t, done) => { - * // When the setImmediate() runs, done() is invoked with an Error object and - * // the test fails. - * setImmediate(() => { - * done(new Error('callback failure')); - * }); - * }); - * ``` - * - * If any tests fail, the process exit code is set to `1`. - * @since v18.0.0, v16.17.0 - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/test.js) - */ -declare module "node:test" { - import { Readable } from "node:stream"; - /** - * **Note:** `shard` is used to horizontally parallelize test running across - * machines or processes, ideal for large-scale executions across varied - * environments. It's incompatible with `watch` mode, tailored for rapid - * code iteration by automatically rerunning tests on file changes. - * - * ```js - * import { tap } from 'node:test/reporters'; - * import { run } from 'node:test'; - * import process from 'node:process'; - * import path from 'node:path'; - * - * run({ files: [path.resolve('./tests/test.js')] }) - * .compose(tap) - * .pipe(process.stdout); - * ``` - * @since v18.9.0, v16.19.0 - * @param options Configuration options for running tests. - */ - function run(options?: RunOptions): TestsStream; - /** - * The `test()` function is the value imported from the `test` module. Each - * invocation of this function results in reporting the test to the `TestsStream`. - * - * The `TestContext` object passed to the `fn` argument can be used to perform - * actions related to the current test. Examples include skipping the test, adding - * additional diagnostic information, or creating subtests. - * - * `test()` returns a `Promise` that fulfills once the test completes. - * if `test()` is called within a suite, it fulfills immediately. - * The return value can usually be discarded for top level tests. - * However, the return value from subtests should be used to prevent the parent - * test from finishing first and cancelling the subtest - * as shown in the following example. - * - * ```js - * test('top level test', async (t) => { - * // The setTimeout() in the following subtest would cause it to outlive its - * // parent test if 'await' is removed on the next line. Once the parent test - * // completes, it will cancel any outstanding subtests. - * await t.test('longer running subtest', async (t) => { - * return new Promise((resolve, reject) => { - * setTimeout(resolve, 1000); - * }); - * }); - * }); - * ``` - * - * The `timeout` option can be used to fail the test if it takes longer than `timeout` milliseconds to complete. However, it is not a reliable mechanism for - * canceling tests because a running test might block the application thread and - * thus prevent the scheduled cancellation. - * @since v18.0.0, v16.17.0 - * @param name The name of the test, which is displayed when reporting test results. - * Defaults to the `name` property of `fn`, or `''` if `fn` does not have a name. - * @param options Configuration options for the test. - * @param fn The function under test. The first argument to this function is a {@link TestContext} object. - * If the test uses callbacks, the callback function is passed as the second argument. - * @return Fulfilled with `undefined` once the test completes, or immediately if the test runs within a suite. - */ - function test(name?: string, fn?: TestFn): Promise; - function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function test(options?: TestOptions, fn?: TestFn): Promise; - function test(fn?: TestFn): Promise; - namespace test { - export { - after, - afterEach, - before, - beforeEach, - describe, - it, - mock, - only, - run, - skip, - snapshot, - suite, - test, - todo, - }; - } - /** - * The `suite()` function is imported from the `node:test` module. - * @param name The name of the suite, which is displayed when reporting test results. - * Defaults to the `name` property of `fn`, or `''` if `fn` does not have a name. - * @param options Configuration options for the suite. This supports the same options as {@link test}. - * @param fn The suite function declaring nested tests and suites. The first argument to this function is a {@link SuiteContext} object. - * @return Immediately fulfilled with `undefined`. - * @since v20.13.0 - */ - function suite(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function suite(name?: string, fn?: SuiteFn): Promise; - function suite(options?: TestOptions, fn?: SuiteFn): Promise; - function suite(fn?: SuiteFn): Promise; - namespace suite { - /** - * Shorthand for skipping a suite. This is the same as calling {@link suite} with `options.skip` set to `true`. - * @since v20.13.0 - */ - function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function skip(name?: string, fn?: SuiteFn): Promise; - function skip(options?: TestOptions, fn?: SuiteFn): Promise; - function skip(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `TODO`. This is the same as calling {@link suite} with `options.todo` set to `true`. - * @since v20.13.0 - */ - function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function todo(name?: string, fn?: SuiteFn): Promise; - function todo(options?: TestOptions, fn?: SuiteFn): Promise; - function todo(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `only`. This is the same as calling {@link suite} with `options.only` set to `true`. - * @since v20.13.0 - */ - function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function only(name?: string, fn?: SuiteFn): Promise; - function only(options?: TestOptions, fn?: SuiteFn): Promise; - function only(fn?: SuiteFn): Promise; - } - /** - * Alias for {@link suite}. - * - * The `describe()` function is imported from the `node:test` module. - */ - function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function describe(name?: string, fn?: SuiteFn): Promise; - function describe(options?: TestOptions, fn?: SuiteFn): Promise; - function describe(fn?: SuiteFn): Promise; - namespace describe { - /** - * Shorthand for skipping a suite. This is the same as calling {@link describe} with `options.skip` set to `true`. - * @since v18.15.0 - */ - function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function skip(name?: string, fn?: SuiteFn): Promise; - function skip(options?: TestOptions, fn?: SuiteFn): Promise; - function skip(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `TODO`. This is the same as calling {@link describe} with `options.todo` set to `true`. - * @since v18.15.0 - */ - function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function todo(name?: string, fn?: SuiteFn): Promise; - function todo(options?: TestOptions, fn?: SuiteFn): Promise; - function todo(fn?: SuiteFn): Promise; - /** - * Shorthand for marking a suite as `only`. This is the same as calling {@link describe} with `options.only` set to `true`. - * @since v18.15.0 - */ - function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; - function only(name?: string, fn?: SuiteFn): Promise; - function only(options?: TestOptions, fn?: SuiteFn): Promise; - function only(fn?: SuiteFn): Promise; - } - /** - * Alias for {@link test}. - * - * The `it()` function is imported from the `node:test` module. - * @since v18.6.0, v16.17.0 - */ - function it(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function it(name?: string, fn?: TestFn): Promise; - function it(options?: TestOptions, fn?: TestFn): Promise; - function it(fn?: TestFn): Promise; - namespace it { - /** - * Shorthand for skipping a test. This is the same as calling {@link it} with `options.skip` set to `true`. - */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function skip(name?: string, fn?: TestFn): Promise; - function skip(options?: TestOptions, fn?: TestFn): Promise; - function skip(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `TODO`. This is the same as calling {@link it} with `options.todo` set to `true`. - */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function todo(name?: string, fn?: TestFn): Promise; - function todo(options?: TestOptions, fn?: TestFn): Promise; - function todo(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `only`. This is the same as calling {@link it} with `options.only` set to `true`. - * @since v18.15.0 - */ - function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function only(name?: string, fn?: TestFn): Promise; - function only(options?: TestOptions, fn?: TestFn): Promise; - function only(fn?: TestFn): Promise; - } - /** - * Shorthand for skipping a test. This is the same as calling {@link test} with `options.skip` set to `true`. - * @since v20.2.0 - */ - function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function skip(name?: string, fn?: TestFn): Promise; - function skip(options?: TestOptions, fn?: TestFn): Promise; - function skip(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `TODO`. This is the same as calling {@link test} with `options.todo` set to `true`. - * @since v20.2.0 - */ - function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function todo(name?: string, fn?: TestFn): Promise; - function todo(options?: TestOptions, fn?: TestFn): Promise; - function todo(fn?: TestFn): Promise; - /** - * Shorthand for marking a test as `only`. This is the same as calling {@link test} with `options.only` set to `true`. - * @since v20.2.0 - */ - function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; - function only(name?: string, fn?: TestFn): Promise; - function only(options?: TestOptions, fn?: TestFn): Promise; - function only(fn?: TestFn): Promise; - /** - * The type of a function passed to {@link test}. The first argument to this function is a {@link TestContext} object. - * If the test uses callbacks, the callback function is passed as the second argument. - */ - type TestFn = (t: TestContext, done: (result?: any) => void) => void | Promise; - /** - * The type of a suite test function. The argument to this function is a {@link SuiteContext} object. - */ - type SuiteFn = (s: SuiteContext) => void | Promise; - interface TestShard { - /** - * A positive integer between 1 and `total` that specifies the index of the shard to run. - */ - index: number; - /** - * A positive integer that specifies the total number of shards to split the test files to. - */ - total: number; - } - interface RunOptions { - /** - * If a number is provided, then that many test processes would run in parallel, where each process corresponds to one test file. - * If `true`, it would run `os.availableParallelism() - 1` test files in parallel. If `false`, it would only run one test file at a time. - * @default false - */ - concurrency?: number | boolean | undefined; - /** - * An array containing the list of files to run. If omitted, files are run according to the - * [test runner execution model](https://nodejs.org/docs/latest-v22.x/api/test.html#test-runner-execution-model). - */ - files?: readonly string[] | undefined; - /** - * Configures the test runner to exit the process once all known - * tests have finished executing even if the event loop would - * otherwise remain active. - * @default false - */ - forceExit?: boolean | undefined; - /** - * An array containing the list of glob patterns to match test files. - * This option cannot be used together with `files`. If omitted, files are run according to the - * [test runner execution model](https://nodejs.org/docs/latest-v22.x/api/test.html#test-runner-execution-model). - * @since v22.6.0 - */ - globPatterns?: readonly string[] | undefined; - /** - * Sets inspector port of test child process. - * If a nullish value is provided, each process gets its own port, - * incremented from the primary's `process.debugPort`. - * @default undefined - */ - inspectPort?: number | (() => number) | undefined; - /** - * If truthy, the test context will only run tests that have the `only` option set - */ - only?: boolean | undefined; - /** - * A function that accepts the `TestsStream` instance and can be used to setup listeners before any tests are run. - * @default undefined - */ - setup?: ((reporter: TestsStream) => void | Promise) | undefined; - /** - * Allows aborting an in-progress test execution. - */ - signal?: AbortSignal | undefined; - /** - * If provided, only run tests whose name matches the provided pattern. - * Strings are interpreted as JavaScript regular expressions. - * @default undefined - */ - testNamePatterns?: string | RegExp | ReadonlyArray | undefined; - /** - * A String, RegExp or a RegExp Array, that can be used to exclude running tests whose - * name matches the provided pattern. Test name patterns are interpreted as JavaScript - * regular expressions. For each test that is executed, any corresponding test hooks, - * such as `beforeEach()`, are also run. - * @default undefined - * @since v22.1.0 - */ - testSkipPatterns?: string | RegExp | ReadonlyArray | undefined; - /** - * The number of milliseconds after which the test execution will fail. - * If unspecified, subtests inherit this value from their parent. - * @default Infinity - */ - timeout?: number | undefined; - /** - * Whether to run in watch mode or not. - * @default false - */ - watch?: boolean | undefined; - /** - * Running tests in a specific shard. - * @default undefined - */ - shard?: TestShard | undefined; - } - /** - * A successful call to `run()` will return a new `TestsStream` object, streaming a series of events representing the execution of the tests. - * - * Some of the events are guaranteed to be emitted in the same order as the tests are defined, while others are emitted in the order that the tests execute. - * @since v18.9.0, v16.19.0 - */ - class TestsStream extends Readable implements NodeJS.ReadableStream { - addListener(event: "test:coverage", listener: (data: TestCoverage) => void): this; - addListener(event: "test:complete", listener: (data: TestComplete) => void): this; - addListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this; - addListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - addListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; - addListener(event: "test:fail", listener: (data: TestFail) => void): this; - addListener(event: "test:pass", listener: (data: TestPass) => void): this; - addListener(event: "test:plan", listener: (data: TestPlan) => void): this; - addListener(event: "test:start", listener: (data: TestStart) => void): this; - addListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - addListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - addListener(event: "test:watch:drained", listener: () => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; - emit(event: "test:coverage", data: TestCoverage): boolean; - emit(event: "test:complete", data: TestComplete): boolean; - emit(event: "test:dequeue", data: TestDequeue): boolean; - emit(event: "test:diagnostic", data: DiagnosticData): boolean; - emit(event: "test:enqueue", data: TestEnqueue): boolean; - emit(event: "test:fail", data: TestFail): boolean; - emit(event: "test:pass", data: TestPass): boolean; - emit(event: "test:plan", data: TestPlan): boolean; - emit(event: "test:start", data: TestStart): boolean; - emit(event: "test:stderr", data: TestStderr): boolean; - emit(event: "test:stdout", data: TestStdout): boolean; - emit(event: "test:watch:drained"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: "test:coverage", listener: (data: TestCoverage) => void): this; - on(event: "test:complete", listener: (data: TestComplete) => void): this; - on(event: "test:dequeue", listener: (data: TestDequeue) => void): this; - on(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - on(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; - on(event: "test:fail", listener: (data: TestFail) => void): this; - on(event: "test:pass", listener: (data: TestPass) => void): this; - on(event: "test:plan", listener: (data: TestPlan) => void): this; - on(event: "test:start", listener: (data: TestStart) => void): this; - on(event: "test:stderr", listener: (data: TestStderr) => void): this; - on(event: "test:stdout", listener: (data: TestStdout) => void): this; - on(event: "test:watch:drained", listener: () => void): this; - on(event: string, listener: (...args: any[]) => void): this; - once(event: "test:coverage", listener: (data: TestCoverage) => void): this; - once(event: "test:complete", listener: (data: TestComplete) => void): this; - once(event: "test:dequeue", listener: (data: TestDequeue) => void): this; - once(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - once(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; - once(event: "test:fail", listener: (data: TestFail) => void): this; - once(event: "test:pass", listener: (data: TestPass) => void): this; - once(event: "test:plan", listener: (data: TestPlan) => void): this; - once(event: "test:start", listener: (data: TestStart) => void): this; - once(event: "test:stderr", listener: (data: TestStderr) => void): this; - once(event: "test:stdout", listener: (data: TestStdout) => void): this; - once(event: "test:watch:drained", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "test:coverage", listener: (data: TestCoverage) => void): this; - prependListener(event: "test:complete", listener: (data: TestComplete) => void): this; - prependListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this; - prependListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - prependListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; - prependListener(event: "test:fail", listener: (data: TestFail) => void): this; - prependListener(event: "test:pass", listener: (data: TestPass) => void): this; - prependListener(event: "test:plan", listener: (data: TestPlan) => void): this; - prependListener(event: "test:start", listener: (data: TestStart) => void): this; - prependListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - prependListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - prependListener(event: "test:watch:drained", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "test:coverage", listener: (data: TestCoverage) => void): this; - prependOnceListener(event: "test:complete", listener: (data: TestComplete) => void): this; - prependOnceListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this; - prependOnceListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this; - prependOnceListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this; - prependOnceListener(event: "test:fail", listener: (data: TestFail) => void): this; - prependOnceListener(event: "test:pass", listener: (data: TestPass) => void): this; - prependOnceListener(event: "test:plan", listener: (data: TestPlan) => void): this; - prependOnceListener(event: "test:start", listener: (data: TestStart) => void): this; - prependOnceListener(event: "test:stderr", listener: (data: TestStderr) => void): this; - prependOnceListener(event: "test:stdout", listener: (data: TestStdout) => void): this; - prependOnceListener(event: "test:watch:drained", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - } - /** - * An instance of `TestContext` is passed to each test function in order to - * interact with the test runner. However, the `TestContext` constructor is not - * exposed as part of the API. - * @since v18.0.0, v16.17.0 - */ - class TestContext { - /** - * An object containing assertion methods bound to the test context. - * The top-level functions from the `node:assert` module are exposed here for the purpose of creating test plans. - * @since v22.2.0, v20.15.0 - */ - readonly assert: TestContextAssert; - /** - * This function is used to create a hook running before subtest of the current test. - * @param fn The hook function. The first argument to this function is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - * @since v20.1.0, v18.17.0 - */ - before(fn?: TestContextHookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running before each subtest of the current test. - * @param fn The hook function. The first argument to this function is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - beforeEach(fn?: TestContextHookFn, options?: HookOptions): void; - /** - * This function is used to create a hook that runs after the current test finishes. - * @param fn The hook function. The first argument to this function is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - * @since v18.13.0 - */ - after(fn?: TestContextHookFn, options?: HookOptions): void; - /** - * This function is used to create a hook running after each subtest of the current test. - * @param fn The hook function. The first argument to this function is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - * @since v18.8.0 - */ - afterEach(fn?: TestContextHookFn, options?: HookOptions): void; - /** - * This function is used to write diagnostics to the output. Any diagnostic - * information is included at the end of the test's results. This function does - * not return a value. - * - * ```js - * test('top level test', (t) => { - * t.diagnostic('A diagnostic message'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Message to be reported. - */ - diagnostic(message: string): void; - /** - * The absolute path of the test file that created the current test. If a test file imports - * additional modules that generate tests, the imported tests will return the path of the root test file. - * @since v22.6.0 - */ - readonly filePath: string | undefined; - /** - * The name of the test and each of its ancestors, separated by `>`. - * @since v22.3.0 - */ - readonly fullName: string; - /** - * The name of the test. - * @since v18.8.0, v16.18.0 - */ - readonly name: string; - /** - * Used to set the number of assertions and subtests that are expected to run within the test. - * If the number of assertions and subtests that run does not match the expected count, the test will fail. - * - * To make sure assertions are tracked, the assert functions on `context.assert` must be used, - * instead of importing from the `node:assert` module. - * ```js - * test('top level test', (t) => { - * t.plan(2); - * t.assert.ok('some relevant assertion here'); - * t.test('subtest', () => {}); - * }); - * ``` - * - * When working with asynchronous code, the `plan` function can be used to ensure that the correct number of assertions are run: - * ```js - * test('planning with streams', (t, done) => { - * function* generate() { - * yield 'a'; - * yield 'b'; - * yield 'c'; - * } - * const expected = ['a', 'b', 'c']; - * t.plan(expected.length); - * const stream = Readable.from(generate()); - * stream.on('data', (chunk) => { - * t.assert.strictEqual(chunk, expected.shift()); - * }); - * stream.on('end', () => { - * done(); - * }); - * }); - * ``` - * @since v22.2.0 - */ - plan(count: number): void; - /** - * If `shouldRunOnlyTests` is truthy, the test context will only run tests that - * have the `only` option set. Otherwise, all tests are run. If Node.js was not - * started with the `--test-only` command-line option, this function is a - * no-op. - * - * ```js - * test('top level test', (t) => { - * // The test context can be set to run subtests with the 'only' option. - * t.runOnly(true); - * return Promise.all([ - * t.test('this subtest is now skipped'), - * t.test('this subtest is run', { only: true }), - * ]); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param shouldRunOnlyTests Whether or not to run `only` tests. - */ - runOnly(shouldRunOnlyTests: boolean): void; - /** - * ```js - * test('top level test', async (t) => { - * await fetch('some/uri', { signal: t.signal }); - * }); - * ``` - * @since v18.7.0, v16.17.0 - */ - readonly signal: AbortSignal; - /** - * This function causes the test's output to indicate the test as skipped. If `message` is provided, it is included in the output. Calling `skip()` does - * not terminate execution of the test function. This function does not return a - * value. - * - * ```js - * test('top level test', (t) => { - * // Make sure to return here as well if the test contains additional logic. - * t.skip('this is skipped'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Optional skip message. - */ - skip(message?: string): void; - /** - * This function adds a `TODO` directive to the test's output. If `message` is - * provided, it is included in the output. Calling `todo()` does not terminate - * execution of the test function. This function does not return a value. - * - * ```js - * test('top level test', (t) => { - * // This test is marked as `TODO` - * t.todo('this is a todo'); - * }); - * ``` - * @since v18.0.0, v16.17.0 - * @param message Optional `TODO` message. - */ - todo(message?: string): void; - /** - * This function is used to create subtests under the current test. This function behaves in - * the same fashion as the top level {@link test} function. - * @since v18.0.0 - * @param name The name of the test, which is displayed when reporting test results. - * Defaults to the `name` property of `fn`, or `''` if `fn` does not have a name. - * @param options Configuration options for the test. - * @param fn The function under test. This first argument to this function is a {@link TestContext} object. - * If the test uses callbacks, the callback function is passed as the second argument. - * @returns A {@link Promise} resolved with `undefined` once the test completes. - */ - test: typeof test; - /** - * Each test provides its own MockTracker instance. - */ - readonly mock: MockTracker; - } - interface TestContextAssert { - /** - * Identical to the `deepEqual` function from the `node:assert` module, but bound to the test context. - */ - deepEqual: typeof import("node:assert").deepEqual; - /** - * Identical to the `deepStrictEqual` function from the `node:assert` module, but bound to the test context. - * - * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a - * type annotation, otherwise an error will be raised by the TypeScript compiler: - * ```ts - * import { test, type TestContext } from 'node:test'; - * - * // The test function's context parameter must have a type annotation. - * test('example', (t: TestContext) => { - * t.assert.deepStrictEqual(actual, expected); - * }); - * - * // Omitting the type annotation will result in a compilation error. - * test('example', t => { - * t.assert.deepStrictEqual(actual, expected); // Error: 't' needs an explicit type annotation. - * }); - * ``` - */ - deepStrictEqual: typeof import("node:assert").deepStrictEqual; - /** - * Identical to the `doesNotMatch` function from the `node:assert` module, but bound to the test context. - */ - doesNotMatch: typeof import("node:assert").doesNotMatch; - /** - * Identical to the `doesNotReject` function from the `node:assert` module, but bound to the test context. - */ - doesNotReject: typeof import("node:assert").doesNotReject; - /** - * Identical to the `doesNotThrow` function from the `node:assert` module, but bound to the test context. - */ - doesNotThrow: typeof import("node:assert").doesNotThrow; - /** - * Identical to the `equal` function from the `node:assert` module, but bound to the test context. - */ - equal: typeof import("node:assert").equal; - /** - * Identical to the `fail` function from the `node:assert` module, but bound to the test context. - */ - fail: typeof import("node:assert").fail; - /** - * Identical to the `ifError` function from the `node:assert` module, but bound to the test context. - * - * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a - * type annotation, otherwise an error will be raised by the TypeScript compiler: - * ```ts - * import { test, type TestContext } from 'node:test'; - * - * // The test function's context parameter must have a type annotation. - * test('example', (t: TestContext) => { - * t.assert.ifError(err); - * }); - * - * // Omitting the type annotation will result in a compilation error. - * test('example', t => { - * t.assert.ifError(err); // Error: 't' needs an explicit type annotation. - * }); - * ``` - */ - ifError: typeof import("node:assert").ifError; - /** - * Identical to the `match` function from the `node:assert` module, but bound to the test context. - */ - match: typeof import("node:assert").match; - /** - * Identical to the `notDeepEqual` function from the `node:assert` module, but bound to the test context. - */ - notDeepEqual: typeof import("node:assert").notDeepEqual; - /** - * Identical to the `notDeepStrictEqual` function from the `node:assert` module, but bound to the test context. - */ - notDeepStrictEqual: typeof import("node:assert").notDeepStrictEqual; - /** - * Identical to the `notEqual` function from the `node:assert` module, but bound to the test context. - */ - notEqual: typeof import("node:assert").notEqual; - /** - * Identical to the `notStrictEqual` function from the `node:assert` module, but bound to the test context. - */ - notStrictEqual: typeof import("node:assert").notStrictEqual; - /** - * Identical to the `ok` function from the `node:assert` module, but bound to the test context. - * - * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a - * type annotation, otherwise an error will be raised by the TypeScript compiler: - * ```ts - * import { test, type TestContext } from 'node:test'; - * - * // The test function's context parameter must have a type annotation. - * test('example', (t: TestContext) => { - * t.assert.ok(condition); - * }); - * - * // Omitting the type annotation will result in a compilation error. - * test('example', t => { - * t.assert.ok(condition)); // Error: 't' needs an explicit type annotation. - * }); - * ``` - */ - ok: typeof import("node:assert").ok; - /** - * Identical to the `rejects` function from the `node:assert` module, but bound to the test context. - */ - rejects: typeof import("node:assert").rejects; - /** - * Identical to the `strictEqual` function from the `node:assert` module, but bound to the test context. - * - * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a - * type annotation, otherwise an error will be raised by the TypeScript compiler: - * ```ts - * import { test, type TestContext } from 'node:test'; - * - * // The test function's context parameter must have a type annotation. - * test('example', (t: TestContext) => { - * t.assert.strictEqual(actual, expected); - * }); - * - * // Omitting the type annotation will result in a compilation error. - * test('example', t => { - * t.assert.strictEqual(actual, expected); // Error: 't' needs an explicit type annotation. - * }); - * ``` - */ - strictEqual: typeof import("node:assert").strictEqual; - /** - * Identical to the `throws` function from the `node:assert` module, but bound to the test context. - */ - throws: typeof import("node:assert").throws; - /** - * This function implements assertions for snapshot testing. - * ```js - * test('snapshot test with default serialization', (t) => { - * t.assert.snapshot({ value1: 1, value2: 2 }); - * }); - * - * test('snapshot test with custom serialization', (t) => { - * t.assert.snapshot({ value3: 3, value4: 4 }, { - * serializers: [(value) => JSON.stringify(value)] - * }); - * }); - * ``` - * - * Only available through the [--experimental-test-snapshots](https://nodejs.org/api/cli.html#--experimental-test-snapshots) flag. - * @since v22.3.0 - * @experimental - */ - snapshot(value: any, options?: AssertSnapshotOptions): void; - } - interface AssertSnapshotOptions { - /** - * An array of synchronous functions used to serialize `value` into a string. - * `value` is passed as the only argument to the first serializer function. - * The return value of each serializer is passed as input to the next serializer. - * Once all serializers have run, the resulting value is coerced to a string. - * - * If no serializers are provided, the test runner's default serializers are used. - */ - serializers?: ReadonlyArray<(value: any) => any> | undefined; - } - - /** - * An instance of `SuiteContext` is passed to each suite function in order to - * interact with the test runner. However, the `SuiteContext` constructor is not - * exposed as part of the API. - * @since v18.7.0, v16.17.0 - */ - class SuiteContext { - /** - * The absolute path of the test file that created the current suite. If a test file imports - * additional modules that generate suites, the imported suites will return the path of the root test file. - * @since v22.6.0 - */ - readonly filePath: string | undefined; - /** - * The name of the suite. - * @since v18.8.0, v16.18.0 - */ - readonly name: string; - /** - * Can be used to abort test subtasks when the test has been aborted. - * @since v18.7.0, v16.17.0 - */ - readonly signal: AbortSignal; - } - interface TestOptions { - /** - * If a number is provided, then that many tests would run in parallel. - * If truthy, it would run (number of cpu cores - 1) tests in parallel. - * For subtests, it will be `Infinity` tests in parallel. - * If falsy, it would only run one test at a time. - * If unspecified, subtests inherit this value from their parent. - * @default false - */ - concurrency?: number | boolean | undefined; - /** - * If truthy, and the test context is configured to run `only` tests, then this test will be - * run. Otherwise, the test is skipped. - * @default false - */ - only?: boolean | undefined; - /** - * Allows aborting an in-progress test. - * @since v18.8.0 - */ - signal?: AbortSignal | undefined; - /** - * If truthy, the test is skipped. If a string is provided, that string is displayed in the - * test results as the reason for skipping the test. - * @default false - */ - skip?: boolean | string | undefined; - /** - * A number of milliseconds the test will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - * @since v18.7.0 - */ - timeout?: number | undefined; - /** - * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in - * the test results as the reason why the test is `TODO`. - * @default false - */ - todo?: boolean | string | undefined; - /** - * The number of assertions and subtests expected to be run in the test. - * If the number of assertions run in the test does not match the number - * specified in the plan, the test will fail. - * @default undefined - * @since v22.2.0 - */ - plan?: number | undefined; - } - /** - * This function creates a hook that runs before executing a suite. - * - * ```js - * describe('tests', async () => { - * before(() => console.log('about to run some test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - */ - function before(fn?: HookFn, options?: HookOptions): void; - /** - * This function creates a hook that runs after executing a suite. - * - * ```js - * describe('tests', async () => { - * after(() => console.log('finished running tests')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - */ - function after(fn?: HookFn, options?: HookOptions): void; - /** - * This function creates a hook that runs before each test in the current suite. - * - * ```js - * describe('tests', async () => { - * beforeEach(() => console.log('about to run a test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - */ - function beforeEach(fn?: HookFn, options?: HookOptions): void; - /** - * This function creates a hook that runs after each test in the current suite. - * The `afterEach()` hook is run even if the test fails. - * - * ```js - * describe('tests', async () => { - * afterEach(() => console.log('finished running a test')); - * it('is a subtest', () => { - * assert.ok('some relevant assertion here'); - * }); - * }); - * ``` - * @since v18.8.0, v16.18.0 - * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument. - * @param options Configuration options for the hook. - */ - function afterEach(fn?: HookFn, options?: HookOptions): void; - /** - * The hook function. The first argument is the context in which the hook is called. - * If the hook uses callbacks, the callback function is passed as the second argument. - */ - type HookFn = (c: TestContext | SuiteContext, done: (result?: any) => void) => any; - /** - * The hook function. The first argument is a `TestContext` object. - * If the hook uses callbacks, the callback function is passed as the second argument. - */ - type TestContextHookFn = (t: TestContext, done: (result?: any) => void) => any; - /** - * Configuration options for hooks. - * @since v18.8.0 - */ - interface HookOptions { - /** - * Allows aborting an in-progress hook. - */ - signal?: AbortSignal | undefined; - /** - * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this - * value from their parent. - * @default Infinity - */ - timeout?: number | undefined; - } - interface MockFunctionOptions { - /** - * The number of times that the mock will use the behavior of `implementation`. - * Once the mock function has been called `times` times, - * it will automatically restore the behavior of `original`. - * This value must be an integer greater than zero. - * @default Infinity - */ - times?: number | undefined; - } - interface MockMethodOptions extends MockFunctionOptions { - /** - * If `true`, `object[methodName]` is treated as a getter. - * This option cannot be used with the `setter` option. - */ - getter?: boolean | undefined; - /** - * If `true`, `object[methodName]` is treated as a setter. - * This option cannot be used with the `getter` option. - */ - setter?: boolean | undefined; - } - type Mock = F & { - mock: MockFunctionContext; - }; - type NoOpFunction = (...args: any[]) => undefined; - type FunctionPropertyNames = { - [K in keyof T]: T[K] extends Function ? K : never; - }[keyof T]; - interface MockModuleOptions { - /** - * If false, each call to `require()` or `import()` generates a new mock module. - * If true, subsequent calls will return the same module mock, and the mock module is inserted into the CommonJS cache. - * @default false - */ - cache?: boolean | undefined; - /** - * The value to use as the mocked module's default export. - * - * If this value is not provided, ESM mocks do not include a default export. - * If the mock is a CommonJS or builtin module, this setting is used as the value of `module.exports`. - * If this value is not provided, CJS and builtin mocks use an empty object as the value of `module.exports`. - */ - defaultExport?: any; - /** - * An object whose keys and values are used to create the named exports of the mock module. - * - * If the mock is a CommonJS or builtin module, these values are copied onto `module.exports`. - * Therefore, if a mock is created with both named exports and a non-object default export, - * the mock will throw an exception when used as a CJS or builtin module. - */ - namedExports?: object | undefined; - } - /** - * The `MockTracker` class is used to manage mocking functionality. The test runner - * module provides a top level `mock` export which is a `MockTracker` instance. - * Each test also provides its own `MockTracker` instance via the test context's `mock` property. - * @since v19.1.0, v18.13.0 - */ - class MockTracker { - /** - * This function is used to create a mock function. - * - * The following example creates a mock function that increments a counter by one - * on each invocation. The `times` option is used to modify the mock behavior such - * that the first two invocations add two to the counter instead of one. - * - * ```js - * test('mocks a counting function', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne, addTwo, { times: 2 }); - * - * assert.strictEqual(fn(), 2); - * assert.strictEqual(fn(), 4); - * assert.strictEqual(fn(), 5); - * assert.strictEqual(fn(), 6); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param original An optional function to create a mock on. - * @param implementation An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and - * then restore the behavior of `original`. - * @param options Optional configuration options for the mock function. - * @return The mocked function. The mocked function contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the - * behavior of the mocked function. - */ - fn(original?: F, options?: MockFunctionOptions): Mock; - fn( - original?: F, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock; - /** - * This function is used to create a mock on an existing object method. The - * following example demonstrates how a mock is created on an existing object - * method. - * - * ```js - * test('spies on an object method', (t) => { - * const number = { - * value: 5, - * subtract(a) { - * return this.value - a; - * }, - * }; - * - * t.mock.method(number, 'subtract'); - * assert.strictEqual(number.subtract.mock.calls.length, 0); - * assert.strictEqual(number.subtract(3), 2); - * assert.strictEqual(number.subtract.mock.calls.length, 1); - * - * const call = number.subtract.mock.calls[0]; - * - * assert.deepStrictEqual(call.arguments, [3]); - * assert.strictEqual(call.result, 2); - * assert.strictEqual(call.error, undefined); - * assert.strictEqual(call.target, undefined); - * assert.strictEqual(call.this, number); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param object The object whose method is being mocked. - * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown. - * @param implementation An optional function used as the mock implementation for `object[methodName]`. - * @param options Optional configuration options for the mock method. - * @return The mocked method. The mocked method contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the - * behavior of the mocked method. - */ - method< - MockedObject extends object, - MethodName extends FunctionPropertyNames, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): MockedObject[MethodName] extends Function ? Mock - : never; - method< - MockedObject extends object, - MethodName extends FunctionPropertyNames, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation: Implementation, - options?: MockFunctionOptions, - ): MockedObject[MethodName] extends Function ? Mock - : never; - method( - object: MockedObject, - methodName: keyof MockedObject, - options: MockMethodOptions, - ): Mock; - method( - object: MockedObject, - methodName: keyof MockedObject, - implementation: Function, - options: MockMethodOptions, - ): Mock; - - /** - * This function is syntax sugar for `MockTracker.method` with `options.getter` set to `true`. - * @since v19.3.0, v18.13.0 - */ - getter< - MockedObject extends object, - MethodName extends keyof MockedObject, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): Mock<() => MockedObject[MethodName]>; - getter< - MockedObject extends object, - MethodName extends keyof MockedObject, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock<(() => MockedObject[MethodName]) | Implementation>; - /** - * This function is syntax sugar for `MockTracker.method` with `options.setter` set to `true`. - * @since v19.3.0, v18.13.0 - */ - setter< - MockedObject extends object, - MethodName extends keyof MockedObject, - >( - object: MockedObject, - methodName: MethodName, - options?: MockFunctionOptions, - ): Mock<(value: MockedObject[MethodName]) => void>; - setter< - MockedObject extends object, - MethodName extends keyof MockedObject, - Implementation extends Function, - >( - object: MockedObject, - methodName: MethodName, - implementation?: Implementation, - options?: MockFunctionOptions, - ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>; - - /** - * This function is used to mock the exports of ECMAScript modules, CommonJS modules, and Node.js builtin modules. - * Any references to the original module prior to mocking are not impacted. - * - * Only available through the [--experimental-test-module-mocks](https://nodejs.org/api/cli.html#--experimental-test-module-mocks) flag. - * @since v22.3.0 - * @experimental - * @param specifier A string identifying the module to mock. - * @param options Optional configuration options for the mock module. - */ - module(specifier: string, options?: MockModuleOptions): MockModuleContext; - - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTracker` and disassociates the mocks from the `MockTracker` instance. Once disassociated, the mocks can still be used, but the `MockTracker` instance can no longer be - * used to reset their behavior or - * otherwise interact with them. - * - * After each test completes, this function is called on the test context's `MockTracker`. If the global `MockTracker` is used extensively, calling this - * function manually is recommended. - * @since v19.1.0, v18.13.0 - */ - reset(): void; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTracker`. Unlike `mock.reset()`, `mock.restoreAll()` does - * not disassociate the mocks from the `MockTracker` instance. - * @since v19.1.0, v18.13.0 - */ - restoreAll(): void; - - timers: MockTimers; - } - const mock: MockTracker; - interface MockFunctionCall< - F extends Function, - ReturnType = F extends (...args: any) => infer T ? T - : F extends abstract new(...args: any) => infer T ? T - : unknown, - Args = F extends (...args: infer Y) => any ? Y - : F extends abstract new(...args: infer Y) => any ? Y - : unknown[], - > { - /** - * An array of the arguments passed to the mock function. - */ - arguments: Args; - /** - * If the mocked function threw then this property contains the thrown value. - */ - error: unknown | undefined; - /** - * The value returned by the mocked function. - * - * If the mocked function threw, it will be `undefined`. - */ - result: ReturnType | undefined; - /** - * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation. - */ - stack: Error; - /** - * If the mocked function is a constructor, this field contains the class being constructed. - * Otherwise this will be `undefined`. - */ - target: F extends abstract new(...args: any) => any ? F : undefined; - /** - * The mocked function's `this` value. - */ - this: unknown; - } - /** - * The `MockFunctionContext` class is used to inspect or manipulate the behavior of - * mocks created via the `MockTracker` APIs. - * @since v19.1.0, v18.13.0 - */ - class MockFunctionContext { - /** - * A getter that returns a copy of the internal array used to track calls to the - * mock. Each entry in the array is an object with the following properties. - * @since v19.1.0, v18.13.0 - */ - readonly calls: Array>; - /** - * This function returns the number of times that this mock has been invoked. This - * function is more efficient than checking `ctx.calls.length` because `ctx.calls` is a getter that creates a copy of the internal call tracking array. - * @since v19.1.0, v18.13.0 - * @return The number of times that this mock has been invoked. - */ - callCount(): number; - /** - * This function is used to change the behavior of an existing mock. - * - * The following example creates a mock function using `t.mock.fn()`, calls the - * mock function, and then changes the mock implementation to a different function. - * - * ```js - * test('changes a mock behavior', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne); - * - * assert.strictEqual(fn(), 1); - * fn.mock.mockImplementation(addTwo); - * assert.strictEqual(fn(), 3); - * assert.strictEqual(fn(), 5); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param implementation The function to be used as the mock's new implementation. - */ - mockImplementation(implementation: F): void; - /** - * This function is used to change the behavior of an existing mock for a single - * invocation. Once invocation `onCall` has occurred, the mock will revert to - * whatever behavior it would have used had `mockImplementationOnce()` not been - * called. - * - * The following example creates a mock function using `t.mock.fn()`, calls the - * mock function, changes the mock implementation to a different function for the - * next invocation, and then resumes its previous behavior. - * - * ```js - * test('changes a mock behavior once', (t) => { - * let cnt = 0; - * - * function addOne() { - * cnt++; - * return cnt; - * } - * - * function addTwo() { - * cnt += 2; - * return cnt; - * } - * - * const fn = t.mock.fn(addOne); - * - * assert.strictEqual(fn(), 1); - * fn.mock.mockImplementationOnce(addTwo); - * assert.strictEqual(fn(), 3); - * assert.strictEqual(fn(), 4); - * }); - * ``` - * @since v19.1.0, v18.13.0 - * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`. - * @param onCall The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown. - */ - mockImplementationOnce(implementation: F, onCall?: number): void; - /** - * Resets the call history of the mock function. - * @since v19.3.0, v18.13.0 - */ - resetCalls(): void; - /** - * Resets the implementation of the mock function to its original behavior. The - * mock can still be used after calling this function. - * @since v19.1.0, v18.13.0 - */ - restore(): void; - } - /** - * @since v22.3.0 - * @experimental - */ - class MockModuleContext { - /** - * Resets the implementation of the mock module. - * @since v22.3.0 - */ - restore(): void; - } - - type Timer = "setInterval" | "setTimeout" | "setImmediate" | "Date"; - interface MockTimersOptions { - apis: Timer[]; - now?: number | Date | undefined; - } - /** - * Mocking timers is a technique commonly used in software testing to simulate and - * control the behavior of timers, such as `setInterval` and `setTimeout`, - * without actually waiting for the specified time intervals. - * - * The MockTimers API also allows for mocking of the `Date` constructor and - * `setImmediate`/`clearImmediate` functions. - * - * The `MockTracker` provides a top-level `timers` export - * which is a `MockTimers` instance. - * @since v20.4.0 - * @experimental - */ - class MockTimers { - /** - * Enables timer mocking for the specified timers. - * - * **Note:** When you enable mocking for a specific timer, its associated - * clear function will also be implicitly mocked. - * - * **Note:** Mocking `Date` will affect the behavior of the mocked timers - * as they use the same internal clock. - * - * Example usage without setting initial time: - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['setInterval', 'Date'], now: 1234 }); - * ``` - * - * The above example enables mocking for the `Date` constructor, `setInterval` timer and - * implicitly mocks the `clearInterval` function. Only the `Date` constructor from `globalThis`, - * `setInterval` and `clearInterval` functions from `node:timers`, `node:timers/promises`, and `globalThis` will be mocked. - * - * Example usage with initial time set - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['Date'], now: 1000 }); - * ``` - * - * Example usage with initial Date object as time set - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.enable({ apis: ['Date'], now: new Date() }); - * ``` - * - * Alternatively, if you call `mock.timers.enable()` without any parameters: - * - * All timers (`'setInterval'`, `'clearInterval'`, `'Date'`, `'setImmediate'`, `'clearImmediate'`, `'setTimeout'`, and `'clearTimeout'`) - * will be mocked. - * - * The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout` functions from `node:timers`, `node:timers/promises`, - * and `globalThis` will be mocked. - * The `Date` constructor from `globalThis` will be mocked. - * - * If there is no initial epoch set, the initial date will be based on 0 in the Unix epoch. This is `January 1st, 1970, 00:00:00 UTC`. You can - * set an initial date by passing a now property to the `.enable()` method. This value will be used as the initial date for the mocked Date - * object. It can either be a positive integer, or another Date object. - * @since v20.4.0 - */ - enable(options?: MockTimersOptions): void; - /** - * You can use the `.setTime()` method to manually move the mocked date to another time. This method only accepts a positive integer. - * Note: This method will execute any mocked timers that are in the past from the new time. - * In the below example we are setting a new time for the mocked date. - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * test('sets the time of a date object', (context) => { - * // Optionally choose what to mock - * context.mock.timers.enable({ apis: ['Date'], now: 100 }); - * assert.strictEqual(Date.now(), 100); - * // Advance in time will also advance the date - * context.mock.timers.setTime(1000); - * context.mock.timers.tick(200); - * assert.strictEqual(Date.now(), 1200); - * }); - * ``` - */ - setTime(time: number): void; - /** - * This function restores the default behavior of all mocks that were previously - * created by this `MockTimers` instance and disassociates the mocks - * from the `MockTracker` instance. - * - * **Note:** After each test completes, this function is called on - * the test context's `MockTracker`. - * - * ```js - * import { mock } from 'node:test'; - * mock.timers.reset(); - * ``` - * @since v20.4.0 - */ - reset(): void; - /** - * Advances time for all mocked timers. - * - * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts - * only positive numbers. In Node.js, `setTimeout` with negative numbers is - * only supported for web compatibility reasons. - * - * The following example mocks a `setTimeout` function and - * by using `.tick` advances in - * time triggering all pending timers. - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * - * context.mock.timers.enable({ apis: ['setTimeout'] }); - * - * setTimeout(fn, 9999); - * - * assert.strictEqual(fn.mock.callCount(), 0); - * - * // Advance in time - * context.mock.timers.tick(9999); - * - * assert.strictEqual(fn.mock.callCount(), 1); - * }); - * ``` - * - * Alternativelly, the `.tick` function can be called many times - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * context.mock.timers.enable({ apis: ['setTimeout'] }); - * const nineSecs = 9000; - * setTimeout(fn, nineSecs); - * - * const twoSeconds = 3000; - * context.mock.timers.tick(twoSeconds); - * context.mock.timers.tick(twoSeconds); - * context.mock.timers.tick(twoSeconds); - * - * assert.strictEqual(fn.mock.callCount(), 1); - * }); - * ``` - * - * Advancing time using `.tick` will also advance the time for any `Date` object - * created after the mock was enabled (if `Date` was also set to be mocked). - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { - * const fn = context.mock.fn(); - * - * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); - * setTimeout(fn, 9999); - * - * assert.strictEqual(fn.mock.callCount(), 0); - * assert.strictEqual(Date.now(), 0); - * - * // Advance in time - * context.mock.timers.tick(9999); - * assert.strictEqual(fn.mock.callCount(), 1); - * assert.strictEqual(Date.now(), 9999); - * }); - * ``` - * @since v20.4.0 - */ - tick(milliseconds: number): void; - /** - * Triggers all pending mocked timers immediately. If the `Date` object is also - * mocked, it will also advance the `Date` object to the furthest timer's time. - * - * The example below triggers all pending timers immediately, - * causing them to execute without any delay. - * - * ```js - * import assert from 'node:assert'; - * import { test } from 'node:test'; - * - * test('runAll functions following the given order', (context) => { - * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); - * const results = []; - * setTimeout(() => results.push(1), 9999); - * - * // Notice that if both timers have the same timeout, - * // the order of execution is guaranteed - * setTimeout(() => results.push(3), 8888); - * setTimeout(() => results.push(2), 8888); - * - * assert.deepStrictEqual(results, []); - * - * context.mock.timers.runAll(); - * assert.deepStrictEqual(results, [3, 2, 1]); - * // The Date object is also advanced to the furthest timer's time - * assert.strictEqual(Date.now(), 9999); - * }); - * ``` - * - * **Note:** The `runAll()` function is specifically designed for - * triggering timers in the context of timer mocking. - * It does not have any effect on real-time system - * clocks or actual timers outside of the mocking environment. - * @since v20.4.0 - */ - runAll(): void; - /** - * Calls {@link MockTimers.reset()}. - */ - [Symbol.dispose](): void; - } - /** - * Only available through the [--experimental-test-snapshots](https://nodejs.org/api/cli.html#--experimental-test-snapshots) flag. - * @since v22.3.0 - * @experimental - */ - namespace snapshot { - /** - * This function is used to customize the default serialization mechanism used by the test runner. - * - * By default, the test runner performs serialization by calling `JSON.stringify(value, null, 2)` on the provided value. - * `JSON.stringify()` does have limitations regarding circular structures and supported data types. - * If a more robust serialization mechanism is required, this function should be used to specify a list of custom serializers. - * - * Serializers are called in order, with the output of the previous serializer passed as input to the next. - * The final result must be a string value. - * @since v22.3.0 - * @param serializers An array of synchronous functions used as the default serializers for snapshot tests. - */ - function setDefaultSnapshotSerializers(serializers: ReadonlyArray<(value: any) => any>): void; - /** - * This function is used to set a custom resolver for the location of the snapshot file used for snapshot testing. - * By default, the snapshot filename is the same as the entry point filename with `.snapshot` appended. - * @since v22.3.0 - * @param fn A function which returns a string specifying the location of the snapshot file. - * The function receives the path of the test file as its only argument. - * If `process.argv[1]` is not associated with a file (for example in the REPL), the input is undefined. - */ - function setResolveSnapshotPath(fn: (path: string | undefined) => string): void; - } - export { - after, - afterEach, - before, - beforeEach, - describe, - it, - Mock, - mock, - only, - run, - skip, - snapshot, - suite, - SuiteContext, - test, - test as default, - TestContext, - todo, - }; -} - -interface TestError extends Error { - cause: Error; -} -interface TestLocationInfo { - /** - * The column number where the test is defined, or - * `undefined` if the test was run through the REPL. - */ - column?: number; - /** - * The path of the test file, `undefined` if test was run through the REPL. - */ - file?: string; - /** - * The line number where the test is defined, or `undefined` if the test was run through the REPL. - */ - line?: number; -} -interface DiagnosticData extends TestLocationInfo { - /** - * The diagnostic message. - */ - message: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestCoverage { - /** - * An object containing the coverage report. - */ - summary: { - /** - * An array of coverage reports for individual files. - */ - files: Array<{ - /** - * The absolute path of the file. - */ - path: string; - /** - * The total number of lines. - */ - totalLineCount: number; - /** - * The total number of branches. - */ - totalBranchCount: number; - /** - * The total number of functions. - */ - totalFunctionCount: number; - /** - * The number of covered lines. - */ - coveredLineCount: number; - /** - * The number of covered branches. - */ - coveredBranchCount: number; - /** - * The number of covered functions. - */ - coveredFunctionCount: number; - /** - * The percentage of lines covered. - */ - coveredLinePercent: number; - /** - * The percentage of branches covered. - */ - coveredBranchPercent: number; - /** - * The percentage of functions covered. - */ - coveredFunctionPercent: number; - /** - * An array of functions representing function coverage. - */ - functions: Array<{ - /** - * The name of the function. - */ - name: string; - /** - * The line number where the function is defined. - */ - line: number; - /** - * The number of times the function was called. - */ - count: number; - }>; - /** - * An array of branches representing branch coverage. - */ - branches: Array<{ - /** - * The line number where the branch is defined. - */ - line: number; - /** - * The number of times the branch was taken. - */ - count: number; - }>; - /** - * An array of lines representing line numbers and the number of times they were covered. - */ - lines: Array<{ - /** - * The line number. - */ - line: number; - /** - * The number of times the line was covered. - */ - count: number; - }>; - }>; - /** - * An object containing a summary of coverage for all files. - */ - totals: { - /** - * The total number of lines. - */ - totalLineCount: number; - /** - * The total number of branches. - */ - totalBranchCount: number; - /** - * The total number of functions. - */ - totalFunctionCount: number; - /** - * The number of covered lines. - */ - coveredLineCount: number; - /** - * The number of covered branches. - */ - coveredBranchCount: number; - /** - * The number of covered functions. - */ - coveredFunctionCount: number; - /** - * The percentage of lines covered. - */ - coveredLinePercent: number; - /** - * The percentage of branches covered. - */ - coveredBranchPercent: number; - /** - * The percentage of functions covered. - */ - coveredFunctionPercent: number; - }; - /** - * The working directory when code coverage began. This - * is useful for displaying relative path names in case - * the tests changed the working directory of the Node.js process. - */ - workingDirectory: string; - }; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestComplete extends TestLocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * Whether the test passed or not. - */ - passed: boolean; - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * An error wrapping the error thrown by the test if it did not pass. - */ - error?: TestError; - /** - * The type of the test, used to denote whether this is a suite. - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; -} -interface TestDequeue extends TestLocationInfo { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestEnqueue extends TestLocationInfo { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestFail extends TestLocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * An error wrapping the error thrown by the test. - */ - error: TestError; - /** - * The type of the test, used to denote whether this is a suite. - * @since v20.0.0, v19.9.0, v18.17.0 - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; -} -interface TestPass extends TestLocationInfo { - /** - * Additional execution metadata. - */ - details: { - /** - * The duration of the test in milliseconds. - */ - duration_ms: number; - /** - * The type of the test, used to denote whether this is a suite. - * @since 20.0.0, 19.9.0, 18.17.0 - */ - type?: "suite"; - }; - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The ordinal number of the test. - */ - testNumber: number; - /** - * Present if `context.todo` is called. - */ - todo?: string | boolean; - /** - * Present if `context.skip` is called. - */ - skip?: string | boolean; -} -interface TestPlan extends TestLocationInfo { - /** - * The nesting level of the test. - */ - nesting: number; - /** - * The number of subtests that have ran. - */ - count: number; -} -interface TestStart extends TestLocationInfo { - /** - * The test name. - */ - name: string; - /** - * The nesting level of the test. - */ - nesting: number; -} -interface TestStderr { - /** - * The path of the test file. - */ - file: string; - /** - * The message written to `stderr`. - */ - message: string; -} -interface TestStdout { - /** - * The path of the test file. - */ - file: string; - /** - * The message written to `stdout`. - */ - message: string; -} - -/** - * The `node:test/reporters` module exposes the builtin-reporters for `node:test`. - * To access it: - * - * ```js - * import test from 'node:test/reporters'; - * ``` - * - * This module is only available under the `node:` scheme. The following will not - * work: - * - * ```js - * import test from 'node:test/reporters'; - * ``` - * @since v19.9.0 - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/test/reporters.js) - */ -declare module "node:test/reporters" { - import { Transform, TransformOptions } from "node:stream"; - - type TestEvent = - | { type: "test:coverage"; data: TestCoverage } - | { type: "test:complete"; data: TestComplete } - | { type: "test:dequeue"; data: TestDequeue } - | { type: "test:diagnostic"; data: DiagnosticData } - | { type: "test:enqueue"; data: TestEnqueue } - | { type: "test:fail"; data: TestFail } - | { type: "test:pass"; data: TestPass } - | { type: "test:plan"; data: TestPlan } - | { type: "test:start"; data: TestStart } - | { type: "test:stderr"; data: TestStderr } - | { type: "test:stdout"; data: TestStdout } - | { type: "test:watch:drained"; data: undefined }; - type TestEventGenerator = AsyncGenerator; - - interface ReporterConstructorWrapper Transform> { - new(...args: ConstructorParameters): InstanceType; - (...args: ConstructorParameters): InstanceType; - } - - /** - * The `dot` reporter outputs the test results in a compact format, - * where each passing test is represented by a `.`, - * and each failing test is represented by a `X`. - * @since v20.0.0 - */ - function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>; - /** - * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. - * @since v20.0.0 - */ - function tap(source: TestEventGenerator): AsyncGenerator; - class SpecReporter extends Transform { - constructor(); - } - /** - * The `spec` reporter outputs the test results in a human-readable format. - * @since v20.0.0 - */ - const spec: ReporterConstructorWrapper; - /** - * The `junit` reporter outputs test results in a jUnit XML format. - * @since v21.0.0 - */ - function junit(source: TestEventGenerator): AsyncGenerator; - class LcovReporter extends Transform { - constructor(opts?: Omit); - } - /** - * The `lcov` reporter outputs test coverage when used with the - * [`--experimental-test-coverage`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--experimental-test-coverage) flag. - * @since v22.0.0 - */ - // TODO: change the export to a wrapper function once node@0db38f0 is merged (breaking change) - // const lcov: ReporterConstructorWrapper; - const lcov: LcovReporter; - - export { dot, junit, lcov, spec, tap, TestEvent }; -} diff --git a/node_modules/@types/node/timers.d.ts b/node_modules/@types/node/timers.d.ts deleted file mode 100644 index a4ea3e5..0000000 --- a/node_modules/@types/node/timers.d.ts +++ /dev/null @@ -1,240 +0,0 @@ -/** - * 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 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/v22.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 { - /** - * Set to `false` to indicate that the scheduled `Timeout` - * should not require the Node.js event loop to remain active. - * @default true - */ - 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. - */ - class Immediate implements RefCounted { - /** - * 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` - */ - ref(): this; - /** - * When called, the active `Immediate` 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 `Immediate` object's callback is - * invoked. Calling `immediate.unref()` multiple times will have no effect. - * @since v9.7.0 - * @return 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 - */ - [Symbol.dispose](): void; - } - /** - * 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 - * 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 { - /** - * 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 - * @return 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; - /** - * If true, the `Timeout` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - /** - * 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 - * time. This is useful for refreshing a timer without allocating a new - * JavaScript object. - * - * Using this on a timer that has already called its callback will reactivate the - * timer. - * @since v10.2.0 - * @return a reference to `timeout` - */ - refresh(): this; - [Symbol.toPrimitive](): number; - /** - * Cancels the timeout. - * @since v20.5.0 - */ - [Symbol.dispose](): 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( - 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( - 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. - * - * When multiple calls to `setImmediate()` are made, the `callback` functions are - * queued for execution in the order in which they are created. The entire callback - * queue is processed every event loop iteration. If an immediate timer is queued - * from inside an executing callback, that timer will not be triggered until the - * next event loop iteration. - * - * 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()`. - * @since v0.9.1 - * @param callback The function to call at the end of this turn of the Node.js `Event Loop` - * @param args Optional arguments to pass when the `callback` is called. - * @return for use with {@link clearImmediate} - */ - function setImmediate( - callback: (...args: TArgs) => void, - ...args: TArgs - ): NodeJS.Immediate; - // util.promisify no rest args compability - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - function setImmediate(callback: (args: void) => void): NodeJS.Immediate; - namespace setImmediate { - const __promisify__: typeof setImmediatePromise; - } - /** - * Cancels an `Immediate` object created by `setImmediate()`. - * @since v0.9.1 - * @param immediate An `Immediate` object as returned by {@link setImmediate}. - */ - function clearImmediate(immediateId: NodeJS.Immediate | undefined): void; - function queueMicrotask(callback: () => void): void; - } -} -declare module "node:timers" { - export * from "timers"; -} diff --git a/node_modules/@types/node/timers/promises.d.ts b/node_modules/@types/node/timers/promises.d.ts deleted file mode 100644 index 1e6eb65..0000000 --- a/node_modules/@types/node/timers/promises.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * The `timers/promises` API provides an alternative set of timer functions - * that return `Promise` objects. The API is accessible via `import timersPromises from 'node:timers/promises'`. - * - * ```js - * import { - * setTimeout, - * setImmediate, - * setInterval, - * } from 'node:timers/promises'; - * ``` - * @since v15.0.0 - */ -declare module "timers/promises" { - import { TimerOptions } from "node:timers"; - /** - * ```js - * import { - * setTimeout, - * } 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 value A value with which the promise is fulfilled. - */ - function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; - /** - * ```js - * import { - * setImmediate, - * } from 'node:timers/promises'; - * - * const res = await setImmediate('result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param value A value with which the promise is fulfilled. - */ - function setImmediate(value?: T, options?: TimerOptions): Promise; - /** - * Returns an async iterator that generates values in an interval of `delay` ms. - * If `ref` is `true`, you need to call `next()` of async iterator explicitly - * or implicitly to keep the event loop alive. - * - * ```js - * import { - * setInterval, - * } from 'node:timers/promises'; - * - * const interval = 100; - * for await (const startTime of setInterval(interval, Date.now())) { - * const now = Date.now(); - * console.log(now); - * if ((now - startTime) > 1000) - * break; - * } - * console.log(Date.now()); - * ``` - * @since v15.9.0 - */ - function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; - 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. - * - * 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 - * @experimental - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. - */ - wait: (delay?: number, options?: Pick) => Promise; - /** - * An experimental API defined by the [Scheduling APIs](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html#promise-execution-tracking) 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 - * @experimental - */ - yield: () => Promise; - } - const scheduler: Scheduler; -} -declare module "node:timers/promises" { - export * from "timers/promises"; -} diff --git a/node_modules/@types/node/tls.d.ts b/node_modules/@types/node/tls.d.ts deleted file mode 100644 index ee81ba2..0000000 --- a/node_modules/@types/node/tls.d.ts +++ /dev/null @@ -1,1220 +0,0 @@ -/** - * The `node:tls` module provides an implementation of the Transport Layer Security - * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. - * The module can be accessed using: - * - * ```js - * import tls from 'node:tls'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/tls.js) - */ -declare module "tls" { - import { X509Certificate } from "node:crypto"; - import * as net from "node:net"; - import * as stream from "stream"; - const CLIENT_RENEG_LIMIT: number; - const CLIENT_RENEG_WINDOW: number; - interface Certificate { - /** - * Country code. - */ - C: string; - /** - * Street. - */ - ST: string; - /** - * Locality. - */ - L: string; - /** - * Organization. - */ - O: string; - /** - * Organizational unit. - */ - OU: string; - /** - * Common name. - */ - CN: string; - } - interface PeerCertificate { - /** - * `true` if a Certificate Authority (CA), `false` otherwise. - * @since v18.13.0 - */ - ca: boolean; - /** - * The DER encoded X.509 certificate data. - */ - raw: Buffer; - /** - * The certificate subject. - */ - subject: Certificate; - /** - * The certificate issuer, described in the same terms as the `subject`. - */ - issuer: Certificate; - /** - * The date-time the certificate is valid from. - */ - valid_from: string; - /** - * The date-time the certificate is valid to. - */ - valid_to: string; - /** - * The certificate serial number, as a hex string. - */ - serialNumber: string; - /** - * The SHA-1 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint: string; - /** - * The SHA-256 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint256: string; - /** - * The SHA-512 digest of the DER encoded certificate. - * It is returned as a `:` separated hexadecimal string. - */ - fingerprint512: string; - /** - * The extended key usage, a set of OIDs. - */ - ext_key_usage?: string[]; - /** - * A string containing concatenated names for the subject, - * an alternative to the `subject` names. - */ - subjectaltname?: string; - /** - * An array describing the AuthorityInfoAccess, used with OCSP. - */ - infoAccess?: NodeJS.Dict; - /** - * For RSA keys: The RSA bit size. - * - * For EC keys: The key size in bits. - */ - bits?: number; - /** - * The RSA exponent, as a string in hexadecimal number notation. - */ - exponent?: string; - /** - * The RSA modulus, as a hexadecimal string. - */ - modulus?: string; - /** - * The public key. - */ - pubkey?: Buffer; - /** - * The ASN.1 name of the OID of the elliptic curve. - * Well-known curves are identified by an OID. - * While it is unusual, it is possible that the curve - * is identified by its mathematical properties, - * in which case it will not have an OID. - */ - asn1Curve?: string; - /** - * The NIST name for the elliptic curve, if it has one - * (not all well-known curves have been assigned names by NIST). - */ - nistCurve?: string; - } - interface DetailedPeerCertificate extends PeerCertificate { - /** - * The issuer certificate object. - * For self-signed certificates, this may be a circular reference. - */ - issuerCertificate: DetailedPeerCertificate; - } - interface CipherNameAndProtocol { - /** - * The cipher name. - */ - name: string; - /** - * SSL/TLS protocol version. - */ - version: string; - /** - * IETF name for the cipher suite. - */ - standardName: string; - } - interface EphemeralKeyInfo { - /** - * The supported types are 'DH' and 'ECDH'. - */ - type: string; - /** - * The name property is available only when type is 'ECDH'. - */ - name?: string | undefined; - /** - * The size of parameter of an ephemeral key exchange. - */ - size: number; - } - interface KeyObject { - /** - * Private keys in PEM format. - */ - pem: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface PxfObject { - /** - * PFX or PKCS12 encoded private key and certificate chain. - */ - buf: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { - /** - * If true the TLS socket will be instantiated in server-mode. - * Defaults to false. - */ - isServer?: boolean | undefined; - /** - * An optional net.Server instance. - */ - server?: net.Server | undefined; - /** - * An optional Buffer instance containing a TLS session. - */ - session?: Buffer | undefined; - /** - * If true, specifies that the OCSP status request extension will be - * added to the client hello and an 'OCSPResponse' event will be - * emitted on the socket before establishing a secure communication - */ - requestOCSP?: boolean | undefined; - } - /** - * Performs transparent encryption of written data and all required TLS - * negotiation. - * - * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. - * - * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate}) will only return data while the - * connection is open. - * @since v0.11.4 - */ - class TLSSocket extends net.Socket { - /** - * Construct a new tls.TLSSocket object from an existing TCP socket. - */ - constructor(socket: net.Socket | stream.Duplex, options?: TLSSocketOptions); - /** - * This property is `true` if the peer certificate was signed by one of the CAs - * specified when creating the `tls.TLSSocket` instance, otherwise `false`. - * @since v0.11.4 - */ - authorized: boolean; - /** - * Returns the reason why the peer's certificate was not been verified. This - * property is set only when `tlsSocket.authorized === false`. - * @since v0.11.4 - */ - authorizationError: Error; - /** - * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. - * @since v0.11.4 - */ - encrypted: true; - /** - * String containing the selected ALPN protocol. - * Before a handshake has completed, this value is always null. - * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. - */ - alpnProtocol: string | false | null; - /** - * Returns an object representing the local certificate. The returned object has - * some properties corresponding to the fields of the certificate. - * - * See {@link TLSSocket.getPeerCertificate} for an example of the certificate - * structure. - * - * If there is no local certificate, an empty object will be returned. If the - * socket has been destroyed, `null` will be returned. - * @since v11.2.0 - */ - getCertificate(): PeerCertificate | object | null; - /** - * Returns an object containing information on the negotiated cipher suite. - * - * For example, a TLSv1.2 protocol with AES256-SHA cipher: - * - * ```json - * { - * "name": "AES256-SHA", - * "standardName": "TLS_RSA_WITH_AES_256_CBC_SHA", - * "version": "SSLv3" - * } - * ``` - * - * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information. - * @since v0.11.4 - */ - getCipher(): CipherNameAndProtocol; - /** - * Returns an object representing the type, name, and size of parameter of - * an ephemeral key exchange in `perfect forward secrecy` on a client - * connection. It returns an empty object when the key exchange is not - * ephemeral. As this is only supported on a client socket; `null` is returned - * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The `name` property is available only when type is `'ECDH'`. - * - * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. - * @since v5.0.0 - */ - getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @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; - /** - * 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 - * destroyed, `null` will be returned. - * - * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's - * certificate. - * @since v0.11.4 - * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. - * @return A certificate object. - */ - getPeerCertificate(detailed: true): DetailedPeerCertificate; - getPeerCertificate(detailed?: false): PeerCertificate; - getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @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; - /** - * Returns a string containing the negotiated SSL/TLS protocol version of the - * current connection. The value `'unknown'` will be returned for connected - * sockets that have not completed the handshaking process. The value `null` will - * be returned for server sockets or disconnected client sockets. - * - * Protocol versions are: - * - * * `'SSLv3'` - * * `'TLSv1'` - * * `'TLSv1.1'` - * * `'TLSv1.2'` - * * `'TLSv1.3'` - * - * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. - * @since v5.7.0 - */ - getProtocol(): string | null; - /** - * Returns the TLS session data or `undefined` if no session was - * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful - * for debugging. - * - * See `Session Resumption` for more information. - * - * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications - * must use the `'session'` event (it also works for TLSv1.2 and below). - * @since v0.11.4 - */ - getSession(): Buffer | 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 - * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. - */ - getSharedSigalgs(): string[]; - /** - * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. - * - * It may be useful for debugging. - * - * See `Session Resumption` for more information. - * @since v0.11.4 - */ - getTLSTicket(): Buffer | undefined; - /** - * See `Session Resumption` for more information. - * @since v0.5.6 - * @return `true` if the session was reused, `false` otherwise. - */ - isSessionReused(): boolean; - /** - * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. - * Upon completion, the `callback` function will be passed a single argument - * that is either an `Error` (if the request failed) or `null`. - * - * This method can be used to request a peer's certificate after the secure - * connection has been established. - * - * When running as the server, the socket will be destroyed with an error after `handshakeTimeout` timeout. - * - * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the - * protocol. - * @since v0.11.8 - * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with - * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. - * @return `true` if renegotiation was initiated, `false` otherwise. - */ - renegotiate( - options: { - rejectUnauthorized?: boolean | undefined; - requestCert?: boolean | undefined; - }, - callback: (err: Error | null) => void, - ): undefined | boolean; - /** - * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. - * Returns `true` if setting the limit succeeded; `false` otherwise. - * - * Smaller fragment sizes decrease the buffering latency on the client: larger - * fragments are buffered by the TLS layer until the entire fragment is received - * and its integrity is verified; large fragments can span multiple roundtrips - * and their processing can be delayed due to packet loss or reordering. However, - * smaller fragments add extra TLS framing bytes and CPU overhead, which may - * decrease overall server throughput. - * @since v0.11.11 - * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. - */ - setMaxSendFragment(size: number): boolean; - /** - * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts - * to renegotiate will trigger an `'error'` event on the `TLSSocket`. - * @since v8.4.0 - */ - disableRenegotiation(): void; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * - * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by - * OpenSSL's `SSL_trace()` function, the format is undocumented, can change - * without notice, and should not be relied on. - * @since v12.2.0 - */ - enableTrace(): void; - /** - * Returns the peer certificate as an `X509Certificate` object. - * - * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getPeerX509Certificate(): X509Certificate | undefined; - /** - * Returns the local certificate as an `X509Certificate` object. - * - * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getX509Certificate(): X509Certificate | undefined; - /** - * Keying material is used for validations to prevent different kind of attacks in - * network protocols, for example in the specifications of IEEE 802.1X. - * - * Example - * - * ```js - * const keyingMaterial = tlsSocket.exportKeyingMaterial( - * 128, - * 'client finished'); - * - * /* - * Example return value of keyingMaterial: - * - * - * ``` - * - * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more - * information. - * @since v13.10.0, v12.17.0 - * @param length number of bytes to retrieve from keying material - * @param label an application specific label, typically this will be a value from the [IANA Exporter Label - * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). - * @param context Optionally provide a context. - * @return requested bytes of the keying material - */ - exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - addListener(event: "secureConnect", listener: () => void): this; - addListener(event: "session", listener: (session: Buffer) => void): this; - addListener(event: "keylog", listener: (line: Buffer) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "OCSPResponse", response: Buffer): boolean; - emit(event: "secureConnect"): boolean; - emit(event: "session", session: Buffer): boolean; - emit(event: "keylog", line: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "OCSPResponse", listener: (response: Buffer) => void): this; - on(event: "secureConnect", listener: () => void): this; - on(event: "session", listener: (session: Buffer) => void): this; - on(event: "keylog", listener: (line: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "OCSPResponse", listener: (response: Buffer) => void): this; - once(event: "secureConnect", listener: () => void): this; - once(event: "session", listener: (session: Buffer) => void): this; - once(event: "keylog", listener: (line: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - prependListener(event: "secureConnect", listener: () => void): this; - prependListener(event: "session", listener: (session: Buffer) => void): this; - prependListener(event: "keylog", listener: (line: Buffer) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - prependOnceListener(event: "secureConnect", listener: () => void): this; - prependOnceListener(event: "session", listener: (session: Buffer) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this; - } - interface CommonConnectionOptions { - /** - * An optional TLS context object from tls.createSecureContext() - */ - secureContext?: SecureContext | undefined; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * @default false - */ - enableTrace?: boolean | undefined; - /** - * If true the server will request a certificate from clients that - * connect and attempt to verify that certificate. Defaults to - * false. - */ - requestCert?: boolean | undefined; - /** - * An array of strings or a Buffer naming possible ALPN protocols. - * (Protocols should be ordered by their priority.) - */ - ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined; - /** - * SNICallback(servername, cb) A function that will be - * called if the client supports SNI TLS extension. Two arguments - * will be passed when called: servername and cb. SNICallback should - * invoke cb(null, ctx), where ctx is a SecureContext instance. - * (tls.createSecureContext(...) can be used to get a proper - * SecureContext.) If SNICallback wasn't provided the default callback - * with high-level API will be used (see below). - */ - SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; - /** - * If true the server will reject any connection which is not - * authorized with the list of supplied CAs. This option only has an - * effect if requestCert is true. - * @default true - */ - rejectUnauthorized?: boolean | undefined; - } - interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { - /** - * Abort the connection if the SSL/TLS handshake does not finish in the - * specified number of milliseconds. A 'tlsClientError' is emitted on - * the tls.Server object whenever a handshake times out. Default: - * 120000 (120 seconds). - */ - handshakeTimeout?: number | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - */ - ticketKeys?: Buffer | undefined; - /** - * @param socket - * @param identity identity parameter sent from the client. - * @return pre-shared key that must either be - * a buffer or `null` to stop the negotiation process. Returned PSK must be - * compatible with the selected cipher's digest. - * - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with the identity provided by the client. - * If the return value is `null` the negotiation process will stop and an - * "unknown_psk_identity" alert message will be sent to the other party. - * If the server wishes to hide the fact that the PSK identity was not known, - * the callback must provide some random data as `psk` to make the connection - * fail with "decrypt_error" before negotiation is finished. - * PSK ciphers are disabled by default, and using TLS-PSK thus - * 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; - /** - * hint to send to a client to help - * with selecting the identity during TLS-PSK negotiation. Will be ignored - * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be - * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. - */ - pskIdentityHint?: string | undefined; - } - interface PSKCallbackNegotation { - psk: DataView | NodeJS.TypedArray; - identity: string; - } - interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { - host?: string | undefined; - port?: number | undefined; - path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. - socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket - checkServerIdentity?: typeof checkServerIdentity | undefined; - servername?: string | undefined; // SNI TLS Extension - session?: Buffer | undefined; - minDHSize?: number | undefined; - lookup?: net.LookupFunction | undefined; - timeout?: number | undefined; - /** - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with optional identity `hint` provided by the server or `null` - * in case of TLS 1.3 where `hint` was removed. - * It will be necessary to provide a custom `tls.checkServerIdentity()` - * for the connection as the default one will try to check hostname/IP - * of the server against the certificate but that's not applicable for PSK - * because there won't be a certificate present. - * More information can be found in the RFC 4279. - * - * @param hint message sent from the server to help client - * decide which identity to use during negotiation. - * Always `null` if TLS 1.3 is used. - * @returns Return `null` to stop the negotiation process. `psk` must be - * compatible with the selected cipher's digest. - * `identity` must use UTF-8 encoding. - */ - pskCallback?(hint: string | null): PSKCallbackNegotation | null; - } - /** - * Accepts encrypted connections using TLS or SSL. - * @since v0.3.2 - */ - class Server extends net.Server { - constructor(secureConnectionListener?: (socket: TLSSocket) => void); - constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); - /** - * The `server.addContext()` method adds a secure context that will be used if - * the client request's SNI name matches the supplied `hostname` (or wildcard). - * - * When there are multiple matching contexts, the most recently added one is - * used. - * @since v0.5.3 - * @param hostname A SNI host name or wildcard (e.g. `'*'`) - * @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; - /** - * Returns the session ticket keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @return A 48-byte buffer containing the session ticket keys. - */ - getTicketKeys(): Buffer; - /** - * The `server.setSecureContext()` method replaces the secure context of an - * existing server. Existing connections to the server are not interrupted. - * @since v11.0.0 - * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - setSecureContext(options: SecureContextOptions): void; - /** - * Sets the session ticket keys. - * - * Changes to the ticket keys are effective only for future server connections. - * Existing or currently pending server connections will use the previous keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @param keys A 48-byte buffer containing the session ticket keys. - */ - setTicketKeys(keys: Buffer): void; - /** - * events.EventEmitter - * 1. tlsClientError - * 2. newSession - * 3. OCSPRequest - * 4. resumeSession - * 5. secureConnection - * 6. keylog - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - addListener( - event: "newSession", - listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void, - ): this; - addListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - addListener( - event: "resumeSession", - listener: (sessionId: Buffer, 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; - 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: "OCSPRequest", - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ): boolean; - emit( - event: "resumeSession", - sessionId: Buffer, - callback: (err: Error | null, sessionData: Buffer | null) => void, - ): boolean; - emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; - emit(event: "keylog", line: Buffer, 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: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - on( - event: "resumeSession", - listener: (sessionId: Buffer, 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; - 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, - ): this; - once( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - once( - event: "resumeSession", - listener: (sessionId: Buffer, 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; - 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, - ): this; - prependListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependListener( - event: "resumeSession", - listener: (sessionId: Buffer, 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; - 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, - ): this; - prependOnceListener( - event: "OCSPRequest", - listener: ( - certificate: Buffer, - issuer: Buffer, - callback: (err: Error | null, resp: Buffer) => void, - ) => void, - ): this; - prependOnceListener( - event: "resumeSession", - listener: (sessionId: Buffer, 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; - } - type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1"; - interface SecureContextOptions { - /** - * If set, this will be called when a client opens a connection using the ALPN extension. - * One argument will be passed to the callback: an object containing `servername` and `protocols` fields, - * respectively containing the server name from the SNI extension (if any) and an array of - * ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, - * which will be returned to the client as the selected ALPN protocol, or `undefined`, - * to reject the connection with a fatal alert. If a string is returned that does not match one of - * the client's ALPN protocols, an error will be thrown. - * 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; - /** - * Optionally override the trusted CA certificates. Default is to trust - * the well-known CAs curated by Mozilla. Mozilla's CAs are completely - * replaced when CAs are explicitly specified using this option. - */ - ca?: string | Buffer | Array | undefined; - /** - * Cert chains in PEM format. One cert chain should be provided per - * private key. Each cert chain should consist of the PEM formatted - * certificate for a provided private key, followed by the PEM - * formatted intermediate certificates (if any), in order, and not - * including the root CA (the root CA must be pre-known to the peer, - * see ca). When providing multiple cert chains, they do not have to - * be in the same order as their private keys in key. If the - * intermediate certificates are not provided, the peer will not be - * able to validate the certificate, and the handshake will fail. - */ - cert?: string | Buffer | Array | undefined; - /** - * Colon-separated list of supported signature algorithms. The list - * can contain digest algorithms (SHA256, MD5 etc.), public key - * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g - * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). - */ - sigalgs?: string | undefined; - /** - * Cipher suite specification, replacing the default. For more - * information, see modifying the default cipher suite. Permitted - * ciphers can be obtained via tls.getCiphers(). Cipher names must be - * uppercased in order for OpenSSL to accept them. - */ - ciphers?: string | undefined; - /** - * Name of an OpenSSL engine which can provide the client certificate. - * @deprecated - */ - clientCertEngine?: string | undefined; - /** - * PEM formatted CRLs (Certificate Revocation Lists). - */ - crl?: string | Buffer | Array | undefined; - /** - * `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy. - * If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. - * ECDHE-based perfect forward secrecy will still be available. - */ - dhparam?: string | Buffer | undefined; - /** - * A string describing a named curve or a colon separated list of curve - * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key - * agreement. Set to auto to select the curve automatically. Use - * crypto.getCurves() to obtain a list of available curve names. On - * recent releases, openssl ecparam -list_curves will also display the - * name and description of each available elliptic curve. Default: - * tls.DEFAULT_ECDH_CURVE. - */ - ecdhCurve?: string | undefined; - /** - * Attempt to use the server's cipher suite preferences instead of the - * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be - * set in secureOptions - */ - honorCipherOrder?: boolean | undefined; - /** - * Private keys in PEM format. PEM allows the option of private keys - * being encrypted. Encrypted keys will be decrypted with - * options.passphrase. Multiple keys using different algorithms can be - * provided either as an array of unencrypted key strings or buffers, - * or an array of objects in the form {pem: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted keys will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - key?: string | Buffer | Array | undefined; - /** - * 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; - /** - * Optionally set the maximum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. - * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using - * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to - * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. - */ - maxVersion?: SecureVersion | undefined; - /** - * Optionally set the minimum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. It is not recommended to use - * less than TLSv1.2, but it may be required for interoperability. - * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using - * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to - * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. - */ - minVersion?: SecureVersion | undefined; - /** - * Shared passphrase used for a single private key and/or a PFX. - */ - passphrase?: string | undefined; - /** - * PFX or PKCS12 encoded private key and certificate chain. pfx is an - * alternative to providing key and cert individually. PFX is usually - * encrypted, if it is, passphrase will be used to decrypt it. Multiple - * PFX can be provided either as an array of unencrypted PFX buffers, - * or an array of objects in the form {buf: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted PFX will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - pfx?: string | Buffer | Array | undefined; - /** - * Optionally affect the OpenSSL protocol behavior, which is not - * usually necessary. This should be used carefully if at all! Value is - * a numeric bitmask of the SSL_OP_* options from OpenSSL Options - */ - secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options - /** - * Legacy mechanism to select the TLS protocol version to use, it does - * not support independent control of the minimum and maximum version, - * and does not support limiting the protocol to TLSv1.3. Use - * minVersion and maxVersion instead. The possible values are listed as - * SSL_METHODS, use the function names as strings. For example, use - * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow - * any TLS protocol version up to TLSv1.3. It is not recommended to use - * TLS versions less than 1.2, but it may be required for - * interoperability. Default: none, see minVersion. - */ - secureProtocol?: string | undefined; - /** - * Opaque identifier used by servers to ensure session state is not - * shared between applications. Unused by clients. - */ - sessionIdContext?: string | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - * See Session Resumption for more information. - */ - ticketKeys?: Buffer | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - } - interface SecureContext { - context: any; - } - /** - * Verifies the certificate `cert` is issued to `hostname`. - * - * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on - * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). - * - * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as - * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. - * - * This function can be overwritten by providing an alternative function as the `options.checkServerIdentity` option that is passed to `tls.connect()`. The - * overwriting function can call `tls.checkServerIdentity()` of course, to augment - * the checks done with additional verification. - * - * This function is only called if the certificate passed all other checks, such as - * being issued by trusted CA (`options.ca`). - * - * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name - * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use - * a custom `options.checkServerIdentity` function that implements the desired behavior. - * @since v0.8.4 - * @param hostname The host name or IP address to verify the certificate against. - * @param cert A `certificate object` representing the peer's certificate. - */ - function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; - /** - * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is - * automatically set as a listener for the `'secureConnection'` event. - * - * The `ticketKeys` options is automatically shared between `node:cluster` module - * workers. - * - * The following illustrates a simple echo server: - * - * ```js - * import tls from 'node:tls'; - * import fs from 'node:fs'; - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * - * // This is necessary only if using client certificate authentication. - * requestCert: true, - * - * // This is necessary only if the client uses a self-signed certificate. - * ca: [ fs.readFileSync('client-cert.pem') ], - * }; - * - * const server = tls.createServer(options, (socket) => { - * console.log('server connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * socket.write('welcome!\n'); - * socket.setEncoding('utf8'); - * socket.pipe(socket); - * }); - * server.listen(8000, () => { - * console.log('server bound'); - * }); - * ``` - * - * The server can be tested by connecting to it using the example client from {@link connect}. - * @since v0.3.2 - */ - function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; - function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; - /** - * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. - * - * `tls.connect()` returns a {@link TLSSocket} object. - * - * Unlike the `https` API, `tls.connect()` does not enable the - * SNI (Server Name Indication) extension by default, which may cause some - * servers to return an incorrect certificate or reject the connection - * altogether. To enable SNI, set the `servername` option in addition - * to `host`. - * - * The following illustrates a client for the echo server example from {@link createServer}: - * - * ```js - * // Assumes an echo server that is listening on port 8000. - * import tls from 'node:tls'; - * import fs from 'node:fs'; - * - * const options = { - * // Necessary only if the server requires client certificate authentication. - * key: fs.readFileSync('client-key.pem'), - * cert: fs.readFileSync('client-cert.pem'), - * - * // Necessary only if the server uses a self-signed certificate. - * ca: [ fs.readFileSync('server-cert.pem') ], - * - * // Necessary only if the server's cert isn't for "localhost". - * checkServerIdentity: () => { return null; }, - * }; - * - * const socket = tls.connect(8000, options, () => { - * console.log('client connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * process.stdin.pipe(socket); - * process.stdin.resume(); - * }); - * socket.setEncoding('utf8'); - * socket.on('data', (data) => { - * console.log(data); - * }); - * socket.on('end', () => { - * console.log('server ends connection'); - * }); - * ``` - * @since v0.11.3 - */ - function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect( - port: number, - host?: string, - options?: ConnectionOptions, - 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. - * - * `{@link createServer}` uses a 128 bit truncated SHA1 hash value generated - * from `process.argv` as the default value of the `sessionIdContext` option, other - * APIs that create secure contexts have no default value. - * - * The `tls.createSecureContext()` method creates a `SecureContext` object. It is - * usable as an argument to several `tls` APIs, such as `server.addContext()`, - * but has no public methods. The {@link Server} constructor and the {@link createServer} method do not support the `secureContext` option. - * - * A key is _required_ for ciphers that use certificates. Either `key` or `pfx` can be used to provide it. - * - * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of - * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). - * - * Custom DHE parameters are discouraged in favor of the new `dhparam: 'auto' `option. When set to `'auto'`, well-known DHE parameters of sufficient strength - * will be selected automatically. Otherwise, if necessary, `openssl dhparam` can - * be used to create custom parameters. The key length must be greater than or - * equal to 1024 bits or else an error will be thrown. Although 1024 bits is - * permissible, use 2048 bits or larger for stronger security. - * @since v0.11.13 - */ - function createSecureContext(options?: SecureContextOptions): SecureContext; - /** - * 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-v22.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. - * - * ```js - * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] - * ``` - * @since v0.10.2 - */ - function getCiphers(): string[]; - /** - * The default curve name to use for ECDH key agreement in a tls server. - * The default value is `'auto'`. See `{@link createSecureContext()}` for further - * information. - * @since v0.11.13 - */ - let DEFAULT_ECDH_CURVE: string; - /** - * The default value of the `maxVersion` option of `{@link createSecureContext()}`. - * It can be assigned any of the supported TLS protocol versions, - * `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. **Default:** `'TLSv1.3'`, unless - * changed using CLI options. Using `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using - * `--tls-max-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options - * are provided, the highest maximum is used. - * @since v11.4.0 - */ - let DEFAULT_MAX_VERSION: SecureVersion; - /** - * The default value of the `minVersion` option of `{@link createSecureContext()}`. - * It can be assigned any of the supported TLS protocol versions, - * `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. **Default:** `'TLSv1.2'`, unless - * changed using CLI options. Using `--tls-min-v1.0` sets the default to - * `'TLSv1'`. Using `--tls-min-v1.1` sets the default to `'TLSv1.1'`. Using - * `--tls-min-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options - * are provided, the lowest minimum is used. - * @since v11.4.0 - */ - let DEFAULT_MIN_VERSION: SecureVersion; - /** - * The default value of the `ciphers` option of `{@link createSecureContext()}`. - * It can be assigned any of the supported OpenSSL ciphers. - * Defaults to the content of `crypto.constants.defaultCoreCipherList`, unless - * changed using CLI options using `--tls-default-ciphers`. - * @since v19.8.0 - */ - let DEFAULT_CIPHERS: string; - /** - * An immutable array of strings representing the root certificates (in PEM format) - * from the bundled Mozilla CA store as supplied by the current Node.js version. - * - * The bundled CA store, as supplied by Node.js, is a snapshot of Mozilla CA store - * that is fixed at release time. It is identical on all supported platforms. - * @since v12.3.0 - */ - const rootCertificates: readonly string[]; -} -declare module "node:tls" { - export * from "tls"; -} diff --git a/node_modules/@types/node/trace_events.d.ts b/node_modules/@types/node/trace_events.d.ts deleted file mode 100644 index f334b0b..0000000 --- a/node_modules/@types/node/trace_events.d.ts +++ /dev/null @@ -1,197 +0,0 @@ -/** - * The `node:trace_events` module provides a mechanism to centralize tracing information - * generated by V8, Node.js core, and userspace code. - * - * Tracing can be enabled with the `--trace-event-categories` command-line flag - * or by using the `trace_events` module. The `--trace-event-categories` flag - * accepts a list of comma-separated category names. - * - * The available categories are: - * - * * `node`: An empty placeholder. - * * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v22.x/api/async_hooks.html) trace data. - * The [`async_hooks`](https://nodejs.org/docs/latest-v22.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`. - * * `node.threadpoolwork.async`: Enables capture of trace data for threadpool asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. - * * `node.dns.native`: Enables capture of trace data for DNS queries. - * * `node.net.native`: Enables capture of trace data for network. - * * `node.environment`: Enables capture of Node.js Environment milestones. - * * `node.fs.sync`: Enables capture of trace data for file system sync methods. - * * `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-v22.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 - * measurements. - * * `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-v22.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. - * - * ```bash - * node --trace-event-categories v8,node,node.async_hooks server.js - * ``` - * - * Prior versions of Node.js required the use of the `--trace-events-enabled` flag to enable trace events. This requirement has been removed. However, the `--trace-events-enabled` flag _may_ still be - * used and will enable the `node`, `node.async_hooks`, and `v8` trace event categories by default. - * - * ```bash - * node --trace-events-enabled - * - * # is equivalent to - * - * node --trace-event-categories v8,node,node.async_hooks - * ``` - * - * Alternatively, trace events may be enabled using the `node:trace_events` module: - * - * ```js - * 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 - * - * // do work - * - * tracing.disable(); // Disable trace event capture for the 'node.perf' category - * ``` - * - * Running Node.js with tracing enabled will produce log files that can be opened - * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. - * - * The logging file is by default called `node_trace.${rotation}.log`, where `${rotation}` is an incrementing log-rotation id. The filepath pattern can - * be specified with `--trace-event-file-pattern` that accepts a template - * string that supports `${rotation}` and `${pid}`: - * - * ```bash - * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js - * ``` - * - * To guarantee that the log file is properly generated after signal events like `SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers - * in your code, such as: - * - * ```js - * process.on('SIGINT', function onSigint() { - * console.info('Received SIGINT.'); - * process.exit(130); // Or applicable exit code depending on OS and signal - * }); - * ``` - * - * The tracing system uses the same time source - * as the one used by `process.hrtime()`. - * 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-v22.x/api/worker_threads.html#class-worker) threads. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/trace_events.js) - */ -declare module "trace_events" { - /** - * The `Tracing` object is used to enable or disable tracing for sets of - * categories. Instances are created using the - * `trace_events.createTracing()` method. - * - * When created, the `Tracing` object is disabled. Calling the - * `tracing.enable()` method adds the categories to the set of enabled trace - * event categories. Calling `tracing.disable()` will remove the categories - * from the set of enabled trace event categories. - */ - interface Tracing { - /** - * A comma-separated list of the trace event categories covered by this - * `Tracing` object. - * @since v10.0.0 - */ - readonly categories: string; - /** - * Disables this `Tracing` object. - * - * Only trace event categories _not_ covered by other enabled `Tracing` - * objects and _not_ specified by the `--trace-event-categories` flag - * will be disabled. - * - * ```js - * 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(); - * t2.enable(); - * - * // Prints 'node,node.perf,v8' - * console.log(trace_events.getEnabledCategories()); - * - * t2.disable(); // Will only disable emission of the 'node.perf' category - * - * // Prints 'node,v8' - * console.log(trace_events.getEnabledCategories()); - * ``` - * @since v10.0.0 - */ - disable(): void; - /** - * Enables this `Tracing` object for the set of categories covered by - * the `Tracing` object. - * @since v10.0.0 - */ - enable(): void; - /** - * `true` only if the `Tracing` object has been enabled. - * @since v10.0.0 - */ - readonly enabled: boolean; - } - interface CreateTracingOptions { - /** - * An array of trace category names. Values included in the array are - * coerced to a string when possible. An error will be thrown if the - * value cannot be coerced. - */ - categories: string[]; - } - /** - * Creates and returns a `Tracing` object for the given set of `categories`. - * - * ```js - * import trace_events from 'node:trace_events'; - * const categories = ['node.perf', 'node.async_hooks']; - * const tracing = trace_events.createTracing({ categories }); - * tracing.enable(); - * // do stuff - * tracing.disable(); - * ``` - * @since v10.0.0 - */ - function createTracing(options: CreateTracingOptions): Tracing; - /** - * Returns a comma-separated list of all currently-enabled trace event - * categories. The current set of enabled trace event categories is determined - * by the _union_ of all currently-enabled `Tracing` objects and any categories - * enabled using the `--trace-event-categories` flag. - * - * 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 - * 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'] }); - * - * t1.enable(); - * t2.enable(); - * - * console.log(trace_events.getEnabledCategories()); - * ``` - * @since v10.0.0 - */ - function getEnabledCategories(): string | undefined; -} -declare module "node:trace_events" { - export * from "trace_events"; -} diff --git a/node_modules/@types/node/ts5.6/buffer.buffer.d.ts b/node_modules/@types/node/ts5.6/buffer.buffer.d.ts deleted file mode 100644 index 21f7211..0000000 --- a/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +++ /dev/null @@ -1,385 +0,0 @@ -declare module "buffer" { - global { - interface BufferConstructor { - // see ../buffer.d.ts for implementation shared with all TypeScript versions - - /** - * 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, - 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): 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 - | { - [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; - /** - * 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: - * 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; - /** - * 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: - * ``` - * - * 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: - * ``` - * - * 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: - * ``` - * - * 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): - * - * buf.fill(0); - * - * console.log(buf); - * // Prints: - * ``` - * - * 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; - } - interface Buffer extends Uint8Array { - // see ../buffer.d.ts for implementation shared with all TypeScript versions - - /** - * 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; - } - } -} diff --git a/node_modules/@types/node/ts5.6/globals.typedarray.d.ts b/node_modules/@types/node/ts5.6/globals.typedarray.d.ts deleted file mode 100644 index 0e4633b..0000000 --- a/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export {}; // Make this a module - -declare global { - namespace NodeJS { - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - } -} diff --git a/node_modules/@types/node/ts5.6/index.d.ts b/node_modules/@types/node/ts5.6/index.d.ts deleted file mode 100644 index 96c9532..0000000 --- a/node_modules/@types/node/ts5.6/index.d.ts +++ /dev/null @@ -1,92 +0,0 @@ -/** - * License for programmatically and manually incorporated - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc - * - * Copyright Node.js contributors. All rights reserved. - * 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: - * - * 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. - */ - -// NOTE: These definitions support Node.js and TypeScript 4.9 through 5.6. - -// Reference required TypeScript libs: -/// - -// TypeScript backwards-compatibility definitions: -/// - -// Definitions specific to TypeScript 4.9 through 5.6: -/// -/// - -// Definitions for Node.js modules that are not specific to any version of TypeScript: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// diff --git a/node_modules/@types/node/tty.d.ts b/node_modules/@types/node/tty.d.ts deleted file mode 100644 index f567946..0000000 --- a/node_modules/@types/node/tty.d.ts +++ /dev/null @@ -1,208 +0,0 @@ -/** - * The `node:tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes. In most cases, it will not be necessary or possible to use this module - * directly. However, it can be accessed using: - * - * ```js - * import tty from 'node:tty'; - * ``` - * - * When Node.js detects that it is being run with a text terminal ("TTY") - * attached, `process.stdin` will, by default, be initialized as an instance of `tty.ReadStream` and both `process.stdout` and `process.stderr` will, by - * default, be instances of `tty.WriteStream`. The preferred method of determining - * whether Node.js is being run within a TTY context is to check that the value of - * the `process.stdout.isTTY` property is `true`: - * - * ```console - * $ node -p -e "Boolean(process.stdout.isTTY)" - * true - * $ node -p -e "Boolean(process.stdout.isTTY)" | cat - * false - * ``` - * - * 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/v22.x/lib/tty.js) - */ -declare module "tty" { - import * as net from "node:net"; - /** - * The `tty.isatty()` method returns `true` if the given `fd` is associated with - * a TTY and `false` if it is not, including whenever `fd` is not a non-negative - * integer. - * @since v0.5.8 - * @param fd A numeric file descriptor - */ - function isatty(fd: number): boolean; - /** - * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js - * process and there should be no reason to create additional instances. - * @since v0.5.8 - */ - class ReadStream extends net.Socket { - constructor(fd: number, options?: net.SocketConstructorOpts); - /** - * A `boolean` that is `true` if the TTY is currently configured to operate as a - * raw device. - * - * This flag is always `false` when a process starts, even if the terminal is - * operating in raw mode. Its value will change with subsequent calls to `setRawMode`. - * @since v0.7.7 - */ - isRaw: boolean; - /** - * Allows configuration of `tty.ReadStream` so that it operates as a raw device. - * - * When in raw mode, input is always available character-by-character, not - * including modifiers. Additionally, all special processing of characters by the - * terminal is disabled, including echoing input - * characters. Ctrl+C will no longer cause a `SIGINT` when - * in this mode. - * @since v0.7.7 - * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` - * property will be set to the resulting mode. - * @return The read stream instance. - */ - setRawMode(mode: boolean): this; - /** - * A `boolean` that is always `true` for `tty.ReadStream` instances. - * @since v0.5.8 - */ - isTTY: boolean; - } - /** - * -1 - to the left from cursor - * 0 - the entire line - * 1 - to the right from cursor - */ - type Direction = -1 | 0 | 1; - /** - * Represents the writable side of a TTY. In normal circumstances, `process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there - * should be no reason to create additional instances. - * @since v0.5.8 - */ - class WriteStream extends net.Socket { - constructor(fd: number); - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "resize", listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "resize"): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: "resize", listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: "resize", listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "resize", listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "resize", listener: () => void): this; - /** - * `writeStream.clearLine()` clears the current line of this `WriteStream` in a - * direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearLine(dir: Direction, callback?: () => void): boolean; - /** - * `writeStream.clearScreenDown()` clears this `WriteStream` from the current - * cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearScreenDown(callback?: () => void): boolean; - /** - * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified - * position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - cursorTo(x: number, y?: number, callback?: () => void): boolean; - cursorTo(x: number, callback: () => void): boolean; - /** - * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its - * current position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - moveCursor(dx: number, dy: number, callback?: () => void): boolean; - /** - * Returns: - * - * * `1` for 2, - * * `4` for 16, - * * `8` for 256, - * * `24` for 16,777,216 colors supported. - * - * Use this to determine what colors the terminal supports. Due to the nature of - * colors in terminals it is possible to either have false positives or false - * negatives. It depends on process information and the environment variables that - * may lie about what terminal is used. - * It is possible to pass in an `env` object to simulate the usage of a specific - * terminal. This can be useful to check how specific environment settings behave. - * - * To enforce a specific color support, use one of the below environment settings. - * - * * 2 colors: `FORCE_COLOR = 0` (Disables colors) - * * 16 colors: `FORCE_COLOR = 1` - * * 256 colors: `FORCE_COLOR = 2` - * * 16,777,216 colors: `FORCE_COLOR = 3` - * - * Disabling color support is also possible by using the `NO_COLOR` and `NODE_DISABLE_COLORS` environment variables. - * @since v9.9.0 - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - getColorDepth(env?: object): number; - /** - * Returns `true` if the `writeStream` supports at least as many colors as provided - * in `count`. Minimum support is 2 (black and white). - * - * This has the same false positives and negatives as described in `writeStream.getColorDepth()`. - * - * ```js - * process.stdout.hasColors(); - * // Returns true or false depending on if `stdout` supports at least 16 colors. - * process.stdout.hasColors(256); - * // Returns true or false depending on if `stdout` supports at least 256 colors. - * process.stdout.hasColors({ TMUX: '1' }); - * // Returns true. - * process.stdout.hasColors(2 ** 24, { TMUX: '1' }); - * // Returns false (the environment setting pretends to support 2 ** 8 colors). - * ``` - * @since v11.13.0, v10.16.0 - * @param [count=16] The number of colors that are requested (minimum 2). - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - hasColors(count?: number): boolean; - hasColors(env?: object): boolean; - hasColors(count: number, env?: object): boolean; - /** - * `writeStream.getWindowSize()` returns the size of the TTY - * corresponding to this `WriteStream`. The array is of the type `[numColumns, numRows]` where `numColumns` and `numRows` represent the number - * of columns and rows in the corresponding TTY. - * @since v0.7.7 - */ - getWindowSize(): [number, number]; - /** - * A `number` specifying the number of columns the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - columns: number; - /** - * A `number` specifying the number of rows the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - rows: number; - /** - * A `boolean` that is always `true`. - * @since v0.5.8 - */ - isTTY: boolean; - } -} -declare module "node:tty" { - export * from "tty"; -} diff --git a/node_modules/@types/node/url.d.ts b/node_modules/@types/node/url.d.ts deleted file mode 100644 index 72232c7..0000000 --- a/node_modules/@types/node/url.d.ts +++ /dev/null @@ -1,972 +0,0 @@ -/** - * The `node:url` module provides utilities for URL resolution and parsing. It can - * be accessed using: - * - * ```js - * import url from 'node:url'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/url.js) - */ -declare module "url" { - import { Blob as NodeBlob } from "node:buffer"; - import { ClientRequestArgs } from "node:http"; - import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring"; - // Input to `url.format` - interface UrlObject { - auth?: string | null | undefined; - hash?: string | null | undefined; - host?: string | null | undefined; - hostname?: string | null | undefined; - href?: string | null | undefined; - pathname?: string | null | undefined; - protocol?: string | null | undefined; - search?: string | null | undefined; - slashes?: boolean | null | undefined; - port?: string | number | null | undefined; - query?: string | null | ParsedUrlQueryInput | undefined; - } - // Output of `url.parse` - interface Url { - auth: string | null; - hash: string | null; - host: string | null; - hostname: string | null; - href: string; - path: string | null; - pathname: string | null; - protocol: string | null; - search: string | null; - slashes: boolean | null; - port: string | null; - query: string | null | ParsedUrlQuery; - } - interface UrlWithParsedQuery extends Url { - query: ParsedUrlQuery; - } - interface UrlWithStringQuery extends Url { - query: string | null; - } - interface FileUrlToPathOptions { - /** - * `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; - } - /** - * The `url.parse()` method takes a URL string, parses it, and returns a URL - * object. - * - * A `TypeError` is thrown if `urlString` is not a string. - * - * 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. - * @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'}`. - */ - function parse(urlString: string): UrlWithStringQuery; - function parse( - urlString: string, - parseQueryString: false | undefined, - slashesDenoteHost?: boolean, - ): UrlWithStringQuery; - function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; - function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; - /** - * The `url.format()` method returns a formatted URL string derived from `urlObject`. - * - * ```js - * import url from 'node:url'; - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json', - * }, - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//` will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or `file`; - * * If the value of the `urlObject.auth` property is truthy, and either `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of `urlObject.auth` will be coerced into a string - * and appended to `result` followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname` is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to `result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of `urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname` _does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result` followed by the output of calling the - * `querystring` module's `stringify()` method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search` _does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash` _does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. - */ - function format(urlObject: URL, options?: URLFormatOptions): string; - /** - * The `url.format()` method returns a formatted URL string derived from `urlObject`. - * - * ```js - * import url from 'node:url'; - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json', - * }, - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//` will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or `file`; - * * If the value of the `urlObject.auth` property is truthy, and either `urlObject.host` or `urlObject.hostname` are not `undefined`, the value of `urlObject.auth` will be coerced into a string - * and appended to `result` followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname` is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to `result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of `urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname` _does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result` followed by the output of calling the - * `querystring` module's `stringify()` method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search` _does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash` _does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. - */ - function format(urlObject: UrlObject | string): string; - /** - * The `url.resolve()` method resolves a target URL relative to a base URL in a - * manner similar to that of a web browser resolving an anchor tag. - * - * ```js - * 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' - * ``` - * - * To achieve the same result using the WHATWG URL API: - * - * ```js - * function resolve(from, to) { - * const resolvedUrl = new URL(to, new URL(from, 'resolve://')); - * if (resolvedUrl.protocol === 'resolve:') { - * // `from` is a relative URL. - * const { pathname, search, hash } = resolvedUrl; - * return pathname + search + hash; - * } - * return resolvedUrl.toString(); - * } - * - * resolve('/one/two/three', 'four'); // '/one/two/four' - * resolve('http://example.com/', '/one'); // 'http://example.com/one' - * resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * @since v0.1.25 - * @legacy Use the WHATWG URL API instead. - * @param from The base URL to use if `to` is a relative URL. - * @param to The target URL to resolve. - */ - function resolve(from: string, to: string): string; - /** - * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an - * invalid domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToUnicode}. - * - * ```js - * import url from 'node:url'; - * - * console.log(url.domainToASCII('español.com')); - * // Prints xn--espaol-zwa.com - * console.log(url.domainToASCII('中文.com')); - * // Prints xn--fiq228c.com - * console.log(url.domainToASCII('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToASCII(domain: string): string; - /** - * Returns the Unicode serialization of the `domain`. If `domain` is an invalid - * domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToASCII}. - * - * ```js - * import url from 'node:url'; - * - * console.log(url.domainToUnicode('xn--espaol-zwa.com')); - * // Prints español.com - * console.log(url.domainToUnicode('xn--fiq228c.com')); - * // Prints 中文.com - * console.log(url.domainToUnicode('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToUnicode(domain: string): string; - /** - * This function ensures the correct decodings of percent-encoded characters as - * well as ensuring a cross-platform valid absolute path string. - * - * ```js - * import { fileURLToPath } from 'node:url'; - * - * const __filename = fileURLToPath(import.meta.url); - * - * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/ - * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows) - * - * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt - * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows) - * - * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt - * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX) - * - * new URL('file:///hello world').pathname; // Incorrect: /hello%20world - * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) - * ``` - * @since v10.12.0 - * @param url The file URL string or URL object to convert to a path. - * @return The fully-resolved platform-specific Node.js file path. - */ - function fileURLToPath(url: string | URL, options?: FileUrlToPathOptions): string; - /** - * This function ensures that `path` is resolved absolutely, and that the URL - * control characters are correctly encoded when converting into a File URL. - * - * ```js - * import { pathToFileURL } from 'node:url'; - * - * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1 - * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX) - * - * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c - * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX) - * ``` - * @since v10.12.0 - * @param path The path to convert to a File URL. - * @return The file URL object. - */ - function pathToFileURL(path: string, options?: PathToFileUrlOptions): URL; - /** - * This utility function converts a URL object into an ordinary options object as - * expected by the `http.request()` and `https.request()` APIs. - * - * ```js - * import { urlToHttpOptions } from 'node:url'; - * const myURL = new URL('https://a:b@測試?abc#foo'); - * - * console.log(urlToHttpOptions(myURL)); - * /* - * { - * protocol: 'https:', - * hostname: 'xn--g6w251d', - * hash: '#foo', - * search: '?abc', - * pathname: '/', - * path: '/?abc', - * href: 'https://a:b@xn--g6w251d/?abc#foo', - * auth: 'a:b' - * } - * - * ``` - * @since v15.7.0, v14.18.0 - * @param url The `WHATWG URL` object to convert to an options object. - * @return Options object - */ - function urlToHttpOptions(url: URL): ClientRequestArgs; - interface URLFormatOptions { - /** - * `true` if the serialized URL string should include the username and password, `false` otherwise. - * @default true - */ - auth?: boolean | undefined; - /** - * `true` if the serialized URL string should include the fragment, `false` otherwise. - * @default true - */ - fragment?: boolean | undefined; - /** - * `true` if the serialized URL string should include the search query, `false` otherwise. - * @default true - */ - search?: boolean | undefined; - /** - * `true` if Unicode characters appearing in the host component of the URL string should be encoded directly as opposed to - * being Punycode encoded. - * @default false - */ - unicode?: boolean | undefined; - } - /** - * Browser-compatible `URL` class, implemented by following the WHATWG URL - * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself. - * The `URL` class is also available on the global object. - * - * In accordance with browser conventions, all properties of `URL` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. Thus, unlike `legacy urlObject`s, - * using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still - * return `true`. - * @since v7.0.0, v6.13.0 - */ - class URL { - /** - * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later. - * - * ```js - * import { - * Blob, - * resolveObjectURL, - * } from 'node:buffer'; - * - * const blob = new Blob(['hello']); - * const id = URL.createObjectURL(blob); - * - * // later... - * - * const otherBlob = resolveObjectURL(id); - * console.log(otherBlob.size); - * ``` - * - * The data stored by the registered `Blob` will be retained in memory until `URL.revokeObjectURL()` is called to remove it. - * - * `Blob` objects are registered within the current thread. If using Worker - * 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; - /** - * Checks if an `input` relative to the `base` can be parsed to a `URL`. - * - * ```js - * const isValid = URL.canParse('/foo', 'https://example.org/'); // true - * - * const isNotValid = URL.canParse('/foo'); // false - * ``` - * @since v19.9.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` 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` 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 `input` is not a valid. - * @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` 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` first. - * @since v22.1.0 - */ - 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. - * - * ```js - * const myURL = new URL('https://example.org/foo#bar'); - * console.log(myURL.hash); - * // Prints #bar - * - * myURL.hash = 'baz'; - * console.log(myURL.href); - * // Prints https://example.org/foo#baz - * ``` - * - * Invalid URL characters included in the value assigned to the `hash` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - hash: string; - /** - * Gets and sets the host portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.host); - * // Prints example.org:81 - * - * myURL.host = 'example.com:82'; - * console.log(myURL.href); - * // Prints https://example.com:82/foo - * ``` - * - * Invalid host values assigned to the `host` property are ignored. - */ - host: string; - /** - * Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the - * port. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.hostname); - * // Prints example.org - * - * // Setting the hostname does not change the port - * myURL.hostname = 'example.com'; - * console.log(myURL.href); - * // Prints https://example.com:81/foo - * - * // Use myURL.host to change the hostname and port - * myURL.host = 'example.org:82'; - * console.log(myURL.href); - * // Prints https://example.org:82/foo - * ``` - * - * Invalid host name values assigned to the `hostname` property are ignored. - */ - hostname: string; - /** - * Gets and sets the serialized URL. - * - * ```js - * const myURL = new URL('https://example.org/foo'); - * console.log(myURL.href); - * // Prints https://example.org/foo - * - * myURL.href = 'https://example.com/bar'; - * console.log(myURL.href); - * // Prints https://example.com/bar - * ``` - * - * Getting the value of the `href` property is equivalent to calling {@link toString}. - * - * Setting the value of this property to a new value is equivalent to creating a - * new `URL` object using `new URL(value)`. Each of the `URL` object's properties will be modified. - * - * If the value assigned to the `href` property is not a valid URL, a `TypeError` will be thrown. - */ - href: string; - /** - * Gets the read-only serialization of the URL's origin. - * - * ```js - * const myURL = new URL('https://example.org/foo/bar?baz'); - * console.log(myURL.origin); - * // Prints https://example.org - * ``` - * - * ```js - * const idnURL = new URL('https://測試'); - * console.log(idnURL.origin); - * // Prints https://xn--g6w251d - * - * console.log(idnURL.hostname); - * // Prints xn--g6w251d - * ``` - */ - readonly origin: string; - /** - * Gets and sets the password portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.password); - * // Prints xyz - * - * myURL.password = '123'; - * console.log(myURL.href); - * // Prints https://abc:123@example.com/ - * ``` - * - * Invalid URL characters included in the value assigned to the `password` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - password: string; - /** - * Gets and sets the path portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc/xyz?123'); - * console.log(myURL.pathname); - * // Prints /abc/xyz - * - * myURL.pathname = '/abcdef'; - * console.log(myURL.href); - * // Prints https://example.org/abcdef?123 - * ``` - * - * Invalid URL characters included in the value assigned to the `pathname` property are `percent-encoded`. The selection of which characters - * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - pathname: string; - /** - * Gets and sets the port portion of the URL. - * - * The port value may be a number or a string containing a number in the range `0` to `65535` (inclusive). Setting the value to the default port of the `URL` objects given `protocol` will - * result in the `port` value becoming - * the empty string (`''`). - * - * The port value can be an empty string in which case the port depends on - * the protocol/scheme: - * - * - * - * Upon assigning a value to the port, the value will first be converted to a - * string using `.toString()`. - * - * If that string is invalid but it begins with a number, the leading number is - * assigned to `port`. - * If the number lies outside the range denoted above, it is ignored. - * - * ```js - * const myURL = new URL('https://example.org:8888'); - * console.log(myURL.port); - * // Prints 8888 - * - * // Default ports are automatically transformed to the empty string - * // (HTTPS protocol's default port is 443) - * myURL.port = '443'; - * console.log(myURL.port); - * // Prints the empty string - * console.log(myURL.href); - * // Prints https://example.org/ - * - * myURL.port = 1234; - * console.log(myURL.port); - * // Prints 1234 - * console.log(myURL.href); - * // Prints https://example.org:1234/ - * - * // Completely invalid port strings are ignored - * myURL.port = 'abcd'; - * console.log(myURL.port); - * // Prints 1234 - * - * // Leading numbers are treated as a port number - * myURL.port = '5678abcd'; - * console.log(myURL.port); - * // Prints 5678 - * - * // Non-integers are truncated - * myURL.port = 1234.5678; - * console.log(myURL.port); - * // Prints 1234 - * - * // Out-of-range numbers which are not represented in scientific notation - * // will be ignored. - * myURL.port = 1e10; // 10000000000, will be range-checked as described below - * console.log(myURL.port); - * // Prints 1234 - * ``` - * - * Numbers which contain a decimal point, - * such as floating-point numbers or numbers in scientific notation, - * are not an exception to this rule. - * Leading numbers up to the decimal point will be set as the URL's port, - * assuming they are valid: - * - * ```js - * myURL.port = 4.567e21; - * console.log(myURL.port); - * // Prints 4 (because it is the leading number in the string '4.567e21') - * ``` - */ - port: string; - /** - * Gets and sets the protocol portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org'); - * console.log(myURL.protocol); - * // Prints https: - * - * myURL.protocol = 'ftp'; - * console.log(myURL.href); - * // Prints ftp://example.org/ - * ``` - * - * Invalid URL protocol values assigned to the `protocol` property are ignored. - */ - protocol: string; - /** - * Gets and sets the serialized query portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc?123'); - * console.log(myURL.search); - * // Prints ?123 - * - * myURL.search = 'abc=xyz'; - * console.log(myURL.href); - * // Prints https://example.org/abc?abc=xyz - * ``` - * - * Any invalid URL characters appearing in the value assigned the `search` property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - search: string; - /** - * Gets the `URLSearchParams` object representing the query parameters of the - * URL. This property is read-only but the `URLSearchParams` object it provides - * can be used to mutate the URL instance; to replace the entirety of query - * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details. - * - * Use care when using `.searchParams` to modify the `URL` because, - * per the WHATWG specification, the `URLSearchParams` object uses - * different rules to determine which characters to percent-encode. For - * instance, the `URL` object will not percent encode the ASCII tilde (`~`) - * character, while `URLSearchParams` will always encode it: - * - * ```js - * const myURL = new URL('https://example.org/abc?foo=~bar'); - * - * console.log(myURL.search); // prints ?foo=~bar - * - * // Modify the URL via searchParams... - * myURL.searchParams.sort(); - * - * console.log(myURL.search); // prints ?foo=%7Ebar - * ``` - */ - readonly searchParams: URLSearchParams; - /** - * Gets and sets the username portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.username); - * // Prints abc - * - * myURL.username = '123'; - * console.log(myURL.href); - * // Prints https://123:xyz@example.com/ - * ``` - * - * Any invalid URL characters appearing in the value assigned the `username` property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - username: string; - /** - * The `toString()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toJSON}. - */ - toString(): string; - /** - * The `toJSON()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toString}. - * - * This method is automatically called when an `URL` object is serialized - * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). - * - * ```js - * const myURLs = [ - * new URL('https://www.example.com'), - * new URL('https://test.example.org'), - * ]; - * console.log(JSON.stringify(myURLs)); - * // Prints ["https://www.example.com/","https://test.example.org/"] - * ``` - */ - toJSON(): string; - } - interface URLSearchParamsIterator extends NodeJS.Iterator { - [Symbol.iterator](): URLSearchParamsIterator; - } - /** - * 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. - * The `URLSearchParams` class is also available on the global object. - * - * The WHATWG `URLSearchParams` interface and the `querystring` module have - * similar purpose, but the purpose of the `querystring` module is more - * general, as it allows the customization of delimiter characters (`&` and `=`). - * On the other hand, this API is designed purely for URL query strings. - * - * ```js - * const myURL = new URL('https://example.org/?abc=123'); - * console.log(myURL.searchParams.get('abc')); - * // Prints 123 - * - * myURL.searchParams.append('abc', 'xyz'); - * console.log(myURL.href); - * // Prints https://example.org/?abc=123&abc=xyz - * - * myURL.searchParams.delete('abc'); - * myURL.searchParams.set('a', 'b'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * - * const newSearchParams = new URLSearchParams(myURL.searchParams); - * // The above is equivalent to - * // const newSearchParams = new URLSearchParams(myURL.search); - * - * newSearchParams.append('a', 'c'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * console.log(newSearchParams.toString()); - * // Prints a=b&a=c - * - * // newSearchParams.toString() is implicitly called - * myURL.search = newSearchParams; - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * newSearchParams.delete('a'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * ``` - * @since v7.5.0, v6.13.0 - */ - class URLSearchParams implements Iterable<[string, string]> { - constructor( - init?: - | URLSearchParams - | string - | Record - | Iterable<[string, string]> - | ReadonlyArray<[string, string]>, - ); - /** - * Append a new name-value pair to the query string. - */ - append(name: string, value: string): void; - /** - * If `value` is provided, removes all name-value pairs - * where name is `name` and value is `value`. - * - * If `value` is not provided, removes all name-value pairs whose name is `name`. - */ - delete(name: string, value?: string): void; - /** - * 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]()`. - */ - entries(): URLSearchParamsIterator<[string, string]>; - /** - * Iterates over each name-value pair in the query and invokes the given function. - * - * ```js - * const myURL = new URL('https://example.org/?a=b&c=d'); - * myURL.searchParams.forEach((value, name, searchParams) => { - * console.log(name, value, myURL.searchParams === searchParams); - * }); - * // Prints: - * // a b true - * // c d true - * ``` - * @param fn Invoked for each name-value pair in the query - * @param thisArg To be used as `this` value for when `fn` is called - */ - forEach( - fn: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void, - thisArg?: TThis, - ): void; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ - get(name: string): string | null; - /** - * Returns the values of all name-value pairs whose name is `name`. If there are - * no such pairs, an empty array is returned. - */ - getAll(name: string): string[]; - /** - * Checks if the `URLSearchParams` object contains key-value pair(s) based on `name` and an optional `value` argument. - * - * If `value` is provided, returns `true` when name-value pair with - * same `name` and `value` exists. - * - * If `value` is not provided, returns `true` if there is at least one name-value - * pair whose name is `name`. - */ - has(name: string, value?: string): boolean; - /** - * Returns an ES6 `Iterator` over the names of each name-value pair. - * - * ```js - * const params = new URLSearchParams('foo=bar&foo=baz'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // foo - * ``` - */ - keys(): URLSearchParamsIterator; - /** - * 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, - * append the name-value pair to the query string. - * - * ```js - * const params = new URLSearchParams(); - * params.append('foo', 'bar'); - * params.append('foo', 'baz'); - * params.append('abc', 'def'); - * console.log(params.toString()); - * // Prints foo=bar&foo=baz&abc=def - * - * params.set('foo', 'def'); - * params.set('xyz', 'opq'); - * console.log(params.toString()); - * // Prints foo=def&abc=def&xyz=opq - * ``` - */ - set(name: string, value: string): void; - /** - * The total number of parameter entries. - * @since v19.8.0 - */ - readonly size: number; - /** - * Sort all existing name-value pairs in-place by their names. Sorting is done - * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs - * with the same name is preserved. - * - * This method can be used, in particular, to increase cache hits. - * - * ```js - * const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); - * params.sort(); - * console.log(params.toString()); - * // Prints query%5B%5D=abc&query%5B%5D=123&type=search - * ``` - * @since v7.7.0, v6.13.0 - */ - sort(): void; - /** - * Returns the search parameters serialized as a string, with characters - * percent-encoded where necessary. - */ - toString(): string; - /** - * Returns an ES6 `Iterator` over the values of each name-value pair. - */ - values(): URLSearchParamsIterator; - [Symbol.iterator](): URLSearchParamsIterator<[string, string]>; - } - import { URL as _URL, 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 `import { URL } from '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 `import { URLSearchParams } from 'node:url'` - * https://nodejs.org/api/url.html#class-urlsearchparams - * @since v10.0.0 - */ - var URLSearchParams: typeof globalThis extends { - onmessage: any; - URLSearchParams: infer T; - } ? T - : typeof _URLSearchParams; - } -} -declare module "node:url" { - export * from "url"; -} diff --git a/node_modules/@types/node/util.d.ts b/node_modules/@types/node/util.d.ts deleted file mode 100644 index 19aeb23..0000000 --- a/node_modules/@types/node/util.d.ts +++ /dev/null @@ -1,2301 +0,0 @@ -/** - * The `node:util` module supports the needs of Node.js internal APIs. Many of the - * utilities are useful for application and module developers as well. To access - * it: - * - * ```js - * import util from 'node:util'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/util.js) - */ -declare module "util" { - import * as types from "node:util/types"; - export interface InspectOptions { - /** - * If `true`, object's non-enumerable symbols and properties are included in the formatted result. - * `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties). - * @default false - */ - showHidden?: boolean | undefined; - /** - * Specifies the number of times to recurse while formatting object. - * This is useful for inspecting large objects. - * To recurse up to the maximum call stack size pass `Infinity` or `null`. - * @default 2 - */ - depth?: number | null | undefined; - /** - * If `true`, the output is styled with ANSI color codes. Colors are customizable. - */ - colors?: boolean | undefined; - /** - * If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked. - * @default true - */ - customInspect?: boolean | undefined; - /** - * If `true`, `Proxy` inspection includes the target and handler objects. - * @default false - */ - showProxy?: boolean | undefined; - /** - * Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements - * to include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no elements. - * @default 100 - */ - maxArrayLength?: number | null | undefined; - /** - * Specifies the maximum number of characters to - * include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no characters. - * @default 10000 - */ - maxStringLength?: number | null | undefined; - /** - * The length at which input values are split across multiple lines. - * Set to `Infinity` to format the input as a single line - * (in combination with `compact` set to `true` or any number >= `1`). - * @default 80 - */ - breakLength?: number | undefined; - /** - * Setting this to `false` causes each object key - * to be displayed on a new line. It will also add new lines to text that is - * longer than `breakLength`. If set to a number, the most `n` inner elements - * are united on a single line as long as all properties fit into - * `breakLength`. Short array elements are also grouped together. Note that no - * text will be reduced below 16 characters, no matter the `breakLength` size. - * For more information, see the example below. - * @default true - */ - compact?: boolean | number | undefined; - /** - * If set to `true` or a function, all properties of an object, and `Set` and `Map` - * entries are sorted in the resulting string. - * If set to `true` the default sort is used. - * If set to a function, it is used as a compare function. - */ - sorted?: boolean | ((a: string, b: string) => number) | undefined; - /** - * If set to `true`, getters are going to be - * inspected as well. If set to `'get'` only getters without setter are going - * to be inspected. If set to `'set'` only getters having a corresponding - * setter are going to be inspected. This might cause side effects depending on - * the getter function. - * @default false - */ - getters?: "get" | "set" | boolean | undefined; - /** - * If set to `true`, an underscore is used to separate every three digits in all bigints and numbers. - * @default false - */ - numericSeparator?: boolean | undefined; - } - export type Style = - | "special" - | "number" - | "bigint" - | "boolean" - | "undefined" - | "null" - | "string" - | "symbol" - | "date" - | "regexp" - | "module"; - export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect - export interface InspectOptionsStylized extends InspectOptions { - stylize(text: string, styleType: Style): string; - } - /** - * The `util.format()` method returns a formatted string using the first argument - * as a `printf`-like format string which can contain zero or more format - * specifiers. Each specifier is replaced with the converted value from the - * corresponding argument. Supported specifiers are: - * - * If a specifier does not have a corresponding argument, it is not replaced: - * - * ```js - * util.format('%s:%s', 'foo'); - * // Returns: 'foo:%s' - * ``` - * - * Values that are not part of the format string are formatted using `util.inspect()` if their type is not `string`. - * - * If there are more arguments passed to the `util.format()` method than the - * number of specifiers, the extra arguments are concatenated to the returned - * string, separated by spaces: - * - * ```js - * util.format('%s:%s', 'foo', 'bar', 'baz'); - * // Returns: 'foo:bar baz' - * ``` - * - * If the first argument does not contain a valid format specifier, `util.format()` returns a string that is the concatenation of all arguments separated by spaces: - * - * ```js - * util.format(1, 2, 3); - * // Returns: '1 2 3' - * ``` - * - * If only one argument is passed to `util.format()`, it is returned as it is - * without any formatting: - * - * ```js - * util.format('%% %s'); - * // Returns: '%% %s' - * ``` - * - * `util.format()` is a synchronous method that is intended as a debugging tool. - * Some input values can have a significant performance overhead that can block the - * event loop. Use this function with care and never in a hot code path. - * @since v0.5.3 - * @param format A `printf`-like format string. - */ - export function format(format?: any, ...param: any[]): string; - /** - * This function is identical to {@link format}, except in that it takes - * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}. - * - * ```js - * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); - * // Returns 'See object { foo: 42 }', where `42` is colored as a number - * // when printed to a terminal. - * ``` - * @since v10.0.0 - */ - export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string; - /** - * Returns the string name for a numeric error code that comes from a Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const name = util.getSystemErrorName(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v9.7.0 - */ - export function getSystemErrorName(err: number): string; - /** - * Returns a Map of all system error codes available from the Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const errorMap = util.getSystemErrorMap(); - * const name = errorMap.get(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v16.0.0, v14.17.0 - */ - export function getSystemErrorMap(): Map; - /** - * The `util.log()` method prints the given `string` to `stdout` with an included - * timestamp. - * - * ```js - * import util from 'node:util'; - * - * util.log('Timestamped message.'); - * ``` - * @since v0.3.0 - * @deprecated Since v6.0.0 - Use a third party module instead. - */ - export function log(string: string): void; - /** - * Returns the `string` after replacing any surrogate code points - * (or equivalently, any unpaired surrogate code units) with the - * Unicode "replacement character" U+FFFD. - * @since v16.8.0, v14.18.0 - */ - export function toUSVString(string: string): string; - /** - * Creates and returns an `AbortController` instance whose `AbortSignal` is marked - * as transferable and can be used with `structuredClone()` or `postMessage()`. - * @since v18.11.0 - * @experimental - * @returns A transferable AbortController - */ - export function transferableAbortController(): AbortController; - /** - * Marks the given `AbortSignal` as transferable so that it can be used with`structuredClone()` and `postMessage()`. - * - * ```js - * const signal = transferableAbortSignal(AbortSignal.timeout(100)); - * const channel = new MessageChannel(); - * channel.port2.postMessage(signal, [signal]); - * ``` - * @since v18.11.0 - * @experimental - * @param signal The AbortSignal - * @returns The same AbortSignal - */ - export function transferableAbortSignal(signal: AbortSignal): AbortSignal; - /** - * Listens to abort event on the provided `signal` and - * returns a promise that is fulfilled when the `signal` is - * aborted. If the passed `resource` is garbage collected before the `signal` is - * aborted, the returned promise shall remain pending indefinitely. - * - * ```js - * import { aborted } from 'node:util'; - * - * const dependent = obtainSomethingAbortable(); - * - * aborted(dependent.signal, dependent).then(() => { - * // Do something when dependent is aborted. - * }); - * - * dependent.on('event', () => { - * dependent.abort(); - * }); - * ``` - * @since v19.7.0 - * @experimental - * @param resource Any non-null entity, reference to which is held weakly. - */ - export function aborted(signal: AbortSignal, resource: any): Promise; - /** - * The `util.inspect()` method returns a string representation of `object` that is - * intended for debugging. The output of `util.inspect` may change at any time - * and should not be depended upon programmatically. Additional `options` may be - * passed that alter the result. `util.inspect()` will use the constructor's name and/or `@@toStringTag` to make - * an identifiable tag for an inspected value. - * - * ```js - * class Foo { - * get [Symbol.toStringTag]() { - * return 'bar'; - * } - * } - * - * class Bar {} - * - * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } }); - * - * util.inspect(new Foo()); // 'Foo [bar] {}' - * util.inspect(new Bar()); // 'Bar {}' - * util.inspect(baz); // '[foo] {}' - * ``` - * - * Circular references point to their anchor by using a reference index: - * - * ```js - * import { inspect } from 'node:util'; - * - * const obj = {}; - * obj.a = [obj]; - * obj.b = {}; - * obj.b.inner = obj.b; - * obj.b.obj = obj; - * - * console.log(inspect(obj)); - * // { - * // a: [ [Circular *1] ], - * // b: { inner: [Circular *2], obj: [Circular *1] } - * // } - * ``` - * - * The following example inspects all properties of the `util` object: - * - * ```js - * import util from 'node:util'; - * - * console.log(util.inspect(util, { showHidden: true, depth: null })); - * ``` - * - * The following example highlights the effect of the `compact` option: - * - * ```js - * import util from 'node:util'; - * - * const o = { - * a: [1, 2, [[ - * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' + - * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.', - * 'test', - * 'foo']], 4], - * b: new Map([['za', 1], ['zb', 'test']]), - * }; - * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 })); - * - * // { a: - * // [ 1, - * // 2, - * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line - * // 'test', - * // 'foo' ] ], - * // 4 ], - * // b: Map(2) { 'za' => 1, 'zb' => 'test' } } - * - * // Setting `compact` to false or an integer creates more reader friendly output. - * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 })); - * - * // { - * // a: [ - * // 1, - * // 2, - * // [ - * // [ - * // 'Lorem ipsum dolor sit amet,\n' + - * // 'consectetur adipiscing elit, sed do eiusmod \n' + - * // 'tempor incididunt ut labore et dolore magna aliqua.', - * // 'test', - * // 'foo' - * // ] - * // ], - * // 4 - * // ], - * // b: Map(2) { - * // 'za' => 1, - * // 'zb' => 'test' - * // } - * // } - * - * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a - * // single line. - * ``` - * - * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and - * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be - * inspected. If there are more entries than `maxArrayLength`, there is no - * guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may - * result in different output. Furthermore, entries - * with no remaining strong references may be garbage collected at any time. - * - * ```js - * import { inspect } from 'node:util'; - * - * const obj = { a: 1 }; - * const obj2 = { b: 2 }; - * const weakSet = new WeakSet([obj, obj2]); - * - * console.log(inspect(weakSet, { showHidden: true })); - * // WeakSet { { a: 1 }, { b: 2 } } - * ``` - * - * The `sorted` option ensures that an object's property insertion order does not - * impact the result of `util.inspect()`. - * - * ```js - * import { inspect } from 'node:util'; - * import assert from 'node:assert'; - * - * const o1 = { - * b: [2, 3, 1], - * a: '`a` comes before `b`', - * c: new Set([2, 3, 1]), - * }; - * console.log(inspect(o1, { sorted: true })); - * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } } - * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) })); - * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' } - * - * const o2 = { - * c: new Set([2, 1, 3]), - * a: '`a` comes before `b`', - * b: [2, 3, 1], - * }; - * assert.strict.equal( - * inspect(o1, { sorted: true }), - * inspect(o2, { sorted: true }), - * ); - * ``` - * - * The `numericSeparator` option adds an underscore every three digits to all - * numbers. - * - * ```js - * import { inspect } from 'node:util'; - * - * const thousand = 1_000; - * const million = 1_000_000; - * const bigNumber = 123_456_789n; - * const bigDecimal = 1_234.123_45; - * - * console.log(inspect(thousand, { numericSeparator: true })); - * // 1_000 - * console.log(inspect(million, { numericSeparator: true })); - * // 1_000_000 - * console.log(inspect(bigNumber, { numericSeparator: true })); - * // 123_456_789n - * console.log(inspect(bigDecimal, { numericSeparator: true })); - * // 1_234.123_45 - * ``` - * - * `util.inspect()` is a synchronous method intended for debugging. Its maximum - * output length is approximately 128 MiB. Inputs that result in longer output will - * be truncated. - * @since v0.3.0 - * @param object Any JavaScript primitive or `Object`. - * @return The representation of `object`. - */ - export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; - export function inspect(object: any, options?: InspectOptions): string; - export namespace inspect { - let colors: NodeJS.Dict<[number, number]>; - let styles: { - [K in Style]: string; - }; - let defaultOptions: InspectOptions; - /** - * Allows changing inspect settings from the repl. - */ - let replDefaults: InspectOptions; - /** - * That can be used to declare custom inspect functions. - */ - const custom: unique symbol; - } - /** - * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). - * - * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isArray([]); - * // Returns: true - * util.isArray(new Array()); - * // Returns: true - * util.isArray({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use `isArray` instead. - */ - export function isArray(object: unknown): object is unknown[]; - /** - * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isRegExp(/some regexp/); - * // Returns: true - * util.isRegExp(new RegExp('another regexp')); - * // Returns: true - * util.isRegExp({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Deprecated - */ - export function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isDate(new Date()); - * // Returns: true - * util.isDate(Date()); - * // false (without 'new' returns a String) - * util.isDate({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isDate} instead. - */ - export function isDate(object: unknown): object is Date; - /** - * Returns `true` if the given `object` is an `Error`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isError(new Error()); - * // Returns: true - * util.isError(new TypeError()); - * // Returns: true - * util.isError({ name: 'Error', message: 'an error occurred' }); - * // Returns: false - * ``` - * - * This method relies on `Object.prototype.toString()` behavior. It is - * possible to obtain an incorrect result when the `object` argument manipulates `@@toStringTag`. - * - * ```js - * import util from 'node:util'; - * const obj = { name: 'Error', message: 'an error occurred' }; - * - * util.isError(obj); - * // Returns: false - * obj[Symbol.toStringTag] = 'Error'; - * util.isError(obj); - * // Returns: true - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead. - */ - export function isError(object: unknown): object is Error; - /** - * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and `extends` keywords to get language level inheritance support. Also note - * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179). - * - * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The - * prototype of `constructor` will be set to a new object created from `superConstructor`. - * - * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`. - * As an additional convenience, `superConstructor` will be accessible - * through the `constructor.super_` property. - * - * ```js - * import util from 'node:util'; - * import EventEmitter from 'node:events'; - * - * function MyStream() { - * EventEmitter.call(this); - * } - * - * util.inherits(MyStream, EventEmitter); - * - * MyStream.prototype.write = function(data) { - * this.emit('data', data); - * }; - * - * const stream = new MyStream(); - * - * console.log(stream instanceof EventEmitter); // true - * console.log(MyStream.super_ === EventEmitter); // true - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('It works!'); // Received data: "It works!" - * ``` - * - * ES6 example using `class` and `extends`: - * - * ```js - * import EventEmitter from 'node:events'; - * - * class MyStream extends EventEmitter { - * write(data) { - * this.emit('data', data); - * } - * } - * - * const stream = new MyStream(); - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('With ES6'); - * ``` - * @since v0.3.0 - * @legacy Use ES2015 class syntax and `extends` keyword instead. - */ - export function inherits(constructor: unknown, superConstructor: unknown): void; - export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void; - export interface DebugLogger extends DebugLoggerFunction { - enabled: boolean; - } - /** - * The `util.debuglog()` method is used to create a function that conditionally - * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that - * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op. - * - * ```js - * import util from 'node:util'; - * const debuglog = util.debuglog('foo'); - * - * debuglog('hello from foo [%d]', 123); - * ``` - * - * If this program is run with `NODE_DEBUG=foo` in the environment, then - * it will output something like: - * - * ```console - * FOO 3245: hello from foo [123] - * ``` - * - * where `3245` is the process id. If it is not run with that - * environment variable set, then it will not print anything. - * - * The `section` supports wildcard also: - * - * ```js - * import util from 'node:util'; - * const debuglog = util.debuglog('foo-bar'); - * - * debuglog('hi there, it\'s foo-bar [%d]', 2333); - * ``` - * - * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output - * something like: - * - * ```console - * FOO-BAR 3257: hi there, it's foo-bar [2333] - * ``` - * - * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`. - * - * The optional `callback` argument can be used to replace the logging function - * with a different function that doesn't have any initialization or - * unnecessary wrapping. - * - * ```js - * import util from 'node:util'; - * let debuglog = util.debuglog('internals', (debug) => { - * // Replace with a logging function that optimizes out - * // testing if the section is enabled - * debuglog = debug; - * }); - * ``` - * @since v0.11.3 - * @param section A string identifying the portion of the application for which the `debuglog` function is being created. - * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function. - * @return The logging function - */ - export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger; - export const debug: typeof debuglog; - /** - * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isBoolean(1); - * // Returns: false - * util.isBoolean(0); - * // Returns: false - * util.isBoolean(false); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead. - */ - export function isBoolean(object: unknown): object is boolean; - /** - * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isBuffer({ length: 0 }); - * // Returns: false - * util.isBuffer([]); - * // Returns: false - * util.isBuffer(Buffer.from('hello world')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `isBuffer` instead. - */ - export function isBuffer(object: unknown): object is Buffer; - /** - * Returns `true` if the given `object` is a `Function`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * function Foo() {} - * const Bar = () => {}; - * - * util.isFunction({}); - * // Returns: false - * util.isFunction(Foo); - * // Returns: true - * util.isFunction(Bar); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead. - */ - export function isFunction(object: unknown): boolean; - /** - * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`. - * - * ```js - * import util from 'node:util'; - * - * util.isNull(0); - * // Returns: false - * util.isNull(undefined); - * // Returns: false - * util.isNull(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === null` instead. - */ - export function isNull(object: unknown): object is null; - /** - * Returns `true` if the given `object` is `null` or `undefined`. Otherwise, - * returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isNullOrUndefined(0); - * // Returns: false - * util.isNullOrUndefined(undefined); - * // Returns: true - * util.isNullOrUndefined(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead. - */ - export function isNullOrUndefined(object: unknown): object is null | undefined; - /** - * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isNumber(false); - * // Returns: false - * util.isNumber(Infinity); - * // Returns: true - * util.isNumber(0); - * // Returns: true - * util.isNumber(NaN); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead. - */ - export function isNumber(object: unknown): object is number; - /** - * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript). - * Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isObject(5); - * // Returns: false - * util.isObject(null); - * // Returns: false - * util.isObject({}); - * // Returns: true - * util.isObject(() => {}); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value !== null && typeof value === 'object'` instead. - */ - export function isObject(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`. - * - * ```js - * import util from 'node:util'; - * - * util.isPrimitive(5); - * // Returns: true - * util.isPrimitive('foo'); - * // Returns: true - * util.isPrimitive(false); - * // Returns: true - * util.isPrimitive(null); - * // Returns: true - * util.isPrimitive(undefined); - * // Returns: true - * util.isPrimitive({}); - * // Returns: false - * util.isPrimitive(() => {}); - * // Returns: false - * util.isPrimitive(/^$/); - * // Returns: false - * util.isPrimitive(new Date()); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. - */ - export function isPrimitive(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isString(''); - * // Returns: true - * util.isString('foo'); - * // Returns: true - * util.isString(String('foo')); - * // Returns: true - * util.isString(5); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead. - */ - export function isString(object: unknown): object is string; - /** - * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * util.isSymbol(5); - * // Returns: false - * util.isSymbol('foo'); - * // Returns: false - * util.isSymbol(Symbol('foo')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead. - */ - export function isSymbol(object: unknown): object is symbol; - /** - * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`. - * - * ```js - * import util from 'node:util'; - * - * const foo = undefined; - * util.isUndefined(5); - * // Returns: false - * util.isUndefined(foo); - * // Returns: true - * util.isUndefined(null); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined` instead. - */ - export function isUndefined(object: unknown): object is undefined; - /** - * The `util.deprecate()` method wraps `fn` (which may be a function or class) in - * such a way that it is marked as deprecated. - * - * ```js - * import util from 'node:util'; - * - * exports.obsoleteFunction = util.deprecate(() => { - * // Do something here. - * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.'); - * ``` - * - * When called, `util.deprecate()` will return a function that will emit a `DeprecationWarning` using the `'warning'` event. The warning will - * be emitted and printed to `stderr` the first time the returned function is - * called. After the warning is emitted, the wrapped function is called without - * emitting a warning. - * - * If the same optional `code` is supplied in multiple calls to `util.deprecate()`, - * the warning will be emitted only once for that `code`. - * - * ```js - * import util from 'node:util'; - * - * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001'); - * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001'); - * fn1(); // Emits a deprecation warning with code DEP0001 - * fn2(); // Does not emit a deprecation warning because it has the same code - * ``` - * - * If either the `--no-deprecation` or `--no-warnings` command-line flags are - * used, or if the `process.noDeprecation` property is set to `true`_prior_ to - * the first deprecation warning, the `util.deprecate()` method does nothing. - * - * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, - * or the `process.traceDeprecation` property is set to `true`, a warning and a - * stack trace are printed to `stderr` the first time the deprecated function is - * called. - * - * If the `--throw-deprecation` command-line flag is set, or the `process.throwDeprecation` property is set to `true`, then an exception will be - * thrown when the deprecated function is called. - * - * The `--throw-deprecation` command-line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation` and `process.traceDeprecation`. - * @since v0.8.0 - * @param fn The function that is being deprecated. - * @param msg A warning message to display when the deprecated function is invoked. - * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes. - * @return The deprecated function wrapped to emit a warning. - */ - export function deprecate(fn: T, msg: string, code?: string): T; - /** - * Returns `true` if there is deep strict equality between `val1` and `val2`. - * Otherwise, returns `false`. - * - * See `assert.deepStrictEqual()` for more information about deep strict - * equality. - * @since v9.0.0 - */ - export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean; - /** - * Returns `str` with any ANSI escape codes removed. - * - * ```js - * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m')); - * // Prints "value" - * ``` - * @since v16.11.0 - */ - export function stripVTControlCharacters(str: string): string; - /** - * Takes an `async` function (or a function that returns a `Promise`) and returns a - * function following the error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument. In the callback, the - * first argument will be the rejection reason (or `null` if the `Promise` resolved), and the second argument will be the resolved value. - * - * ```js - * import util from 'node:util'; - * - * async function fn() { - * return 'hello world'; - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * if (err) throw err; - * console.log(ret); - * }); - * ``` - * - * Will print: - * - * ```text - * hello world - * ``` - * - * The callback is executed asynchronously, and will have a limited stack trace. - * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit. - * - * Since `null` has a special meaning as the first argument to a callback, if a - * wrapped function rejects a `Promise` with a falsy value as a reason, the value - * is wrapped in an `Error` with the original value stored in a field named `reason`. - * - * ```js - * function fn() { - * return Promise.reject(null); - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * // When the Promise was rejected with `null` it is wrapped with an Error and - * // the original value is stored in `reason`. - * err && Object.hasOwn(err, 'reason') && err.reason === null; // true - * }); - * ``` - * @since v8.2.0 - * @param fn An `async` function - * @return a callback style function - */ - export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: () => Promise, - ): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1) => Promise, - ): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1) => Promise, - ): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2) => Promise, - ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2) => Promise, - ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - callback: (err: NodeJS.ErrnoException) => void, - ) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, - ): ( - arg1: T1, - arg2: T2, - arg3: T3, - arg4: T4, - arg5: T5, - arg6: T6, - callback: (err: NodeJS.ErrnoException | null, result: TResult) => void, - ) => void; - export interface CustomPromisifyLegacy extends Function { - __promisify__: TCustom; - } - export interface CustomPromisifySymbol extends Function { - [promisify.custom]: TCustom; - } - export type CustomPromisify = - | CustomPromisifySymbol - | CustomPromisifyLegacy; - /** - * Takes a function following the common error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument, and returns a version - * that returns promises. - * - * ```js - * import util from 'node:util'; - * import fs from 'node:fs'; - * - * const stat = util.promisify(fs.stat); - * stat('.').then((stats) => { - * // Do something with `stats` - * }).catch((error) => { - * // Handle the error. - * }); - * ``` - * - * Or, equivalently using `async function`s: - * - * ```js - * import util from 'node:util'; - * import fs from 'node:fs'; - * - * const stat = util.promisify(fs.stat); - * - * async function callStat() { - * const stats = await stat('.'); - * console.log(`This directory is owned by ${stats.uid}`); - * } - * - * callStat(); - * ``` - * - * If there is an `original[util.promisify.custom]` property present, `promisify` will return its value, see `Custom promisified functions`. - * - * `promisify()` assumes that `original` is a function taking a callback as its - * final argument in all cases. If `original` is not a function, `promisify()` will throw an error. If `original` is a function but its last argument is not - * an error-first callback, it will still be passed an error-first - * callback as its last argument. - * - * Using `promisify()` on class methods or other methods that use `this` may not - * work as expected unless handled specially: - * - * ```js - * import util from 'node:util'; - * - * class Foo { - * constructor() { - * this.a = 42; - * } - * - * bar(callback) { - * callback(null, this.a); - * } - * } - * - * const foo = new Foo(); - * - * const naiveBar = util.promisify(foo.bar); - * // TypeError: Cannot read property 'a' of undefined - * // naiveBar().then(a => console.log(a)); - * - * naiveBar.call(foo).then((a) => console.log(a)); // '42' - * - * const bindBar = naiveBar.bind(foo); - * bindBar().then((a) => console.log(a)); // '42' - * ``` - * @since v8.0.0 - */ - export function promisify(fn: CustomPromisify): TCustom; - export function promisify( - fn: (callback: (err: any, result: TResult) => void) => void, - ): () => Promise; - export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise; - export function promisify( - fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: Function): Function; - export namespace promisify { - /** - * That can be used to declare custom promisified variants of functions. - */ - const custom: unique symbol; - } - /** - * Stability: 1.1 - Active development - * Given an example `.env` file: - * - * ```js - * import { parseEnv } from 'node:util'; - * - * parseEnv('HELLO=world\nHELLO=oh my\n'); - * // Returns: { HELLO: 'oh my' } - * ``` - * @param content The raw contents of a `.env` file. - * @since v20.12.0 - */ - export function parseEnv(content: string): object; - // https://nodejs.org/docs/latest/api/util.html#foreground-colors - type ForegroundColors = - | "black" - | "blackBright" - | "blue" - | "blueBright" - | "cyan" - | "cyanBright" - | "gray" - | "green" - | "greenBright" - | "grey" - | "magenta" - | "magentaBright" - | "red" - | "redBright" - | "white" - | "whiteBright" - | "yellow" - | "yellowBright"; - // https://nodejs.org/docs/latest/api/util.html#background-colors - type BackgroundColors = - | "bgBlack" - | "bgBlackBright" - | "bgBlue" - | "bgBlueBright" - | "bgCyan" - | "bgCyanBright" - | "bgGray" - | "bgGreen" - | "bgGreenBright" - | "bgGrey" - | "bgMagenta" - | "bgMagentaBright" - | "bgRed" - | "bgRedBright" - | "bgWhite" - | "bgWhiteBright" - | "bgYellow" - | "bgYellowBright"; - // https://nodejs.org/docs/latest/api/util.html#modifiers - type Modifiers = - | "blink" - | "bold" - | "dim" - | "doubleunderline" - | "framed" - | "hidden" - | "inverse" - | "italic" - | "overlined" - | "reset" - | "strikethrough" - | "underline"; - /** - * Stability: 1.1 - Active development - * - * This function returns a formatted text considering the `format` passed. - * - * ```js - * import { styleText } from 'node:util'; - * const errorMessage = styleText('red', 'Error! Error!'); - * console.log(errorMessage); - * ``` - * - * `util.inspect.colors` also provides text formats such as `italic`, and `underline` and you can combine both: - * - * ```js - * console.log( - * util.styleText(['underline', 'italic'], 'My italic underlined message'), - * ); - * ``` - * - * When passing an array of formats, the order of the format applied is left to right so the following style - * might overwrite the previous one. - * - * ```js - * console.log( - * util.styleText(['red', 'green'], 'text'), // green - * ); - * ``` - * - * The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v22.x/api/util.html#modifiers). - * @param format A text format or an Array of text formats defined in `util.inspect.colors`. - * @param text The text to to be formatted. - * @since v20.12.0 - */ - export function styleText( - format: - | ForegroundColors - | BackgroundColors - | Modifiers - | Array, - text: string, - ): string; - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API. - * - * ```js - * const decoder = new TextDecoder(); - * const u8arr = new Uint8Array([72, 101, 108, 108, 111]); - * console.log(decoder.decode(u8arr)); // Hello - * ``` - * @since v8.3.0 - */ - export class TextDecoder { - /** - * The encoding supported by the `TextDecoder` instance. - */ - readonly encoding: string; - /** - * The value will be `true` if decoding errors result in a `TypeError` being - * thrown. - */ - readonly fatal: boolean; - /** - * The value will be `true` if the decoding result will include the byte order - * mark. - */ - readonly ignoreBOM: boolean; - constructor( - encoding?: string, - options?: { - fatal?: boolean | undefined; - ignoreBOM?: boolean | undefined; - }, - ); - /** - * Decodes the `input` and returns a string. If `options.stream` is `true`, any - * incomplete byte sequences occurring at the end of the `input` are buffered - * internally and emitted after the next call to `textDecoder.decode()`. - * - * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a `TypeError` being thrown. - * @param input An `ArrayBuffer`, `DataView`, or `TypedArray` instance containing the encoded data. - */ - decode( - input?: NodeJS.ArrayBufferView | ArrayBuffer | null, - options?: { - stream?: boolean | undefined; - }, - ): string; - } - export interface EncodeIntoResult { - /** - * The read Unicode code units of input. - */ - read: number; - /** - * The written UTF-8 bytes of output. - */ - written: number; - } - export { types }; - - //// TextEncoder/Decoder - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All - * instances of `TextEncoder` only support UTF-8 encoding. - * - * ```js - * const encoder = new TextEncoder(); - * const uint8array = encoder.encode('this is some data'); - * ``` - * - * The `TextEncoder` class is also available on the global object. - * @since v8.3.0 - */ - export class TextEncoder { - /** - * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. - */ - readonly encoding: string; - /** - * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the - * encoded bytes. - * @param [input='an empty string'] The text to encode. - */ - encode(input?: string): Uint8Array; - /** - * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object - * containing the read Unicode code units and written UTF-8 bytes. - * - * ```js - * const encoder = new TextEncoder(); - * const src = 'this is some data'; - * const dest = new Uint8Array(10); - * const { read, written } = encoder.encodeInto(src, dest); - * ``` - * @param src The text to encode. - * @param dest The array to hold the encode result. - */ - encodeInto(src: string, dest: Uint8Array): EncodeIntoResult; - } - import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from "util"; - global { - /** - * `TextDecoder` class is a global reference for `import { TextDecoder } from 'node:util'` - * https://nodejs.org/api/globals.html#textdecoder - * @since v11.0.0 - */ - var TextDecoder: typeof globalThis extends { - onmessage: any; - TextDecoder: infer TextDecoder; - } ? TextDecoder - : typeof _TextDecoder; - /** - * `TextEncoder` class is a global reference for `import { TextEncoder } from 'node:util'` - * https://nodejs.org/api/globals.html#textencoder - * @since v11.0.0 - */ - var TextEncoder: typeof globalThis extends { - onmessage: any; - TextEncoder: infer TextEncoder; - } ? TextEncoder - : typeof _TextEncoder; - } - - //// parseArgs - /** - * Provides a higher level API for command-line argument parsing than interacting - * with `process.argv` directly. Takes a specification for the expected arguments - * and returns a structured object with the parsed options and positionals. - * - * ```js - * import { parseArgs } from 'node:util'; - * const args = ['-f', '--bar', 'b']; - * const options = { - * foo: { - * type: 'boolean', - * short: 'f', - * }, - * bar: { - * type: 'string', - * }, - * }; - * const { - * values, - * positionals, - * } = parseArgs({ args, options }); - * console.log(values, positionals); - * // Prints: [Object: null prototype] { foo: true, bar: 'b' } [] - * ``` - * @since v18.3.0, v16.17.0 - * @param config Used to provide arguments for parsing and to configure the parser. `config` supports the following properties: - * @return The parsed command line arguments: - */ - export function parseArgs(config?: T): ParsedResults; - interface ParseArgsOptionConfig { - /** - * Type of argument. - */ - type: "string" | "boolean"; - /** - * Whether this option can be provided multiple times. - * If `true`, all values will be collected in an array. - * If `false`, values for the option are last-wins. - * @default false. - */ - multiple?: boolean | undefined; - /** - * A single character alias for the option. - */ - short?: string | undefined; - /** - * The default option value when it is not set by args. - * It must be of the same type as the the `type` property. - * When `multiple` is `true`, it must be an array. - * @since v18.11.0 - */ - default?: string | boolean | string[] | boolean[] | undefined; - } - interface ParseArgsOptionsConfig { - [longOption: string]: ParseArgsOptionConfig; - } - export interface ParseArgsConfig { - /** - * Array of argument strings. - */ - args?: string[] | undefined; - /** - * Used to describe arguments known to the parser. - */ - options?: ParseArgsOptionsConfig | undefined; - /** - * Should an error be thrown when unknown arguments are encountered, - * or when arguments are passed that do not match the `type` configured in `options`. - * @default true - */ - strict?: boolean | undefined; - /** - * Whether this command accepts positional arguments. - */ - allowPositionals?: boolean | undefined; - /** - * If `true`, allows explicitly setting boolean options to `false` by prefixing the option name with `--no-`. - * @default false - * @since v22.4.0 - */ - allowNegative?: boolean | undefined; - /** - * Return the parsed tokens. This is useful for extending the built-in behavior, - * from adding additional checks through to reprocessing the tokens in different ways. - * @default false - */ - tokens?: boolean | undefined; - } - /* - IfDefaultsTrue and IfDefaultsFalse are helpers to handle default values for missing boolean properties. - TypeScript does not have exact types for objects: https://github.com/microsoft/TypeScript/issues/12936 - This means it is impossible to distinguish between "field X is definitely not present" and "field X may or may not be present". - But we expect users to generally provide their config inline or `as const`, which means TS will always know whether a given field is present. - So this helper treats "not definitely present" (i.e., not `extends boolean`) as being "definitely not present", i.e. it should have its default value. - This is technically incorrect but is a much nicer UX for the common case. - The IfDefaultsTrue version is for things which default to true; the IfDefaultsFalse version is for things which default to false. - */ - type IfDefaultsTrue = T extends true ? IfTrue - : T extends false ? IfFalse - : IfTrue; - - // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false` - type IfDefaultsFalse = T extends false ? IfFalse - : T extends true ? IfTrue - : IfFalse; - - type ExtractOptionValue = IfDefaultsTrue< - T["strict"], - O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean, - string | boolean - >; - - type ParsedValues = - & IfDefaultsTrue - & (T["options"] extends ParseArgsOptionsConfig ? { - -readonly [LongOption in keyof T["options"]]: - // when "default" is not undefined, the value will be present - | (T["options"][LongOption]["default"] extends {} ? never : undefined) - | IfDefaultsFalse< - T["options"][LongOption]["multiple"], - Array>, - ExtractOptionValue - >; - } - : {}); - - type ParsedPositionals = IfDefaultsTrue< - T["strict"], - IfDefaultsFalse, - IfDefaultsTrue - >; - - type PreciseTokenForOptions< - K extends string, - O extends ParseArgsOptionConfig, - > = O["type"] extends "string" ? { - kind: "option"; - index: number; - name: K; - rawName: string; - value: string; - inlineValue: boolean; - } - : O["type"] extends "boolean" ? { - kind: "option"; - index: number; - name: K; - rawName: string; - value: undefined; - inlineValue: undefined; - } - : OptionToken & { name: K }; - - type TokenForOptions< - T extends ParseArgsConfig, - K extends keyof T["options"] = keyof T["options"], - > = K extends unknown - ? T["options"] extends ParseArgsOptionsConfig ? PreciseTokenForOptions - : OptionToken - : never; - - type ParsedOptionToken = IfDefaultsTrue, OptionToken>; - - type ParsedPositionalToken = IfDefaultsTrue< - T["strict"], - IfDefaultsFalse, - IfDefaultsTrue - >; - - type ParsedTokens = Array< - ParsedOptionToken | ParsedPositionalToken | { kind: "option-terminator"; index: number } - >; - - type PreciseParsedResults = IfDefaultsFalse< - T["tokens"], - { - values: ParsedValues; - positionals: ParsedPositionals; - tokens: ParsedTokens; - }, - { - values: ParsedValues; - positionals: ParsedPositionals; - } - >; - - type OptionToken = - | { kind: "option"; index: number; name: string; rawName: string; value: string; inlineValue: boolean } - | { - kind: "option"; - index: number; - name: string; - rawName: string; - value: undefined; - inlineValue: undefined; - }; - - type Token = - | OptionToken - | { kind: "positional"; index: number; value: string } - | { kind: "option-terminator"; index: number }; - - // If ParseArgsConfig extends T, then the user passed config constructed elsewhere. - // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above. - type ParsedResults = ParseArgsConfig extends T ? { - values: { - [longOption: string]: undefined | string | boolean | Array; - }; - positionals: string[]; - tokens?: Token[]; - } - : PreciseParsedResults; - - /** - * An implementation of [the MIMEType class](https://bmeck.github.io/node-proposal-mime-api/). - * - * In accordance with browser conventions, all properties of `MIMEType` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. - * - * A MIME string is a structured string containing multiple meaningful - * components. When parsed, a `MIMEType` object is returned containing - * properties for each of these components. - * @since v19.1.0, v18.13.0 - * @experimental - */ - export class MIMEType { - /** - * Creates a new MIMEType object by parsing the input. - * - * A `TypeError` will be thrown if the `input` is not a valid MIME. - * Note that an effort will be made to coerce the given values into strings. - * @param input The input MIME to parse. - */ - constructor(input: string | { toString: () => string }); - - /** - * Gets and sets the type portion of the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/javascript'); - * console.log(myMIME.type); - * // Prints: text - * myMIME.type = 'application'; - * console.log(myMIME.type); - * // Prints: application - * console.log(String(myMIME)); - * // Prints: application/javascript - * ``` - */ - type: string; - /** - * Gets and sets the subtype portion of the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/ecmascript'); - * console.log(myMIME.subtype); - * // Prints: ecmascript - * myMIME.subtype = 'javascript'; - * console.log(myMIME.subtype); - * // Prints: javascript - * console.log(String(myMIME)); - * // Prints: text/javascript - * ``` - */ - subtype: string; - /** - * Gets the essence of the MIME. This property is read only. - * Use `mime.type` or `mime.subtype` to alter the MIME. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const myMIME = new MIMEType('text/javascript;key=value'); - * console.log(myMIME.essence); - * // Prints: text/javascript - * myMIME.type = 'application'; - * console.log(myMIME.essence); - * // Prints: application/javascript - * console.log(String(myMIME)); - * // Prints: application/javascript;key=value - * ``` - */ - readonly essence: string; - /** - * Gets the `MIMEParams` object representing the - * parameters of the MIME. This property is read-only. See `MIMEParams` documentation for details. - */ - readonly params: MIMEParams; - /** - * The `toString()` method on the `MIMEType` object returns the serialized MIME. - * - * Because of the need for standard compliance, this method does not allow users - * to customize the serialization process of the MIME. - */ - toString(): string; - } - /** - * The `MIMEParams` API provides read and write access to the parameters of a `MIMEType`. - * @since v19.1.0, v18.13.0 - */ - export class MIMEParams { - /** - * Remove all name-value pairs whose name is `name`. - */ - delete(name: string): void; - /** - * Returns an iterator over each of the name-value pairs in the parameters. - * 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`. - */ - entries(): NodeJS.Iterator<[name: string, value: string]>; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ - get(name: string): string | null; - /** - * Returns `true` if there is at least one name-value pair whose name is `name`. - */ - has(name: string): boolean; - /** - * Returns an iterator over the names of each name-value pair. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const { params } = new MIMEType('text/plain;foo=0;bar=1'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // bar - * ``` - */ - keys(): NodeJS.Iterator; - /** - * Sets the value in the `MIMEParams` 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`. - * - * ```js - * import { MIMEType } from 'node:util'; - * - * const { params } = new MIMEType('text/plain;foo=0;bar=1'); - * params.set('foo', 'def'); - * params.set('baz', 'xyz'); - * console.log(params.toString()); - * // Prints: foo=def;bar=1;baz=xyz - * ``` - */ - set(name: string, value: string): void; - /** - * Returns an iterator over the values of each name-value pair. - */ - values(): NodeJS.Iterator; - /** - * Returns an iterator over each of the name-value pairs in the parameters. - */ - [Symbol.iterator](): NodeJS.Iterator<[name: string, value: string]>; - } -} -declare module "util/types" { - import { KeyObject, webcrypto } from "node:crypto"; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or - * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * - * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`. - * - * ```js - * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike; - /** - * Returns `true` if the value is an `arguments` object. - * - * ```js - * function foo() { - * util.types.isArgumentsObject(arguments); // Returns true - * } - * ``` - * @since v10.0.0 - */ - function isArgumentsObject(object: unknown): object is IArguments; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance. - * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false - * ``` - * @since v10.0.0 - */ - function isArrayBuffer(object: unknown): object is ArrayBuffer; - /** - * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed - * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to - * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * - * ```js - * util.types.isArrayBufferView(new Int8Array()); // true - * util.types.isArrayBufferView(Buffer.from('hello world')); // true - * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true - * util.types.isArrayBufferView(new ArrayBuffer()); // false - * ``` - * @since v10.0.0 - */ - function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView; - /** - * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isAsyncFunction(function foo() {}); // Returns false - * util.types.isAsyncFunction(async function foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isAsyncFunction(object: unknown): boolean; - /** - * Returns `true` if the value is a `BigInt64Array` instance. - * - * ```js - * util.types.isBigInt64Array(new BigInt64Array()); // Returns true - * util.types.isBigInt64Array(new BigUint64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isBigInt64Array(value: unknown): value is BigInt64Array; - /** - * Returns `true` if the value is a `BigUint64Array` instance. - * - * ```js - * util.types.isBigUint64Array(new BigInt64Array()); // Returns false - * util.types.isBigUint64Array(new BigUint64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isBigUint64Array(value: unknown): value is BigUint64Array; - /** - * Returns `true` if the value is a boolean object, e.g. created - * by `new Boolean()`. - * - * ```js - * util.types.isBooleanObject(false); // Returns false - * util.types.isBooleanObject(true); // Returns false - * util.types.isBooleanObject(new Boolean(false)); // Returns true - * util.types.isBooleanObject(new Boolean(true)); // Returns true - * util.types.isBooleanObject(Boolean(false)); // Returns false - * util.types.isBooleanObject(Boolean(true)); // Returns false - * ``` - * @since v10.0.0 - */ - function isBooleanObject(object: unknown): object is Boolean; - /** - * Returns `true` if the value is any boxed primitive object, e.g. created - * by `new Boolean()`, `new String()` or `Object(Symbol())`. - * - * For example: - * - * ```js - * util.types.isBoxedPrimitive(false); // Returns false - * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true - * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false - * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true - * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true - * ``` - * @since v10.11.0 - */ - function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol; - /** - * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance. - * - * ```js - * const ab = new ArrayBuffer(20); - * util.types.isDataView(new DataView(ab)); // Returns true - * util.types.isDataView(new Float64Array()); // Returns false - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isDataView(object: unknown): object is DataView; - /** - * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. - * - * ```js - * util.types.isDate(new Date()); // Returns true - * ``` - * @since v10.0.0 - */ - function isDate(object: unknown): object is Date; - /** - * Returns `true` if the value is a native `External` value. - * - * A native `External` value is a special type of object that contains a - * raw C++ pointer (`void*`) for access from native code, and has no other - * properties. Such objects are created either by Node.js internals or native - * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype. - * - * ```c - * #include - * #include - * napi_value result; - * static napi_value MyNapi(napi_env env, napi_callback_info info) { - * int* raw = (int*) malloc(1024); - * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result); - * if (status != napi_ok) { - * napi_throw_error(env, NULL, "napi_create_external failed"); - * return NULL; - * } - * return result; - * } - * ... - * DECLARE_NAPI_PROPERTY("myNapi", MyNapi) - * ... - * ``` - * - * ```js - * const native = require('napi_addon.node'); - * const data = native.myNapi(); - * util.types.isExternal(data); // returns true - * util.types.isExternal(0); // returns false - * util.types.isExternal(new String('foo')); // returns false - * ``` - * - * For further information on `napi_create_external`, refer to `napi_create_external()`. - * @since v10.0.0 - */ - function isExternal(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance. - * - * ```js - * util.types.isFloat32Array(new ArrayBuffer()); // Returns false - * util.types.isFloat32Array(new Float32Array()); // Returns true - * util.types.isFloat32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isFloat32Array(object: unknown): object is Float32Array; - /** - * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance. - * - * ```js - * util.types.isFloat64Array(new ArrayBuffer()); // Returns false - * util.types.isFloat64Array(new Uint8Array()); // Returns false - * util.types.isFloat64Array(new Float64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isFloat64Array(object: unknown): object is Float64Array; - /** - * Returns `true` if the value is a generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isGeneratorFunction(function foo() {}); // Returns false - * util.types.isGeneratorFunction(function* foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorFunction(object: unknown): object is GeneratorFunction; - /** - * Returns `true` if the value is a generator object as returned from a - * built-in generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * function* foo() {} - * const generator = foo(); - * util.types.isGeneratorObject(generator); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorObject(object: unknown): object is Generator; - /** - * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance. - * - * ```js - * util.types.isInt8Array(new ArrayBuffer()); // Returns false - * util.types.isInt8Array(new Int8Array()); // Returns true - * util.types.isInt8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt8Array(object: unknown): object is Int8Array; - /** - * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance. - * - * ```js - * util.types.isInt16Array(new ArrayBuffer()); // Returns false - * util.types.isInt16Array(new Int16Array()); // Returns true - * util.types.isInt16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt16Array(object: unknown): object is Int16Array; - /** - * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance. - * - * ```js - * util.types.isInt32Array(new ArrayBuffer()); // Returns false - * util.types.isInt32Array(new Int32Array()); // Returns true - * util.types.isInt32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt32Array(object: unknown): object is Int32Array; - /** - * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * util.types.isMap(new Map()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMap( - object: T | {}, - ): object is T extends ReadonlyMap ? (unknown extends T ? never : ReadonlyMap) - : Map; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * const map = new Map(); - * util.types.isMapIterator(map.keys()); // Returns true - * util.types.isMapIterator(map.values()); // Returns true - * util.types.isMapIterator(map.entries()); // Returns true - * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMapIterator(object: unknown): boolean; - /** - * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects). - * - * ```js - * import * as ns from './a.js'; - * - * util.types.isModuleNamespaceObject(ns); // Returns true - * ``` - * @since v10.0.0 - */ - function isModuleNamespaceObject(value: unknown): boolean; - /** - * Returns `true` if the value was returned by the constructor of a [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects). - * - * ```js - * console.log(util.types.isNativeError(new Error())); // true - * console.log(util.types.isNativeError(new TypeError())); // true - * console.log(util.types.isNativeError(new RangeError())); // true - * ``` - * - * Subclasses of the native error types are also native errors: - * - * ```js - * class MyError extends Error {} - * console.log(util.types.isNativeError(new MyError())); // true - * ``` - * - * A value being `instanceof` a native error class is not equivalent to `isNativeError()` returning `true` for that value. `isNativeError()` returns `true` for errors - * which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false` for these errors: - * - * ```js - * import vm from 'node:vm'; - * const context = vm.createContext({}); - * const myError = vm.runInContext('new Error()', context); - * console.log(util.types.isNativeError(myError)); // true - * console.log(myError instanceof Error); // false - * ``` - * - * Conversely, `isNativeError()` returns `false` for all objects which were not - * returned by the constructor of a native error. That includes values - * which are `instanceof` native errors: - * - * ```js - * const myError = { __proto__: Error.prototype }; - * console.log(util.types.isNativeError(myError)); // false - * console.log(myError instanceof Error); // true - * ``` - * @since v10.0.0 - */ - function isNativeError(object: unknown): object is Error; - /** - * Returns `true` if the value is a number object, e.g. created - * by `new Number()`. - * - * ```js - * util.types.isNumberObject(0); // Returns false - * util.types.isNumberObject(new Number(0)); // Returns true - * ``` - * @since v10.0.0 - */ - function isNumberObject(object: unknown): object is Number; - /** - * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - * - * ```js - * util.types.isPromise(Promise.resolve(42)); // Returns true - * ``` - * @since v10.0.0 - */ - function isPromise(object: unknown): object is Promise; - /** - * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance. - * - * ```js - * const target = {}; - * const proxy = new Proxy(target, {}); - * util.types.isProxy(target); // Returns false - * util.types.isProxy(proxy); // Returns true - * ``` - * @since v10.0.0 - */ - function isProxy(object: unknown): boolean; - /** - * Returns `true` if the value is a regular expression object. - * - * ```js - * util.types.isRegExp(/abc/); // Returns true - * util.types.isRegExp(new RegExp('abc')); // Returns true - * ``` - * @since v10.0.0 - */ - function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * util.types.isSet(new Set()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSet( - object: T | {}, - ): object is T extends ReadonlySet ? (unknown extends T ? never : ReadonlySet) : Set; - /** - * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * const set = new Set(); - * util.types.isSetIterator(set.keys()); // Returns true - * util.types.isSetIterator(set.values()); // Returns true - * util.types.isSetIterator(set.entries()); // Returns true - * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSetIterator(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false - * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer; - /** - * Returns `true` if the value is a string object, e.g. created - * by `new String()`. - * - * ```js - * util.types.isStringObject('foo'); // Returns false - * util.types.isStringObject(new String('foo')); // Returns true - * ``` - * @since v10.0.0 - */ - function isStringObject(object: unknown): object is String; - /** - * Returns `true` if the value is a symbol object, created - * by calling `Object()` on a `Symbol` primitive. - * - * ```js - * const symbol = Symbol('foo'); - * util.types.isSymbolObject(symbol); // Returns false - * util.types.isSymbolObject(Object(symbol)); // Returns true - * ``` - * @since v10.0.0 - */ - function isSymbolObject(object: unknown): object is Symbol; - /** - * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance. - * - * ```js - * util.types.isTypedArray(new ArrayBuffer()); // Returns false - * util.types.isTypedArray(new Uint8Array()); // Returns true - * util.types.isTypedArray(new Float64Array()); // Returns true - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isTypedArray(object: unknown): object is NodeJS.TypedArray; - /** - * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance. - * - * ```js - * util.types.isUint8Array(new ArrayBuffer()); // Returns false - * util.types.isUint8Array(new Uint8Array()); // Returns true - * util.types.isUint8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8Array(object: unknown): object is Uint8Array; - /** - * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance. - * - * ```js - * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false - * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true - * util.types.isUint8ClampedArray(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray; - /** - * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance. - * - * ```js - * util.types.isUint16Array(new ArrayBuffer()); // Returns false - * util.types.isUint16Array(new Uint16Array()); // Returns true - * util.types.isUint16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint16Array(object: unknown): object is Uint16Array; - /** - * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance. - * - * ```js - * util.types.isUint32Array(new ArrayBuffer()); // Returns false - * util.types.isUint32Array(new Uint32Array()); // Returns true - * util.types.isUint32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint32Array(object: unknown): object is Uint32Array; - /** - * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance. - * - * ```js - * util.types.isWeakMap(new WeakMap()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakMap(object: unknown): object is WeakMap; - /** - * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance. - * - * ```js - * util.types.isWeakSet(new WeakSet()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakSet(object: unknown): object is WeakSet; - /** - * Returns `true` if `value` is a `KeyObject`, `false` otherwise. - * @since v16.2.0 - */ - function isKeyObject(object: unknown): object is KeyObject; - /** - * Returns `true` if `value` is a `CryptoKey`, `false` otherwise. - * @since v16.2.0 - */ - function isCryptoKey(object: unknown): object is webcrypto.CryptoKey; -} -declare module "node:util" { - export * from "util"; -} -declare module "node:util/types" { - export * from "util/types"; -} diff --git a/node_modules/@types/node/v8.d.ts b/node_modules/@types/node/v8.d.ts deleted file mode 100644 index 040bcfa..0000000 --- a/node_modules/@types/node/v8.d.ts +++ /dev/null @@ -1,808 +0,0 @@ -/** - * 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 - * import v8 from 'node:v8'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/v8.js) - */ -declare module "v8" { - import { Readable } from "node:stream"; - interface HeapSpaceInfo { - space_name: string; - space_size: number; - space_used_size: number; - space_available_size: number; - physical_space_size: number; - } - // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ - type DoesZapCodeSpaceFlag = 0 | 1; - interface HeapInfo { - total_heap_size: number; - total_heap_size_executable: number; - total_physical_size: number; - total_available_size: number; - used_heap_size: number; - heap_size_limit: number; - malloced_memory: number; - peak_malloced_memory: number; - does_zap_garbage: DoesZapCodeSpaceFlag; - number_of_native_contexts: number; - number_of_detached_contexts: number; - total_global_handles_size: number; - used_global_handles_size: number; - external_memory: number; - } - interface HeapCodeStatistics { - code_and_metadata_size: number; - bytecode_and_metadata_size: number; - external_script_source_size: number; - } - interface HeapSnapshotOptions { - /** - * If true, expose internals in the heap snapshot. - * @default false - */ - exposeInternals?: boolean; - /** - * If true, expose numeric values in artificial fields. - * @default false - */ - exposeNumericValues?: boolean; - } - /** - * Returns an integer representing a version tag derived from the V8 version, - * command-line flags, and detected CPU features. This is useful for determining - * whether a `vm.Script` `cachedData` buffer is compatible with this instance - * of V8. - * - * ```js - * console.log(v8.cachedDataVersionTag()); // 3947234607 - * // The value returned by v8.cachedDataVersionTag() is derived from the V8 - * // version, command-line flags, and detected CPU features. Test that the value - * // does indeed update when flags are toggled. - * v8.setFlagsFromString('--allow_natives_syntax'); - * console.log(v8.cachedDataVersionTag()); // 183726201 - * ``` - * @since v8.0.0 - */ - function cachedDataVersionTag(): number; - /** - * Returns an object with the following properties: - * - * `does_zap_garbage` is a 0/1 boolean, which signifies whether the `--zap_code_space` option is enabled or not. This makes V8 overwrite heap - * garbage with a bit pattern. The RSS footprint (resident set size) gets bigger - * because it continuously touches all heap pages and that makes them less likely - * to get swapped out by the operating system. - * - * `number_of_native_contexts` The value of native\_context is the number of the - * top-level contexts currently active. Increase of this number over time indicates - * a memory leak. - * - * `number_of_detached_contexts` The value of detached\_context is the number - * of contexts that were detached and not yet garbage collected. This number - * being non-zero indicates a potential memory leak. - * - * `total_global_handles_size` The value of total\_global\_handles\_size is the - * total memory size of V8 global handles. - * - * `used_global_handles_size` The value of used\_global\_handles\_size is the - * used memory size of V8 global handles. - * - * `external_memory` The value of external\_memory is the memory size of array - * buffers and external strings. - * - * ```js - * { - * total_heap_size: 7326976, - * total_heap_size_executable: 4194304, - * total_physical_size: 7326976, - * total_available_size: 1152656, - * used_heap_size: 3476208, - * heap_size_limit: 1535115264, - * malloced_memory: 16384, - * peak_malloced_memory: 1127496, - * does_zap_garbage: 0, - * number_of_native_contexts: 1, - * number_of_detached_contexts: 0, - * total_global_handles_size: 8192, - * used_global_handles_size: 3296, - * external_memory: 318824 - * } - * ``` - * @since v1.0.0 - */ - function getHeapStatistics(): HeapInfo; - /** - * 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 - * heap space can be guaranteed as the statistics are provided via the - * V8 [`GetHeapSpaceStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4) function and may change from one V8 version to the - * next. - * - * The value returned is an array of objects containing the following properties: - * - * ```json - * [ - * { - * "space_name": "new_space", - * "space_size": 2063872, - * "space_used_size": 951112, - * "space_available_size": 80824, - * "physical_space_size": 2063872 - * }, - * { - * "space_name": "old_space", - * "space_size": 3090560, - * "space_used_size": 2493792, - * "space_available_size": 0, - * "physical_space_size": 3090560 - * }, - * { - * "space_name": "code_space", - * "space_size": 1260160, - * "space_used_size": 644256, - * "space_available_size": 960, - * "physical_space_size": 1260160 - * }, - * { - * "space_name": "map_space", - * "space_size": 1094160, - * "space_used_size": 201608, - * "space_available_size": 0, - * "physical_space_size": 1094160 - * }, - * { - * "space_name": "large_object_space", - * "space_size": 0, - * "space_used_size": 0, - * "space_available_size": 1490980608, - * "physical_space_size": 0 - * } - * ] - * ``` - * @since v6.0.0 - */ - function getHeapSpaceStatistics(): HeapSpaceInfo[]; - /** - * The `v8.setFlagsFromString()` method can be used to programmatically set - * V8 command-line flags. This method should be used with care. Changing settings - * after the VM has started may result in unpredictable behavior, including - * crashes and data loss; or it may simply do nothing. - * - * The V8 options available for a version of Node.js may be determined by running `node --v8-options`. - * - * Usage: - * - * ```js - * // Print GC events to stdout for one minute. - * import v8 from 'node:v8'; - * v8.setFlagsFromString('--trace_gc'); - * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3); - * ``` - * @since v1.0.0 - */ - function setFlagsFromString(flags: string): void; - /** - * This is similar to the [`queryObjects()` console API](https://developer.chrome.com/docs/devtools/console/utilities#queryObjects-function) - * provided by the Chromium DevTools console. It can be used to search for objects that have the matching constructor on its prototype chain - * in the heap after a full garbage collection, which can be useful for memory leak regression tests. To avoid surprising results, users should - * avoid using this API on constructors whose implementation they don't control, or on constructors that can be invoked by other parties in the - * application. - * - * To avoid accidental leaks, this API does not return raw references to the objects found. By default, it returns the count of the objects - * found. If `options.format` is `'summary'`, it returns an array containing brief string representations for each object. The visibility provided - * in this API is similar to what the heap snapshot provides, while users can save the cost of serialization and parsing and directly filter the - * target objects during the search. - * - * Only objects created in the current execution context are included in the results. - * - * ```js - * import { queryObjects } from 'node:v8'; - * class A { foo = 'bar'; } - * console.log(queryObjects(A)); // 0 - * const a = new A(); - * console.log(queryObjects(A)); // 1 - * // [ "A { foo: 'bar' }" ] - * console.log(queryObjects(A, { format: 'summary' })); - * - * class B extends A { bar = 'qux'; } - * const b = new B(); - * console.log(queryObjects(B)); // 1 - * // [ "B { foo: 'bar', bar: 'qux' }" ] - * console.log(queryObjects(B, { format: 'summary' })); - * - * // Note that, when there are child classes inheriting from a constructor, - * // the constructor also shows up in the prototype chain of the child - * // classes's prototoype, so the child classes's prototoype would also be - * // included in the result. - * console.log(queryObjects(A)); // 3 - * // [ "B { foo: 'bar', bar: 'qux' }", 'A {}', "A { foo: 'bar' }" ] - * console.log(queryObjects(A, { format: 'summary' })); - * ``` - * @param ctor The constructor that can be used to search on the prototype chain in order to filter target objects in the heap. - * @since v20.13.0 - * @experimental - */ - function queryObjects(ctor: Function): number | string[]; - function queryObjects(ctor: Function, options: { format: "count" }): number; - function queryObjects(ctor: Function, options: { format: "summary" }): string[]; - /** - * Generates a snapshot of the current V8 heap and returns a Readable - * Stream that may be used to read the JSON serialized representation. - * This JSON stream format is intended to be used with tools such as - * Chrome DevTools. The JSON schema is undocumented and specific to the - * V8 engine. Therefore, the schema may change from one version of V8 to the next. - * - * Creating a heap snapshot requires memory about twice the size of the heap at - * the time the snapshot is created. This results in the risk of OOM killers - * terminating the process. - * - * Generating a snapshot is a synchronous operation which blocks the event loop - * for a duration depending on the heap size. - * - * ```js - * // Print heap snapshot to the console - * import v8 from 'node:v8'; - * const stream = v8.getHeapSnapshot(); - * stream.pipe(process.stdout); - * ``` - * @since v11.13.0 - * @return A Readable containing the V8 heap snapshot. - */ - function getHeapSnapshot(options?: HeapSnapshotOptions): Readable; - /** - * Generates a snapshot of the current V8 heap and writes it to a JSON - * file. This file is intended to be used with tools such as Chrome - * DevTools. The JSON schema is undocumented and specific to the V8 - * engine, and may change from one version of V8 to the next. - * - * A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will - * not contain any information about the workers, and vice versa. - * - * Creating a heap snapshot requires memory about twice the size of the heap at - * the time the snapshot is created. This results in the risk of OOM killers - * terminating the process. - * - * Generating a snapshot is a synchronous operation which blocks the event loop - * for a duration depending on the heap size. - * - * ```js - * import { writeHeapSnapshot } from 'node:v8'; - * import { - * Worker, - * isMainThread, - * parentPort, - * } from 'node:worker_threads'; - * - * if (isMainThread) { - * const worker = new Worker(__filename); - * - * worker.once('message', (filename) => { - * console.log(`worker heapdump: ${filename}`); - * // Now get a heapdump for the main thread. - * console.log(`main thread heapdump: ${writeHeapSnapshot()}`); - * }); - * - * // Tell the worker to create a heapdump. - * worker.postMessage('heapdump'); - * } else { - * parentPort.once('message', (message) => { - * if (message === 'heapdump') { - * // Generate a heapdump for the worker - * // and return the filename to the parent. - * parentPort.postMessage(writeHeapSnapshot()); - * } - * }); - * } - * ``` - * @since v11.13.0 - * @param filename The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be - * generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a - * worker thread. - * @return The filename where the snapshot was saved. - */ - function writeHeapSnapshot(filename?: string, options?: HeapSnapshotOptions): string; - /** - * Get statistics about code and its metadata in the heap, see - * V8 [`GetHeapCodeAndMetadataStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#a6079122af17612ef54ef3348ce170866) API. Returns an object with the - * following properties: - * - * ```js - * { - * code_and_metadata_size: 212208, - * bytecode_and_metadata_size: 161368, - * external_script_source_size: 1410794, - * cpu_profiler_metadata_size: 0, - * } - * ``` - * @since v12.8.0 - */ - function getHeapCodeStatistics(): HeapCodeStatistics; - /** - * @since v8.0.0 - */ - class Serializer { - /** - * Writes out a header, which includes the serialization format version. - */ - writeHeader(): void; - /** - * Serializes a JavaScript value and adds the serialized representation to the - * internal buffer. - * - * This throws an error if `value` cannot be serialized. - */ - writeValue(val: any): boolean; - /** - * Returns the stored internal buffer. This serializer should not be used once - * the buffer is released. Calling this method results in undefined behavior - * if a previous write has failed. - */ - releaseBuffer(): Buffer; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`. - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Write a raw 32-bit unsigned integer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint32(value: number): void; - /** - * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint64(hi: number, lo: number): void; - /** - * Write a JS `number` value. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeDouble(value: number): void; - /** - * Write raw bytes into the serializer's internal buffer. The deserializer - * will require a way to compute the length of the buffer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeRawBytes(buffer: NodeJS.TypedArray): void; - } - /** - * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only - * stores the part of their underlying `ArrayBuffer`s that they are referring to. - * @since v8.0.0 - */ - class DefaultSerializer extends Serializer {} - /** - * @since v8.0.0 - */ - class Deserializer { - constructor(data: NodeJS.TypedArray); - /** - * Reads and validates a header (including the format version). - * May, for example, reject an invalid or unsupported wire format. In that case, - * an `Error` is thrown. - */ - readHeader(): boolean; - /** - * Deserializes a JavaScript value from the buffer and returns it. - */ - readValue(): any; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the serializing context to `serializer.transferArrayBuffer()` (or return the `id` from `serializer._getSharedArrayBufferId()` in the case of - * `SharedArrayBuffer`s). - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Reads the underlying wire format version. Likely mostly to be useful to - * legacy code reading old wire format versions. May not be called before `.readHeader()`. - */ - getWireFormatVersion(): number; - /** - * Read a raw 32-bit unsigned integer and return it. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint32(): number; - /** - * Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]` with two 32-bit unsigned integer entries. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint64(): [number, number]; - /** - * Read a JS `number` value. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readDouble(): number; - /** - * Read raw bytes from the deserializer's internal buffer. The `length` parameter - * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readRawBytes(length: number): Buffer; - } - /** - * A subclass of `Deserializer` corresponding to the format written by `DefaultSerializer`. - * @since v8.0.0 - */ - class DefaultDeserializer extends Deserializer {} - /** - * Uses a `DefaultSerializer` to serialize `value` into a buffer. - * - * `ERR_BUFFER_TOO_LARGE` will be thrown when trying to - * serialize a huge object which requires buffer - * larger than `buffer.constants.MAX_LENGTH`. - * @since v8.0.0 - */ - function serialize(value: any): Buffer; - /** - * 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; - /** - * 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 - * be reset and a new coverage report will be written to the directory specified - * by `NODE_V8_COVERAGE`. - * - * When the process is about to exit, one last coverage will still be written to - * disk unless {@link stopCoverage} is invoked before the process exits. - * @since v15.1.0, v14.18.0, v12.22.0 - */ - function takeCoverage(): void; - /** - * The `v8.stopCoverage()` method allows the user to stop the coverage collection - * started by `NODE_V8_COVERAGE`, so that V8 can release the execution count - * records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand. - * @since v15.1.0, v14.18.0, v12.22.0 - */ - 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-v22.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information. - * @experimental - * @since v18.10.0, v16.18.0 - */ - function setHeapSnapshotNearHeapLimit(limit: number): void; - /** - * This API collects GC data in current thread. - * @since v19.6.0, v18.15.0 - */ - class GCProfiler { - /** - * Start collecting GC data. - * @since v19.6.0, v18.15.0 - */ - start(): void; - /** - * Stop collecting GC data and return an object. The content of object - * is as follows. - * - * ```json - * { - * "version": 1, - * "startTime": 1674059033862, - * "statistics": [ - * { - * "gcType": "Scavenge", - * "beforeGC": { - * "heapStatistics": { - * "totalHeapSize": 5005312, - * "totalHeapSizeExecutable": 524288, - * "totalPhysicalSize": 5226496, - * "totalAvailableSize": 4341325216, - * "totalGlobalHandlesSize": 8192, - * "usedGlobalHandlesSize": 2112, - * "usedHeapSize": 4883840, - * "heapSizeLimit": 4345298944, - * "mallocedMemory": 254128, - * "externalMemory": 225138, - * "peakMallocedMemory": 181760 - * }, - * "heapSpaceStatistics": [ - * { - * "spaceName": "read_only_space", - * "spaceSize": 0, - * "spaceUsedSize": 0, - * "spaceAvailableSize": 0, - * "physicalSpaceSize": 0 - * } - * ] - * }, - * "cost": 1574.14, - * "afterGC": { - * "heapStatistics": { - * "totalHeapSize": 6053888, - * "totalHeapSizeExecutable": 524288, - * "totalPhysicalSize": 5500928, - * "totalAvailableSize": 4341101384, - * "totalGlobalHandlesSize": 8192, - * "usedGlobalHandlesSize": 2112, - * "usedHeapSize": 4059096, - * "heapSizeLimit": 4345298944, - * "mallocedMemory": 254128, - * "externalMemory": 225138, - * "peakMallocedMemory": 181760 - * }, - * "heapSpaceStatistics": [ - * { - * "spaceName": "read_only_space", - * "spaceSize": 0, - * "spaceUsedSize": 0, - * "spaceAvailableSize": 0, - * "physicalSpaceSize": 0 - * } - * ] - * } - * } - * ], - * "endTime": 1674059036865 - * } - * ``` - * - * Here's an example. - * - * ```js - * import { GCProfiler } from 'node:v8'; - * const profiler = new GCProfiler(); - * profiler.start(); - * setTimeout(() => { - * console.log(profiler.stop()); - * }, 1000); - * ``` - * @since v19.6.0, v18.15.0 - */ - stop(): GCProfilerResult; - } - interface GCProfilerResult { - version: number; - startTime: number; - endTime: number; - statistics: Array<{ - gcType: string; - cost: number; - beforeGC: { - heapStatistics: HeapStatistics; - heapSpaceStatistics: HeapSpaceStatistics[]; - }; - afterGC: { - heapStatistics: HeapStatistics; - heapSpaceStatistics: HeapSpaceStatistics[]; - }; - }>; - } - interface HeapStatistics { - totalHeapSize: number; - totalHeapSizeExecutable: number; - totalPhysicalSize: number; - totalAvailableSize: number; - totalGlobalHandlesSize: number; - usedGlobalHandlesSize: number; - usedHeapSize: number; - heapSizeLimit: number; - mallocedMemory: number; - externalMemory: number; - peakMallocedMemory: number; - } - interface HeapSpaceStatistics { - spaceName: string; - spaceSize: number; - spaceUsedSize: number; - spaceAvailableSize: number; - physicalSpaceSize: number; - } - /** - * Called when a promise is constructed. This does not mean that corresponding before/after events will occur, only that the possibility exists. This will - * happen if a promise is created without ever getting a continuation. - * @since v17.1.0, v16.14.0 - * @param promise The promise being created. - * @param parent The promise continued from, if applicable. - */ - interface Init { - (promise: Promise, parent: Promise): void; - } - /** - * Called before a promise continuation executes. This can be in the form of `then()`, `catch()`, or `finally()` handlers or an await resuming. - * - * The before callback will be called 0 to N times. The before callback will typically be called 0 times if no continuation was ever made for the promise. - * The before callback may be called many times in the case where many continuations have been made from the same promise. - * @since v17.1.0, v16.14.0 - */ - interface Before { - (promise: Promise): void; - } - /** - * Called immediately after a promise continuation executes. This may be after a `then()`, `catch()`, or `finally()` handler or before an await after another await. - * @since v17.1.0, v16.14.0 - */ - interface After { - (promise: Promise): void; - } - /** - * Called when the promise receives a resolution or rejection value. This may occur synchronously in the case of {@link Promise.resolve()} or - * {@link Promise.reject()}. - * @since v17.1.0, v16.14.0 - */ - interface Settled { - (promise: Promise): void; - } - /** - * Key events in the lifetime of a promise have been categorized into four areas: creation of a promise, before/after a continuation handler is called or - * around an await, and when the promise resolves or rejects. - * - * Because promises are asynchronous resources whose lifecycle is tracked via the promise hooks mechanism, the `init()`, `before()`, `after()`, and - * `settled()` callbacks must not be async functions as they create more promises which would produce an infinite loop. - * @since v17.1.0, v16.14.0 - */ - interface HookCallbacks { - init?: Init; - before?: Before; - after?: After; - settled?: Settled; - } - interface PromiseHooks { - /** - * The `init` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param init The {@link Init | `init` callback} to call when a promise is created. - * @return Call to stop the hook. - */ - onInit: (init: Init) => Function; - /** - * The `settled` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param settled The {@link Settled | `settled` callback} to call when a promise is created. - * @return Call to stop the hook. - */ - onSettled: (settled: Settled) => Function; - /** - * The `before` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param before The {@link Before | `before` callback} to call before a promise continuation executes. - * @return Call to stop the hook. - */ - onBefore: (before: Before) => Function; - /** - * The `after` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param after The {@link After | `after` callback} to call after a promise continuation executes. - * @return Call to stop the hook. - */ - onAfter: (after: After) => Function; - /** - * Registers functions to be called for different lifetime events of each promise. - * The callbacks `init()`/`before()`/`after()`/`settled()` are called for the respective events during a promise's lifetime. - * All callbacks are optional. For example, if only promise creation needs to be tracked, then only the init callback needs to be passed. - * The hook callbacks must be plain functions. Providing async functions will throw as it would produce an infinite microtask loop. - * @since v17.1.0, v16.14.0 - * @param callbacks The {@link HookCallbacks | Hook Callbacks} to register - * @return Used for disabling hooks - */ - createHook: (callbacks: HookCallbacks) => Function; - } - /** - * The `promiseHooks` interface can be used to track promise lifecycle events. - * @since v17.1.0, v16.14.0 - */ - 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. - * - * ```bash - * $ node --snapshot-blob snapshot.blob --build-snapshot entry.js - * # This launches a process with the snapshot - * $ node --snapshot-blob snapshot.blob - * ``` - * - * In the example above, `entry.js` can use methods from the `v8.startupSnapshot` interface to specify how to save information for custom objects - * in the snapshot during serialization and how the information can be used to synchronize these objects during deserialization of the snapshot. - * For example, if the `entry.js` contains the following script: - * - * ```js - * 'use strict'; - * - * import fs from 'node:fs'; - * import zlib from 'node:zlib'; - * import path from 'node:path'; - * import assert from 'node:assert'; - * - * import v8 from 'node:v8'; - * - * class BookShelf { - * storage = new Map(); - * - * // Reading a series of files from directory and store them into storage. - * constructor(directory, books) { - * for (const book of books) { - * this.storage.set(book, fs.readFileSync(path.join(directory, book))); - * } - * } - * - * static compressAll(shelf) { - * for (const [ book, content ] of shelf.storage) { - * shelf.storage.set(book, zlib.gzipSync(content)); - * } - * } - * - * static decompressAll(shelf) { - * for (const [ book, content ] of shelf.storage) { - * shelf.storage.set(book, zlib.gunzipSync(content)); - * } - * } - * } - * - * // __dirname here is where the snapshot script is placed - * // during snapshot building time. - * const shelf = new BookShelf(__dirname, [ - * 'book1.en_US.txt', - * 'book1.es_ES.txt', - * 'book2.zh_CN.txt', - * ]); - * - * assert(v8.startupSnapshot.isBuildingSnapshot()); - * // On snapshot serialization, compress the books to reduce size. - * v8.startupSnapshot.addSerializeCallback(BookShelf.compressAll, shelf); - * // On snapshot deserialization, decompress the books. - * v8.startupSnapshot.addDeserializeCallback(BookShelf.decompressAll, shelf); - * v8.startupSnapshot.setDeserializeMainFunction((shelf) => { - * // process.env and process.argv are refreshed during snapshot - * // deserialization. - * const lang = process.env.BOOK_LANG || 'en_US'; - * const book = process.argv[1]; - * const name = `${book}.${lang}.txt`; - * console.log(shelf.storage.get(name)); - * }, shelf); - * ``` - * - * The resulted binary will get print the data deserialized from the snapshot during start up, using the refreshed `process.env` and `process.argv` of the launched process: - * - * ```bash - * $ BOOK_LANG=es_ES node --snapshot-blob snapshot.blob book1 - * # Prints content of book1.es_ES.txt deserialized from the snapshot. - * ``` - * - * 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; -} -declare module "node:v8" { - export * from "v8"; -} diff --git a/node_modules/@types/node/vm.d.ts b/node_modules/@types/node/vm.d.ts deleted file mode 100644 index 9d9ff1a..0000000 --- a/node_modules/@types/node/vm.d.ts +++ /dev/null @@ -1,922 +0,0 @@ -/** - * The `node:vm` module enables compiling and running code within V8 Virtual - * Machine contexts. - * - * **The `node:vm` module is not a security** - * **mechanism. Do not use it to run untrusted code.** - * - * JavaScript code can be compiled and run immediately or - * compiled, saved, and run later. - * - * A common use case is to run the code in a different V8 Context. This means - * invoked code has a different global object than the invoking code. - * - * One can provide the context by `contextifying` an - * object. The invoked code treats any property in the context like a - * global variable. Any changes to global variables caused by the invoked - * code are reflected in the context object. - * - * ```js - * import vm from 'node:vm'; - * - * const x = 1; - * - * const context = { x: 2 }; - * vm.createContext(context); // Contextify the object. - * - * const code = 'x += 40; var y = 17;'; - * // `x` and `y` are global variables in the context. - * // Initially, x has the value 2 because that is the value of context.x. - * vm.runInContext(code, context); - * - * console.log(context.x); // 42 - * console.log(context.y); // 17 - * - * console.log(x); // 1; y is not defined. - * ``` - * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/vm.js) - */ -declare module "vm" { - import { ImportAttributes } from "node:module"; - interface Context extends NodeJS.Dict {} - interface BaseOptions { - /** - * Specifies the filename used in stack traces produced by this script. - * @default '' - */ - filename?: string | undefined; - /** - * Specifies the line number offset that is displayed in stack traces produced by this script. - * @default 0 - */ - lineOffset?: number | undefined; - /** - * Specifies the column number offset that is displayed in stack traces produced by this script. - * @default 0 - */ - columnOffset?: number | undefined; - } - interface ScriptOptions extends BaseOptions { - /** - * V8's code cache data for the supplied source. - */ - cachedData?: Buffer | 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-v22.x/api/vm.html#support-of-dynamic-import-in-compilation-apis). - */ - importModuleDynamically?: - | ((specifier: string, script: Script, importAttributes: ImportAttributes) => Module) - | typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER - | undefined; - } - interface RunningScriptOptions extends BaseOptions { - /** - * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. - * @default true - */ - displayErrors?: boolean | undefined; - /** - * Specifies the number of milliseconds to execute code before terminating execution. - * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer. - */ - timeout?: number | undefined; - /** - * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. - * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. - * If execution is terminated, an `Error` will be thrown. - * @default false - */ - breakOnSigint?: boolean | undefined; - } - interface RunningScriptInNewContextOptions extends RunningScriptOptions { - /** - * Human-readable name of the newly created context. - */ - contextName?: CreateContextOptions["name"]; - /** - * 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"]; - } - interface RunningCodeOptions extends RunningScriptOptions { - cachedData?: ScriptOptions["cachedData"]; - importModuleDynamically?: ScriptOptions["importModuleDynamically"]; - } - interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions { - cachedData?: ScriptOptions["cachedData"]; - importModuleDynamically?: ScriptOptions["importModuleDynamically"]; - } - interface CompileFunctionOptions extends BaseOptions { - /** - * Provides an optional data with V8's code cache data for the supplied source. - */ - cachedData?: Buffer | undefined; - /** - * Specifies whether to produce new cache data. - * @default false - */ - produceCachedData?: boolean | undefined; - /** - * The sandbox/context in which the said function should be compiled in. - */ - parsingContext?: Context | undefined; - /** - * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling - */ - contextExtensions?: Object[] | undefined; - } - interface CreateContextOptions { - /** - * Human-readable name of the newly created context. - * @default 'VM Context i' Where i is an ascending numerical index of the created context. - */ - name?: string | undefined; - /** - * Corresponds 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. - * @default '' - */ - origin?: string | undefined; - codeGeneration?: - | { - /** - * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc) - * will throw an EvalError. - * @default true - */ - strings?: boolean | undefined; - /** - * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError. - * @default true - */ - wasm?: boolean | undefined; - } - | undefined; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: "afterEvaluate" | undefined; - } - type MeasureMemoryMode = "summary" | "detailed"; - interface MeasureMemoryOptions { - /** - * @default 'summary' - */ - mode?: MeasureMemoryMode | undefined; - /** - * @default 'default' - */ - execution?: "default" | "eager" | undefined; - } - interface MemoryMeasurement { - total: { - jsMemoryEstimate: number; - jsMemoryRange: [number, number]; - }; - } - /** - * Instances of the `vm.Script` class contain precompiled scripts that can be - * executed in specific contexts. - * @since v0.3.1 - */ - class Script { - constructor(code: string, options?: ScriptOptions | string); - /** - * Runs the compiled code contained by the `vm.Script` object within the given `contextifiedObject` and returns the result. Running code does not have access - * to local scope. - * - * The following example compiles code that increments a global variable, sets - * the value of another global variable, then execute the code multiple times. - * The globals are contained in the `context` object. - * - * ```js - * import vm from 'node:vm'; - * - * const context = { - * animal: 'cat', - * count: 2, - * }; - * - * const script = new vm.Script('count += 1; name = "kitty";'); - * - * vm.createContext(context); - * for (let i = 0; i < 10; ++i) { - * script.runInContext(context); - * } - * - * console.log(context); - * // Prints: { animal: 'cat', count: 12, name: 'kitty' } - * ``` - * - * Using the `timeout` or `breakOnSigint` options will result in new event loops - * and corresponding threads being started, which have a non-zero performance - * overhead. - * @since v0.3.1 - * @param contextifiedObject A `contextified` object as returned by the `vm.createContext()` method. - * @return the result of the very last statement executed in the script. - */ - 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. - * - * 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 - * contained within each individual `context`. - * - * ```js - * import vm from 'node:vm'; - * - * const script = new vm.Script('globalVar = "set"'); - * - * const contexts = [{}, {}, {}]; - * contexts.forEach((context) => { - * script.runInNewContext(context); - * }); - * - * console.log(contexts); - * // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }] - * ``` - * @since v0.3.1 - * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created. - * @return the result of the very last statement executed in the script. - */ - runInNewContext(contextObject?: Context, 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. - * - * The following example compiles code that increments a `global` variable then - * executes that code multiple times: - * - * ```js - * import vm from 'node:vm'; - * - * global.globalVar = 0; - * - * const script = new vm.Script('globalVar += 1', { filename: 'myfile.vm' }); - * - * for (let i = 0; i < 1000; ++i) { - * script.runInThisContext(); - * } - * - * console.log(globalVar); - * - * // 1000 - * ``` - * @since v0.3.1 - * @return the result of the very last statement executed in the script. - */ - runInThisContext(options?: RunningScriptOptions): any; - /** - * Creates a code cache that can be used with the `Script` constructor's `cachedData` option. Returns a `Buffer`. This method may be called at any - * time and any number of times. - * - * The code cache of the `Script` doesn't contain any JavaScript observable - * states. The code cache is safe to be saved along side the script source and - * used to construct new `Script` instances multiple times. - * - * Functions in the `Script` source can be marked as lazily compiled and they are - * not compiled at construction of the `Script`. These functions are going to be - * compiled when they are invoked the first time. The code cache serializes the - * metadata that V8 currently knows about the `Script` that it can use to speed up - * future compilations. - * - * ```js - * const script = new vm.Script(` - * function add(a, b) { - * return a + b; - * } - * - * const x = add(1, 2); - * `); - * - * const cacheWithoutAdd = script.createCachedData(); - * // In `cacheWithoutAdd` the function `add()` is marked for full compilation - * // upon invocation. - * - * script.runInThisContext(); - * - * const cacheWithAdd = script.createCachedData(); - * // `cacheWithAdd` contains fully compiled function `add()`. - * ``` - * @since v10.6.0 - */ - createCachedData(): Buffer; - /** @deprecated in favor of `script.createCachedData()` */ - cachedDataProduced?: boolean | undefined; - /** - * 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; - /** - * 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. - * - * ```js - * import vm from 'node:vm'; - * - * const script = new vm.Script(` - * function myFunc() {} - * //# sourceMappingURL=sourcemap.json - * `); - * - * console.log(script.sourceMapURL); - * // Prints: sourcemap.json - * ``` - * @since v19.1.0, v18.13.0 - */ - sourceMapURL?: string | undefined; - } - /** - * If given a `contextObject`, the `vm.createContext()` method will - * [prepare that object](https://nodejs.org/docs/latest-v22.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-v22.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 - * variables will remain unchanged. - * - * ```js - * import vm from 'node:vm'; - * - * global.globalVar = 3; - * - * const context = { globalVar: 1 }; - * vm.createContext(context); - * - * vm.runInContext('globalVar *= 2;', context); - * - * console.log(context); - * // Prints: { globalVar: 2 } - * - * console.log(global.globalVar); - * // Prints: 3 - * ``` - * - * If `contextObject` is omitted (or passed explicitly as `undefined`), a new, - * empty `contextified` object will be returned. - * - * 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 - * web browser, the method can be used to create a single context representing a - * window's global object, then run all ` - ``` - -## Features - -- Runs on browser and node.js seamlessly -- Runs inside HTML5 WebWorker -- Can encode and decode packets - - Encodes from/to ArrayBuffer or Blob when in browser, and Buffer or ArrayBuffer in Node - -## API - -Note: `cb(type)` means the type is a callback function that contains a parameter of type `type` when called. - -### Node - -- `encodePacket` - - Encodes a packet. - - **Parameters** - - `Object`: the packet to encode, has `type` and `data`. - - `data`: can be a `String`, `Number`, `Buffer`, `ArrayBuffer` - - `Boolean`: binary support - - `Function`: callback, returns the encoded packet (`cb(String)`) -- `decodePacket` - - Decodes a packet. Data also available as an ArrayBuffer if requested. - - Returns data as `String` or (`Blob` on browser, `ArrayBuffer` on Node) - - **Parameters** - - `String` | `ArrayBuffer`: the packet to decode, has `type` and `data` - - `String`: optional, the binary type - -- `encodePayload` - - Encodes multiple messages (payload). - - If any contents are binary, they will be encoded as base64 strings. Base64 - encoded strings are marked with a b before the length specifier - - **Parameters** - - `Array`: an array of packets - - `Function`: callback, returns the encoded payload (`cb(String)`) -- `decodePayload` - - Decodes data when a payload is maybe expected. Possible binary contents are - decoded from their base64 representation. - - **Parameters** - - `String`: the payload - - `Function`: callback, returns (cb(`Object`: packet, `Number`:packet index, `Number`:packet total)) - -## Tests - -Standalone tests can be run with `npm test` which will run the node.js tests. - -Browser tests are run using [zuul](https://github.com/defunctzombie/zuul). -(You must have zuul setup with a saucelabs account.) - -You can run the tests locally using the following command: - -``` -npm run test:browser -``` - -## Support - -The support channels for `engine.io-parser` are the same as `socket.io`: - - irc.freenode.net **#socket.io** - - [Github Discussions](https://github.com/socketio/socket.io/discussions) - - [Website](https://socket.io) - -## Development - -To contribute patches, run tests or benchmarks, make sure to clone the -repository: - -```bash -git clone git://github.com/socketio/engine.io-parser.git -``` - -Then: - -```bash -cd engine.io-parser -npm ci -``` - -See the `Tests` section above for how to run tests before submitting any patches. - -## License - -MIT diff --git a/node_modules/engine.io-parser/build/cjs/commons.d.ts b/node_modules/engine.io-parser/build/cjs/commons.d.ts deleted file mode 100644 index 60a5b48..0000000 --- a/node_modules/engine.io-parser/build/cjs/commons.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -declare const PACKET_TYPES: any; -declare const PACKET_TYPES_REVERSE: any; -declare const ERROR_PACKET: Packet; -export { PACKET_TYPES, PACKET_TYPES_REVERSE, ERROR_PACKET }; -export type PacketType = "open" | "close" | "ping" | "pong" | "message" | "upgrade" | "noop" | "error"; -export type RawData = any; -export interface Packet { - type: PacketType; - options?: { - compress: boolean; - }; - data?: RawData; -} -export type BinaryType = "nodebuffer" | "arraybuffer" | "blob"; diff --git a/node_modules/engine.io-parser/build/cjs/commons.js b/node_modules/engine.io-parser/build/cjs/commons.js deleted file mode 100644 index 9bc62d2..0000000 --- a/node_modules/engine.io-parser/build/cjs/commons.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ERROR_PACKET = exports.PACKET_TYPES_REVERSE = exports.PACKET_TYPES = void 0; -const PACKET_TYPES = Object.create(null); // no Map = no polyfill -exports.PACKET_TYPES = PACKET_TYPES; -PACKET_TYPES["open"] = "0"; -PACKET_TYPES["close"] = "1"; -PACKET_TYPES["ping"] = "2"; -PACKET_TYPES["pong"] = "3"; -PACKET_TYPES["message"] = "4"; -PACKET_TYPES["upgrade"] = "5"; -PACKET_TYPES["noop"] = "6"; -const PACKET_TYPES_REVERSE = Object.create(null); -exports.PACKET_TYPES_REVERSE = PACKET_TYPES_REVERSE; -Object.keys(PACKET_TYPES).forEach((key) => { - PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key; -}); -const ERROR_PACKET = { type: "error", data: "parser error" }; -exports.ERROR_PACKET = ERROR_PACKET; diff --git a/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts b/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts deleted file mode 100644 index 6e0fa6b..0000000 --- a/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const encode: (arraybuffer: ArrayBuffer) => string; -export declare const decode: (base64: string) => ArrayBuffer; diff --git a/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js b/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js deleted file mode 100644 index b92118e..0000000 --- a/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decode = exports.encode = void 0; -// imported from https://github.com/socketio/base64-arraybuffer -const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; -// Use a lookup table to find the index. -const lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256); -for (let i = 0; i < chars.length; i++) { - lookup[chars.charCodeAt(i)] = i; -} -const encode = (arraybuffer) => { - let bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = ''; - for (i = 0; i < len; i += 3) { - base64 += chars[bytes[i] >> 2]; - base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; - base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; - base64 += chars[bytes[i + 2] & 63]; - } - if (len % 3 === 2) { - base64 = base64.substring(0, base64.length - 1) + '='; - } - else if (len % 3 === 1) { - base64 = base64.substring(0, base64.length - 2) + '=='; - } - return base64; -}; -exports.encode = encode; -const decode = (base64) => { - let bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4; - if (base64[base64.length - 1] === '=') { - bufferLength--; - if (base64[base64.length - 2] === '=') { - bufferLength--; - } - } - const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer); - for (i = 0; i < len; i += 4) { - encoded1 = lookup[base64.charCodeAt(i)]; - encoded2 = lookup[base64.charCodeAt(i + 1)]; - encoded3 = lookup[base64.charCodeAt(i + 2)]; - encoded4 = lookup[base64.charCodeAt(i + 3)]; - bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); - bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); - bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); - } - return arraybuffer; -}; -exports.decode = decode; diff --git a/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts b/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts deleted file mode 100644 index 3a38ee5..0000000 --- a/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Packet, BinaryType, RawData } from "./commons.js"; -export declare const decodePacket: (encodedPacket: RawData, binaryType?: BinaryType) => Packet; diff --git a/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js b/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js deleted file mode 100644 index f434be6..0000000 --- a/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodePacket = void 0; -const commons_js_1 = require("./commons.js"); -const base64_arraybuffer_js_1 = require("./contrib/base64-arraybuffer.js"); -const withNativeArrayBuffer = typeof ArrayBuffer === "function"; -const decodePacket = (encodedPacket, binaryType) => { - if (typeof encodedPacket !== "string") { - return { - type: "message", - data: mapBinary(encodedPacket, binaryType), - }; - } - const type = encodedPacket.charAt(0); - if (type === "b") { - return { - type: "message", - data: decodeBase64Packet(encodedPacket.substring(1), binaryType), - }; - } - const packetType = commons_js_1.PACKET_TYPES_REVERSE[type]; - if (!packetType) { - return commons_js_1.ERROR_PACKET; - } - return encodedPacket.length > 1 - ? { - type: commons_js_1.PACKET_TYPES_REVERSE[type], - data: encodedPacket.substring(1), - } - : { - type: commons_js_1.PACKET_TYPES_REVERSE[type], - }; -}; -exports.decodePacket = decodePacket; -const decodeBase64Packet = (data, binaryType) => { - if (withNativeArrayBuffer) { - const decoded = (0, base64_arraybuffer_js_1.decode)(data); - return mapBinary(decoded, binaryType); - } - else { - return { base64: true, data }; // fallback for old browsers - } -}; -const mapBinary = (data, binaryType) => { - switch (binaryType) { - case "blob": - if (data instanceof Blob) { - // from WebSocket + binaryType "blob" - return data; - } - else { - // from HTTP long-polling or WebTransport - return new Blob([data]); - } - case "arraybuffer": - default: - if (data instanceof ArrayBuffer) { - // from HTTP long-polling (base64) or WebSocket + binaryType "arraybuffer" - return data; - } - else { - // from WebTransport (Uint8Array) - return data.buffer; - } - } -}; diff --git a/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts b/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts deleted file mode 100644 index 3a38ee5..0000000 --- a/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Packet, BinaryType, RawData } from "./commons.js"; -export declare const decodePacket: (encodedPacket: RawData, binaryType?: BinaryType) => Packet; diff --git a/node_modules/engine.io-parser/build/cjs/decodePacket.js b/node_modules/engine.io-parser/build/cjs/decodePacket.js deleted file mode 100644 index a27b8d2..0000000 --- a/node_modules/engine.io-parser/build/cjs/decodePacket.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodePacket = void 0; -const commons_js_1 = require("./commons.js"); -const decodePacket = (encodedPacket, binaryType) => { - if (typeof encodedPacket !== "string") { - return { - type: "message", - data: mapBinary(encodedPacket, binaryType), - }; - } - const type = encodedPacket.charAt(0); - if (type === "b") { - const buffer = Buffer.from(encodedPacket.substring(1), "base64"); - return { - type: "message", - data: mapBinary(buffer, binaryType), - }; - } - if (!commons_js_1.PACKET_TYPES_REVERSE[type]) { - return commons_js_1.ERROR_PACKET; - } - return encodedPacket.length > 1 - ? { - type: commons_js_1.PACKET_TYPES_REVERSE[type], - data: encodedPacket.substring(1), - } - : { - type: commons_js_1.PACKET_TYPES_REVERSE[type], - }; -}; -exports.decodePacket = decodePacket; -const mapBinary = (data, binaryType) => { - switch (binaryType) { - case "arraybuffer": - if (data instanceof ArrayBuffer) { - // from WebSocket & binaryType "arraybuffer" - return data; - } - else if (Buffer.isBuffer(data)) { - // from HTTP long-polling - return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength); - } - else { - // from WebTransport (Uint8Array) - return data.buffer; - } - case "nodebuffer": - default: - if (Buffer.isBuffer(data)) { - // from HTTP long-polling or WebSocket & binaryType "nodebuffer" (default) - return data; - } - else { - // from WebTransport (Uint8Array) - return Buffer.from(data); - } - } -}; diff --git a/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts b/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts deleted file mode 100644 index 4a56000..0000000 --- a/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Packet, RawData } from "./commons.js"; -declare const encodePacket: ({ type, data }: Packet, supportsBinary: boolean, callback: (encodedPacket: RawData) => void) => void; -export declare function encodePacketToBinary(packet: Packet, callback: (encodedPacket: RawData) => void): void | Promise; -export { encodePacket }; diff --git a/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js b/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js deleted file mode 100644 index 959d870..0000000 --- a/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodePacket = void 0; -exports.encodePacketToBinary = encodePacketToBinary; -const commons_js_1 = require("./commons.js"); -const withNativeBlob = typeof Blob === "function" || - (typeof Blob !== "undefined" && - Object.prototype.toString.call(Blob) === "[object BlobConstructor]"); -const withNativeArrayBuffer = typeof ArrayBuffer === "function"; -// ArrayBuffer.isView method is not defined in IE10 -const isView = (obj) => { - return typeof ArrayBuffer.isView === "function" - ? ArrayBuffer.isView(obj) - : obj && obj.buffer instanceof ArrayBuffer; -}; -const encodePacket = ({ type, data }, supportsBinary, callback) => { - if (withNativeBlob && data instanceof Blob) { - if (supportsBinary) { - return callback(data); - } - else { - return encodeBlobAsBase64(data, callback); - } - } - else if (withNativeArrayBuffer && - (data instanceof ArrayBuffer || isView(data))) { - if (supportsBinary) { - return callback(data); - } - else { - return encodeBlobAsBase64(new Blob([data]), callback); - } - } - // plain string - return callback(commons_js_1.PACKET_TYPES[type] + (data || "")); -}; -exports.encodePacket = encodePacket; -const encodeBlobAsBase64 = (data, callback) => { - const fileReader = new FileReader(); - fileReader.onload = function () { - const content = fileReader.result.split(",")[1]; - callback("b" + (content || "")); - }; - return fileReader.readAsDataURL(data); -}; -function toArray(data) { - if (data instanceof Uint8Array) { - return data; - } - else if (data instanceof ArrayBuffer) { - return new Uint8Array(data); - } - else { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength); - } -} -let TEXT_ENCODER; -function encodePacketToBinary(packet, callback) { - if (withNativeBlob && packet.data instanceof Blob) { - return packet.data.arrayBuffer().then(toArray).then(callback); - } - else if (withNativeArrayBuffer && - (packet.data instanceof ArrayBuffer || isView(packet.data))) { - return callback(toArray(packet.data)); - } - encodePacket(packet, false, (encoded) => { - if (!TEXT_ENCODER) { - TEXT_ENCODER = new TextEncoder(); - } - callback(TEXT_ENCODER.encode(encoded)); - }); -} diff --git a/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts b/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts deleted file mode 100644 index 86aec4d..0000000 --- a/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Packet, RawData } from "./commons.js"; -export declare const encodePacket: ({ type, data }: Packet, supportsBinary: boolean, callback: (encodedPacket: RawData) => void) => void; -export declare function encodePacketToBinary(packet: Packet, callback: (encodedPacket: RawData) => void): void; diff --git a/node_modules/engine.io-parser/build/cjs/encodePacket.js b/node_modules/engine.io-parser/build/cjs/encodePacket.js deleted file mode 100644 index 40d0d5d..0000000 --- a/node_modules/engine.io-parser/build/cjs/encodePacket.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodePacket = void 0; -exports.encodePacketToBinary = encodePacketToBinary; -const commons_js_1 = require("./commons.js"); -const encodePacket = ({ type, data }, supportsBinary, callback) => { - if (data instanceof ArrayBuffer || ArrayBuffer.isView(data)) { - return callback(supportsBinary ? data : "b" + toBuffer(data, true).toString("base64")); - } - // plain string - return callback(commons_js_1.PACKET_TYPES[type] + (data || "")); -}; -exports.encodePacket = encodePacket; -const toBuffer = (data, forceBufferConversion) => { - if (Buffer.isBuffer(data) || - (data instanceof Uint8Array && !forceBufferConversion)) { - return data; - } - else if (data instanceof ArrayBuffer) { - return Buffer.from(data); - } - else { - return Buffer.from(data.buffer, data.byteOffset, data.byteLength); - } -}; -let TEXT_ENCODER; -function encodePacketToBinary(packet, callback) { - if (packet.data instanceof ArrayBuffer || ArrayBuffer.isView(packet.data)) { - return callback(toBuffer(packet.data, false)); - } - (0, exports.encodePacket)(packet, true, (encoded) => { - if (!TEXT_ENCODER) { - // lazily created for compatibility with Node.js 10 - TEXT_ENCODER = new TextEncoder(); - } - callback(TEXT_ENCODER.encode(encoded)); - }); -} diff --git a/node_modules/engine.io-parser/build/cjs/index.d.ts b/node_modules/engine.io-parser/build/cjs/index.d.ts deleted file mode 100644 index 37adde2..0000000 --- a/node_modules/engine.io-parser/build/cjs/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { encodePacket } from "./encodePacket.js"; -import { decodePacket } from "./decodePacket.js"; -import { Packet, PacketType, RawData, BinaryType } from "./commons.js"; -declare const encodePayload: (packets: Packet[], callback: (encodedPayload: string) => void) => void; -declare const decodePayload: (encodedPayload: string, binaryType?: BinaryType) => Packet[]; -export declare function createPacketEncoderStream(): any; -export declare function createPacketDecoderStream(maxPayload: number, binaryType: BinaryType): any; -export declare const protocol = 4; -export { encodePacket, encodePayload, decodePacket, decodePayload, Packet, PacketType, RawData, BinaryType, }; diff --git a/node_modules/engine.io-parser/build/cjs/index.js b/node_modules/engine.io-parser/build/cjs/index.js deleted file mode 100644 index 16c8793..0000000 --- a/node_modules/engine.io-parser/build/cjs/index.js +++ /dev/null @@ -1,164 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodePayload = exports.decodePacket = exports.encodePayload = exports.encodePacket = exports.protocol = void 0; -exports.createPacketEncoderStream = createPacketEncoderStream; -exports.createPacketDecoderStream = createPacketDecoderStream; -const encodePacket_js_1 = require("./encodePacket.js"); -Object.defineProperty(exports, "encodePacket", { enumerable: true, get: function () { return encodePacket_js_1.encodePacket; } }); -const decodePacket_js_1 = require("./decodePacket.js"); -Object.defineProperty(exports, "decodePacket", { enumerable: true, get: function () { return decodePacket_js_1.decodePacket; } }); -const commons_js_1 = require("./commons.js"); -const SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text -const encodePayload = (packets, callback) => { - // some packets may be added to the array while encoding, so the initial length must be saved - const length = packets.length; - const encodedPackets = new Array(length); - let count = 0; - packets.forEach((packet, i) => { - // force base64 encoding for binary packets - (0, encodePacket_js_1.encodePacket)(packet, false, (encodedPacket) => { - encodedPackets[i] = encodedPacket; - if (++count === length) { - callback(encodedPackets.join(SEPARATOR)); - } - }); - }); -}; -exports.encodePayload = encodePayload; -const decodePayload = (encodedPayload, binaryType) => { - const encodedPackets = encodedPayload.split(SEPARATOR); - const packets = []; - for (let i = 0; i < encodedPackets.length; i++) { - const decodedPacket = (0, decodePacket_js_1.decodePacket)(encodedPackets[i], binaryType); - packets.push(decodedPacket); - if (decodedPacket.type === "error") { - break; - } - } - return packets; -}; -exports.decodePayload = decodePayload; -function createPacketEncoderStream() { - return new TransformStream({ - transform(packet, controller) { - (0, encodePacket_js_1.encodePacketToBinary)(packet, (encodedPacket) => { - const payloadLength = encodedPacket.length; - let header; - // inspired by the WebSocket format: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#decoding_payload_length - if (payloadLength < 126) { - header = new Uint8Array(1); - new DataView(header.buffer).setUint8(0, payloadLength); - } - else if (payloadLength < 65536) { - header = new Uint8Array(3); - const view = new DataView(header.buffer); - view.setUint8(0, 126); - view.setUint16(1, payloadLength); - } - else { - header = new Uint8Array(9); - const view = new DataView(header.buffer); - view.setUint8(0, 127); - view.setBigUint64(1, BigInt(payloadLength)); - } - // first bit indicates whether the payload is plain text (0) or binary (1) - if (packet.data && typeof packet.data !== "string") { - header[0] |= 0x80; - } - controller.enqueue(header); - controller.enqueue(encodedPacket); - }); - }, - }); -} -let TEXT_DECODER; -function totalLength(chunks) { - return chunks.reduce((acc, chunk) => acc + chunk.length, 0); -} -function concatChunks(chunks, size) { - if (chunks[0].length === size) { - return chunks.shift(); - } - const buffer = new Uint8Array(size); - let j = 0; - for (let i = 0; i < size; i++) { - buffer[i] = chunks[0][j++]; - if (j === chunks[0].length) { - chunks.shift(); - j = 0; - } - } - if (chunks.length && j < chunks[0].length) { - chunks[0] = chunks[0].slice(j); - } - return buffer; -} -function createPacketDecoderStream(maxPayload, binaryType) { - if (!TEXT_DECODER) { - TEXT_DECODER = new TextDecoder(); - } - const chunks = []; - let state = 0 /* State.READ_HEADER */; - let expectedLength = -1; - let isBinary = false; - return new TransformStream({ - transform(chunk, controller) { - chunks.push(chunk); - while (true) { - if (state === 0 /* State.READ_HEADER */) { - if (totalLength(chunks) < 1) { - break; - } - const header = concatChunks(chunks, 1); - isBinary = (header[0] & 0x80) === 0x80; - expectedLength = header[0] & 0x7f; - if (expectedLength < 126) { - state = 3 /* State.READ_PAYLOAD */; - } - else if (expectedLength === 126) { - state = 1 /* State.READ_EXTENDED_LENGTH_16 */; - } - else { - state = 2 /* State.READ_EXTENDED_LENGTH_64 */; - } - } - else if (state === 1 /* State.READ_EXTENDED_LENGTH_16 */) { - if (totalLength(chunks) < 2) { - break; - } - const headerArray = concatChunks(chunks, 2); - expectedLength = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length).getUint16(0); - state = 3 /* State.READ_PAYLOAD */; - } - else if (state === 2 /* State.READ_EXTENDED_LENGTH_64 */) { - if (totalLength(chunks) < 8) { - break; - } - const headerArray = concatChunks(chunks, 8); - const view = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length); - const n = view.getUint32(0); - if (n > Math.pow(2, 53 - 32) - 1) { - // the maximum safe integer in JavaScript is 2^53 - 1 - controller.enqueue(commons_js_1.ERROR_PACKET); - break; - } - expectedLength = n * Math.pow(2, 32) + view.getUint32(4); - state = 3 /* State.READ_PAYLOAD */; - } - else { - if (totalLength(chunks) < expectedLength) { - break; - } - const data = concatChunks(chunks, expectedLength); - controller.enqueue((0, decodePacket_js_1.decodePacket)(isBinary ? data : TEXT_DECODER.decode(data), binaryType)); - state = 0 /* State.READ_HEADER */; - } - if (expectedLength === 0 || expectedLength > maxPayload) { - controller.enqueue(commons_js_1.ERROR_PACKET); - break; - } - } - }, - }); -} -exports.protocol = 4; diff --git a/node_modules/engine.io-parser/build/cjs/package.json b/node_modules/engine.io-parser/build/cjs/package.json deleted file mode 100644 index bdc4dbd..0000000 --- a/node_modules/engine.io-parser/build/cjs/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "engine.io-parser", - "type": "commonjs", - "browser": { - "./encodePacket.js": "./encodePacket.browser.js", - "./decodePacket.js": "./decodePacket.browser.js" - } -} diff --git a/node_modules/engine.io-parser/build/esm/commons.d.ts b/node_modules/engine.io-parser/build/esm/commons.d.ts deleted file mode 100644 index 60a5b48..0000000 --- a/node_modules/engine.io-parser/build/esm/commons.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -declare const PACKET_TYPES: any; -declare const PACKET_TYPES_REVERSE: any; -declare const ERROR_PACKET: Packet; -export { PACKET_TYPES, PACKET_TYPES_REVERSE, ERROR_PACKET }; -export type PacketType = "open" | "close" | "ping" | "pong" | "message" | "upgrade" | "noop" | "error"; -export type RawData = any; -export interface Packet { - type: PacketType; - options?: { - compress: boolean; - }; - data?: RawData; -} -export type BinaryType = "nodebuffer" | "arraybuffer" | "blob"; diff --git a/node_modules/engine.io-parser/build/esm/commons.js b/node_modules/engine.io-parser/build/esm/commons.js deleted file mode 100644 index fdbbe30..0000000 --- a/node_modules/engine.io-parser/build/esm/commons.js +++ /dev/null @@ -1,14 +0,0 @@ -const PACKET_TYPES = Object.create(null); // no Map = no polyfill -PACKET_TYPES["open"] = "0"; -PACKET_TYPES["close"] = "1"; -PACKET_TYPES["ping"] = "2"; -PACKET_TYPES["pong"] = "3"; -PACKET_TYPES["message"] = "4"; -PACKET_TYPES["upgrade"] = "5"; -PACKET_TYPES["noop"] = "6"; -const PACKET_TYPES_REVERSE = Object.create(null); -Object.keys(PACKET_TYPES).forEach((key) => { - PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key; -}); -const ERROR_PACKET = { type: "error", data: "parser error" }; -export { PACKET_TYPES, PACKET_TYPES_REVERSE, ERROR_PACKET }; diff --git a/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts b/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts deleted file mode 100644 index 6e0fa6b..0000000 --- a/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const encode: (arraybuffer: ArrayBuffer) => string; -export declare const decode: (base64: string) => ArrayBuffer; diff --git a/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js b/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js deleted file mode 100644 index b544384..0000000 --- a/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +++ /dev/null @@ -1,43 +0,0 @@ -// imported from https://github.com/socketio/base64-arraybuffer -const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; -// Use a lookup table to find the index. -const lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256); -for (let i = 0; i < chars.length; i++) { - lookup[chars.charCodeAt(i)] = i; -} -export const encode = (arraybuffer) => { - let bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = ''; - for (i = 0; i < len; i += 3) { - base64 += chars[bytes[i] >> 2]; - base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; - base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; - base64 += chars[bytes[i + 2] & 63]; - } - if (len % 3 === 2) { - base64 = base64.substring(0, base64.length - 1) + '='; - } - else if (len % 3 === 1) { - base64 = base64.substring(0, base64.length - 2) + '=='; - } - return base64; -}; -export const decode = (base64) => { - let bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4; - if (base64[base64.length - 1] === '=') { - bufferLength--; - if (base64[base64.length - 2] === '=') { - bufferLength--; - } - } - const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer); - for (i = 0; i < len; i += 4) { - encoded1 = lookup[base64.charCodeAt(i)]; - encoded2 = lookup[base64.charCodeAt(i + 1)]; - encoded3 = lookup[base64.charCodeAt(i + 2)]; - encoded4 = lookup[base64.charCodeAt(i + 3)]; - bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); - bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); - bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); - } - return arraybuffer; -}; diff --git a/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts b/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts deleted file mode 100644 index 3a38ee5..0000000 --- a/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Packet, BinaryType, RawData } from "./commons.js"; -export declare const decodePacket: (encodedPacket: RawData, binaryType?: BinaryType) => Packet; diff --git a/node_modules/engine.io-parser/build/esm/decodePacket.browser.js b/node_modules/engine.io-parser/build/esm/decodePacket.browser.js deleted file mode 100644 index 07882aa..0000000 --- a/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +++ /dev/null @@ -1,62 +0,0 @@ -import { ERROR_PACKET, PACKET_TYPES_REVERSE, } from "./commons.js"; -import { decode } from "./contrib/base64-arraybuffer.js"; -const withNativeArrayBuffer = typeof ArrayBuffer === "function"; -export const decodePacket = (encodedPacket, binaryType) => { - if (typeof encodedPacket !== "string") { - return { - type: "message", - data: mapBinary(encodedPacket, binaryType), - }; - } - const type = encodedPacket.charAt(0); - if (type === "b") { - return { - type: "message", - data: decodeBase64Packet(encodedPacket.substring(1), binaryType), - }; - } - const packetType = PACKET_TYPES_REVERSE[type]; - if (!packetType) { - return ERROR_PACKET; - } - return encodedPacket.length > 1 - ? { - type: PACKET_TYPES_REVERSE[type], - data: encodedPacket.substring(1), - } - : { - type: PACKET_TYPES_REVERSE[type], - }; -}; -const decodeBase64Packet = (data, binaryType) => { - if (withNativeArrayBuffer) { - const decoded = decode(data); - return mapBinary(decoded, binaryType); - } - else { - return { base64: true, data }; // fallback for old browsers - } -}; -const mapBinary = (data, binaryType) => { - switch (binaryType) { - case "blob": - if (data instanceof Blob) { - // from WebSocket + binaryType "blob" - return data; - } - else { - // from HTTP long-polling or WebTransport - return new Blob([data]); - } - case "arraybuffer": - default: - if (data instanceof ArrayBuffer) { - // from HTTP long-polling (base64) or WebSocket + binaryType "arraybuffer" - return data; - } - else { - // from WebTransport (Uint8Array) - return data.buffer; - } - } -}; diff --git a/node_modules/engine.io-parser/build/esm/decodePacket.d.ts b/node_modules/engine.io-parser/build/esm/decodePacket.d.ts deleted file mode 100644 index 3a38ee5..0000000 --- a/node_modules/engine.io-parser/build/esm/decodePacket.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Packet, BinaryType, RawData } from "./commons.js"; -export declare const decodePacket: (encodedPacket: RawData, binaryType?: BinaryType) => Packet; diff --git a/node_modules/engine.io-parser/build/esm/decodePacket.js b/node_modules/engine.io-parser/build/esm/decodePacket.js deleted file mode 100644 index e8fc5e0..0000000 --- a/node_modules/engine.io-parser/build/esm/decodePacket.js +++ /dev/null @@ -1,55 +0,0 @@ -import { ERROR_PACKET, PACKET_TYPES_REVERSE, } from "./commons.js"; -export const decodePacket = (encodedPacket, binaryType) => { - if (typeof encodedPacket !== "string") { - return { - type: "message", - data: mapBinary(encodedPacket, binaryType), - }; - } - const type = encodedPacket.charAt(0); - if (type === "b") { - const buffer = Buffer.from(encodedPacket.substring(1), "base64"); - return { - type: "message", - data: mapBinary(buffer, binaryType), - }; - } - if (!PACKET_TYPES_REVERSE[type]) { - return ERROR_PACKET; - } - return encodedPacket.length > 1 - ? { - type: PACKET_TYPES_REVERSE[type], - data: encodedPacket.substring(1), - } - : { - type: PACKET_TYPES_REVERSE[type], - }; -}; -const mapBinary = (data, binaryType) => { - switch (binaryType) { - case "arraybuffer": - if (data instanceof ArrayBuffer) { - // from WebSocket & binaryType "arraybuffer" - return data; - } - else if (Buffer.isBuffer(data)) { - // from HTTP long-polling - return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength); - } - else { - // from WebTransport (Uint8Array) - return data.buffer; - } - case "nodebuffer": - default: - if (Buffer.isBuffer(data)) { - // from HTTP long-polling or WebSocket & binaryType "nodebuffer" (default) - return data; - } - else { - // from WebTransport (Uint8Array) - return Buffer.from(data); - } - } -}; diff --git a/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts b/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts deleted file mode 100644 index 4a56000..0000000 --- a/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Packet, RawData } from "./commons.js"; -declare const encodePacket: ({ type, data }: Packet, supportsBinary: boolean, callback: (encodedPacket: RawData) => void) => void; -export declare function encodePacketToBinary(packet: Packet, callback: (encodedPacket: RawData) => void): void | Promise; -export { encodePacket }; diff --git a/node_modules/engine.io-parser/build/esm/encodePacket.browser.js b/node_modules/engine.io-parser/build/esm/encodePacket.browser.js deleted file mode 100644 index 11eb4fa..0000000 --- a/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +++ /dev/null @@ -1,68 +0,0 @@ -import { PACKET_TYPES } from "./commons.js"; -const withNativeBlob = typeof Blob === "function" || - (typeof Blob !== "undefined" && - Object.prototype.toString.call(Blob) === "[object BlobConstructor]"); -const withNativeArrayBuffer = typeof ArrayBuffer === "function"; -// ArrayBuffer.isView method is not defined in IE10 -const isView = (obj) => { - return typeof ArrayBuffer.isView === "function" - ? ArrayBuffer.isView(obj) - : obj && obj.buffer instanceof ArrayBuffer; -}; -const encodePacket = ({ type, data }, supportsBinary, callback) => { - if (withNativeBlob && data instanceof Blob) { - if (supportsBinary) { - return callback(data); - } - else { - return encodeBlobAsBase64(data, callback); - } - } - else if (withNativeArrayBuffer && - (data instanceof ArrayBuffer || isView(data))) { - if (supportsBinary) { - return callback(data); - } - else { - return encodeBlobAsBase64(new Blob([data]), callback); - } - } - // plain string - return callback(PACKET_TYPES[type] + (data || "")); -}; -const encodeBlobAsBase64 = (data, callback) => { - const fileReader = new FileReader(); - fileReader.onload = function () { - const content = fileReader.result.split(",")[1]; - callback("b" + (content || "")); - }; - return fileReader.readAsDataURL(data); -}; -function toArray(data) { - if (data instanceof Uint8Array) { - return data; - } - else if (data instanceof ArrayBuffer) { - return new Uint8Array(data); - } - else { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength); - } -} -let TEXT_ENCODER; -export function encodePacketToBinary(packet, callback) { - if (withNativeBlob && packet.data instanceof Blob) { - return packet.data.arrayBuffer().then(toArray).then(callback); - } - else if (withNativeArrayBuffer && - (packet.data instanceof ArrayBuffer || isView(packet.data))) { - return callback(toArray(packet.data)); - } - encodePacket(packet, false, (encoded) => { - if (!TEXT_ENCODER) { - TEXT_ENCODER = new TextEncoder(); - } - callback(TEXT_ENCODER.encode(encoded)); - }); -} -export { encodePacket }; diff --git a/node_modules/engine.io-parser/build/esm/encodePacket.d.ts b/node_modules/engine.io-parser/build/esm/encodePacket.d.ts deleted file mode 100644 index 86aec4d..0000000 --- a/node_modules/engine.io-parser/build/esm/encodePacket.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Packet, RawData } from "./commons.js"; -export declare const encodePacket: ({ type, data }: Packet, supportsBinary: boolean, callback: (encodedPacket: RawData) => void) => void; -export declare function encodePacketToBinary(packet: Packet, callback: (encodedPacket: RawData) => void): void; diff --git a/node_modules/engine.io-parser/build/esm/encodePacket.js b/node_modules/engine.io-parser/build/esm/encodePacket.js deleted file mode 100644 index 7986057..0000000 --- a/node_modules/engine.io-parser/build/esm/encodePacket.js +++ /dev/null @@ -1,33 +0,0 @@ -import { PACKET_TYPES } from "./commons.js"; -export const encodePacket = ({ type, data }, supportsBinary, callback) => { - if (data instanceof ArrayBuffer || ArrayBuffer.isView(data)) { - return callback(supportsBinary ? data : "b" + toBuffer(data, true).toString("base64")); - } - // plain string - return callback(PACKET_TYPES[type] + (data || "")); -}; -const toBuffer = (data, forceBufferConversion) => { - if (Buffer.isBuffer(data) || - (data instanceof Uint8Array && !forceBufferConversion)) { - return data; - } - else if (data instanceof ArrayBuffer) { - return Buffer.from(data); - } - else { - return Buffer.from(data.buffer, data.byteOffset, data.byteLength); - } -}; -let TEXT_ENCODER; -export function encodePacketToBinary(packet, callback) { - if (packet.data instanceof ArrayBuffer || ArrayBuffer.isView(packet.data)) { - return callback(toBuffer(packet.data, false)); - } - encodePacket(packet, true, (encoded) => { - if (!TEXT_ENCODER) { - // lazily created for compatibility with Node.js 10 - TEXT_ENCODER = new TextEncoder(); - } - callback(TEXT_ENCODER.encode(encoded)); - }); -} diff --git a/node_modules/engine.io-parser/build/esm/index.d.ts b/node_modules/engine.io-parser/build/esm/index.d.ts deleted file mode 100644 index 37adde2..0000000 --- a/node_modules/engine.io-parser/build/esm/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { encodePacket } from "./encodePacket.js"; -import { decodePacket } from "./decodePacket.js"; -import { Packet, PacketType, RawData, BinaryType } from "./commons.js"; -declare const encodePayload: (packets: Packet[], callback: (encodedPayload: string) => void) => void; -declare const decodePayload: (encodedPayload: string, binaryType?: BinaryType) => Packet[]; -export declare function createPacketEncoderStream(): any; -export declare function createPacketDecoderStream(maxPayload: number, binaryType: BinaryType): any; -export declare const protocol = 4; -export { encodePacket, encodePayload, decodePacket, decodePayload, Packet, PacketType, RawData, BinaryType, }; diff --git a/node_modules/engine.io-parser/build/esm/index.js b/node_modules/engine.io-parser/build/esm/index.js deleted file mode 100644 index 050fa36..0000000 --- a/node_modules/engine.io-parser/build/esm/index.js +++ /dev/null @@ -1,156 +0,0 @@ -import { encodePacket, encodePacketToBinary } from "./encodePacket.js"; -import { decodePacket } from "./decodePacket.js"; -import { ERROR_PACKET, } from "./commons.js"; -const SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text -const encodePayload = (packets, callback) => { - // some packets may be added to the array while encoding, so the initial length must be saved - const length = packets.length; - const encodedPackets = new Array(length); - let count = 0; - packets.forEach((packet, i) => { - // force base64 encoding for binary packets - encodePacket(packet, false, (encodedPacket) => { - encodedPackets[i] = encodedPacket; - if (++count === length) { - callback(encodedPackets.join(SEPARATOR)); - } - }); - }); -}; -const decodePayload = (encodedPayload, binaryType) => { - const encodedPackets = encodedPayload.split(SEPARATOR); - const packets = []; - for (let i = 0; i < encodedPackets.length; i++) { - const decodedPacket = decodePacket(encodedPackets[i], binaryType); - packets.push(decodedPacket); - if (decodedPacket.type === "error") { - break; - } - } - return packets; -}; -export function createPacketEncoderStream() { - return new TransformStream({ - transform(packet, controller) { - encodePacketToBinary(packet, (encodedPacket) => { - const payloadLength = encodedPacket.length; - let header; - // inspired by the WebSocket format: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#decoding_payload_length - if (payloadLength < 126) { - header = new Uint8Array(1); - new DataView(header.buffer).setUint8(0, payloadLength); - } - else if (payloadLength < 65536) { - header = new Uint8Array(3); - const view = new DataView(header.buffer); - view.setUint8(0, 126); - view.setUint16(1, payloadLength); - } - else { - header = new Uint8Array(9); - const view = new DataView(header.buffer); - view.setUint8(0, 127); - view.setBigUint64(1, BigInt(payloadLength)); - } - // first bit indicates whether the payload is plain text (0) or binary (1) - if (packet.data && typeof packet.data !== "string") { - header[0] |= 0x80; - } - controller.enqueue(header); - controller.enqueue(encodedPacket); - }); - }, - }); -} -let TEXT_DECODER; -function totalLength(chunks) { - return chunks.reduce((acc, chunk) => acc + chunk.length, 0); -} -function concatChunks(chunks, size) { - if (chunks[0].length === size) { - return chunks.shift(); - } - const buffer = new Uint8Array(size); - let j = 0; - for (let i = 0; i < size; i++) { - buffer[i] = chunks[0][j++]; - if (j === chunks[0].length) { - chunks.shift(); - j = 0; - } - } - if (chunks.length && j < chunks[0].length) { - chunks[0] = chunks[0].slice(j); - } - return buffer; -} -export function createPacketDecoderStream(maxPayload, binaryType) { - if (!TEXT_DECODER) { - TEXT_DECODER = new TextDecoder(); - } - const chunks = []; - let state = 0 /* State.READ_HEADER */; - let expectedLength = -1; - let isBinary = false; - return new TransformStream({ - transform(chunk, controller) { - chunks.push(chunk); - while (true) { - if (state === 0 /* State.READ_HEADER */) { - if (totalLength(chunks) < 1) { - break; - } - const header = concatChunks(chunks, 1); - isBinary = (header[0] & 0x80) === 0x80; - expectedLength = header[0] & 0x7f; - if (expectedLength < 126) { - state = 3 /* State.READ_PAYLOAD */; - } - else if (expectedLength === 126) { - state = 1 /* State.READ_EXTENDED_LENGTH_16 */; - } - else { - state = 2 /* State.READ_EXTENDED_LENGTH_64 */; - } - } - else if (state === 1 /* State.READ_EXTENDED_LENGTH_16 */) { - if (totalLength(chunks) < 2) { - break; - } - const headerArray = concatChunks(chunks, 2); - expectedLength = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length).getUint16(0); - state = 3 /* State.READ_PAYLOAD */; - } - else if (state === 2 /* State.READ_EXTENDED_LENGTH_64 */) { - if (totalLength(chunks) < 8) { - break; - } - const headerArray = concatChunks(chunks, 8); - const view = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length); - const n = view.getUint32(0); - if (n > Math.pow(2, 53 - 32) - 1) { - // the maximum safe integer in JavaScript is 2^53 - 1 - controller.enqueue(ERROR_PACKET); - break; - } - expectedLength = n * Math.pow(2, 32) + view.getUint32(4); - state = 3 /* State.READ_PAYLOAD */; - } - else { - if (totalLength(chunks) < expectedLength) { - break; - } - const data = concatChunks(chunks, expectedLength); - controller.enqueue(decodePacket(isBinary ? data : TEXT_DECODER.decode(data), binaryType)); - state = 0 /* State.READ_HEADER */; - } - if (expectedLength === 0 || expectedLength > maxPayload) { - controller.enqueue(ERROR_PACKET); - break; - } - } - }, - }); -} -export const protocol = 4; -export { encodePacket, encodePayload, decodePacket, decodePayload, }; diff --git a/node_modules/engine.io-parser/build/esm/package.json b/node_modules/engine.io-parser/build/esm/package.json deleted file mode 100644 index 6f2c74a..0000000 --- a/node_modules/engine.io-parser/build/esm/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "engine.io-parser", - "type": "module", - "browser": { - "./encodePacket.js": "./encodePacket.browser.js", - "./decodePacket.js": "./decodePacket.browser.js" - } -} diff --git a/node_modules/engine.io-parser/package.json b/node_modules/engine.io-parser/package.json deleted file mode 100644 index 8a631eb..0000000 --- a/node_modules/engine.io-parser/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "engine.io-parser", - "description": "Parser for the client for the realtime Engine", - "license": "MIT", - "version": "5.2.3", - "main": "./build/cjs/index.js", - "module": "./build/esm/index.js", - "exports": { - "import": "./build/esm/index.js", - "require": "./build/cjs/index.js" - }, - "types": "build/esm/index.d.ts", - "devDependencies": { - "prettier": "^3.3.2" - }, - "scripts": { - "compile": "rimraf ./build && tsc && tsc -p tsconfig.esm.json && ./postcompile.sh", - "test": "npm run format:check && npm run compile && if test \"$BROWSERS\" = \"1\" ; then npm run test:browser; else npm run test:node; fi", - "test:node": "nyc mocha -r ts-node/register test/index.ts", - "test:browser": "zuul test/index.ts --no-coverage", - "format:check": "prettier --check 'lib/**/*.ts' 'test/**/*.ts'", - "format:fix": "prettier --write 'lib/**/*.ts' 'test/**/*.ts'", - "prepack": "npm run compile" - }, - "homepage": "https://github.com/socketio/socket.io/tree/main/packages/engine.io-parser#readme", - "repository": { - "type": "git", - "url": "https://github.com/socketio/socket.io.git" - }, - "bugs": { - "url": "https://github.com/socketio/socket.io/issues" - }, - "files": [ - "build/" - ], - "browser": { - "./test/node": "./test/browser", - "./build/esm/encodePacket.js": "./build/esm/encodePacket.browser.js", - "./build/esm/decodePacket.js": "./build/esm/decodePacket.browser.js", - "./build/cjs/encodePacket.js": "./build/cjs/encodePacket.browser.js", - "./build/cjs/decodePacket.js": "./build/cjs/decodePacket.browser.js" - }, - "engines": { - "node": ">=10.0.0" - } -} diff --git a/node_modules/engine.io/LICENSE b/node_modules/engine.io/LICENSE deleted file mode 100644 index e08dedd..0000000 --- a/node_modules/engine.io/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -(The MIT License) - -Copyright (c) 2014-present Guillermo Rauch and Socket.IO contributors - -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: - -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. - diff --git a/node_modules/engine.io/README.md b/node_modules/engine.io/README.md deleted file mode 100644 index f33f788..0000000 --- a/node_modules/engine.io/README.md +++ /dev/null @@ -1,603 +0,0 @@ - -# Engine.IO: the realtime engine - -[![Build Status](https://github.com/socketio/engine.io/workflows/CI/badge.svg?branch=master)](https://github.com/socketio/engine.io/actions) -[![NPM version](https://badge.fury.io/js/engine.io.svg)](http://badge.fury.io/js/engine.io) - -`Engine.IO` is the implementation of transport-based -cross-browser/cross-device bi-directional communication layer for -[Socket.IO](http://github.com/socketio/socket.io). - -## How to use - -### Server - -#### (A) Listening on a port - -```js -const engine = require('engine.io'); -const server = engine.listen(80); - -server.on('connection', socket => { - socket.send('utf 8 string'); - socket.send(Buffer.from([0, 1, 2, 3, 4, 5])); // binary data -}); -``` - -#### (B) Intercepting requests for a http.Server - -```js -const engine = require('engine.io'); -const http = require('http').createServer().listen(3000); -const server = engine.attach(http); - -server.on('connection', socket => { - socket.on('message', data => { }); - socket.on('close', () => { }); -}); -``` - -#### (C) Passing in requests - -```js -const engine = require('engine.io'); -const server = new engine.Server(); - -server.on('connection', socket => { - socket.send('hi'); -}); - -// … -httpServer.on('upgrade', (req, socket, head) => { - server.handleUpgrade(req, socket, head); -}); - -httpServer.on('request', (req, res) => { - server.handleRequest(req, res); -}); -``` - -### Client - -```html - - -``` - -For more information on the client refer to the -[engine-client](http://github.com/socketio/engine.io-client) repository. - -## What features does it have? - -- **Maximum reliability**. Connections are established even in the presence of: - - proxies and load balancers. - - personal firewall and antivirus software. - - for more information refer to **Goals** and **Architecture** sections -- **Minimal client size** aided by: - - lazy loading of flash transports. - - lack of redundant transports. -- **Scalable** - - load balancer friendly -- **Future proof** -- **100% Node.JS core style** - - No API sugar (left for higher level projects) - -## API - -### Server - -

- -#### Top-level - -These are exposed by `require('engine.io')`: - -##### Events - -- `flush` - - Called when a socket buffer is being flushed. - - **Arguments** - - `Socket`: socket being flushed - - `Array`: write buffer -- `drain` - - Called when a socket buffer is drained - - **Arguments** - - `Socket`: socket being flushed - -##### Properties - -- `protocol` _(Number)_: protocol revision number -- `Server`: Server class constructor -- `Socket`: Socket class constructor -- `Transport` _(Function)_: transport constructor -- `transports` _(Object)_: map of available transports - -##### Methods - -- `()` - - Returns a new `Server` instance. If the first argument is an `http.Server` then the - new `Server` instance will be attached to it. Otherwise, the arguments are passed - directly to the `Server` constructor. - - **Parameters** - - `http.Server`: optional, server to attach to. - - `Object`: optional, options object (see `Server#constructor` api docs below) - - The following are identical ways to instantiate a server and then attach it. - -```js -const httpServer; // previously created with `http.createServer();` from node.js api. - -// create a server first, and then attach -const eioServer = require('engine.io').Server(); -eioServer.attach(httpServer); - -// or call the module as a function to get `Server` -const eioServer = require('engine.io')(); -eioServer.attach(httpServer); - -// immediately attach -const eioServer = require('engine.io')(httpServer); - -// with custom options -const eioServer = require('engine.io')(httpServer, { - maxHttpBufferSize: 1e3 -}); -``` - -- `listen` - - Creates an `http.Server` which listens on the given port and attaches WS - to it. It returns `501 Not Implemented` for regular http requests. - - **Parameters** - - `Number`: port to listen on. - - `Object`: optional, options object - - `Function`: callback for `listen`. - - **Options** - - All options from `Server.attach` method, documented below. - - **Additionally** See Server `constructor` below for options you can pass for creating the new Server - - **Returns** `Server` - -```js -const engine = require('engine.io'); -const server = engine.listen(3000, { - pingTimeout: 2000, - pingInterval: 10000 -}); - -server.on('connection', /* ... */); -``` - -- `attach` - - Captures `upgrade` requests for a `http.Server`. In other words, makes - a regular http.Server WebSocket-compatible. - - **Parameters** - - `http.Server`: server to attach to. - - `Object`: optional, options object - - **Options** - - All options from `Server.attach` method, documented below. - - **Additionally** See Server `constructor` below for options you can pass for creating the new Server - - **Returns** `Server` a new Server instance. - -```js -const engine = require('engine.io'); -const httpServer = require('http').createServer().listen(3000); -const server = engine.attach(httpServer, { - wsEngine: require('eiows').Server // requires having eiows as dependency -}); - -server.on('connection', /* ... */); -``` - -#### Server - -The main server/manager. _Inherits from EventEmitter_. - -##### Events - -- `connection` - - Fired when a new connection is established. - - **Arguments** - - `Socket`: a Socket object - -- `initial_headers` - - Fired on the first request of the connection, before writing the response headers - - **Arguments** - - `headers` (`Object`): a hash of headers - - `req` (`http.IncomingMessage`): the request - -- `headers` - - Fired on the all requests of the connection, before writing the response headers - - **Arguments** - - `headers` (`Object`): a hash of headers - - `req` (`http.IncomingMessage`): the request - -- `connection_error` - - Fired when an error occurs when establishing the connection. - - **Arguments** - - `error`: an object with following properties: - - `req` (`http.IncomingMessage`): the request that was dropped - - `code` (`Number`): one of `Server.errors` - - `message` (`string`): one of `Server.errorMessages` - - `context` (`Object`): extra info about the error - -| Code | Message | -| ---- | ------- | -| 0 | "Transport unknown" -| 1 | "Session ID unknown" -| 2 | "Bad handshake method" -| 3 | "Bad request" -| 4 | "Forbidden" -| 5 | "Unsupported protocol version" - - -##### Properties - -**Important**: if you plan to use Engine.IO in a scalable way, please -keep in mind the properties below will only reflect the clients connected -to a single process. - -- `clients` _(Object)_: hash of connected clients by id. -- `clientsCount` _(Number)_: number of connected clients. - -##### Methods - -- **constructor** - - Initializes the server - - **Parameters** - - `Object`: optional, options object - - **Options** - - `pingTimeout` (`Number`): how many ms without a pong packet to - consider the connection closed (`20000`) - - `pingInterval` (`Number`): how many ms before sending a new ping - packet (`25000`) - - `upgradeTimeout` (`Number`): how many ms before an uncompleted transport upgrade is cancelled (`10000`) - - `maxHttpBufferSize` (`Number`): how many bytes or characters a message - can be, before closing the session (to avoid DoS). Default - value is `1E6`. - - `allowRequest` (`Function`): A function that receives a given handshake - or upgrade request as its first parameter, and can decide whether to - continue or not. The second argument is a function that needs to be - called with the decided information: `fn(err, success)`, where - `success` is a boolean value where false means that the request is - rejected, and err is an error code. - - `transports` (` String`): transports to allow connections - to (`['polling', 'websocket']`) - - `allowUpgrades` (`Boolean`): whether to allow transport upgrades - (`true`) - - `perMessageDeflate` (`Object|Boolean`): parameters of the WebSocket permessage-deflate extension - (see [ws module](https://github.com/einaros/ws) api docs). Set to `true` to enable. (defaults to `false`) - - `threshold` (`Number`): data is compressed only if the byte size is above this value (`1024`) - - `httpCompression` (`Object|Boolean`): parameters of the http compression for the polling transports - (see [zlib](http://nodejs.org/api/zlib.html#zlib_options) api docs). Set to `false` to disable. (`true`) - - `threshold` (`Number`): data is compressed only if the byte size is above this value (`1024`) - - `cookie` (`Object|Boolean`): configuration of the cookie that - contains the client sid to send as part of handshake response - headers. This cookie might be used for sticky-session. Defaults to not sending any cookie (`false`). - See [here](https://github.com/jshttp/cookie#options-1) for all supported options. - - `wsEngine` (`Function`): what WebSocket server implementation to use. Specified module must conform to the `ws` interface (see [ws module api docs](https://github.com/websockets/ws/blob/master/doc/ws.md)). Default value is `ws`. An alternative c++ addon is also available by installing `eiows` module. - - `cors` (`Object`): the options that will be forwarded to the cors module. See [there](https://github.com/expressjs/cors#configuration-options) for all available options. Defaults to no CORS allowed. - - `initialPacket` (`Object`): an optional packet which will be concatenated to the handshake packet emitted by Engine.IO. - - `allowEIO3` (`Boolean`): whether to support v3 Engine.IO clients (defaults to `false`) -- `close` - - Closes all clients - - **Returns** `Server` for chaining -- `handleRequest` - - Called internally when a `Engine` request is intercepted. - - **Parameters** - - `http.IncomingMessage`: a node request object - - `http.ServerResponse`: a node response object - - **Returns** `Server` for chaining -- `handleUpgrade` - - Called internally when a `Engine` ws upgrade is intercepted. - - **Parameters** (same as `upgrade` event) - - `http.IncomingMessage`: a node request object - - `net.Stream`: TCP socket for the request - - `Buffer`: legacy tail bytes - - **Returns** `Server` for chaining -- `attach` - - Attach this Server instance to an `http.Server` - - Captures `upgrade` requests for a `http.Server`. In other words, makes - a regular http.Server WebSocket-compatible. - - **Parameters** - - `http.Server`: server to attach to. - - `Object`: optional, options object - - **Options** - - `path` (`String`): name of the path to capture (`/engine.io`). - - `destroyUpgrade` (`Boolean`): destroy unhandled upgrade requests (`true`) - - `destroyUpgradeTimeout` (`Number`): milliseconds after which unhandled requests are ended (`1000`) -- `generateId` - - Generate a socket id. - - Overwrite this method to generate your custom socket id. - - **Parameters** - - `http.IncomingMessage`: a node request object - - **Returns** A socket id for connected client. - -

- -#### Socket - -A representation of a client. _Inherits from EventEmitter_. - -##### Events - -- `close` - - Fired when the client is disconnected. - - **Arguments** - - `String`: reason for closing - - `Object`: description object (optional) -- `message` - - Fired when the client sends a message. - - **Arguments** - - `String` or `Buffer`: Unicode string or Buffer with binary contents -- `error` - - Fired when an error occurs. - - **Arguments** - - `Error`: error object -- `upgrading` - - Fired when the client starts the upgrade to a better transport like WebSocket. - - **Arguments** - - `Object`: the transport -- `upgrade` - - Fired when the client completes the upgrade to a better transport like WebSocket. - - **Arguments** - - `Object`: the transport -- `flush` - - Called when the write buffer is being flushed. - - **Arguments** - - `Array`: write buffer -- `drain` - - Called when the write buffer is drained -- `packet` - - Called when a socket received a packet (`message`, `ping`) - - **Arguments** - - `type`: packet type - - `data`: packet data (if type is message) -- `packetCreate` - - Called before a socket sends a packet (`message`, `ping`) - - **Arguments** - - `type`: packet type - - `data`: packet data (if type is message) -- `heartbeat` - - Called when `ping` or `pong` packed is received (depends of client version) - -##### Properties - -- `id` _(String)_: unique identifier -- `server` _(Server)_: engine parent reference -- `request` _(http.IncomingMessage)_: request that originated the Socket -- `upgraded` _(Boolean)_: whether the transport has been upgraded -- `readyState` _(String)_: opening|open|closing|closed -- `transport` _(Transport)_: transport reference - -##### Methods - -- `send`: - - Sends a message, performing `message = toString(arguments[0])` unless - sending binary data, which is sent as is. - - **Parameters** - - `String` | `Buffer` | `ArrayBuffer` | `ArrayBufferView`: a string or any object implementing `toString()`, with outgoing data, or a Buffer or ArrayBuffer with binary data. Also any ArrayBufferView can be sent as is. - - `Object`: optional, options object - - `Function`: optional, a callback executed when the message gets flushed out by the transport - - **Options** - - `compress` (`Boolean`): whether to compress sending data. This option might be ignored and forced to be `true` when using polling. (`true`) - - **Returns** `Socket` for chaining -- `close` - - Disconnects the client - - **Returns** `Socket` for chaining - -### Client - -

- -Exposed in the `eio` global namespace (in the browser), or by -`require('engine.io-client')` (in Node.JS). - -For the client API refer to the -[engine-client](http://github.com/learnboost/engine.io-client) repository. - -## Debug / logging - -Engine.IO is powered by [debug](http://github.com/visionmedia/debug). -In order to see all the debug output, run your app with the environment variable -`DEBUG` including the desired scope. - -To see the output from all of Engine.IO's debugging scopes you can use: - -``` -DEBUG=engine* node myapp -``` - -## Transports - -- `polling`: XHR / JSONP polling transport. -- `websocket`: WebSocket transport. - -## Plugins - -- [engine.io-conflation](https://github.com/EugenDueck/engine.io-conflation): Makes **conflation and aggregation** of messages straightforward. - -## Support - -The support channels for `engine.io` are the same as `socket.io`: - - irc.freenode.net **#socket.io** - - [Google Groups](http://groups.google.com/group/socket_io) - - [Website](http://socket.io) - -## Development - -To contribute patches, run tests or benchmarks, make sure to clone the -repository: - -``` -git clone git://github.com/LearnBoost/engine.io.git -``` - -Then: - -``` -cd engine.io -npm install -``` - -## Tests - -Tests run with `npm test`. It runs the server tests that are aided by -the usage of `engine.io-client`. - -Make sure `npm install` is run first. - -## Goals - -The main goal of `Engine` is ensuring the most reliable realtime communication. -Unlike the previous Socket.IO core, it always establishes a long-polling -connection first, then tries to upgrade to better transports that are "tested" on -the side. - -During the lifetime of the Socket.IO projects, we've found countless drawbacks -to relying on `HTML5 WebSocket` or `Flash Socket` as the first connection -mechanisms. - -Both are clearly the _right way_ of establishing a bidirectional communication, -with HTML5 WebSocket being the way of the future. However, to answer most business -needs, alternative traditional HTTP 1.1 mechanisms are just as good as delivering -the same solution. - -WebSocket based connections have two fundamental benefits: - -1. **Better server performance** - - _A: Load balancers_
- Load balancing a long polling connection poses a serious architectural nightmare - since requests can come from any number of open sockets by the user agent, but - they all need to be routed to the process and computer that owns the `Engine` - connection. This negatively impacts RAM and CPU usage. - - _B: Network traffic_
- WebSocket is designed around the premise that each message frame has to be - surrounded by the least amount of data. In HTTP 1.1 transports, each message - frame is surrounded by HTTP headers and chunked encoding frames. If you try to - send the message _"Hello world"_ with xhr-polling, the message ultimately - becomes larger than if you were to send it with WebSocket. - - _C: Lightweight parser_
- As an effect of **B**, the server has to do a lot more work to parse the network - data and figure out the message when traditional HTTP requests are used - (as in long polling). This means that another advantage of WebSocket is - less server CPU usage. - -2. **Better user experience** - - Due to the reasons stated in point **1**, the most important effect of being able - to establish a WebSocket connection is raw data transfer speed, which translates - in _some_ cases in better user experience. - - Applications with heavy realtime interaction (such as games) will benefit greatly, - whereas applications like realtime chat (Gmail/Facebook), newsfeeds (Facebook) or - timelines (Twitter) will have negligible user experience improvements. - -Having said this, attempting to establish a WebSocket connection directly so far has -proven problematic: - -1. **Proxies**
- Many corporate proxies block WebSocket traffic. - -2. **Personal firewall and antivirus software**
- As a result of our research, we've found that at least 3 personal security - applications block WebSocket traffic. - -3. **Cloud application platforms**
- Platforms like Heroku or No.de have had trouble keeping up with the fast-paced - nature of the evolution of the WebSocket protocol. Applications therefore end up - inevitably using long polling, but the seamless installation experience of - Socket.IO we strive for (_"require() it and it just works"_) disappears. - -Some of these problems have solutions. In the case of proxies and personal programs, -however, the solutions many times involve upgrading software. Experience has shown -that relying on client software upgrades to deliver a business solution is -fruitless: the very existence of this project has to do with a fragmented panorama -of user agent distribution, with clients connecting with latest versions of the most -modern user agents (Chrome, Firefox and Safari), but others with versions as low as -IE 5.5. - -From the user perspective, an unsuccessful WebSocket connection can translate in -up to at least 10 seconds of waiting for the realtime application to begin -exchanging data. This **perceptively** hurts user experience. - -To summarize, **Engine** focuses on reliability and user experience first, marginal -potential UX improvements and increased server performance second. `Engine` is the -result of all the lessons learned with WebSocket in the wild. - -## Architecture - -The main premise of `Engine`, and the core of its existence, is the ability to -swap transports on the fly. A connection starts as xhr-polling, but it can -switch to WebSocket. - -The central problem this poses is: how do we switch transports without losing -messages? - -`Engine` only switches from polling to another transport in between polling -cycles. Since the server closes the connection after a certain timeout when -there's no activity, and the polling transport implementation buffers messages -in between connections, this ensures no message loss and optimal performance. - -Another benefit of this design is that we workaround almost all the limitations -of **Flash Socket**, such as slow connection times, increased file size (we can -safely lazy load it without hurting user experience), etc. - -## FAQ - -### Can I use engine without Socket.IO ? - -Absolutely. Although the recommended framework for building realtime applications -is Socket.IO, since it provides fundamental features for real-world applications -such as multiplexing, reconnection support, etc. - -`Engine` is to Socket.IO what Connect is to Express. An essential piece for building -realtime frameworks, but something you _probably_ won't be using for building -actual applications. - -### Does the server serve the client? - -No. The main reason is that `Engine` is meant to be bundled with frameworks. -Socket.IO includes `Engine`, therefore serving two clients is not necessary. If -you use Socket.IO, including - -```html -